node-paytmpg 7.3.6 → 7.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -695,11 +695,20 @@ class PaymentController {
695
695
  console.log(`Razorpay webhook payment order=${razorpay_order_id} payid=${razorpay_payment_id} status=${status}`);
696
696
  const reqBody = req.rawBody;
697
697
  const signature = req.headers["x-razorpay-signature"];
698
+ console.log("Razorpay webhook signature:", signature);
699
+ console.log("Razorpay rawBody:", reqBody);
700
+ console.log("Razorpay SECRET:", config.SECRET);
698
701
  if (signature === undefined) {
699
702
  res.status(400).send({ message: "Missing Razorpay signature" });
700
703
  return;
701
704
  }
702
- const signatureValid = razorpay_1.default.validateWebhookSignature(reqBody, signature, config.SECRET);
705
+ let signatureValid;
706
+ try {
707
+ signatureValid = razorpay_1.default.validateWebhookSignature(reqBody, signature, config.SECRET);
708
+ }
709
+ catch (e) {
710
+ signatureValid = false;
711
+ }
703
712
  if (signatureValid) {
704
713
  if (event === events[0]) {
705
714
  req.body.STATUS = "TXN_SUCCESS";
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "7.3.6",
3
+ "version": "7.3.8",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "7.3.6",
3
+ "version": "7.3.8",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",