1const crypto = require("crypto");
2const hmac = crypto.createHmac('sha256', RAZORPAY_KEY_SECRET);
3
4hmac.update(razorpayOrderId + "|" + razorpayPaymentId);
5let generatedSignature = hmac.digest('hex');
6
7let isSignatureValid = generatedSignature == payload.razorpay_signature;
8