Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Users can Application link which is the BaseURL to connect to the payment link application by using this link : "https://pay.leatherback.co/redirect/$%7Bdata “

Info

Please note that the data object to be appended is in a base64 format. This can be achieved using the javascript  btoa(encodeURI(paymentObjPara))

A sample of the object parameter to be passed is shown below;

Panel
bgColor#4C9AFF

SAMPLE REQUEST PAYLOAD

Expand
titleSAMPLE REQUEST PAYLOAD
Code Block
languagejs
{
  
"redirectUrl": "
http
https://
localhost:3035?status=redirectedBack
your-redirect-url.com",
  
"key": "pk_test_
a4hae811b76c17g364g6fhc3cce5ab0359g67f8
*****",
  
"showPersonalInformation": false,
  
"customerEmail": "
marcicocha@yahoo
test@yahoo.com",
  
"customerName": "
Marcia
Vee 
Cole
Test",
  
"reference": "MC000000000029",
  
"shouldWindowClose": false,
  
"amount": 
amountObj.value.amount
100,
  
"currencyCode": 
amountObj.value.currencyCode, };
Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#FFF0B3
Please note, that there is a collection of user information on the payment application, if you don’t want this option, the showPersonalInformation flag should be false and the customerEmail and customerName should be part of the payload as shown above; Also note, that if the key shouldWindowClose is true, the page won't redirect, the page will only close. These are for cases where the link is being hosted in an iframe.
"NGN"
}

Element

Description

Type

Example

Required

redirectUrl

This is your URL what will be redirected after transaction is successful or failed

string

https://your-url.com/

Yes

key

Your public key, ensure you switch based on the environment

string

For test, pk_test_*****

 

For Live,

pk_live_****

Yes

showPersonalInformation

This show the page for your customer to enter their information

boolean

false

Yes

customerEmail

Email of the customer making payment

string

useremail@email.com

Yes

customerName

Full Name of the customer making payment

string

Vee Test

Yes

reference

Reference for the transaction, this must be unique per transaction

string

 

Yes

shouldWindowClose

Refer to implementation recommendation below

boolean

False (recommended)

Yes

amount

Amount for the transaction

Integer | float

100, 100.30

Yes

currencyCode

Currency code for your transaction, based on the currency enabled on your portal

string

NGN, GBP, CAD

Yes

Panel
bgColor#4C9AFF

Implementation Steps

 

  1. Generate your payload as describe in the sample payload above

  2. Stringify the payload if javascript, e.g. JSON.stringify(payload)

  3. Convert/Encode to base64 format, in Javascript, you can use btoa(payload)

  4. Append the encoded object as a “path params” and not query params e.g. You can click on the link below for confirmation.

  5. Follow the payment steps returned.

https://pay.leatherback.co/redirect/eyJyZWRpcmVjdFVybCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTA1MC9yZWRpcmVjdC5odG1sIiwia2V5IjoicGtfdGVzdF8wZjFiNmZoZDY0YzkyZzI2NGNhOGFlZmFjNmM0ZTVnaDA0NTIzZzMiLCJzaG93UGVyc29uYWxJbmZvcm1hdGlvbiI6ZmFsc2UsImN1c3RvbWVyRW1haWwiOiJ0ZXN0QHlhaG9vLmNvbSIsImN1c3RvbWVyTmFtZSI6IlZlZSB0ZXN0IiwicmVmZXJlbmNlIjoiTnVvUkZ6SXRCIiwic2hvdWxkV2luZG93Q2xvc2UiOmZhbHNlLCJhbW91bnQiOjMwMCwiY3VycmVuY3lDb2RlIjoiR0JQIn0=

On redirect to your provided URL, the reference of the transaction is returned as a query params e.g https://your-redirect-url.com/redirect.html?reference=99frbZck1

 You can use the reference to get the status of the transaction as your desire.

Panel
bgColor#4C9AFF

 Implementation Recommendation

for shouldWindowClose = true

●     if shouldWindowClose is set to true and link is opened in new tab, the new tab will close automatically after the transaction is completed but won't redirect to the URL you provided

●     if shouldWindowClose is set to true and link is opened in the same tab, the transaction page remain open and won't redirect to the URL you provided

  for shouldWindowClose = false (recommended)

●     if shouldWindowClose is set to false and link is opened in same tab, the transaction page will close automatically when completed and it would be redirected to the URL you provided

  • if shouldWindowClose is set to false and link is opened in new tab, the transaction page will close automatically when completed but the redirect to the provided URL will take effect on the new opened tab

...