Instant Payment Notification
Notifications are sent to the defined notify URL for each transaction when the transaction status changes. Notifications are sent with the HTTP POST method.
The request header contains the "payload-hash" parameter. The value of this parameter is the body of the request and your secret key hashed with the SHA-256 algorithm.
To ensure that the request was sent by us, you should verify the hash for a match.
How to verify hash
const exampleSecretKey = "12345";
// Example notification body
const body = {
status: "successful",
messagetype: "acquirerRes",
message: {
action: "3ds-verification",
status: "succeeded",
referenceNo: "103751904",
transactionId: "d43aaaca80e842a890f5dfad095fc350",
message: "ok",
},
};
const hash = sha256(`${JSON.stringify(body)}${exampleSecretKey}`).toString();
// hash result
// c640d9931b950b53a5c15c783ea211c1200890bcf374bb0d0ff6f5a3d38cc1a3
Notifications
The notification body may vary depending on the type of operation
Parameter | Description | Type |
---|---|---|
status | Response status | string |
messagetype | Response message type | string |
message | Response message | object |
Examples of notifications for a purchase
{
"status": "successful",
"messagetype": "acquirerRes",
"message": {
"action": "payment",
"paymentStatus": "REDIRECTED_TO_3DS",
"referenceNo": "103751904",
"transactionId": "d43aaaca80e842a890f5dfad095fc350"
}
}
{
"status": "successful",
"messagetype": "acquirerRes",
"message": {
"action": "3ds-verification",
"status": "failed",
"referenceNo": "103751904",
"transactionId": "d43aaaca80e842a890f5dfad095fc350",
"message": "Generic Decline"
}
}
{
"status": "successful",
"messagetype": "acquirerRes",
"message": {
"action": "3ds-verification",
"status": "succeeded",
"referenceNo": "103751904",
"transactionId": "d43aaaca80e842a890f5dfad095fc350"
}
}
Examples of notifications for a refund
{
"status": "successful",
"messagetype": "transactionRefund",
"message": {
"status": "refund_pending",
"amount": 1000,
"currency": "EUR",
"message": "ok",
"transactionId": "d43aaaca80e842a890f5dfad095fc350",
"referenceNo": "103751904"
}
}
{
"status": "successful",
"messagetype": "transactionRefund",
"message": {
"status": "refunded",
"amount": 1000,
"currency": "EUR",
"transactionId": "d43aaaca80e842a890f5dfad095fc350",
"referenceNo": "103751904",
"message": "ok"
}
}
{
"status": "successful",
"messagetype": "transactionRefund",
"message": {
"status": "error",
"amount": 1000,
"currency": "EUR",
"message": "Error message",
"transactionId": "d43aaaca80e842a890f5dfad095fc350",
"referenceNo": "103751904"
}
}
Examples of notifications for a provision
{
"status": "successful",
"messagetype": "provision",
"message": {
"status": "requested",
"referenceNo": "57984d15dcfa4e608d647f93b051de55",
"provisionId": "65faa1846fc337002cbf4ae7",
"message": "Provision has been requested"
}
}
{
"status": "successful",
"messagetype": "provision",
"message": {
"status": "expired",
"referenceNo": "57984d15dcfa4e608d647f93b051de55",
"provisionId": "65faa1846fc337002cbf4ae7",
"message": "Provision has been expired"
}
}