Crypto Callback

Crypto Callback

This section explains how crypto callbacks work and how to handle them.


Getting Started

To receive transaction callbacks:

  • Configure your callback URL in the dashboard
  • Use your encryption key to decrypt the payload

What is a Payment Callback?

A callback is a mechanism where the payment gateway sends real-time transaction updates to your server.

This includes transaction statuses such as:

  • success
  • failed
  • pending
  • expired
  • chargeback
  • refunded

This removes the need to poll APIs for updates.


How It Works

1. Transaction Initiation

A customer initiates a payment on your application.

2. Payment Processing

The gateway processes the transaction.

3. Callback Notification

The gateway sends a POST request to your callback URL.

4. Merchant Handling

Your system should:

  • decrypt the payload
  • verify the data
  • update the transaction status

Callback Format

{
  "encryptedData": "xyzllsndkwl=="
}

Fields

  • encryptedData → Encrypted transaction payload

Decryption

Use your dashboard encryption key.

Example (Node.js)

function decryptParameters(input, secretKey) {
  const decryptedBytes = CryptoJS.AES.decrypt(input, secretKey);
  const decryptedData = decryptedBytes.toString(CryptoJS.enc.Utf8);
  return decryptedData;
}

You can implement this in any language.


Decrypted Data Example

{
  "id": "123xyz",
  "status": "success",
  "amount": 10,
  "amount_raw": "1000000",
  "date": "2023-10-27T08:43:27.709Z",
  "tx_hash": "123xxx88",
  "external_id": "4777382",
  "network": "ETH",
  "sender_address": "payer address",
  "receiver_address": "receiver address"
}

Field Description

  • id → Transaction ID
  • status → success / failed / expired / chargeback / refunded
  • amount → Transaction amount
  • amount_raw → Smallest unit (e.g. wei/satoshi)
  • date → ISO timestamp
  • tx_hash → Blockchain transaction hash
  • external_id → Merchant reference ID
  • network → Blockchain network
  • sender_address → Payer wallet
  • receiver_address → Merchant wallet

Notes

  • Your endpoint must accept POST requests
  • Always decrypt encryptedData
  • Always validate data before processing
  • Never expose your encryption key

Summary

  • Callback = real-time updates
  • Encrypted payload
  • You decrypt → validate → process