mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
begin integration of payment gateways
This commit is contained in:
26
src/server/backend/plugins/payments/README.md
Normal file
26
src/server/backend/plugins/payments/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Creating new payment provider integrations
|
||||
All payment gateway integration plugins have to be in their own folders. This folder has to contain a file called [Payment gateway name as camelCase word (starting in small letter)]Routes.js, a file called plugin.json and any number of other files that it needs.
|
||||
|
||||
You will also need to add documentation for the user to set up the payment gateway. Read on below to find out how.
|
||||
|
||||
## Setting up the routes.js file
|
||||
In the routes.js file you should have at least the following code:
|
||||
|
||||
```
|
||||
module.exports = ( app ) => {
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Take some inspiration of the stripe or adyen setup as these are officially supported by the system and have been developed by the original creator.
|
||||
|
||||
The express.js routes it has to expose are the following:
|
||||
|
||||
- /payments/prepare (POST) (returns object: { 'link': [Link to the payment gateway payment], 'id': [Purchase ID to subscribe to status updating] })
|
||||
- /payments/getStatus (SSE) (sends updates to the UI once subscribed (like payment success) using the id sent by /payments/prepare)
|
||||
|
||||
It can contain any number of (not interfering) routes. Please always use the /payments/ route as a base to avoid running into problems.
|
||||
|
||||
|
||||
## The plugin.json file
|
||||
The plugin.json file should look as follows:
|
||||
Reference in New Issue
Block a user