π³Card Webhook Documentation
This document describes the Card Transaction Webhook used to notify your system about card activities such as debits, refunds, failed transactions, and card termination events.
Webhook Notification Format
The webhook will send a JSON payload to your endpoint, with the following structure:
{
"card_id": "CARD_123456",
"transaction_id": "TXN_987654",
"status": "debit",
"amount": -25,
"currency": "USD",
"merchant_name": "Amazon",
"card_balance": 120.50
}
Field Descriptions
card_id
string
Unique card identifier
transaction_id
string
Unique transaction reference
status
string
Transaction status
amount
number
Transaction amount
currency
string
USD or NGN
card_balance
number
Card balance after transaction
Webhook Signature Verification
To ensure the authenticity and integrity of the webhook data, Xixapay includes a signature in the request header for every webhook notification sent. This signature is generated by Xixapay using your secret security key and the webhook payload.
1. Verifying the Webhook Signature
When you receive a webhook, you need to:
Retrieve the payload sent by Xixapay in the request body.
Retrieve the xixapay header, which contains the expected signature for the webhook.
Hash the payload with your secret security key using the same hashing algorithm Xixapay uses (usually HMAC-SHA256).
Compare the computed signature with the one sent in the xixapay header.
If the signatures match, you can be confident that the webhook is authentic and hasn't been tampered with
2. Signature Verification in Different Languages
Hereβs how to implement the signature verification in PHP, Python, and Node.js.
Last updated