A webhook is a real-time push notification sent to the backend system as a JSON payload through HTTP requests. Paysafe uses webhooks to notify the system when the event happens an asynchronous notification of events such as chargebacks, returns, payments cleared, and payments completed.
- Webhooks are more efficient than data polling.
- Webhook Notification (including data points) will be delivered only when the event happen so the backend system will always be up to date.
- Partners subscribe to Webhooks events once and notifications are delivered as soon as the event occurs.
Webhooks do not replace reporting. Webhooks provides real-time information that allows Partners and Merchants to be updated with the transactions. Paysafe recommends that Webhooks are complemented with reports to gain access to the entire set of data and metadata.
- Login into Netbanx Portal.
- Go to Settings > Notifications > Direct Debit.
- Select the events you want to monitor.
- Provide your webhook endpoint (HTTP URL) of your local server.
- Test that your webhooks endpoint is working by hitting button Test connectivity.
- Secure your Webhooks; use HMAC Secret key to verify the webhook signature generated by Paysafe.
- Save the configuration
The webhook notification contains a signature header calculated using the following algorithm:
digest = HMAC_SHA256 (hmacKey, UTF 8 string containing the JSON webhook request body)
signature = base 64 (digest)
The code that received the webhook repeats this algorithm and compare the value generated with the value received in the header.
A Webhook payload contains information about the event that occurred. It is linked to the corresponding resource that triggered the event. The payload also includes attributes such as timestamp, events topic, and the id of the resources.