Webhook Events
Cashfree Cashgram API enables you to receive updates about all event-driven activities originating from your account. Below is the list of Cashgram webhooks: CASHGRAM_REDEEMED - Cashgram redeemed by the customerCASHGRAM_TRANSFER_REVERSAL - Cashgram transfer reversed by the bank
CASHGRAM_EXPIRED - Cashgram is inactive Cashfree gets a response from the bank with the status of the transfer. At times the notifications may get delayed due to various reasons, and the transaction status will be marked as Pending, till Cashfree gets a response. Cashfree polls the transaction status from the bank for the next 72 hours. In case we do not receive the status of a transaction after 72 hours, the transaction will be marked as Failed.
CASHGRAM_REDEEMED
Sent whenever a Cashgram is redeemed.CASHGRAM_TRANSFER_REVERSAL
Sent whenever the bank reverses a Cashgram.CASHGRAM_EXPIRED
Cashgram can become inactive for various reasons. An inactive Cashgram cannot be re-activated. You need to create a new Cashgram to send to your customer. A Cashgram gets reversed if one of the following events occurs:- Redeeming post Expiry time: If the customer does not redeem the Cashgram before the expiration time (set by the Merchant while creating the Cashgram), the Cashgram gets deactivated.
- Reaching the maximum number of retries: A maximum of three attempts is allowed to redeem the Cashgram. If the customer enters incorrect details more than three times, the Cashgram gets deactivated.
- OTP verification attempts exceeded: A maximum of three attempts is allowed to verify the OTP. If the customer fails to verify the OTP successfully, the Cashgram gets deactivated.
Signature Verification
Cashfree sends a signature alongside every webhook, verifying this signature ( passed along with the POST parameters ) is mandatory before processing any response. It helps authenticate that the webhook is from Cashfree. We strongly recommend whitelisting Cashfree’s production IP to help make your communication with Cashfree more secure. Following are the steps to verify Cashfree’s signature:- Get all the POST parameters except ‘signature’ and assign it to an array as key-value pair
- Sort the array based on keys
- Concatenate all the values in this array and the resultant is the post data (say, postData)
- postData needs to be encrypted using SHA-256, and then base64 encoded
- Now verify if both the signature calculated and the signature received match
- Proceed further if it matches, else discards the request