Razorpay.validateWebhookSignature() is not working for invoice.paid events.
See original GitHub issueHere is code snippet
let body = req.body;
let received_signature = req.get("x-razorpay-signature");
let secret = "xxxx";
var success = Razorpay.validateWebhookSignature(
JSON.stringify(body),
received_signature,
secret
);
Razorpay.validateWebhookSignature() returns true for other webhook events but for events type “invoice.type” it is returning false.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Razorpay.validateWebhookSignature() is not working for ...
validateWebhookSignature() returns true for other webhook events but for events type "invoice.paid" it is returning false. I am using Razorpay ...
Read more >Razorpay.validateWebhookSignature() is not working for ...
I am getting "false" for "payment.captured" event with this code. var signature = req.get('X-Razorpay-Signature'); const validate = Razorpay.
Read more >Validate and Test Webhooks | Razorpay Docs
Validate and test the webhook before you start using them. Understand Idempotency and the importance of the order of Webhook Events.
Read more >Invoices | Subscribe to Webhooks | Razorpay Docs
Subscribe to various webhook events related to Invoices to receive instant notifications. ... Triggered when a partial payment is made against an invoice....
Read more >Webhooks | Razorpay Docs
Use webhooks to get notified about events related to the Razorpay payment flow such as orders, payments, settlements, disputes and workflow steps related...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please don’t parse the JSON. The HMAC is generated for the exact request body that we send, and a minor difference in how your JSON encoder works v/s ours will result in a different JSON string (and broken signature). This is often the case where your descriptions contain quotes or slashes.
Instead read the raw response body in your framework of choice and pass that instead as the first argument to
validateWebhookSignature
. Please see your framework documentation on how to do the same.cc @harman28
Here also same issue, Anybody know the solution?