I am making an app in which after a successful payment I create a digest which I verify using the suggest way of Razorpay signature verification.
My backend is in NodeJS and here is how I am creating the digest.
const crypto = require("crypto");
var generatedSignature = crypto
.createHmac(
"SHA256",
razorpay_order_id + "|" + razorpay_payment_id
)
.update(key_secret)
.digest("hex");
var isSignatureValid = generatedSignature == payload.razorpay_signature // false
Is my way of creating signature wrong?