Paylink Checkout JS Library
Paylink is a platform that allows you receive payments and sell items without giving out your account details. We offer APIs to make integration with Paylink a breeze
Usage
You will need to include the Paylink Checkout Library file in your page
<script type="text/javascript" src="https://paylink.ng/cdn/paylink.checkout.js"></script>
Basic Checkout
Basic checkout provides merchants with a very easy way to receive payments by integrating paylink into their existing website.
Paylink.checkout( username, options )
Name | Type | Description |
username | string [Required] | The username of the merchant to receive payment |
amount | number [Required] | The amount being paid for |
reference | string [Optional] | The description of the payment |
name | string [Optional] | The name of the payer |
phone | string [Optional] | The phone number of the payer |
string [Optional] | The email of the payer |
Example
Paylink.checkout( 'tolushoes', {
amount: 1000.50,
reference: 'Payment Description'
})
Store Checkout
Store checkout provides merchants with a very easy way to receive payments for a particular paylink store item from their their existing website.
Paylink.checkoutWithStoreItem( username, options )
Name | Type | Description |
username | string [Required] | The username of the merchant to receive payment |
quantity | number [Required] | The quantity of goods being paid for |
item | string [Required] | The ID of the item being purchased |
reference | string [Optional] | The description of the payment |
name | string [Optional] | The name of the payer |
phone | string [Optional] | The phone number of the payer |
string [Optional] | The email of the payer |
Example
Paylink.checkoutWithStoreItem( 'tolushoes', {
item: 1298129,
quantity: 1,
reference: 'Payment Description'
})
Additional Features
Callback
The purpose of this endpoint is to provide merchants with a way to receive a callback notification after payment is made. This is usually used by merchants to provide value or render service automatically. Having a valid Paylink profile is a prerequisite for using this API. This callback endpoint is to be developed by the merchant.
HTTP METHOD | POST |
URL | {merchant-callback-url} |
Request Entities | transactionReference - reference generated by the merchant paymentReference - reference generated by Paylink after payment status - status of the transaction |
Request Payload | { “transactionReference” : “262763882782738”, “paymentReference” : “1301637829093” “status” : “APPROVED” } |
Response Payload | { “status” : success | failed, “Message” : “ok” } |
Check Status
The purpose of this endpoint is to provide merchants with a way of checking the status of a transaction done via Paylink. Having a valid Paylink profile is a prerequisite for using this API.
HTTP METHOD | POST |
URL | https://paylink.ng/send/api/verticalresourcesvc/secure/check/status.json |
Request Header(s) | x-app-id = paylink Authorization = Bearer {Access Token} |
Request Payload | { “paymentReference” : “283732” } |
Response Payload | { “payerName”: “John Doe”, “payerEmail” : “john@doe.com”, “payerPhone” : “+234882939333”, “amount” : 2900 , “transactionReference” : “8384994893847”, “paymentReference” : “283732”, “status”: “APPROVED” } |
Get Token
The purpose of this endpoint is to provide merchants with a way of getting access token. Having a valid Paylink profile is a prerequisite for using this API.
HTTP METHOD | POST |
URL | https://paylink.ng/send/api/verticalauthsvc/auth/get/token.json |
Request Header(s) | x-app-id = paylink |
Request Payload | { “email” : “john@doe.com”, “password” : “ndewo123” } |
Response Payload | { “responseCode”: “00” “responseData”: [{ “accessToken”: “xZcsdckdsfmalcakldmsadafa” }] } |