Callback notification
Signed webhook when a payment reaches a terminal outcome
Configure webhook URL in Merchant Console → Developers. Store the signing secret whsec_… (shown once).
TaraPay POSTs signed JSON to your URL with retries (about 5 attempts over ~24 hours).
Request headers (to your server)
| Field | Type | Req | Description |
|---|---|---|---|
TaraPay-Signature | String | M | t=<unix>,v1=<hmac-sha256-hex> |
TaraPay-Event-Id | String | M | Unique event id — use as idempotency key |
TaraPay-Event-Type | String | M | e.g. payment_intent.succeeded |
Content-Type | String | M | application/json |
Verify signature
- Read the raw request body as UTF-8 (do not re-serialize JSON).
- Parse TaraPay-Signature into t and v1.
- Reject if |now − t| > 300 seconds.
- Compute HMAC-SHA256(secret, `${t}.${rawBody}`) as hex.
- Compare to v1 with constant-time equality.
- Deduplicate on TaraPay-Event-Id; return 200 on replays.
{
"id": "evt_…",
"type": "payment_intent.succeeded",
"livemode": false,
"data": {
"object": {
"id": "0193a0…",
"status": "succeeded",
"amountMinor": "10000",
"currency": "BDT",
"merchantOrderRef": "qp6-dep-1001"
}
}
}POST/v1/webhooks/simulateScope: payments:write (test keys only)
curl -sS -X POST '$BASE/v1/webhooks/simulate' \
-H 'Authorization: Bearer $TP_TEST_KEY' \
-H 'Content-Type: application/json' \
-d '{
"paymentIntentId": "0193a0…",
"outcome": "succeeded"
}'Credit your customer only after verifying the signature and seeing status succeeded. Never trust a browser return URL alone.