Redirect
Application link which is the BaseURL to connect to the payment link:https://pay.leatherback.co/redirect
SAMPLE REQUEST PAYLOAD
Element | Description | Type | Example | Required |
| This is your URL what will be redirected after transaction is successful or failed | string | Yes | |
| Your public key, ensure you switch based on the environment | string | For test, pk_test_*****
For Live, pk_live_**** | Yes |
| This show the page for your customer to enter their information | boolean | false | Yes |
| Email of the customer making payment | string | Yes | |
| Full Name of the customer making payment | string | Vee Test | Yes |
| Reference for the transaction, this must be unique per transaction | string |
| Yes |
| Refer to implementation recommendation below | boolean | False (recommended) | Yes |
| Amount for the transaction | Integer | float | 100, 100.30 | Yes |
| Currency code for your transaction, based on the currency enabled on your portal | string | NGN, GBP, CAD | Yes |
Implementation Steps
Generate your payload as describe in the sample payload above
Stringify the payload if javascript, e.g. JSON.stringify(payload)
Convert/Encode to base64 format, in Javascript, you can use btoa(payload)
Append the encoded object as a “path params” and not query params e.g. You can click on the link below for confirmation.
Follow the payment steps returned.
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