Below shows how the Payment link flow Integration works:
...
First, you need to assemble gather the payment details. Here are the details you'll need:
Code Block |
---|
|
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 link
description: 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
Code Block |
---|
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"
}
}'
|
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"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
Panel |
---|
|
Title: Validate Payment link |
Panel |
---|
|
Description : This endpoint may be consumed to get the available channels for a transaction currency |
Panel |
---|
|
URL: api /payment/pay/Validate |
...
Error Message
...
Error
...
Cause
...
Solution
...
The {input field} is required
...
A mandatory field is empty
...
Ensure all mandatory fields and values are present.
...
payment link with given reference_id: notes already exists. Please create a payment link with a different reference_id
...
An existing reference id has been passed
...
Ensure that a unique reference id is used for all payment links.
...
Here are the details you'll need:
Code Block |
---|
|
{
"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"
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"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
Panel |
---|
|
Title: Initiate Payment link |
Panel |
---|
|
Description : This endpoint may be consumed to initiate the transaction |
Panel |
---|
|
URL: api /payment/pay/Initiate |
Here are the details you'll need:
Pass Reference value id for channel Pay By transfer from Validate Payment endpoint
Code Block |
---|
{
"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 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"
narration:
This is usually a description of items being purchased by a customer
reference:
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 does
firstName:
This is the first Name of the Customer
lastName:
This is the Last Name of the Customer
phone:
This is the phone number of the Customer
emailAddress
:This is the email address of the customer
meta
data (optional): An object containing any extra information you'd like to store alongside the transaction
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"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
Panel |
---|
|
Title: Authenticate Payment link |
Panel |
---|
|
Description : This endpoint may be consumed to initiate the transaction |
Panel |
---|
|
URL: api /payment/pay/Initiate |
Here are the details you'll need:
Pass Reference value id for channel Pay By transfer from Validate Payment endpoint
Code Block |
---|
{
"referenceId": "4f737265-27cb-40fd-84a6-f41d999a39d1"
} |
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"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
Panel |
---|
|
Title: Finalize Payment |
Panel |
---|
|
Description : This endpoint may be consumed to finalize the transaction |
Panel |
---|
|
URL: api /payment/pay/Initiate |
Here are the details you'll need:
Pass Payment reference from Validate Payment endpoint
Code Block |
---|
{
"paymentReference": "string"
} |
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"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
Panel |
---|
|
Title: Finalize Payment |
Panel |
---|
|
Description : This endpoint may be consumed to retrieve the Transaction reference the transaction |
Panel |
---|
|
URL: api /payment/pay/transactions{reference} |
Here are the details you'll need:
Pass reference from Initiate Payment endpoint
Code Block |
---|
{
"referenceId": "4f737265-27cb-40fd-84a6-f41d999a39d1"
} |
Panel |
---|
|
Response Body Response code : 200 |
Code Block |
---|
{
"value": {
"paymentReference": "TSIXIKHJYBA3DPG",
"amount": {
"currencyCode": "NGN",
"amount": 500
},
"paymentStatus": 0
},
"isSuccess": true,
"error": "",
"message": "",
"type": null,
"title": null,
"status": null,
"detail": null,
"instance": null
} |
Info |
---|
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) |
\uD83D\uDCCB Related articles
...