node-paytmpg 6.4.2 → 6.4.4

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.
@@ -517,6 +517,7 @@ module.exports = function (app, callbacks) {
517
517
  let showConfirmation =
518
518
  function (err, checksum) {
519
519
  res.render(vp + "init.hbs", {
520
+ path_prefix: config.path_prefix,
520
521
  action:"/"+ config.path_prefix+"/init",
521
522
  readonly: 'readonly',
522
523
  BUTTON: 'Pay',
@@ -649,6 +650,7 @@ module.exports = function (app, callbacks) {
649
650
 
650
651
  res.render(vp + "init.hbs", {
651
652
 
653
+ path_prefix: config.path_prefix,
652
654
  action:"/"+ config.path_prefix+"/init",
653
655
  readonly: '',
654
656
  check: true,
@@ -711,7 +713,10 @@ module.exports = function (app, callbacks) {
711
713
  return res.redirect(returnUrl);
712
714
  }
713
715
  else {
714
- return res.render(vp + "result.hbs", objForUpdate);
716
+ return res.render(vp + "result.hbs", {
717
+ path_prefix: config.path_prefix,
718
+ ...objForUpdate
719
+ });
715
720
  }
716
721
  }
717
722
 
@@ -741,7 +746,10 @@ module.exports = function (app, callbacks) {
741
746
  returnUrl = returnUrl + separator + 'status=' + objForUpdate.status + '&ORDERID=' + objForUpdate.orderId + '&TXNID=' + objForUpdate.TXNID;
742
747
  return res.redirect(returnUrl);
743
748
  }
744
- res.render(vp + "result.hbs", objForUpdate);
749
+ res.render(vp + "result.hbs", {
750
+ path_prefix: config.path_prefix,
751
+ ...objForUpdate
752
+ });
745
753
  });
746
754
  }
747
755
 
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet" />
10
10
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
11
- <link rel="stylesheet" href="css/style.css" />
11
+ <link rel="stylesheet" href="/{{path_prefix}}/css/style.css" />
12
12
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23ff5722'/%3E%3C/svg%3E" />
13
13
  <link rel="shortcut icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23ff5722'/%3E%3C/svg%3E" />
14
14
  <style>
@@ -24,23 +24,10 @@
24
24
  <p class="value">{{amount}}</p>
25
25
  </div>
26
26
  <div class="result-item">
27
- <p class="label">Date &amp; Time</p>
28
- <p class="value">{{date}}</p>
27
+ <p class="label">Status</p>
28
+ <p class="value">{{status}}</p>
29
29
  </div>
30
30
  </div>
31
31
 
32
- <div style="display:flex; gap:12px; margin-top:8px; width:100%; justify-content:center;">
33
- <div class="success-buttons" style="display:flex; gap:12px;">
34
- <a href="{{receiptUrl}}" class="button" style="text-decoration:none;">Download Receipt</a>
35
- <form action="{{homeAction}}" method="GET" style="display:inline"><button type="submit" class="button">Done</button></form>
36
- </div>
37
- <div class="fail-buttons" style="display:flex; gap:12px;">
38
- <form action="{{retryAction}}" method="POST" style="display:inline">
39
- <input type="hidden" name="ORDER_ID" value="{{orderId}}" />
40
- <button type="submit" class="button">Try Again</button>
41
- </form>
42
- <form action="{{cancelAction}}" method="GET" style="display:inline"><button type="submit" class="button">Cancel</button></form>
43
- </div>
44
- </div>
45
32
  </div>
46
33
  </section>
package/example.js CHANGED
@@ -27,7 +27,7 @@ const payment = createPaymentMiddleware({
27
27
  brand: 'DemoPay',
28
28
  }, db);
29
29
 
30
- app.use(payment);
30
+ app.use('/_pay',payment);
31
31
 
32
32
  app.listen(process.env.PORT || 5543, function () {
33
33
  console.log('Server started at', process.env.PORT || 5543);
package/index.js CHANGED
@@ -64,7 +64,10 @@ function createPaymentMiddleware(userConfig = {}, db) {
64
64
  // wire routes against existing payment controller (logic unchanged)
65
65
  const callbacks = config.callbacks || userConfig.callbacks;
66
66
  const pc = require('./app/controllers/payment_controller')(subApp, callbacks);
67
-
67
+ subApp.use((req, res, next) => {
68
+ console.log('Received request at', req.originalUrl);
69
+ next();
70
+ });
68
71
  subApp.all('/init', pc.init);
69
72
  subApp.all('/callback', pc.callback);
70
73
  subApp.all('/api/webhook', pc.webhook);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "6.4.2",
3
+ "version": "6.4.4",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {