aeremmiddleware 1.0.12 → 1.0.14

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.
Files changed (39) hide show
  1. package/README.md +28 -28
  2. package/dist/Finance/ingenicoHtml.js +114 -114
  3. package/dist/index.d.ts +0 -3
  4. package/dist/index.js +1 -4
  5. package/dist/index.js.map +1 -1
  6. package/package.json +21 -20
  7. package/src/Finance/Ingenico.types.ts +21 -21
  8. package/src/Finance/crimeCheck.ts +135 -135
  9. package/src/Finance/crimecheck.types.ts +31 -31
  10. package/src/Finance/encrypt.ts +18 -18
  11. package/src/Finance/idfy.ts +542 -542
  12. package/src/Finance/index.ts +13 -13
  13. package/src/Finance/ingenico.ts +110 -110
  14. package/src/Finance/ingenicoHtml.ts +119 -119
  15. package/src/Finance/novel.ts +226 -226
  16. package/src/Finance/novel.types.ts +24 -24
  17. package/src/Finance/qbrik.ts +822 -822
  18. package/src/Finance/qbrik.types.ts +81 -81
  19. package/src/{pushNotification → PushNotification}/pushNotificationFCM.ts +35 -35
  20. package/src/Socials/Sms.types.ts +9 -9
  21. package/src/Socials/SmsSender.ts +78 -78
  22. package/src/Socials/Whatsapp.types.ts +95 -95
  23. package/src/Socials/index.ts +6 -6
  24. package/src/Socials/whatsApp.ts +188 -188
  25. package/src/index.ts +9 -9
  26. package/tsconfig.json +111 -111
  27. package/dist/Finance/qbrik.d.ts +0 -100
  28. package/dist/Finance/qbrik.js +0 -506
  29. package/dist/Finance/qbrik.js.map +0 -1
  30. package/dist/Finance/qbrik.types.d.ts +0 -76
  31. package/dist/Finance/qbrik.types.js +0 -3
  32. package/dist/Finance/qbrik.types.js.map +0 -1
  33. package/dist/pushNotification/index.d.ts +0 -4
  34. package/dist/pushNotification/index.js +0 -8
  35. package/dist/pushNotification/index.js.map +0 -1
  36. package/dist/pushNotification/pushNotificationFCM.d.ts +0 -1
  37. package/dist/pushNotification/pushNotificationFCM.js +0 -42
  38. package/dist/pushNotification/pushNotificationFCM.js.map +0 -1
  39. package/src/pushNotification/index.ts +0 -5
@@ -1,13 +1,13 @@
1
- import IdfyAPIWrapper from "./idfy";
2
- import NovelApiWrapper from "./novel";
3
- import IngenicoApiWrapper from "./ingenico";
4
- import CrimeSearchAPIWrapper from "./crimeCheck";
5
- import QbrikApiWrapper from "./qbrik";
6
-
7
- export const finance = {
8
- idFy: IdfyAPIWrapper,
9
- novel: NovelApiWrapper,
10
- ingenico: IngenicoApiWrapper,
11
- crimecheck: CrimeSearchAPIWrapper,
12
- qbrik: QbrikApiWrapper,
13
- };
1
+ import IdfyAPIWrapper from "./idfy";
2
+ import NovelApiWrapper from "./novel";
3
+ import IngenicoApiWrapper from "./ingenico";
4
+ import CrimeSearchAPIWrapper from "./crimeCheck";
5
+ import QbrikApiWrapper from "./qbrik";
6
+
7
+ export const finance = {
8
+ idFy: IdfyAPIWrapper,
9
+ novel: NovelApiWrapper,
10
+ ingenico: IngenicoApiWrapper,
11
+ crimecheck: CrimeSearchAPIWrapper,
12
+ qbrik: QbrikApiWrapper,
13
+ };
@@ -1,110 +1,110 @@
1
- import axios from "axios";
2
- import { MandateDataType } from "./Ingenico.types";
3
- import { createSHA512Hash } from "./encrypt";
4
- import { createHash } from "crypto";
5
- import { mandateHtml } from "./ingenicoHtml";
6
-
7
- class IngenicoApiWrapper {
8
- private verificationUrl = "https://www.paynimo.com/api/paynimoV2.req";
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,
28
- cardNumber: "",
29
- expMonth: "",
30
- expYear: "",
31
- cvvCode: "",
32
- };
33
-
34
- const tokenId = createSHA512Hash(hashingData, this.salt);
35
- return mandateHtml(mandateData, tokenId);
36
- }
37
-
38
- private hashString(input: string): string {
39
- const hash = createHash("sha512");
40
-
41
- return hash.update(input).digest("hex");
42
- }
43
-
44
- async dualVerification(inputString: any): Promise<any> {
45
- const originalHash = this.hashString(inputString);
46
- console.log("originalhash", originalHash);
47
- const dataArray = inputString.split("|");
48
- dataArray[dataArray.length - 1] = this.salt;
49
- const modifiedString = dataArray.join("|");
50
- const modifiedHash = this.hashString(modifiedString);
51
- console.log("modifiedhash", modifiedHash);
52
-
53
- if (originalHash === modifiedHash) {
54
- console.log("true");
55
- return true;
56
- } else {
57
- console.log("faalse");
58
- return false;
59
- }
60
- }
61
-
62
- async mandateVerification(requestData: any): Promise<any> {
63
- try {
64
- const response = await axios.post(this.verificationUrl, requestData, {
65
- headers: {
66
- "Content-Type": "application/json",
67
- },
68
- });
69
-
70
- const responseData = response.data;
71
-
72
- console.log(responseData);
73
- } catch (error) {
74
- console.error("Error:", error);
75
- }
76
- }
77
-
78
- async transactionScheduling(requestData: any): Promise<any> {
79
- try {
80
- const response = await axios.post(this.verificationUrl, requestData, {
81
- headers: {
82
- "Content-Type": "application/json",
83
- },
84
- });
85
-
86
- const responseData = response.data;
87
-
88
- console.log(responseData);
89
- } catch (error) {
90
- console.error("Error:", error);
91
- }
92
- }
93
- async transactionVerification(requestData: any): Promise<any> {
94
- try {
95
- const response = await axios.post(this.verificationUrl, requestData, {
96
- headers: {
97
- "Content-Type": "application/json",
98
- },
99
- });
100
-
101
- const responseData = response.data;
102
-
103
- console.log(responseData);
104
- } catch (error) {
105
- console.error("Error:", error);
106
- }
107
- }
108
- }
109
-
110
- export default IngenicoApiWrapper;
1
+ import axios from "axios";
2
+ import { MandateDataType } from "./Ingenico.types";
3
+ import { createSHA512Hash } from "./encrypt";
4
+ import { createHash } from "crypto";
5
+ import { mandateHtml } from "./ingenicoHtml";
6
+
7
+ class IngenicoApiWrapper {
8
+ private verificationUrl = "https://www.paynimo.com/api/paynimoV2.req";
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,
28
+ cardNumber: "",
29
+ expMonth: "",
30
+ expYear: "",
31
+ cvvCode: "",
32
+ };
33
+
34
+ const tokenId = createSHA512Hash(hashingData, this.salt);
35
+ return mandateHtml(mandateData, tokenId);
36
+ }
37
+
38
+ private hashString(input: string): string {
39
+ const hash = createHash("sha512");
40
+
41
+ return hash.update(input).digest("hex");
42
+ }
43
+
44
+ async dualVerification(inputString: any): Promise<any> {
45
+ const originalHash = this.hashString(inputString);
46
+ console.log("originalhash", originalHash);
47
+ const dataArray = inputString.split("|");
48
+ dataArray[dataArray.length - 1] = this.salt;
49
+ const modifiedString = dataArray.join("|");
50
+ const modifiedHash = this.hashString(modifiedString);
51
+ console.log("modifiedhash", modifiedHash);
52
+
53
+ if (originalHash === modifiedHash) {
54
+ console.log("true");
55
+ return true;
56
+ } else {
57
+ console.log("faalse");
58
+ return false;
59
+ }
60
+ }
61
+
62
+ async mandateVerification(requestData: any): Promise<any> {
63
+ try {
64
+ const response = await axios.post(this.verificationUrl, requestData, {
65
+ headers: {
66
+ "Content-Type": "application/json",
67
+ },
68
+ });
69
+
70
+ const responseData = response.data;
71
+
72
+ console.log(responseData);
73
+ } catch (error) {
74
+ console.error("Error:", error);
75
+ }
76
+ }
77
+
78
+ async transactionScheduling(requestData: any): Promise<any> {
79
+ try {
80
+ const response = await axios.post(this.verificationUrl, requestData, {
81
+ headers: {
82
+ "Content-Type": "application/json",
83
+ },
84
+ });
85
+
86
+ const responseData = response.data;
87
+
88
+ console.log(responseData);
89
+ } catch (error) {
90
+ console.error("Error:", error);
91
+ }
92
+ }
93
+ async transactionVerification(requestData: any): Promise<any> {
94
+ try {
95
+ const response = await axios.post(this.verificationUrl, requestData, {
96
+ headers: {
97
+ "Content-Type": "application/json",
98
+ },
99
+ });
100
+
101
+ const responseData = response.data;
102
+
103
+ console.log(responseData);
104
+ } catch (error) {
105
+ console.error("Error:", error);
106
+ }
107
+ }
108
+ }
109
+
110
+ export default IngenicoApiWrapper;
@@ -1,119 +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
- };
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
+ };