/
Leatherback Payment Link Integration

Leatherback Payment Link Integration

Below shows how the Payment link flow Integration works:

  • From your server, call our Create Payment link, Validate Payment link, Initiate the 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 Link Endpoint

Title: Create Payment link

Description : This endpoint may be consumed to create payment link

URL: https://laas.leatherback.co/api/payment/payment-link

 

Here are the details you'll need:

{ "name": "Invoice Test 5", "description": "Test", "linkType": 1, "amountType": 1, "currencyCode": "GBP", "amountInfo": { "currencyCode": "GBP", "amount": 12 } }

 

"linkType": 0 - oneTime, 1 - reusable "amountType": 0 - Static, 1 - Dynamic

Element

Description

Type

Example

Required

name

This is a unique name for the payment link.

string

TV Payment

Yes

description

This describes the payment link in details

string

Link to pay for your TV

Yes

linkType

This indicates the payment link type.

0 - OneTime

1 - Reusable

integer

linkType: 0 | 1

Yes

amountType

This indicate how the amount will be set for the payment link, e.g you might want to give user privileges to type the amount or give the link a defined amount

 

0 - Static

1 - Dynamic

integer

amountType: 0 | 1

No

 

If not passed

We will default it to “0” => Static

currencyCode

The transaction currency code of the amount, ISO3

string

GBP | NGN

 

Note: Currency will be based on eligibility when go-live

Yes

amountInfo

 

object

 

Yes

amountInfo.currencyCode

The transaction currency code of the amount

string

 

Yes

amountInfo.amount

The transaction amount

float

100.00

Yes

{ "value": { "id": "4e376b57-cbcb-4c69-8258-08dc7ef7dffe", "name": "Invoice Test 5", "description": "Test", "alias": "0-hvhmxp0", "link": "https://pay.leatherback.co/0-hvhmxp0", "amountInfo": { "currencyCode": "GBP", "amount": 12 }, "linkType": "Reuseable", "amountType": "Dynamic", "supportEmail": null, "logo": null, "status": "New", "createdDate": "2024-06-05T22:07:21.0548519+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

 

Here are the details you'll need:

 

Element

Description

Type

Example

Required

amount

The transaction amount

float, integer

100

Yes

currencyCode

The currency code of the transaction

string

Allowed currency, (GBP, NGN)

Yes

channels

Channel of payment displayed to your user. If no channels is passed, all enabled channels for your account will be returned in the response

string[]

Allowed channels,

 

PayByAccount, Card, PayByTransfer

No

 

 

Step 3: Call Initiate Payment Endpoint

Here are the details you'll need:

 

 

  • 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: "pay by card", "PayByTransfer", "pay with account"

  • 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: This is an Id that uniquely identifies a channel type (this is derived from the Validate Payment endpoint response)

  • 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

  • metadata (optional): An object containing any extra information you'd like to store alongside the transaction

 

 

Step 4: Call Authenticate Payment Endpoint

 

Here are the details you'll need:

  • reference: This is an Id that uniquely identifies a channel type (this is derived from the Validate Payment endpoint response)

Step 5: Call Finalize Payment Endpoint

Here are the details you'll need:

  • paymentreference: This is an Id that uniquely identifies a payment made

 

Step 6: Call Transaction Reference Endpoint

 

Here are the details you'll need:

Element

Description

Type

Example

Required

reference

Transaction reference of the transaction

String | path variables

To be passed as a path variable. Possible payment status: SUCCESSFUL, FAILED & PENDING

Yes

 

 

 Related articles

Leatherback 2024