Pay by Account/Open Banking
Step 1: Call Initiate Payment Endpoint
Title: Initiate Payment
Description: This endpoint is used to initiate a payment transaction irrespective of the channel
URL: https://laas.leatherback.co/api/payment/pay/initiate
First, you need to gather the transaction and Customer details as shown below:
{
"channel": "PayByAccount",
"amount": 20,
"currency": "GBP",
"narration": "test redirect",
"reference": "XXZU9HJ93F",
"userInformation": {
"firstName": "John",
"lastName": "Doe",
"phone": "07843094834",
"emailAddress": "test@gmail.com"
},
"paymentRequestProps": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"metaData": {
"return-url": "https://test.co",
"redirect": false | true
}
}
Element | Description | Type | Example | Required |
Channel | This is the channel in which this payment will be processed NB The available channels vary by the currency selected. To see a list of channels available to you, use the Validate Payment endpoint. | String | ["PayByAccount" ] | Yes |
amount | The amount to charge the customer for the transaction | String | 100 | Yes |
currencyCode | A three-letter ISO code for the currency in which you want to accept the payment. A unique code that represents a defined business currency. | string | GBP | Yes
|
narration | This is usually a description of items being purchased by a customer | string | Payment for goods | No
|
reference | This is a unique alphanumeric code that identifies a payment.
| string |
| Yes |
firstName | This is the first Name of the Customer | string | John | Yes |
lastName | This is the last Name of the Customer | string | Doe | Yes |
phoneNumber | This is the phone number of the Customer | string |
| Yes |
emailAddress | This is the email address of the customer | string |
| Yes |
metaData | This contains your return URL that you will be redirected to once a transaction is completed | object | "metaData": {
"return-url": "https://test.co"
} | Yes |
redirect | This specifies if you want to handle the redirect or allow the page close automatically | boolean | false/true | Yes |
{
"value": {
"paymentStatus": "INITIATED",
"requiresAction": true,
"message": "Payment initiated successfully. Kindly click on the link to complete your payment",
"bankAuthURL": null,
"paymentItem": {
"channel": "PayByAccount",
"message": "Payment initiated successfully. Kindly click on the link to complete your payment",
"totalAmount": 20,
"amount": 19.85,
"fees": 0.15,
"reference": "XXZ9HJ93F",
"paymentReference": "TLUKHPC0J7A1OMRPPG",
"metaData": {
"AuthUrl": "https://pay.leatherback.co/open-banking?link_token=link-sandbox-f725b8d7-8630-453c-b06d-5ba778f24bc8&client_url=https://access.leatherback.co&lb_reference=TLUKHPC0J7A1OMRPPG&redirect=true",
"request-id": "XEoZNJpjoJ0Em8R",
"token": "link-sandbox-f725b8d7-8630-453c-b06d-5ba778f24bc8"
}
}
},
"isSuccess": true,
"error": "",
"message": "",
"type": null,
"title": null,
"status": null,
"detail": null,
"instance": null
}
Step 2: Call GET Transaction Status
Pass the Payment Reference: "TLUKHPC0J7A1OMRPPG"
from the response gotten from the Initiate Payment End point above
Related content
Leatherback 2024