razorpay / razorpay-node

Razorpay node.js bindings
MIT License
182 stars 111 forks source link

razorpay.validateWebhookSignature not working for invoice.paid events and working on all other cases #128

Closed shailu26 closed 2 years ago

shailu26 commented 4 years ago

do anybody knows why validateWebhookSignature is not working for invoice.paid evnets?

Here is the code -

const reqBody = req.body;
        const receivedSignature = req.get('x-razorpay-signature');
        const webhookSecret = '12345';
        let value = razorpay.validateWebhookSignature(JSON.stringify(reqBody), receivedSignature, webhookSecret);

for all webhook events its working except invoice.paid

ankitdas13 commented 2 years ago

sorry for the delay @shailu26. you had to pass rawBody instead of reqBody. could you please let me know if this was resolved ?

ankitdas13 commented 2 years ago

For now, I am closing this issue as I have not received any response. If you need any help then please let us know.