PAYBYLINK-Wrapper is a simple, unofficial wrapper for PayByLink.pl API
This package is based on an official paybylink.pl API documentation available here.
npm i paybylink-wrapper
or
yarn add paybylink-wrapper
const { PblClient } = require('paybylink-wrapper')
const pbl = new PblClient(secret, shopId)
pbl.generateTransaction({
price,
control,
description,
email,
notifyURL,
returnUrlSuccess,
returnUrlSuccessTidPass,
hideReceiver,
customFinishNote,
})
.then(transaction => console.log(transaction))
options (Object):
Key | Type | Required |
---|---|---|
price | Number | True |
control | String | False |
description | String | False |
String | False | |
notifyURL | String | False |
returnUrlSuccess | String | False |
returnUrlSuccessTidPass | Boolean | False |
hideReceiver | Boolean | False |
customFinishNote | String | False |
Example error result
{
errorCode: 404,
error: "shop doesn't exist"
}
Example success result
{
url: "https://secure.pbl.pl/transfer/w3WUQXsMgSYc9gH3V8HcvHxazU5TvJLJ",
transactionId: "w3WUQXsMgSYc9gH3V8HcvHxazU5TvJLJ"
}
options (Object):
Key | Type | Required |
---|---|---|
price | Number | True |
code | String | True |
customerIP | String | True |
control | String | False |
notifyPaymentURL | String | False |
notifyStatusURL | String | False |
API documentation doesn't specify if there could be any error response ¯_(ツ)_/¯
Example success result
{
transactionId: "w3WUQXsMgSYc9gH3V8HcvHxazU5TvJLJ"
}
Parameter | Type | Required |
---|---|---|
transactionId | Number | True |
customReason | String | False |
Example result
{
cancelled: false,
cancelError: "Transaction alredy cancelled"
}
notification (object): - API notification response object
Parameter | Type | Required |
---|---|---|
transactionId | Number | True |
control | String | True |
String | True | |
amountPaid | Number | True |
notificationAttempt | Number | True |
paymentType | String | True |
apiVersion | Number | True |
signature | String | True |
Returns true or false depending on whether the API response was valid.
notification (object): - API notification response object
Parameter | Type | Required |
---|---|---|
transactionId | Number | True |
control | String | True |
price | String | True |
status | Number | True |
signature | String | True |
Returns true or false depending on whether the API response was valid.
GitHub Repository
npm package
Author's website
Jakub Macioł (kuvuś)