Redirect

 

 

Application link which is the BaseURL to connect to the payment link:https://pay.leatherback.co/redirect

SAMPLE REQUEST PAYLOAD

{ "redirectUrl": "https://your-redirect-url.com", "key": "pk_test_*****", "showPersonalInformation": false, "customerEmail": "test@yahoo.com", "customerName": "Vee Test", "reference": "MC000000000029", "shouldWindowClose": false, "amount": 100, "currencyCode": "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

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.

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

 Related articles

Leatherback 2024