aeremmiddleware 1.0.4 → 1.0.6
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/dist/Finance/Ingenico.types.d.ts +21 -0
- package/dist/Finance/Ingenico.types.js +3 -0
- package/dist/Finance/Ingenico.types.js.map +1 -0
- package/dist/Finance/crimeCheck.d.ts +16 -0
- package/dist/Finance/crimeCheck.js +137 -0
- package/dist/Finance/crimeCheck.js.map +1 -0
- package/dist/Finance/crimecheck.types.d.ts +30 -0
- package/dist/Finance/crimecheck.types.js +3 -0
- package/dist/Finance/crimecheck.types.js.map +1 -0
- package/dist/Finance/encrypt.d.ts +1 -0
- package/dist/Finance/encrypt.js +20 -0
- package/dist/Finance/encrypt.js.map +1 -0
- package/dist/Finance/idfy.d.ts +63 -35
- package/dist/Finance/idfy.js +419 -201
- package/dist/Finance/idfy.js.map +1 -1
- package/dist/Finance/index.d.ts +12 -4
- package/dist/Finance/index.js +18 -10
- package/dist/Finance/index.js.map +1 -1
- package/dist/Finance/ingenico.d.ts +13 -0
- package/dist/Finance/ingenico.js +122 -0
- package/dist/Finance/ingenico.js.map +1 -0
- package/dist/Finance/ingenicoHtml.d.ts +2 -0
- package/dist/Finance/ingenicoHtml.js +122 -0
- package/dist/Finance/ingenicoHtml.js.map +1 -0
- package/dist/Finance/novel.d.ts +35 -0
- package/dist/Finance/novel.js +222 -0
- package/dist/Finance/novel.js.map +1 -0
- package/dist/Finance/novel.types.d.ts +23 -0
- package/dist/Finance/novel.types.js +10 -0
- package/dist/Finance/novel.types.js.map +1 -0
- package/dist/Finance/qbrik.d.ts +89 -0
- package/dist/Finance/qbrik.js +463 -0
- package/dist/Finance/qbrik.js.map +1 -0
- package/dist/Finance/qbrik.types.d.ts +76 -0
- package/dist/Finance/qbrik.types.js +3 -0
- package/dist/Finance/qbrik.types.js.map +1 -0
- package/dist/Maps/index.js +1 -1
- package/dist/Socials/Sms.types.d.ts +8 -0
- package/dist/Socials/Sms.types.js +9 -0
- package/dist/Socials/Sms.types.js.map +1 -0
- package/dist/Socials/SmsSender.d.ts +17 -0
- package/dist/Socials/SmsSender.js +74 -0
- package/dist/Socials/SmsSender.js.map +1 -0
- package/dist/Socials/Whatsapp.types.d.ts +93 -97
- package/dist/Socials/Whatsapp.types.js +8 -8
- package/dist/Socials/Whatsapp.types.js.map +1 -1
- package/dist/Socials/index.d.ts +6 -4
- package/dist/Socials/index.js +12 -10
- package/dist/Socials/index.js.map +1 -1
- package/dist/Socials/{message.d.ts → whatsApp.d.ts} +23 -26
- package/dist/Socials/{message.js → whatsApp.js} +169 -212
- package/dist/Socials/{message.js.map → whatsApp.js.map} +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/index.js +8 -8
- package/package.json +1 -1
- package/src/Finance/Ingenico.types.ts +3 -0
- package/src/Finance/crimeCheck.ts +135 -0
- package/src/Finance/crimecheck.types.ts +31 -0
- package/src/Finance/idfy.ts +34 -20
- package/src/Finance/index.ts +6 -0
- package/src/Finance/ingenico.ts +36 -136
- package/src/Finance/ingenicoHtml.ts +119 -0
- package/src/Finance/qbrik.ts +760 -0
- package/src/Finance/qbrik.types.ts +81 -0
- package/src/Socials/SmsSender.ts +20 -21
package/src/Finance/idfy.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
|
|
2
|
-
|
|
2
|
+
interface ObjectTypes {
|
|
3
|
+
IDFY_TASK_ID: string;
|
|
4
|
+
IDFY_GROUP_ID: string;
|
|
5
|
+
IDFY_ACCOUNT_ID: string;
|
|
6
|
+
IDFY_API_KEY: string;
|
|
7
|
+
IDFY_COMPANY_SEARCH_API_KEY: string;
|
|
8
|
+
}
|
|
3
9
|
export default class IdfyAPIWrapper {
|
|
4
10
|
private bodyTaskIdGroupId = {
|
|
5
11
|
task_id: "",
|
|
@@ -59,7 +65,7 @@ export default class IdfyAPIWrapper {
|
|
|
59
65
|
IDFY_ACCOUNT_ID,
|
|
60
66
|
IDFY_API_KEY,
|
|
61
67
|
IDFY_COMPANY_SEARCH_API_KEY,
|
|
62
|
-
}) {
|
|
68
|
+
}: ObjectTypes) {
|
|
63
69
|
this.bodyTaskIdGroupId.task_id = IDFY_TASK_ID;
|
|
64
70
|
this.bodyTaskIdGroupId.group_id = IDFY_GROUP_ID;
|
|
65
71
|
this.defaultHeaderIdfyApi["account-id"] = IDFY_ACCOUNT_ID;
|
|
@@ -156,7 +162,7 @@ export default class IdfyAPIWrapper {
|
|
|
156
162
|
private async pingTaskUntilSuccess(requestId: string): Promise<any> {
|
|
157
163
|
try {
|
|
158
164
|
let res: any = null;
|
|
159
|
-
const checkTaskAfter1sec = (requestId) => {
|
|
165
|
+
const checkTaskAfter1sec = (requestId: any) => {
|
|
160
166
|
return new Promise<any>((resolve, reject) => {
|
|
161
167
|
try {
|
|
162
168
|
setTimeout(async () => {
|
|
@@ -190,7 +196,7 @@ export default class IdfyAPIWrapper {
|
|
|
190
196
|
try {
|
|
191
197
|
console.log(" ## requestId ", requestId);
|
|
192
198
|
let res: any = null;
|
|
193
|
-
const checkTaskAfter1sec = (requestId) => {
|
|
199
|
+
const checkTaskAfter1sec = (requestId: string) => {
|
|
194
200
|
return new Promise<any>((resolve, reject) => {
|
|
195
201
|
try {
|
|
196
202
|
setTimeout(async () => {
|
|
@@ -231,9 +237,10 @@ export default class IdfyAPIWrapper {
|
|
|
231
237
|
data
|
|
232
238
|
);
|
|
233
239
|
return response;
|
|
234
|
-
} catch (error) {
|
|
240
|
+
} catch (error: any) {
|
|
235
241
|
if (error?.response?.data?.error) {
|
|
236
|
-
|
|
242
|
+
let obj = this.idfyError;
|
|
243
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
237
244
|
if (errorObj)
|
|
238
245
|
throw {
|
|
239
246
|
...this.standardErrorThrowFormat,
|
|
@@ -260,9 +267,10 @@ export default class IdfyAPIWrapper {
|
|
|
260
267
|
const successData = await this.pingTaskUntilSuccess(response.request_id);
|
|
261
268
|
|
|
262
269
|
return successData?.[0]?.result?.source_output;
|
|
263
|
-
} catch (error) {
|
|
270
|
+
} catch (error: any) {
|
|
264
271
|
if (error?.response?.data?.error) {
|
|
265
|
-
|
|
272
|
+
let obj = this.idfyError;
|
|
273
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
266
274
|
if (errorObj)
|
|
267
275
|
throw {
|
|
268
276
|
...this.standardErrorThrowFormat,
|
|
@@ -288,9 +296,10 @@ export default class IdfyAPIWrapper {
|
|
|
288
296
|
const successData = await this.pingTaskUntilSuccess(response.request_id);
|
|
289
297
|
|
|
290
298
|
return successData;
|
|
291
|
-
} catch (error) {
|
|
299
|
+
} catch (error: any) {
|
|
292
300
|
if (error?.response?.data?.error) {
|
|
293
|
-
|
|
301
|
+
let obj = this.idfyError;
|
|
302
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
294
303
|
if (errorObj)
|
|
295
304
|
throw {
|
|
296
305
|
...this.standardErrorThrowFormat,
|
|
@@ -328,9 +337,10 @@ export default class IdfyAPIWrapper {
|
|
|
328
337
|
);
|
|
329
338
|
|
|
330
339
|
return response?.result;
|
|
331
|
-
} catch (error) {
|
|
340
|
+
} catch (error: any) {
|
|
332
341
|
if (error?.response?.data?.error) {
|
|
333
|
-
|
|
342
|
+
let obj = this.idfyError;
|
|
343
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
334
344
|
if (errorObj)
|
|
335
345
|
throw {
|
|
336
346
|
...this.standardErrorThrowFormat,
|
|
@@ -361,9 +371,10 @@ export default class IdfyAPIWrapper {
|
|
|
361
371
|
);
|
|
362
372
|
|
|
363
373
|
return response?.result;
|
|
364
|
-
} catch (error) {
|
|
374
|
+
} catch (error: any) {
|
|
365
375
|
if (error?.response?.data?.error) {
|
|
366
|
-
|
|
376
|
+
let obj = this.idfyError;
|
|
377
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
367
378
|
if (errorObj)
|
|
368
379
|
throw {
|
|
369
380
|
...this.standardErrorThrowFormat,
|
|
@@ -393,9 +404,10 @@ export default class IdfyAPIWrapper {
|
|
|
393
404
|
);
|
|
394
405
|
|
|
395
406
|
return response?.result;
|
|
396
|
-
} catch (error) {
|
|
407
|
+
} catch (error: any) {
|
|
397
408
|
if (error?.response?.data?.error) {
|
|
398
|
-
|
|
409
|
+
let obj = this.idfyError;
|
|
410
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
399
411
|
if (errorObj)
|
|
400
412
|
throw {
|
|
401
413
|
...this.standardErrorThrowFormat,
|
|
@@ -426,9 +438,10 @@ export default class IdfyAPIWrapper {
|
|
|
426
438
|
);
|
|
427
439
|
|
|
428
440
|
return response?.result;
|
|
429
|
-
} catch (error) {
|
|
441
|
+
} catch (error: any) {
|
|
430
442
|
if (error?.response?.data?.error) {
|
|
431
|
-
|
|
443
|
+
let obj = this.idfyError;
|
|
444
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
432
445
|
if (errorObj)
|
|
433
446
|
throw {
|
|
434
447
|
...this.standardErrorThrowFormat,
|
|
@@ -459,9 +472,10 @@ export default class IdfyAPIWrapper {
|
|
|
459
472
|
const successData = await this.pingTaskUntilSuccess(response.request_id);
|
|
460
473
|
|
|
461
474
|
return successData;
|
|
462
|
-
} catch (error) {
|
|
475
|
+
} catch (error: any) {
|
|
463
476
|
if (error?.response?.data?.error) {
|
|
464
|
-
|
|
477
|
+
let obj = this.idfyError;
|
|
478
|
+
const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
|
|
465
479
|
if (errorObj)
|
|
466
480
|
throw {
|
|
467
481
|
...this.standardErrorThrowFormat,
|
package/src/Finance/index.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import IdfyAPIWrapper from "./idfy";
|
|
2
2
|
import NovelApiWrapper from "./novel";
|
|
3
|
+
import IngenicoApiWrapper from "./ingenico";
|
|
4
|
+
import CrimeSearchAPIWrapper from "./crimeCheck";
|
|
5
|
+
import QbrikApiWrapper from "./qbrik";
|
|
3
6
|
|
|
4
7
|
export const finance = {
|
|
5
8
|
idFy: IdfyAPIWrapper,
|
|
6
9
|
novel: NovelApiWrapper,
|
|
10
|
+
ingenico: IngenicoApiWrapper,
|
|
11
|
+
crimecheck: CrimeSearchAPIWrapper,
|
|
12
|
+
qbrik: QbrikApiWrapper,
|
|
7
13
|
};
|
package/src/Finance/ingenico.ts
CHANGED
|
@@ -1,160 +1,60 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { MandateDataType } from "./Ingenico.types";
|
|
2
3
|
import { createSHA512Hash } from "./encrypt";
|
|
4
|
+
import { createHash } from "crypto";
|
|
5
|
+
import { mandateHtml } from "./ingenicoHtml";
|
|
3
6
|
|
|
4
7
|
class IngenicoApiWrapper {
|
|
5
8
|
private verificationUrl = "https://www.paynimo.com/api/paynimoV2.req";
|
|
6
|
-
private salt = "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
private salt = "";
|
|
10
|
+
|
|
11
|
+
constructor(salt: string) {
|
|
12
|
+
this.salt = salt;
|
|
13
|
+
}
|
|
14
|
+
async startMandate(mandateData: MandateDataType): Promise<any> {
|
|
15
|
+
const hashingData = {
|
|
16
|
+
merchantId: mandateData.merchantId,
|
|
17
|
+
txnId: mandateData.txnId,
|
|
18
|
+
totalamount: mandateData.totalamount,
|
|
19
|
+
accountNo: mandateData.accountNo,
|
|
20
|
+
consumerId: mandateData.consumerId,
|
|
21
|
+
consumerMobileNo: mandateData.consumerMobileNo,
|
|
22
|
+
consumerEmailId: mandateData.consumerEmailId,
|
|
23
|
+
debitStartDate: mandateData.debitStartDate,
|
|
24
|
+
debitEndDate: mandateData.debitEndDate,
|
|
25
|
+
maxAmount: mandateData.maxAmount,
|
|
26
|
+
amountType: mandateData.amountType,
|
|
27
|
+
frequency: mandateData.frequency,
|
|
22
28
|
cardNumber: "",
|
|
23
29
|
expMonth: "",
|
|
24
30
|
expYear: "",
|
|
25
31
|
cvvCode: "",
|
|
26
32
|
};
|
|
27
33
|
|
|
28
|
-
const tokenId = createSHA512Hash(
|
|
29
|
-
|
|
30
|
-
return `<!DOCTYPE html>
|
|
31
|
-
<html>
|
|
32
|
-
<head>
|
|
33
|
-
<title>Checkout Demo</title>
|
|
34
|
-
<meta name="viewport" content="user-scalable=no, width=device-width,
|
|
35
|
-
initial-scale=1" / />
|
|
36
|
-
<script
|
|
37
|
-
src="https://www.paynimo.com/paynimocheckout/client/lib/jquery.min.js"
|
|
38
|
-
type="text/javascript"
|
|
39
|
-
></script>
|
|
40
|
-
</head>
|
|
41
|
-
|
|
42
|
-
<body>
|
|
43
|
-
<button id="btnSubmit">Register Now</button>
|
|
44
|
-
|
|
45
|
-
<script
|
|
46
|
-
type="text/javascript"
|
|
47
|
-
src="https://www.paynimo.com/paynimocheckout/server/lib/checkout.js"
|
|
48
|
-
></script>
|
|
49
|
-
|
|
50
|
-
<script type="text/javascript">
|
|
51
|
-
$(document).ready(function () {
|
|
52
|
-
function handleResponse(res) {
|
|
53
|
-
if (
|
|
54
|
-
typeof res != "undefined" &&
|
|
55
|
-
typeof res.paymentMethod != "undefined" &&
|
|
56
|
-
typeof res.paymentMethod.paymentTransaction != "undefined" &&
|
|
57
|
-
typeof res.paymentMethod.paymentTransaction.statusCode !=
|
|
58
|
-
"undefined" &&
|
|
59
|
-
res.paymentMethod.paymentTransaction.statusCode == "0300"
|
|
60
|
-
) {
|
|
61
|
-
// success block
|
|
62
|
-
console.log("success block",res);
|
|
63
|
-
} else if (
|
|
64
|
-
typeof res != "undefined" &&
|
|
65
|
-
typeof res.paymentMethod != "undefined" &&
|
|
66
|
-
typeof res.paymentMethod.paymentTransaction != "undefined" &&
|
|
67
|
-
typeof res.paymentMethod.paymentTransaction.statusCode !=
|
|
68
|
-
"undefined" &&
|
|
69
|
-
res.paymentMethod.paymentTransaction.statusCode == "0398"
|
|
70
|
-
) {
|
|
71
|
-
// initiated block
|
|
72
|
-
console.log("initiate block",res);
|
|
73
|
-
} else {
|
|
74
|
-
// error block
|
|
75
|
-
console.log("error block",res);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
$(document)
|
|
80
|
-
.off("click", "#btnSubmit")
|
|
81
|
-
.on("click", "#btnSubmit", function (e) {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
|
|
84
|
-
var reqJson = {
|
|
85
|
-
features: {
|
|
86
|
-
enableAbortResponse: true,
|
|
87
|
-
enableNewWindowFlow: true, //for hybrid applications please disable this by passing false
|
|
88
|
-
enableExpressPay: true,
|
|
89
|
-
enableMerTxnDetails: true,
|
|
90
|
-
siDetailsAtMerchantEnd: true,
|
|
91
|
-
enableSI: true,
|
|
92
|
-
},
|
|
93
|
-
consumerData: {
|
|
94
|
-
deviceId: "WEBSH2",
|
|
95
|
-
token:"${tokenId}",
|
|
96
|
-
returnUrl:
|
|
97
|
-
"https://aerem.co/", //merchant response page URL
|
|
98
|
-
responseHandler: handleResponse,
|
|
99
|
-
paymentMode: "netBanking",
|
|
100
|
-
merchantLogoUrl:
|
|
101
|
-
"https://www.paynimo.com/CompanyDocs/company-logo-vertical.png", //provided merchant logo will be displayed
|
|
102
|
-
merchantId: "T656995",
|
|
103
|
-
currency: "INR",
|
|
104
|
-
consumerId: "c964635", //Your unique consumer identifier to register a eMandate/eNACH
|
|
105
|
-
consumerMobileNo: "8823809696",
|
|
106
|
-
consumerEmailId: "saransh2196@gmail.com",
|
|
107
|
-
txnId: "16949471459696", //Unique merchant transaction ID
|
|
108
|
-
|
|
109
|
-
items: [
|
|
110
|
-
{
|
|
111
|
-
itemId: "FIRST",
|
|
112
|
-
amount: "2",
|
|
113
|
-
comAmt: "0",
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
customStyle: {
|
|
117
|
-
PRIMARY_COLOR_CODE: "#45beaa", //merchant primary color code
|
|
118
|
-
SECONDARY_COLOR_CODE: "#FFFFFF", //provide merchant's suitable color code
|
|
119
|
-
BUTTON_COLOR_CODE_1: "#2d8c8c", //merchant's button background color code
|
|
120
|
-
BUTTON_COLOR_CODE_2: "#FFFFFF", //provide merchant's suitable color code for button text
|
|
121
|
-
},
|
|
122
|
-
accountNo: "203209528180", //Pass this if accountNo is captured at merchant side for eMandate/eNACH
|
|
123
|
-
|
|
124
|
-
ifscCode: "SBIN0000441", //Pass this if ifscCode is captured at merchant side.
|
|
125
|
-
accountType: "Saving", //Required for eNACH registration this is mandatory field
|
|
126
|
-
debitStartDate: "29-09-2023",
|
|
127
|
-
debitEndDate: "10-05-2025",
|
|
128
|
-
maxAmount: "20000",
|
|
129
|
-
amountType: "M",
|
|
130
|
-
frequency: "ADHO",
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
$.pnCheckout(reqJson);
|
|
135
|
-
if (reqJson.features.enableNewWindowFlow) {
|
|
136
|
-
pnCheckoutShared.openNewWindow();
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
</script>
|
|
141
|
-
</body>
|
|
142
|
-
</html>
|
|
143
|
-
|
|
144
|
-
`;
|
|
34
|
+
const tokenId = createSHA512Hash(hashingData, this.salt);
|
|
35
|
+
return mandateHtml(mandateData, tokenId);
|
|
145
36
|
}
|
|
146
37
|
|
|
147
|
-
|
|
148
|
-
"
|
|
38
|
+
private hashString(input: string): string {
|
|
39
|
+
const hash = createHash("sha512");
|
|
40
|
+
|
|
41
|
+
return hash.update(input).digest("hex");
|
|
42
|
+
}
|
|
149
43
|
|
|
150
44
|
async dualVerification(inputString: any): Promise<any> {
|
|
45
|
+
const originalHash = this.hashString(inputString);
|
|
46
|
+
console.log("originalhash", originalHash);
|
|
151
47
|
const dataArray = inputString.split("|");
|
|
152
48
|
dataArray[dataArray.length - 1] = this.salt;
|
|
153
49
|
const modifiedString = dataArray.join("|");
|
|
50
|
+
const modifiedHash = this.hashString(modifiedString);
|
|
51
|
+
console.log("modifiedhash", modifiedHash);
|
|
154
52
|
|
|
155
|
-
if (
|
|
53
|
+
if (originalHash === modifiedHash) {
|
|
54
|
+
console.log("true");
|
|
156
55
|
return true;
|
|
157
56
|
} else {
|
|
57
|
+
console.log("faalse");
|
|
158
58
|
return false;
|
|
159
59
|
}
|
|
160
60
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { MandateDataType } from "./Ingenico.types";
|
|
2
|
+
|
|
3
|
+
export const mandateHtml = (mandateData: MandateDataType, tokenId: string) => {
|
|
4
|
+
return `<!DOCTYPE html>
|
|
5
|
+
<html>
|
|
6
|
+
<head>
|
|
7
|
+
<title>Checkout Demo</title>
|
|
8
|
+
<meta name="viewport" content="user-scalable=no, width=device-width,
|
|
9
|
+
initial-scale=1" / />
|
|
10
|
+
<script
|
|
11
|
+
src="https://www.paynimo.com/paynimocheckout/client/lib/jquery.min.js"
|
|
12
|
+
type="text/javascript"
|
|
13
|
+
></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<button id="btnSubmit">Register Now</button>
|
|
18
|
+
|
|
19
|
+
<script
|
|
20
|
+
type="text/javascript"
|
|
21
|
+
src="https://www.paynimo.com/paynimocheckout/server/lib/checkout.js"
|
|
22
|
+
></script>
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript">
|
|
25
|
+
$(document).ready(function () {
|
|
26
|
+
function handleResponse(res) {
|
|
27
|
+
if (
|
|
28
|
+
typeof res != "undefined" &&
|
|
29
|
+
typeof res.paymentMethod != "undefined" &&
|
|
30
|
+
typeof res.paymentMethod.paymentTransaction != "undefined" &&
|
|
31
|
+
typeof res.paymentMethod.paymentTransaction.statusCode !=
|
|
32
|
+
"undefined" &&
|
|
33
|
+
res.paymentMethod.paymentTransaction.statusCode == "0300"
|
|
34
|
+
) {
|
|
35
|
+
// success block
|
|
36
|
+
console.log("success block",res);
|
|
37
|
+
} else if (
|
|
38
|
+
typeof res != "undefined" &&
|
|
39
|
+
typeof res.paymentMethod != "undefined" &&
|
|
40
|
+
typeof res.paymentMethod.paymentTransaction != "undefined" &&
|
|
41
|
+
typeof res.paymentMethod.paymentTransaction.statusCode !=
|
|
42
|
+
"undefined" &&
|
|
43
|
+
res.paymentMethod.paymentTransaction.statusCode == "0398"
|
|
44
|
+
) {
|
|
45
|
+
// initiated block
|
|
46
|
+
console.log("initiate block",res);
|
|
47
|
+
} else {
|
|
48
|
+
// error block
|
|
49
|
+
console.log("error block",res);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
$(document)
|
|
54
|
+
.off("click", "#btnSubmit")
|
|
55
|
+
.on("click", "#btnSubmit", function (e) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
|
|
58
|
+
var reqJson = {
|
|
59
|
+
features: {
|
|
60
|
+
enableAbortResponse: true,
|
|
61
|
+
enableNewWindowFlow: true, //for hybrid applications please disable this by passing false
|
|
62
|
+
enableExpressPay: true,
|
|
63
|
+
enableMerTxnDetails: true,
|
|
64
|
+
siDetailsAtMerchantEnd: true,
|
|
65
|
+
enableSI: true,
|
|
66
|
+
},
|
|
67
|
+
consumerData: {
|
|
68
|
+
deviceId: "WEBSH2",
|
|
69
|
+
token:"${tokenId}",
|
|
70
|
+
returnUrl:
|
|
71
|
+
"https://aerem.co/", //merchant response page URL
|
|
72
|
+
responseHandler: handleResponse,
|
|
73
|
+
paymentMode: "${mandateData.paymentMode}",
|
|
74
|
+
merchantLogoUrl:
|
|
75
|
+
"https://www.paynimo.com/CompanyDocs/company-logo-vertical.png",
|
|
76
|
+
merchantId: "${mandateData.merchantId}",
|
|
77
|
+
currency: "INR",
|
|
78
|
+
consumerId: "${mandateData.consumerId}",
|
|
79
|
+
consumerMobileNo: "${mandateData.consumerMobileNo}",
|
|
80
|
+
consumerEmailId: "${mandateData.consumerEmailId}",
|
|
81
|
+
txnId: "${mandateData.txnId}",
|
|
82
|
+
|
|
83
|
+
items: [
|
|
84
|
+
{
|
|
85
|
+
itemId: "FIRST",
|
|
86
|
+
amount: "${mandateData.totalamount}",
|
|
87
|
+
comAmt: "0",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
customStyle: {
|
|
91
|
+
PRIMARY_COLOR_CODE: "#45beaa",
|
|
92
|
+
SECONDARY_COLOR_CODE: "#FFFFFF",
|
|
93
|
+
BUTTON_COLOR_CODE_1: "#2d8c8c",
|
|
94
|
+
BUTTON_COLOR_CODE_2: "#FFFFFF",
|
|
95
|
+
},
|
|
96
|
+
accountNo: "${mandateData.accountNo}", //Pass this if accountNo is captured at merchant side for eMandate/eNACH
|
|
97
|
+
|
|
98
|
+
ifscCode: "${mandateData.ifscCode}", //Pass this if ifscCode is captured at merchant side.
|
|
99
|
+
accountType: "${mandateData.accountType}", //Required for eNACH registration this is mandatory field
|
|
100
|
+
debitStartDate: "${mandateData.debitStartDate}",
|
|
101
|
+
debitEndDate: "${mandateData.debitEndDate}",
|
|
102
|
+
maxAmount: "${mandateData.maxAmount}",
|
|
103
|
+
amountType: "${mandateData.amountType}",
|
|
104
|
+
frequency: "${mandateData.frequency}",
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
$.pnCheckout(reqJson);
|
|
109
|
+
if (reqJson.features.enableNewWindowFlow) {
|
|
110
|
+
pnCheckoutShared.openNewWindow();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
</script>
|
|
115
|
+
</body>
|
|
116
|
+
</html>
|
|
117
|
+
|
|
118
|
+
`;
|
|
119
|
+
};
|