Webhooks
Webhooks allow you to receive real-time notifications about the status of transactions processed through the payment gateway. Whenever a transaction reaches a final status (e.g., `SUCCESS`, `FAILED`, or `BLOCKED`), the system sends a webhook to the URL configured by the user.
Webhook Workflow
-
Triggering the Webhook:
A webhook is triggered when a transaction reaches one of the following statuses:SUCCESS
: The transaction is successfully processed.FAILED
: The transaction failed due to an issue (e.g., invalid card details or insufficient funds).BLOCKED
: The transaction is blocked due to security concerns or policy violations.
-
Resending Webhooks:
If the webhook fails (e.g., due to server unavailability or timeout), the system retries the webhook up to 3 times at predefined intervals. After the third failure, the webhook is marked as undelivered. -
Security and Hash Validation:
Users can set their own secret or unique key for enhanced security.The system will sent in the headerfs-webhook-hash
. This allows users to verify the authenticity of the webhook.
Webhook Headers
The webhook request includes the following headers:
Header Name | Description |
---|---|
Content-Type | Specifies the content type. Always set to application/json . |
fs-webhook-hash | A hash generated using the user's encryption key to verify webhook authenticity. |
Webhook Payload
The webhook payload contains details about the transaction and its status. Below is the JSON payload format: