node-paytmpg 7.1.6 → 7.3.6

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.
@@ -676,6 +676,7 @@ class PaymentController {
676
676
  const payuInstance = this.payuInstance;
677
677
  const openMoneyInstance = this.openMoneyInstance;
678
678
  console.log("request_data ", req.originalUrl, JSON.stringify(req.body));
679
+ console.log("request_headers ", req.originalUrl, JSON.stringify(req.headers));
679
680
  if (config.paytm_url) {
680
681
  await this.callback(req, res);
681
682
  return;
@@ -694,6 +695,10 @@ class PaymentController {
694
695
  console.log(`Razorpay webhook payment order=${razorpay_order_id} payid=${razorpay_payment_id} status=${status}`);
695
696
  const reqBody = req.rawBody;
696
697
  const signature = req.headers["x-razorpay-signature"];
698
+ if (signature === undefined) {
699
+ res.status(400).send({ message: "Missing Razorpay signature" });
700
+ return;
701
+ }
697
702
  const signatureValid = razorpay_1.default.validateWebhookSignature(reqBody, signature, config.SECRET);
698
703
  if (signatureValid) {
699
704
  if (event === events[0]) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "7.1.6",
3
+ "version": "7.3.6",
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.1.6",
3
+ "version": "7.3.6",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",