Skip to content

Webhook Requirements

You must provide a Webhook URL where we can send real-time notifications for payment events such as success, failure, or expiration.


Webhook Payload Fields

FieldDescription
chargeReferenceUnique reference number from the merchant (e.g. "124pam124")
authCodeAuthorization code from the payment gateway (e.g. "1648434883535")
retrievalReferenceSystem-generated transaction ID (e.g. "fadf476d-61fd-475b-8739...")
resultTransaction status: SUCCESS, FAIL, or CLOSED
timestampNotification time in yyyyMMddhhmmss format (e.g. "20220328103831")
paymentTypeType of transaction: CHARGE or REFUND
signatureHMAC RSA signature for security validation

Signature Validation

Use the following steps to validate the signature:

  1. Concatenate the fields:

    text
    digest = chargeReference + authCode + retrievalReference + result + timestamp
  2. Use the RSA public key to verify the signature:

    text
    RSASHA256(FromBase64(digest), FromBase64(signature), ToBase64(MERCHANT_RESPONSE_PUBLIC_KEY))

If the signature is valid, the notification is authentic.


Sample Webhook Payloads

json
// Sample: CHARGE
{
  "result": "SUCCESS",
  "retrievalReference": "fadf476d-61fd-475b-8739-d65dabaff811",
  "authCode": "1648434883535",
  "signature": "hmac256-2578cde58b42f94d9a529d122e24421a8e7c9f45df7fa0f84e25e94e0f064f40",
  "chargeReference": "124pam124",
  "timestamp": "20220328103831",
  "paymentType": "CHARGE"
}
json
// Sample: REFUND
{
  "result": "SUCCESS",
  "retrievalReference": "12978418-98fc-4d12-ad19-2bd1fbacacf4",
  "authCode": "1648435315599",
  "signature": "hmac256fc3df3ac70f3e6bb1aaaf5f05d37a33e972027d380d0ceff3d784d5fedb34384",
  "chargeReference": "124pam124",
  "timestamp": "20220328104159",
  "paymentType": "REFUND"
}

Expected Webhook Response

FieldDescription
errorCode0000 for success, or custom integer error code
errorDescriptionBrief message describing the result

Sample Responses

json
// Success
{
  "errorCode": "0000",
  "errorDescription": "success"
}
json
// Error
{
  "errorCode": "0001",
  "errorDescription": "one or more fields empty"
}