node-paytmpg 8.0.2 → 8.0.5

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.
@@ -50,6 +50,7 @@ const user_controller_1 = require("./user.controller");
50
50
  const utils_1 = require("../utils/utils");
51
51
  const loadingsvg_1 = require("./static/loadingsvg");
52
52
  const htmlhelper_1 = require("./htmlhelper");
53
+ const subscription_webhook_1 = require("./subscription.webhook");
53
54
  const buildConfig_1 = require("../utils/buildConfig");
54
55
  const IDLEN = 14;
55
56
  function makeid(length) {
@@ -526,17 +527,19 @@ class PaymentController {
526
527
  const sub = await this.db.getOne(this.tableNames.SUBSCRIPTION, { id: orderToFind }).catch(() => null);
527
528
  if (sub) {
528
529
  isSubscription = true;
530
+ const plan = await this.db.getOne(this.tableNames.PLAN, { id: sub.planId }).catch(() => null);
531
+ const user = await this.db.getOne(this.tableNames.USER, { id: sub.cusId }).catch(() => null);
529
532
  objForUpdate = {
530
533
  id: sub.id,
531
534
  orderId: sub.id,
532
535
  cusId: sub.cusId,
533
536
  time: sub.createdAt || Date.now(),
534
537
  status: 'INITIATED',
535
- name: '',
536
- email: '',
537
- phone: '',
538
- amount: 0,
539
- pname: 'Subscription',
538
+ name: (user === null || user === void 0 ? void 0 : user.name) || '',
539
+ email: (user === null || user === void 0 ? void 0 : user.email) || '',
540
+ phone: (user === null || user === void 0 ? void 0 : user.phone) || '',
541
+ amount: (plan === null || plan === void 0 ? void 0 : plan.amount) || 0,
542
+ pname: (plan === null || plan === void 0 ? void 0 : plan.name) || 'Subscription',
540
543
  extra: '',
541
544
  clientId: sub.clientId,
542
545
  returnUrl: sub.returnUrl || '',
@@ -692,12 +695,15 @@ class PaymentController {
692
695
  let result = false;
693
696
  let isCancelled = false;
694
697
  let objForUpdate = await this.getOrder(req);
698
+ let errorMessage = null;
695
699
  let isSubscriptionCallback = false;
696
700
  // Razorpay Subscription Callback Handling
697
701
  if (!objForUpdate && req.body.razorpay_subscription_id) {
698
702
  const sub = await this.db.getOne(this.tableNames.SUBSCRIPTION, { gateway_subscription_id: req.body.razorpay_subscription_id });
699
703
  if (sub) {
700
704
  isSubscriptionCallback = true;
705
+ const plan = await this.db.getOne(this.tableNames.PLAN, { id: sub.planId }).catch(() => null);
706
+ const user = await this.db.getOne(this.tableNames.USER, { id: sub.cusId }).catch(() => null);
701
707
  // Create a virtual transaction object for the callback processor
702
708
  objForUpdate = {
703
709
  id: sub.id,
@@ -705,15 +711,17 @@ class PaymentController {
705
711
  cusId: sub.cusId,
706
712
  time: Date.now(),
707
713
  status: 'INITIATED',
708
- name: '',
709
- email: '',
710
- phone: '',
711
- amount: 0,
712
- pname: 'Subscription Authentication',
714
+ name: (user === null || user === void 0 ? void 0 : user.name) || '',
715
+ email: (user === null || user === void 0 ? void 0 : user.email) || '',
716
+ phone: (user === null || user === void 0 ? void 0 : user.phone) || '',
717
+ amount: (plan === null || plan === void 0 ? void 0 : plan.amount) || 0,
718
+ pname: (plan === null || plan === void 0 ? void 0 : plan.name) || 'Subscription Authentication',
713
719
  extra: '',
714
720
  clientId: sub.clientId,
715
721
  returnUrl: sub.returnUrl || '',
716
- webhookUrl: sub.webhookUrl || ''
722
+ webhookUrl: sub.webhookUrl || '',
723
+ isSubscription: true,
724
+ subscriptionId: sub.id
717
725
  };
718
726
  }
719
727
  }
@@ -749,6 +757,11 @@ class PaymentController {
749
757
  // Update local subscription status
750
758
  await this.db.update(this.tableNames.SUBSCRIPTION, { id: objForUpdate === null || objForUpdate === void 0 ? void 0 : objForUpdate.id }, { status: 'AUTHENTICATED', updatedAt: Date.now() });
751
759
  }
760
+ else if (objForUpdate) {
761
+ req.body.ORDERID = objForUpdate === null || objForUpdate === void 0 ? void 0 : objForUpdate.id;
762
+ req.body.STATUS = 'TXN_FAILURE';
763
+ errorMessage = 'Subscription signature verification failed';
764
+ }
752
765
  }
753
766
  else {
754
767
  // Standard Order verification
@@ -765,6 +778,11 @@ class PaymentController {
765
778
  req.body.ORDERID = req.body.razorpay_order_id;
766
779
  req.body.TXNID = req.body.razorpay_payment_id;
767
780
  }
781
+ else if (objForUpdate) {
782
+ req.body.ORDERID = objForUpdate === null || objForUpdate === void 0 ? void 0 : objForUpdate.id;
783
+ req.body.STATUS = 'TXN_FAILURE';
784
+ errorMessage = 'Subscription signature verification failed';
785
+ }
768
786
  }
769
787
  else {
770
788
  if (req.body.error && req.body.error.metadata && JSON.parse(req.body.error.metadata)) {
@@ -794,13 +812,8 @@ class PaymentController {
794
812
  req.body.ORDERID = openRest.ORDERID || req.query.order_id;
795
813
  req.body.extras = openRest.data;
796
814
  }
797
- console.log("NodePayTMPG::Transaction => ", req.body.ORDERID, req.body.STATUS);
798
- if (result || isCancelled) {
799
- await this.updateTransaction(req, res);
800
- }
801
- else {
802
- res.send({ message: "Something went wrong ! Please try again later .", ORDERID: req.body.ORDERID, TXNID: req.body.TXNID });
803
- }
815
+ console.log("NodePayTMPG::Transaction => ", req.body.ORDERID, req.body.STATUS, errorMessage || '', 'isCancelled:', isCancelled, 'isSubscriptionCallback:', isSubscriptionCallback);
816
+ await this.updateTransaction(req, res);
804
817
  }
805
818
  getServiceUsed(req, baseConfig) {
806
819
  const config = (0, buildConfig_1.withClientConfigOverrides)(baseConfig, req);
@@ -825,7 +838,6 @@ class PaymentController {
825
838
  return serviceUsed;
826
839
  }
827
840
  async webhook(req, res) {
828
- var _a;
829
841
  try {
830
842
  let config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req);
831
843
  const payuInstance = this.getProviderInstance('PayU', config);
@@ -850,145 +862,8 @@ class PaymentController {
850
862
  const event = req.body.event;
851
863
  // Handle Subscription Events
852
864
  if (event.startsWith("subscription.")) {
853
- if (req.body.payload && req.body.payload.subscription && req.body.payload.subscription.entity) {
854
- const subEntity = req.body.payload.subscription.entity;
855
- const paymentEntity = (_a = req.body.payload.payment) === null || _a === void 0 ? void 0 : _a.entity;
856
- const gateway_subscription_id = subEntity.id;
857
- const reqBody = req.rawBody;
858
- const signature = req.headers["x-razorpay-signature"];
859
- if (signature === undefined) {
860
- res.status(200).send({ message: "Missing Razorpay signature" });
861
- return;
862
- }
863
- let signatureValid;
864
- try {
865
- signatureValid = razorpay_1.default.validateWebhookSignature(reqBody, signature, config.SECRET);
866
- }
867
- catch (e) {
868
- signatureValid = false;
869
- }
870
- if (!signatureValid) {
871
- res.status(200).send({ message: "Invalid Rzpay signature" });
872
- return;
873
- }
874
- // Find the local subscription
875
- const sub = await this.db.getOne(this.tableNames.TRANSACTION.replace('transactions', 'subscriptions'), { gateway_subscription_id });
876
- if (!sub) {
877
- console.log("Subscription not found for webhook:", gateway_subscription_id);
878
- res.status(200).send({ message: "Subscription not found locally" });
879
- return;
880
- }
881
- const clientConf = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req, { clientId: sub.clientId });
882
- let statusChanged = false;
883
- // Map Razorpay events to local subscription status
884
- switch (event) {
885
- case "subscription.authenticated":
886
- sub.status = 'AUTHENTICATED';
887
- statusChanged = true;
888
- break;
889
- case "subscription.activated":
890
- case "subscription.resumed":
891
- case "subscription.updated": // An update might make it active again or just change metadata
892
- if (subEntity.status === 'active') {
893
- sub.status = 'ACTIVE';
894
- statusChanged = true;
895
- }
896
- break;
897
- case "subscription.paused":
898
- sub.status = 'PAUSED';
899
- statusChanged = true;
900
- break;
901
- case "subscription.pending":
902
- sub.status = 'PENDING';
903
- statusChanged = true;
904
- break;
905
- case "subscription.halted":
906
- sub.status = 'HALTED';
907
- statusChanged = true;
908
- break;
909
- case "subscription.cancelled":
910
- sub.status = 'CANCELLED';
911
- statusChanged = true;
912
- break;
913
- case "subscription.completed":
914
- sub.status = 'COMPLETED';
915
- statusChanged = true;
916
- break;
917
- }
918
- if (statusChanged) {
919
- sub.updatedAt = Date.now();
920
- await this.db.update(this.tableNames.TRANSACTION.replace('transactions', 'subscriptions'), { id: sub.id }, sub);
921
- }
922
- // Trigger client payment webhook ONLY on actual charges or definitive failures
923
- if (event === "subscription.charged" && paymentEntity) {
924
- sub.status = 'ACTIVE';
925
- await this.db.update(this.tableNames.TRANSACTION.replace('transactions', 'subscriptions'), { id: sub.id }, sub);
926
- // Create a new transaction record for this specific charge
927
- const txnId = 'txn_' + makeid(10);
928
- const newTxn = {
929
- id: txnId,
930
- orderId: txnId, // Use txnId as orderId for recurring payments since there is no explicit user-created order
931
- cusId: sub.cusId,
932
- time: Date.now(),
933
- status: 'TXN_SUCCESS',
934
- name: '', // We could fetch from user, but keeping minimal
935
- email: paymentEntity.email || '',
936
- phone: paymentEntity.contact || '',
937
- amount: paymentEntity.amount / 100,
938
- pname: 'Subscription Charge',
939
- extra: JSON.stringify(paymentEntity),
940
- txnId: paymentEntity.id,
941
- clientId: sub.clientId,
942
- returnUrl: sub.returnUrl,
943
- webhookUrl: sub.webhookUrl,
944
- isSubscription: true,
945
- subscriptionId: sub.id
946
- };
947
- await this.db.insert(this.tableNames.TRANSACTION, newTxn);
948
- // Trigger client webhook
949
- if (sub.webhookUrl) {
950
- try {
951
- await axios_1.default.post(sub.webhookUrl, newTxn);
952
- console.log("Sent subscription webhook to ", sub.webhookUrl, 'txnId:', paymentEntity.id);
953
- }
954
- catch (e) {
955
- console.log("Error sending subscription webhook to ", sub.webhookUrl, (e === null || e === void 0 ? void 0 : e.message) || e);
956
- }
957
- }
958
- }
959
- else if (event === "subscription.halted") {
960
- // Optional: Inform client of a failed recurring payment that led to a halt
961
- const txnId = 'txn_' + makeid(10);
962
- const newTxn = {
963
- id: txnId,
964
- orderId: txnId,
965
- cusId: sub.cusId,
966
- time: Date.now(),
967
- status: 'TXN_FAILURE',
968
- name: '',
969
- email: '',
970
- phone: '',
971
- amount: 0, // Or fetch plan amount if needed
972
- pname: 'Subscription Halted',
973
- extra: JSON.stringify(subEntity),
974
- txnId: '',
975
- clientId: sub.clientId,
976
- returnUrl: sub.returnUrl,
977
- webhookUrl: sub.webhookUrl,
978
- isSubscription: true,
979
- subscriptionId: sub.id
980
- };
981
- await this.db.insert(this.tableNames.TRANSACTION, newTxn);
982
- if (sub.webhookUrl) {
983
- try {
984
- await axios_1.default.post(sub.webhookUrl, newTxn);
985
- }
986
- catch (e) { }
987
- }
988
- }
989
- res.status(200).send({ message: "Subscription webhook processed" });
990
- return;
991
- }
865
+ await (0, subscription_webhook_1.handleSubscriptionWebhook)(req, res, this.db, this.baseConfig, this.tableNames, makeid);
866
+ return;
992
867
  }
993
868
  // Handle One-time Payment Events
994
869
  if (req.body.payload &&
@@ -17,6 +17,7 @@ export declare class SubscriptionController {
17
17
  initSubscription(req: Request, res: Response): Promise<void>;
18
18
  checkoutSubscription(req: Request, res: Response): Promise<void>;
19
19
  getSubscription(req: Request, res: Response): Promise<void>;
20
+ getSubscriptions(req: Request, res: Response): Promise<void>;
20
21
  cancelSubscription(req: Request, res: Response): Promise<void>;
21
22
  getSubscriptionPayments(req: Request, res: Response): Promise<void>;
22
23
  }
@@ -135,12 +135,14 @@ class SubscriptionController {
135
135
  res.status(404).send({ message: 'Plan not found' });
136
136
  return;
137
137
  }
138
- const { name, description, amount, interval, period } = req.body;
138
+ const { name, description, amount, interval, period, currency, trial_days } = req.body;
139
139
  // Check if Gateway immutable fields are changing
140
140
  let needsNewGatewayPlan = false;
141
141
  if ((amount !== undefined && parseFloat(amount) !== plan.amount) ||
142
142
  (interval !== undefined && parseInt(interval, 10) !== plan.interval) ||
143
- (period !== undefined && period !== plan.period)) {
143
+ (period !== undefined && period !== plan.period) ||
144
+ (currency !== undefined && currency !== plan.currency) ||
145
+ (trial_days !== undefined && parseInt(trial_days, 10) !== plan.trial_days)) {
144
146
  needsNewGatewayPlan = true;
145
147
  }
146
148
  const updatedPlan = { ...plan, updatedAt: Date.now() };
@@ -154,6 +156,10 @@ class SubscriptionController {
154
156
  updatedPlan.interval = parseInt(interval, 10);
155
157
  if (period !== undefined)
156
158
  updatedPlan.period = period;
159
+ if (currency !== undefined)
160
+ updatedPlan.currency = currency;
161
+ if (trial_days !== undefined)
162
+ updatedPlan.trial_days = parseInt(trial_days, 10);
157
163
  if (needsNewGatewayPlan) {
158
164
  const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req);
159
165
  const provider = this.getProvider(config);
@@ -297,7 +303,7 @@ class SubscriptionController {
297
303
  }
298
304
  // Optionally sync from provider
299
305
  if (req.query.sync && sub.gateway_subscription_id) {
300
- const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req);
306
+ const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req, { clientId: sub.clientId });
301
307
  const provider = this.getProvider(config);
302
308
  if (provider) {
303
309
  try {
@@ -332,6 +338,25 @@ class SubscriptionController {
332
338
  res.status(500).send({ message: 'Error fetching subscription', error: err === null || err === void 0 ? void 0 : err.message });
333
339
  }
334
340
  }
341
+ async getSubscriptions(req, res) {
342
+ try {
343
+ const clientId = req.query.clientId || req.query.client_id || req.headers['x-client-id'] || '';
344
+ const query = {};
345
+ if (clientId) {
346
+ query.clientId = clientId;
347
+ }
348
+ const limit = Math.min(parseInt(req.query.limit, 10) || 20, 100);
349
+ const offset = Math.max(parseInt(req.query.offset, 10) || 0, 0);
350
+ const subs = await this.db.get(this.tableNames.SUBSCRIPTION, query, {
351
+ sort: [{ field: 'createdAt', order: 'desc' }],
352
+ limit: limit, offset: offset
353
+ });
354
+ res.send({ limit, offset, count: subs.length, subscriptions: subs });
355
+ }
356
+ catch (err) {
357
+ res.status(500).send({ message: 'Error fetching subscriptions', error: err === null || err === void 0 ? void 0 : err.message });
358
+ }
359
+ }
335
360
  async cancelSubscription(req, res) {
336
361
  try {
337
362
  const id = req.params.id;
@@ -345,7 +370,7 @@ class SubscriptionController {
345
370
  res.status(400).send({ message: `Cannot cancel subscription in ${sub.status} state` });
346
371
  return;
347
372
  }
348
- const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req);
373
+ const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req, { clientId: sub.clientId });
349
374
  const provider = this.getProvider(config);
350
375
  if (provider && sub.gateway_subscription_id) {
351
376
  try {
@@ -377,6 +402,7 @@ class SubscriptionController {
377
402
  res.status(404).send({ message: 'Subscription not found' });
378
403
  return;
379
404
  }
405
+ const config = (0, buildConfig_1.withClientConfigOverrides)(this.baseConfig, req, { clientId: sub.clientId });
380
406
  const limit = Math.min(parseInt(req.query.limit, 10) || 20, 100);
381
407
  const offset = Math.max(parseInt(req.query.offset, 10) || 0, 0);
382
408
  // Fetch transactions linked to this subscription
@@ -46,6 +46,39 @@ async function handleSubscriptionWebhook(req, res, db, baseConfig, tableNames, m
46
46
  case "subscription.authenticated":
47
47
  sub.status = 'AUTHENTICATED';
48
48
  statusChanged = true;
49
+ // Trigger Setup Success Webhook
50
+ const planAuth = await db.getOne(tableNames.PLAN, { id: sub.planId }).catch(() => null);
51
+ const userAuth = await db.getOne(tableNames.USER, { id: sub.cusId }).catch(() => null);
52
+ const authTxn = {
53
+ id: sub.id,
54
+ orderId: sub.id,
55
+ cusId: sub.cusId,
56
+ time: Date.now(),
57
+ status: 'TXN_SUCCESS',
58
+ name: (userAuth === null || userAuth === void 0 ? void 0 : userAuth.name) || '',
59
+ email: (userAuth === null || userAuth === void 0 ? void 0 : userAuth.email) || '',
60
+ phone: (userAuth === null || userAuth === void 0 ? void 0 : userAuth.phone) || '',
61
+ amount: (planAuth === null || planAuth === void 0 ? void 0 : planAuth.amount) || 0,
62
+ pname: (planAuth === null || planAuth === void 0 ? void 0 : planAuth.name) || 'Subscription Authentication',
63
+ extra: JSON.stringify(subEntity),
64
+ txnId: (paymentEntity === null || paymentEntity === void 0 ? void 0 : paymentEntity.id) || '',
65
+ clientId: sub.clientId,
66
+ returnUrl: sub.returnUrl || '',
67
+ webhookUrl: sub.webhookUrl || '',
68
+ isSubscription: true,
69
+ subscriptionId: sub.id
70
+ };
71
+ // Persist if doesn't exist
72
+ const existingAuth = await db.getOne(tableNames.TRANSACTION, { orderId: sub.id }).catch(() => null);
73
+ if (!existingAuth) {
74
+ await db.insert(tableNames.TRANSACTION, authTxn);
75
+ }
76
+ if (sub.webhookUrl) {
77
+ try {
78
+ await axios_1.default.post(sub.webhookUrl, authTxn);
79
+ }
80
+ catch (e) { }
81
+ }
49
82
  break;
50
83
  case "subscription.activated":
51
84
  case "subscription.resumed":
@@ -84,6 +117,8 @@ async function handleSubscriptionWebhook(req, res, db, baseConfig, tableNames, m
84
117
  if (event === "subscription.charged" && paymentEntity) {
85
118
  sub.status = 'ACTIVE';
86
119
  await db.update(tableNames.TRANSACTION.replace('transactions', 'subscriptions'), { id: sub.id }, sub);
120
+ const plan = await db.getOne(tableNames.PLAN, { id: sub.planId }).catch(() => null);
121
+ const user = await db.getOne(tableNames.USER, { id: sub.cusId }).catch(() => null);
87
122
  // Create a new transaction record for this specific charge
88
123
  const txnId = 'txn_' + makeid(10);
89
124
  const newTxn = {
@@ -92,11 +127,11 @@ async function handleSubscriptionWebhook(req, res, db, baseConfig, tableNames, m
92
127
  cusId: sub.cusId,
93
128
  time: Date.now(),
94
129
  status: 'TXN_SUCCESS',
95
- name: '', // We could fetch from user, but keeping minimal
96
- email: paymentEntity.email || '',
97
- phone: paymentEntity.contact || '',
130
+ name: (user === null || user === void 0 ? void 0 : user.name) || '',
131
+ email: paymentEntity.email || (user === null || user === void 0 ? void 0 : user.email) || '',
132
+ phone: paymentEntity.contact || (user === null || user === void 0 ? void 0 : user.phone) || '',
98
133
  amount: paymentEntity.amount / 100,
99
- pname: 'Subscription Charge',
134
+ pname: (plan === null || plan === void 0 ? void 0 : plan.name) || 'Subscription Charge',
100
135
  extra: JSON.stringify(paymentEntity),
101
136
  txnId: paymentEntity.id,
102
137
  clientId: sub.clientId,
@@ -118,6 +153,8 @@ async function handleSubscriptionWebhook(req, res, db, baseConfig, tableNames, m
118
153
  }
119
154
  }
120
155
  else if (event === "subscription.halted") {
156
+ const plan = await db.getOne(tableNames.PLAN, { id: sub.planId }).catch(() => null);
157
+ const user = await db.getOne(tableNames.USER, { id: sub.cusId }).catch(() => null);
121
158
  // Optional: Inform client of a failed recurring payment that led to a halt
122
159
  const txnId = 'txn_' + makeid(10);
123
160
  const newTxn = {
@@ -126,11 +163,11 @@ async function handleSubscriptionWebhook(req, res, db, baseConfig, tableNames, m
126
163
  cusId: sub.cusId,
127
164
  time: Date.now(),
128
165
  status: 'TXN_FAILURE',
129
- name: '',
130
- email: '',
131
- phone: '',
132
- amount: 0, // Or fetch plan amount if needed
133
- pname: 'Subscription Halted',
166
+ name: (user === null || user === void 0 ? void 0 : user.name) || '',
167
+ email: (user === null || user === void 0 ? void 0 : user.email) || '',
168
+ phone: (user === null || user === void 0 ? void 0 : user.phone) || '',
169
+ amount: (plan === null || plan === void 0 ? void 0 : plan.amount) || 0,
170
+ pname: (plan === null || plan === void 0 ? void 0 : plan.name) ? `${plan.name} (Halted)` : 'Subscription Halted',
134
171
  extra: JSON.stringify(subEntity),
135
172
  txnId: '',
136
173
  clientId: sub.clientId,
@@ -12,6 +12,7 @@ const subscriptionRoute = function (app, express, callbacks) {
12
12
  router.patch('/plans/:id', (req, res) => sc.updatePlan(req, res));
13
13
  router.delete('/plans/:id', (req, res) => sc.deletePlan(req, res));
14
14
  // Subscription Management
15
+ router.get('/', (req, res) => sc.getSubscriptions(req, res));
15
16
  router.post('/init', (req, res) => sc.initSubscription(req, res));
16
17
  router.post('/createTxn', (req, res) => sc.initSubscription(req, res));
17
18
  router.post('/createTxn/token', (req, res) => sc.initSubscription(req, res));
package/dist/index.js CHANGED
@@ -118,6 +118,7 @@ function createPaymentMiddleware(app, userConfig, db, callbacks, authenticationM
118
118
  subApp.get('/api/plans/:id', authenticationMiddleware, (req, res) => sc.getPlan(req, res));
119
119
  subApp.patch('/api/plans/:id', authenticationMiddleware, (req, res) => sc.updatePlan(req, res));
120
120
  subApp.delete('/api/plans/:id', authenticationMiddleware, (req, res) => sc.deletePlan(req, res));
121
+ subApp.get('/api/sub', authenticationMiddleware, (req, res) => sc.getSubscriptions(req, res));
121
122
  subApp.post('/api/sub/init', authenticationMiddleware, (req, res) => sc.initSubscription(req, res));
122
123
  subApp.post('/api/sub/createTxn', authenticationMiddleware, (req, res) => sc.initSubscription(req, res));
123
124
  subApp.post('/api/sub/createTxn/token', authenticationMiddleware, (req, res) => sc.initSubscription(req, res));
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "8.0.2",
3
+ "version": "8.0.5",
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": "8.0.2",
3
+ "version": "8.0.5",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",