node-paytmpg 5.3.1 → 5.4.2

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.
@@ -1,50 +1,50 @@
1
- <h2>Payment Status</h2>
2
-
3
- <form action="{{action}}" method="POST">
4
- <ul class="form-list">
5
-
6
-
7
- <li class="form-list__row">
8
- <label>Order ID</label>
9
- <input type="text" name="NAME" required="" value="{{orderId}}" {{readonly}}/>
10
- </li>
11
-
12
- <li class="form-list__row">
13
- <label>Status</label>
14
- <input type="text" name="NAME" required="" value="{{status}}" {{readonly}}/>
15
- </li>
16
-
17
- <li class="form-list__row">
18
- <label>E-Mail</label>
19
- <input type="text" name="EMAIL" required="" value="{{email}}" {{readonly}}/>
20
- </li>
21
-
22
- <li class="form-list__row">
23
- <label>Phone</label>
24
- <input type="text" name="MOBILE_NO" required="" value="{{phone}}" {{readonly}}/>
25
- </li>
26
-
27
-
28
- <li class="form-list__row form-list__row--inline">
29
-
30
- <div>
31
- <label>
32
- Amount
33
- </label>
34
- <input type="text" name="TXN_AMOUNT" required="" value="{{amount}}" {{readonly}} />
35
- </div>
36
-
37
- </li>
38
-
39
-
40
-
41
- <li>
42
- <button type="submit" class="button">DONE</button>
43
- </li>
44
- </ul>
45
-
46
-
47
-
48
-
49
-
1
+ <h2>Payment Status</h2>
2
+
3
+ <form action="{{action}}" method="POST">
4
+ <ul class="form-list">
5
+
6
+
7
+ <li class="form-list__row">
8
+ <label>Order ID</label>
9
+ <input type="text" name="NAME" required="" value="{{orderId}}" {{readonly}}/>
10
+ </li>
11
+
12
+ <li class="form-list__row">
13
+ <label>Status</label>
14
+ <input type="text" name="NAME" required="" value="{{status}}" {{readonly}}/>
15
+ </li>
16
+
17
+ <li class="form-list__row">
18
+ <label>E-Mail</label>
19
+ <input type="text" name="EMAIL" required="" value="{{email}}" {{readonly}}/>
20
+ </li>
21
+
22
+ <li class="form-list__row">
23
+ <label>Phone</label>
24
+ <input type="text" name="MOBILE_NO" required="" value="{{phone}}" {{readonly}}/>
25
+ </li>
26
+
27
+
28
+ <li class="form-list__row form-list__row--inline">
29
+
30
+ <div>
31
+ <label>
32
+ Amount
33
+ </label>
34
+ <input type="text" name="TXN_AMOUNT" required="" value="{{amount}}" {{readonly}} />
35
+ </div>
36
+
37
+ </li>
38
+
39
+
40
+
41
+ <li>
42
+ <button type="submit" class="button">DONE</button>
43
+ </li>
44
+ </ul>
45
+
46
+
47
+
48
+
49
+
50
50
  </form>
package/app.yaml CHANGED
@@ -1,18 +1,18 @@
1
- # Copyright 2017, Google, Inc.
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
13
- #
14
- # [START runtime]
15
- runtime: nodejs
16
- env: flex
17
- # [END runtime]
18
-
1
+ # Copyright 2017, Google, Inc.
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ #
14
+ # [START runtime]
15
+ runtime: nodejs
16
+ env: flex
17
+ # [END runtime]
18
+
package/example.js CHANGED
@@ -1,51 +1,42 @@
1
- var express=require('express')
2
- var app=express()
3
-
4
- var MONGOURL="mongodb+srv://username:pasws@host.net/dbname";
5
-
6
- /***
7
- * Uncomment in case you want to use multidborm
8
- * https://www.npmjs.com/package/multi-db-orm
9
-
10
- const { MultiDbORM, FireStoreDB, MongoDB, SQLiteDB, Sync } = require("multi-db-orm");
11
- var mongodb = new MongoDB(MONGOURL);
12
- app.multidborm = mongodb;
13
-
14
- */
15
-
16
- app.set('np_config', {
17
- "host_url":"http://127.0.0.1:5542",
18
- "view_path":"/../views/",
19
- "paytm_url":"https://securegw-stage.paytm.in",
20
- "MID":"XXXXX",
21
- "WEBSITE":"WEBSTAGING",
22
- "KEY":"XXXXX",
23
- "CHANNEL_ID":"WAP",
24
- "INDUSTRY_TYPE_ID":"Retail",
25
- "homepage":"/",
26
- "path_prefix":"_pay",
27
- "theme_color":"#231530",
28
- "db_url":MONGOURL // Remove this property in case you want to use multidborm
29
- });
30
-
31
- if(process.env.CONFIG){
32
-
33
- app.set('np_config', JSON.parse(process.env.CONFIG));
34
- console.log('using config from env',process.env.CONFIG);
35
-
36
- }
37
-
38
- require('./index')(app,express)
39
-
40
- app.all('/',function(req,res)
41
- {
42
- res.redirect('/_pay/init')
43
- })
44
-
45
-
46
- app.listen(process.env.PORT || 5542,function()
47
- {
48
-
49
- console.log("Server Started At ",process.env.PORT || 5542)
50
-
51
- })
1
+ var express = require('express')
2
+ var app = express()
3
+ try { require('dotenv').config(); } catch (e) { }
4
+
5
+ // use https://www.npmjs.com/package/multi-db-orm for persistance
6
+ const { SQLiteDB } = require("multi-db-orm");
7
+ var db = new SQLiteDB("test.db");
8
+ app.multidborm = db;
9
+
10
+ // Configuration: prefer values from environment, fall back to sample defaults
11
+ app.set('np_config', {
12
+ host_url: process.env.NP_HOST_URL || 'https://pay.example.com',
13
+ view_path: '/../views/',
14
+ payu_url: 'https://secure.payu.in', // for test use https://test.payu.in
15
+ //"razor_url":"https://api.razorpay.com/v1/", // for test use https://api.razorpay.com/v1/
16
+ //"open_money_url":"https://sandbox.openmoney, // for test use https://sandbox.openmoney
17
+ MID: process.env.NP_MID || '12345',
18
+ WEBSITE: process.env.NP_WEBSITE || 'WEBSTAGING',
19
+ KEY: process.env.NP_KEY || 'abcdef',
20
+ SECRET: process.env.NP_SECRET || 'abcdef', // salt for payu
21
+ CHANNEL_ID: 'WAP',
22
+ INDUSTRY_TYPE_ID: 'Retail',
23
+ homepage: '/',
24
+ path_prefix: '_pay',
25
+ theme_color: '#231530',
26
+ // "db_url":MONGOURL // Remove this property in case you want to use multidborm
27
+ });
28
+
29
+ if (process.env.CONFIG) {
30
+ app.set('np_config', JSON.parse(process.env.CONFIG));
31
+ console.log('using config from env', process.env.CONFIG);
32
+ }
33
+
34
+ require('./index')(app, express)
35
+
36
+ app.all('/', function (req, res) {
37
+ res.redirect('/_pay/init')
38
+ })
39
+
40
+ app.listen(process.env.PORT || 5542, function () {
41
+ console.log("Server Started At ", process.env.PORT || 5542)
42
+ })
package/index.js CHANGED
@@ -1,23 +1,23 @@
1
- module.exports = (app, express, callbacks) => {
2
-
3
- var module = {};
4
-
5
- if (app && express) {
6
- require('./app/routes/payment_route.js')(app, express, callbacks)
7
- var config = (app.get('np_config'))
8
- if (config.db_url) {
9
-
10
- module.Transaction = require('./app/models/np_transaction.model.js')
11
- module.User = require('./app/models/np_user.model.js')
12
-
13
- } else if (app.multidborm) {
14
-
15
- module.Transaction = app.NPTransaction;
16
- module.User = app.NPUser;
17
-
18
- }
19
- }
20
-
21
- return module;
22
- };
23
-
1
+ module.exports = (app, express, callbacks) => {
2
+
3
+ var module = {};
4
+
5
+ if (app && express) {
6
+ require('./app/routes/payment_route.js')(app, express, callbacks)
7
+ var config = (app.get('np_config'))
8
+ if (config.db_url) {
9
+
10
+ module.Transaction = require('./app/models/np_transaction.model.js')
11
+ module.User = require('./app/models/np_user.model.js')
12
+
13
+ } else if (app.multidborm) {
14
+
15
+ module.Transaction = app.NPTransaction;
16
+ module.User = app.NPUser;
17
+
18
+ }
19
+ }
20
+
21
+ return module;
22
+ };
23
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "5.3.1",
3
+ "version": "5.4.2",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,15 +27,18 @@
27
27
  },
28
28
  "homepage": "https://github.com/shiveshnavin/node_paytm#readme",
29
29
  "dependencies": {
30
+ "axios": "^1.3.4",
30
31
  "body-parser": "^1.18.3",
31
32
  "crypto": "^1.0.1",
33
+ "dotenv": "^17.2.3",
32
34
  "express": "^4.16.4",
33
35
  "express-handlebars": "^3.0.2",
34
36
  "mongoose": "^5.4.16",
35
- "multi-db-orm": "^1.0.9",
37
+ "multi-db-orm": "^3.1.0",
36
38
  "nodejs-base64-converter": "^1.0.5",
37
39
  "razorpay": "^2.0.6",
38
40
  "request": "^2.88.0",
41
+ "sqlite3": "^5.1.7",
39
42
  "util": "^0.11.1"
40
43
  }
41
44
  }