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.
- package/.github/workflows/codeql-analysis.yml +71 -0
- package/.github/workflows/npm-publish.yml +2 -1
- package/README.MD +38 -1
- package/app/controllers/adapters/open_money.js +514 -0
- package/app/controllers/checksum/PaytmChecksum.js +94 -0
- package/app/controllers/np_user.controller.js +5 -2
- package/app/controllers/payment_controller.js +443 -62
- package/app/routes/payment_route.js +9 -7
- package/app/views/home.hbs +0 -3
- package/example.js +1 -0
- package/package.json +1 -1
- package/public/layer_checkout.js +38 -0
|
@@ -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('/',
|
|
58
|
-
|
|
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
|
|
package/app/views/home.hbs
CHANGED
package/example.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
+
*/
|