Below shows how the Payment link flow Integration works:
From your server, call our create payment link endpoint with the payment details.
We'll return a link alias to a payment page. Redirect your customer to this link to make the payment.
When the transaction is completed, we'll redirect the customer back to you.
Step 1: Call Create Payment Endpoint
Title: Create Payment link
Description : This service may be used to generate payment link
URL: api /payment/payment-link/
HTTP Method : POST
First, you need to gather the payment details. Here are the details you'll need:
amountInfo": { "currencyCode": "string", "amount": 0 }, "tax": { "isEnabled": true }, "name": "string", "description": "string", "linkType": 0, "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string"
amount
: The amount to charge the customer.currency Code
: 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. E.g NGN=Nigerian Naira, USD =United state Dollars etc (Required) If you don't specify a value, we'll assume"NGN"
Tax Enabled:
Specify if Tax/fees is applicable on the purchase value (true, false)name
: This is the name of the item to be purchased via the payment linkdescription: This is the description of the item to be purchased
link Type
: This specify how often the payment link can be used. (Reusable, One-time)meta
data (optional): An object containing any extra information you'd like to store alongside the transaction e.g{CVV
Sample Code
curl -X 'POST' \ 'https://laas-development.leatherback.co/api/payment/portal/payment-link' \ -H 'accept: application/json' \ -H 'Authorization: Bearer Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjA0RjYyRERGNEY4RjYwMEEyMThFNDg4OTU1REU3MjNBIiwidHlwIjoiYXQrand0In0.eyJpc3MiOiJodHRwczovL2Rldi1pZGVudGl0eS5sZWF0aGVyYmFjay5jbyIsIm5iZiI6MTY3NzcwNjUwNCwiaWF0IjoxNjc3NzA2NTA0LCJleHAiOjE2Nzc3MDY4MDQsImF1ZCI6IldlYkFwaUdhdGV3YXkiLCJzY29wZSI6WyJvcGVuaWQiLCJwcm9maWxlIiwiV2ViQXBpR2F0ZXdheSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXSwiY2xpZW50X2lkIjoic3NvY2xpZW50Iiwic3ViIjoiOWM4ZTdlYjMtMjI3MC00NmI3LWZhNjYtMDhkYjE4YWE4MjRhIiwiYXV0aF90aW1lIjoxNjc3NzA0OTg3LCJpZHAiOiJsb2NhbCIsIm5hbWUiOiJhb3RvdGdzd2NkaEBldXJva29vbC5jb20iLCJlbWFpbCI6ImFvdG90Z3N3Y2RoQGV1cm9rb29sLmNvbSIsInBob25lX251bWJlciI6Iis0NDc5NzU3Nzc2NDUiLCJnaXZlbl9uYW1lIjoiICIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlVuVmVyaWZpZWQiLCJlbWFpbF92ZXJpZmllZCI6IlZlcmlmaWVkIiwicm9sZSI6IkN1c3RvbWVyIiwic2lkIjoiQzUxRTgyQjE4QjMyQTI5N0NDNkYwMzk5QTBFRDk4MEYiLCJqdGkiOiI1OUQ4NDk5NDhBMENGMUNDRjk5NjZGNzQ2RjhBREY2OCJ9.GlV1A28Ue-3yuFHmDtT3uNEmA4FUfMYx_atqq4u87f-O-xtgRMhwLvBPcGEv7lcjZygKzS1bXlS9KGQzvMbtLm9bSDKPZzQLA1dxP0p9BM9V2J673Q6Hp_jF2hXPrXEqp28VdZnMFM_D09pXPB3MzD5X7R6mo47Rx7NuwEuuuXoHU0L_ByhnHOP16OsH0BjqaT-LIgAokJctgd1K4s3-tXBFKMq4BCDHEr7vPkQu0jldAzybZh4QSMOjI7zy5q6iDwN6uU470c34joqiN1fQUlqCVaRvaouL6pg8EQTYej6ACYnRy_VmQqq2rIaS7G6Oeg0gSpP8PryknrHLQeyx0g' \ -H 'X-Api: pk_test_7e8201f9232bg86fh53c4f9d2bbc4ehafd4f0b9' \ -H 'Content-Type: application/json' \ -d '{ "amountInfo": { "currencyCode": "NGN", "amount": 500 }, "tax": { "isEnabled": true }, "name": "Redmi", "description": "Redmi 11pro", "linkType": 0, "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" } }'
Response Body
Response code : 200
{ "value": { "id": "d574c37c-cf55-46a5-9556-08db1c659f7d", "name": "REDMI", "description": "JJ", "alias": "0-mjlyfib", "link": "https://app-aaaspaymentlink-dev.azurewebsites.net/0-mjlyfib", "amountInfo": { "currencyCode": "NGN", "amount": 5000 }, "linkType": "Reuseable", "status": "New", "createdDate": "2023-03-04T04:04:59.6635547+00:00", "environment": "Test" }, "isSuccess": true, "error": "", "message": "Request Successful", "type": null, "title": null, "status": null, "detail": null, "instance": null }
Step 2: Call Validate Payment Endpoint
Title: Validate Payment link
Description : This endpoint may be consumed to get the available channels for a transaction currency
URL: api /payment/pay/Validate
HTTP Method : POST
Here are the details you'll need:
{ "amount": { "currencyCode": "string", "amount": 0 }, "channels": [ "string" ] }
amount
: The amount to charge the customer.currency Code
: 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. E.g NGN=Nigerian Naira, USD =United state Dollars etc (Required) If you don't specify a value, we'll assume"NGN"
Response Body
Response code : 200
{ "value": { "isValid": true, "channels": [ { "id": "4f737265-27cb-40fd-84a6-f41d999a39d1", "name": "PayByTransfer", "alias": "PayByTransfer", "description": null }, { "id": "2d60ca92-8f2f-486a-aa21-35cc9434898f", "name": "Card", "alias": "Card", "description": null } ] }, "isSuccess": true, "error": "", "message": "Request Successful", "type": null, "title": null, "status": null, "detail": null, "instance": null }
Step 3: Call Initiate Payment Endpoint
Title: Initiate Payment link
Description : This endpoint may be consumed to initiate the transaction
URL: api /payment/pay/Initiate
HTTP Method : POST
Here are the details you'll need:
Pass Reference value id for channel Pay By transfer from Validate Payment endpoint
{ "channel": "PayByTransfer", "amount": 500, "currency": "NGN", "narration": "SHOE", "reference": "4f737265-27cb-40fd-84a6-f41d999a39d1", "link": { "alias": "0-mjlyfib" }, "userInformation": { "firstName": "Ayobami", "lastName": "Queen", "phone": "08132681675", "emailAddress": "ayobamsy@yahoo.com" }, "paymentRequestProps": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "metaData": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" } }
Channel:
An array of payment channels to control what channels you want to make available to the user to make a payment with. Available channels include: ["payByCard", "PayByTransfer", "paywithAccount" ]amount
: The amount to charge the customercurrency Code
: 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. E.g NGN=Nigerian Naira, USD =United state Dollars etc (Required) If you don't specify a value, we'll assume"NGN"
narration:
This is usually a description of items being purchased by a customerreference:
alias:
An alias allows users to access a page (node) or file at an alternative path. A redirect is moving a user to the correct file or page (node) because it no longer exists at a previous path. Alias lets you choose a nickname for your page, meaning a new URL that points to the content the same way the original URL doesfirstName:
This is the first Name of the CustomerlastName:
This is the Last Name of the Customerphone:
This is the phone number of the CustomeremailAddress
:This is the email address of the customermeta
data (optional): An object containing any extra information you'd like to store alongside the transaction
Response Body
Response code : 200
{ "value": { "paymentStatus": "REQUIRE_USER_OFFLINE_ACTION", "message": "Payment Initiated", "bankAuthURL": null, "paymentItem": { "channel": "PayByTransfer", "message": "Payment Initiated", "amount": 500, "fees": 0, "reference": "4f737265-27cb-40fd-84a6-f41d999a39d1", "metaData": { "transfer-info": { "note": "NILL", "bank": "Providus", "account_number": "9979314914", "account_name": "MERCHANT(jkkffg)", "expiration": "2023-03-04T13:43:11.0447022Z", "mode": "banktransfer" } } } }, "isSuccess": true, "error": "", "message": "", "type": null, "title": null, "status": null, "detail": null, "instance": null }
Step 4: Call Authenticate Payment Endpoint
Title: Authenticate Payment link
Description : This endpoint may be consumed to initiate the transaction
URL: api /payment/pay/Initiate
HTTP Method : POST
Here are the details you'll need:
Pass Reference value id for channel Pay By transfer from Validate Payment endpoint
{ "referenceId": "4f737265-27cb-40fd-84a6-f41d999a39d1" }
reference:
Response Body
Response code : 200
{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string", "isSuccess": true, "error": "string", "message": "string", "responseCode": "string", "value": { "status": "string", "IsAuthenticationEnabled": true, "Recommendation": "string", "message": "string", "authenticationhtml": "string" }, "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }
Step 5: Call Finalize Payment Endpoint
Title: Finalize Payment
Description : This endpoint may be consumed to finalize the transaction
URL: api /payment/pay/Initiate
HTTP Method : POST
Here are the details you'll need:
Pass Payment reference from Validate Payment endpoint
{ "paymentReference": "string" }
paymentreference:
Response Body
Response code : 200
{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string", "isSuccess": true, "error": "string", "message": "string", "responseCode": "string", "value": { "status": "string", "message": "string" }, "additionalProp1": "string", "additionalProp2": "string", "addi }
Step 6: Call Transaction Reference Endpoint
Title: Finalize Payment
Description : This endpoint may be consumed to retrieve the Transaction reference the transaction
URL: api /payment/pay/transactions{reference}
HTTP Method : GET
Here are the details you'll need:
Pass reference from Initiate Payment endpoint
{ "referenceId": "4f737265-27cb-40fd-84a6-f41d999a39d1" }
referenceId:
Response Body
Response code : 200
{ "value": { "paymentReference": "TSIXIKHJYBA3DPG", "amount": { "currencyCode": "NGN", "amount": 500 }, "paymentStatus": 0 }, "isSuccess": true, "error": "", "message": "", "type": null, "title": null, "status": null, "detail": null, "instance": null }
After the payment is initiated and done successfully: We'll send you a webhook if you have that configured on the dev portal
We'll send an email receipt to your customer if the payment was successful (Coming soon)
Add Comment