Callback payout
Callback pembayaran menggunakan header tanda tangan dan mekanisme percobaan ulang yang sama seperti callback pembayaran.
The platform calls back only when a payout reaches the confirmed or failed final state.
Header
| Kolom | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| content-type | application/json | Ya | Selalu aplikasi/json. |
| x-callback-timestamp | string | Ya | Panggilan balik timestamp dalam milidetik. |
| x-callback-nonce | string | Ya | Panggilan balik nonce. |
| x-callback-signature | string | Ya | HMAC-SHA256(apiKey, timestamp + "." + nonce + "." + rawBody)。 |
| x-callback-signature-algorithm | string | Ya | Selalu HMAC-SHA256. |
| x-callback-signature-version | string | Ya | Selalu v1. |
Parameter
| Kolom | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| merchantUid | string | Ya | Merchant UID. |
| orderNo | string | Ya | Nomor pesanan pembayaran platform. |
| merchantOrderNo | string | null | Ya | Nomor pesanan pedagang. |
| chainCode | string | Ya | Kode rantai. |
| tokenSymbol | string | Ya | Simbol token. |
| fromAddress | string | null | Ya | Alamat pengirim. |
| toAddress | string | Ya | Alamat penerimaan. |
| txHash | string | null | TIDAK | Hash dalam rantai. |
| amount | string | Ya | Jumlah pembayaran. |
| status | string | Ya | Final payout state: confirmed or failed. |
| failedStage | string | TIDAK | Returned only when status=failed. |
Contoh permintaan
{
"merchantUid": "880001",
"orderNo": "PO1776193200A1B2C3D4",
"merchantOrderNo": "PO202604150001",
"chainCode": "TRON",
"tokenSymbol": "USDT",
"fromAddress": "TNjBrNq2a9FK2vwu4W9C1QdLKSZ42Yx5YY",
"toAddress": "TS7b7iD8G2PaPqK1TqSmLJ9nrrYH4oKX1S",
"txHash": "b3d4fb0cb11eb86bb906d1e0ee3b84e17f40d5441d1e4c651ea46920a48a9a01",
"amount": "35.500000",
"status": "confirmed"
}Kolom respons
| Kolom | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| HTTP Status | 200-299 | Ya | Setiap respons 2xx dianggap sukses. |
| Response Body | string | json | TIDAK | Respons body dapat disesuaikan. |
Contoh respons
HTTP/1.1 200 OK
Content-Type: text/plain
successContoh kode
Contoh Penangan Ekspres
app.post('/merchant/callback', (req, res) => {
if (req.body.status === 'confirmed') {
// Pembayaran berhasil
}
if (req.body.status === 'failed') {
// Pembayaran failed
}
return res.status(200).send('success');
});Catatan
- Handle callbacks idempotently by orderNo; only confirmed or failed final states are sent automatically.