node-paytmpg 5.2.2 → 5.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-paytmpg",
3
- "version": "5.2.2",
3
+ "version": "5.2.3",
4
4
  "description": "Payment Gateway Integration using NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,63 +0,0 @@
1
- const PaytmChecksum = require('./checksum/PaytmChecksum.js');
2
- var request = require('request')
3
-
4
- let iod = "pay_uuvmP3p282" + Math.floor(Math.random() * 100)
5
- let initTxnbody = {
6
- "requestType": "Payment",
7
- "mid": "mGkXCb73842366174007",
8
- "websiteName": "DEFAULT",
9
- "orderId": iod,
10
- "callbackUrl": "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=" + iod,
11
- "txnAmount": {
12
- "value": "10",
13
- "currency": "INR"
14
- },
15
- "userInfo": {
16
- "custId": "user_q0W8cX7tjt",
17
- "mobile": "+918527483275",
18
- "firstName": "shivesh navin",
19
- "email": "shiveshnavin@gmail.com"
20
- },
21
- "enablePaymentMode": [
22
- {
23
- "mode": "UPI"
24
- },
25
- {
26
- "mode": "BALANCE"
27
- },
28
- {
29
- "mode": "NET_BANKING"
30
- },
31
- {
32
- "mode": "DEBIT_CARD"
33
- },
34
- {
35
- "mode": "CREDIT_CARD"
36
- }
37
- ]
38
- };
39
-
40
- (async () => {
41
-
42
- let checksum = await PaytmChecksum.generateSignature(JSON.stringify(initTxnbody), "KwA5mZLG_wSBDTTi")
43
- let initTxnUrl = "https://securegw.paytm.in" + `/theia/api/v1/initiateTransaction?mid=${initTxnbody.mid}&orderId=${initTxnbody.orderId}`;
44
-
45
-
46
- request.post(
47
- initTxnUrl,
48
- {
49
- json: {
50
- "body": initTxnbody,
51
- "head": {
52
- "signature": checksum,
53
- "channelId": "WAP"
54
- }
55
- }
56
- },
57
- function (error, response, body) {
58
-
59
- console.log(body.body.txnToken)
60
- console.log(initTxnbody.orderId)
61
-
62
- });
63
- })()