Not able to verify signature of payment
See original GitHub issueI have tried following code for verifying payment signature. But signature from payment and generated at my point are diffrent. Please let me know if i am doing something wrong here. Additionally in docs, there’s no sample code for nodejs. It will be really good if we can just find it there.
let generatedSignature = crypto
.createHmac(
"SHA256",
"my-secret"
).update(payment.razorpay_payment_id + '|' + payment.razorpay_order_id)
.digest('hex');
let isSignatureValid = generatedSignature == payment.razorpay_signature;
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Verify the digital signature on a signed email message
If a digital signature isn't valid, there can be many causes. For example, the sender's certificate may have expired, it may have been...
Read more >Verify response with signature | Google Pay for India
For a response with a signature, verify the signature with the corresponding Google Pay public key. If the verification succeeds, check that the...
Read more >Razorpay signature verification not happening as SHA256 ...
I am making an app in which after a successful payment I create a digest which I verify using the suggest way ...
Read more >Validating digital signatures, Adobe Acrobat
Under Categories, select Signatures. For Verification, click More. To automatically validate all signatures in a PDF when you open the document ...
Read more >Could not verify Apple Pay token s… | Apple Developer Forums
Hello, we are having problems with verifying some Apple Pay signatures in payment tokens. ... The openssl asn1parse and dumpasn1 also could not...
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
Closing this issue, As I have figured out that the payment signature is generated using live mode secret key even though you are in test mode and the order was generated in test mode.
So if you want to check the Payment signature always use Live mode secret key. Above code will work if you use Live mode secret key.
I am getting undefined values of razorpayOrderId and razorpaySignature from the handler response while working on test mode. So the payment verification fails in the backend. I have been stuck at this for over a day now. Any help is highly appreciated.
This is my code snippet:
` const launchRazorpay = async () => { const order = await axios.post"http://localhost:8081/api/subscription/pay");
};
`
@harman28 sir, any suggestions?