Webhooks are server callbacks to your server from Cashfree payments.
Webhooks are event-based notifications that are received when a specific event related to the reverse penny drop verification occurs.
In rare cases, such as network retries, read timeouts, processing delays, or delivery failures, the same webhook might be sent more than once for the same event. To prevent unintended side effects, implement idempotency in your webhook handler to handle duplicate deliveries.
Add your webhook URL in our system for us to deliver webhook events.Follow the instructions below to configure the webhook URL. Ensure to provide the publicly accessible HTTPS URL to your webhook endpoint.
Verifying the signature is mandatory before processing any response. It helps authenticate that the webhook is from Cashfree Payments.Follow the steps to verify the signature:
Sort the array based on keys.
Concatenate all the values in this array and the resultant is the post data (postData).
Encrypt the postData with SHA-256 and Base64-encode it.
Verify that the calculated signature matches the signature received.
Continue processing only if the signatures match. Otherwise, discard the request.
Ensure that the clientSecret you use belongs to the oldest active key pair.
For example, from the webhook received, extract the data and pass it to generate HMAC function:
When you decide to consume the webhooks, first, you need to verify if your systems need an IP whitelisting to be done at your end or not. Accordingly you can whitelist the below IPs of Cashfree: