Enbank API Integration
How does the payment flow work

- User opens the merchant’s checkout page
- A
POSTrequest tohttps://pay.enbank.meis sent to the server with the data needed for the payment.
tokenamountdescriptionsuccessCallbackerrorCallback
The request will return the transactionId needed for the next step.
- A “Pay with Enbank” web component, to which the
transactionIdis passed, is shown to the user. - When the user clicks on the button, they are redirected to the payment page, where they can complete the payment
- When the user completes the payment flow, we will call the success/fail callback that was given to us in the request.
note
You should check our OpenAPI docs which can be used to generate code for a client and see how the API endpoints can be used.
In more technical terms a POST request is send to https://enbank-server-local.fly.dev/transactions/newor to https://pay.enbank.me/transactions/newthat has a JSON body that describes the payment details. They will be used to create a new transaction. All transaction details must be included for a transaction to be created, however there are flags that can further modify a transaction and are optional.
Transaction Details
| amount | Transaction amount how much you want the user to pay. Example: "amount": 15 |
|---|---|
| token | Enbank generated token. Example: "token":"<your_enbank_token>” |
| description | Transaction description that will be shown to the user. Example: "description": "My first Enbank transaction” |
| successCallback | The url we will send a GET request to when the payment was completed. (In the headers we attach the amount of the transaction and the transaction Id.) |
| errorCallback | The url we will send a GET request to when the payment was unsuccessful this may be called multiple times. |
Transaction Flags
| lineItems | For including the shopping cart items |
|---|---|
| tip | To enable tips |
| timeOut | To enable payment expiration, a unix time stamp |
| singleMobileBank | 643e710c753d573cad4b4edc9916bdea (Revolut) |
caution
Please do not use the sandbox token on your live site this will send our CTO some money he does not deserve. Let him eat ramen.