node-paytmpg 3.0.5 → 5.1.0

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.
@@ -49,19 +49,21 @@ module.exports = (app, express, callbacks) => {
49
49
 
50
50
  app.set('view engine', 'handlebars');
51
51
 
52
+ let saveRawBody = function (req, res, buf, encoding) {
53
+ req.rawBody = buf.toString();
54
+ }
52
55
  app.use(bodyParser.urlencoded({ extended: true }))
53
- app.use(bodyParser.json())
56
+ app.use(bodyParser.json({ verify: saveRawBody }))
57
+
54
58
  app.use("/" + config.path_prefix, express.static(path.join(__dirname, '../../public')));
55
59
  app.use('/' + config.path_prefix, router);
56
60
 
57
- router.all('/', function (req, res) {
58
- res.send({ message: packageInfo.description, developer: packageInfo.author, version: packageInfo.version })
59
-
60
- });
61
+ router.all('/', pc.init);
62
+ router.all('/init', pc.init);
61
63
 
62
- router.all('/home', pc.home)
63
- router.all('/init', pc.init)
64
+ // router.all('/home', pc.home)
64
65
  router.all('/callback', pc.callback)
66
+ router.all('/api/webhook', pc.webhook)
65
67
  router.all('/api/status', pc.status)
66
68
  router.all('/api/createTxn', pc.createTxn)
67
69
 
@@ -7,9 +7,6 @@
7
7
  <tr>
8
8
  <td>Name</td><td>{{name}}</td>
9
9
  </tr>
10
- <tr>
11
- <td>Author</td><td><a href='https://www.linkedin.com/in/shiveshnavin/'>Shivesh Navin</a></td>
12
- </tr>
13
10
  <tr>
14
11
  <td>Version</td><td>{{version}}</td>
15
12
  </tr>
package/example.js CHANGED
@@ -24,6 +24,7 @@ app.set('np_config', {
24
24
  "INDUSTRY_TYPE_ID":"Retail",
25
25
  "homepage":"/",
26
26
  "path_prefix":"_pay",
27
+ "theme_color":"#231530",
27
28
  "db_url":MONGOURL // Remove this property in case you want to use multidborm
28
29
  });
29
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "3.0.5",
3
+ "version": "5.1.0",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,38 @@
1
+ function triggerLayer() {
2
+
3
+ Layer.checkout(
4
+ {
5
+ token: layer_params.payment_token_id,
6
+ accesskey: layer_params.accesskey,
7
+ },
8
+ function (response) {
9
+ console.log(response)
10
+ if(response !== null || response.length > 0 ){
11
+
12
+ if(response.payment_id !== undefined){
13
+
14
+ document.getElementById('layer_payment_id').value = response.payment_id;
15
+
16
+ }
17
+
18
+ }
19
+
20
+ document.layer_payment_int_form.submit();
21
+ },
22
+ function (err) {
23
+ alert(err.message);
24
+ }
25
+ );
26
+ }
27
+ /*
28
+ var checkExist = setInterval(function() {
29
+ if (typeof Layer !== 'undefined') {
30
+ console.log('Layer Loaded...');
31
+ clearInterval(checkExist);
32
+ triggerLayer();
33
+ }
34
+ else {
35
+ console.log('Layer undefined...');
36
+ }
37
+ }, 1000);
38
+ */