@konplit-services/common 1.0.203 → 1.0.205
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/build/app.configs.d.ts +2 -2
- package/build/app.configs.js +8 -8
- package/build/events/interswitch-events/interfaces/card-payment-initiation.interface.d.ts +16 -19
- package/build/events/interswitch-events/interfaces/card-payment-otp-resend.interface.d.ts +11 -0
- package/build/events/interswitch-events/interfaces/card-payment-otp-resend.interface.js +2 -0
- package/build/events/subjects.d.ts +4 -1
- package/build/events/subjects.js +5 -0
- package/build/helper/date-processing.d.ts +1 -0
- package/build/helper/date-processing.js +5 -1
- package/package.json +1 -1
package/build/app.configs.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ interface Interswitch {
|
|
|
29
29
|
secret_key: string;
|
|
30
30
|
access_token_url: string;
|
|
31
31
|
card_base_url: string;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
exponentKey: string;
|
|
33
|
+
modulusKey: string;
|
|
34
34
|
visa_callback_url: string;
|
|
35
35
|
recurrent_client_id: string;
|
|
36
36
|
recurrent_secret_key: string;
|
package/build/app.configs.js
CHANGED
|
@@ -594,12 +594,6 @@ class AppConfigs {
|
|
|
594
594
|
if (!this.env.INTERSWITCH_CARD_BASE_URL) {
|
|
595
595
|
throw new Error("INTERSWITCH_CARD_BASE_URL is required");
|
|
596
596
|
}
|
|
597
|
-
if (!this.env.INTERSWITCH_EXPONENT_KEY) {
|
|
598
|
-
throw new Error("INTERSWITCH_EXPONENT_KEY is required");
|
|
599
|
-
}
|
|
600
|
-
if (!this.env.INTERSWITCH_MODulus_KEY) {
|
|
601
|
-
throw new Error("INTERSWITCH_MODulus_KEY is required");
|
|
602
|
-
}
|
|
603
597
|
if (!this.env.INTERSWITCH_VISA_CALLBACK_URL) {
|
|
604
598
|
throw new Error("INTERSWITCH_VISA_CALLBACK_URL is required");
|
|
605
599
|
}
|
|
@@ -609,6 +603,12 @@ class AppConfigs {
|
|
|
609
603
|
if (!this.env.INTERSWITCH_RECURRENT_SECRET_KEY) {
|
|
610
604
|
throw new Error("INTERSWITCH_RECURRENT_SECRET_KEY is required");
|
|
611
605
|
}
|
|
606
|
+
if (!this.env.INTERSWITCH_DEFAULT_MODULUS) {
|
|
607
|
+
throw new Error("INTERSWITCH_DEFAULT_MODULUS is required");
|
|
608
|
+
}
|
|
609
|
+
if (!this.env.INTERSWITCH_DEFAULT_EXPONENT) {
|
|
610
|
+
throw new Error("INTERSWITCH_DEFAULT_EXPONENT is required");
|
|
611
|
+
}
|
|
612
612
|
return {
|
|
613
613
|
merchant_id: this.env.INTERSWITCH_MERCHANT_ID,
|
|
614
614
|
pay_item_id: this.env.INTERSWITCH_PAY_ITEM_ID,
|
|
@@ -617,8 +617,8 @@ class AppConfigs {
|
|
|
617
617
|
secret_key: this.env.INTERSWITCH_SECRET_KEY,
|
|
618
618
|
access_token_url: this.env.INTERSWITCH_ACCESS_TOKEN_URL,
|
|
619
619
|
card_base_url: this.env.INTERSWITCH_CARD_BASE_URL,
|
|
620
|
-
|
|
621
|
-
|
|
620
|
+
exponentKey: this.env.INTERSWITCH_DEFAULT_EXPONENT,
|
|
621
|
+
modulusKey: this.env.INTERSWITCH_DEFAULT_MODULUS,
|
|
622
622
|
visa_callback_url: this.env.INTERSWITCH_VISA_CALLBACK_URL,
|
|
623
623
|
recurrent_client_id: this.env.INTERSWITCH_RECURRENT_CLIENT_ID,
|
|
624
624
|
recurrent_secret_key: this.env.INTERSWITCH_RECURRENT_SECRET_KEY,
|
|
@@ -6,25 +6,22 @@ export interface CardInitiationEvent {
|
|
|
6
6
|
merchantId: string;
|
|
7
7
|
accountId: string;
|
|
8
8
|
transactionType: TRANSACTION_CHARGES_TYPE;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
transactionId: string;
|
|
26
|
-
description: string;
|
|
27
|
-
amount: number;
|
|
9
|
+
customerId: string;
|
|
10
|
+
amount: string;
|
|
11
|
+
transactionRef: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
authData: string;
|
|
14
|
+
callbackUrl?: string;
|
|
15
|
+
deviceInformation?: {
|
|
16
|
+
httpBrowserLanguage: string;
|
|
17
|
+
httpBrowserJavaEnabled: boolean;
|
|
18
|
+
httpBrowserJavaScriptEnabled: boolean;
|
|
19
|
+
httpBrowserColorDepth: number;
|
|
20
|
+
httpBrowserScreenHeight: number;
|
|
21
|
+
httpBrowserScreenWidth: number;
|
|
22
|
+
httpBrowserTimeDifference: number;
|
|
23
|
+
userAgentBrowserValue: string;
|
|
24
|
+
deviceChannel: string;
|
|
28
25
|
};
|
|
29
26
|
};
|
|
30
27
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
2
|
+
export interface CardOTPResendEvent {
|
|
3
|
+
subject: Subjects.CardOtpResend;
|
|
4
|
+
streamName: StreamName.name;
|
|
5
|
+
streamEvents: StreamEvent.Event;
|
|
6
|
+
data: {
|
|
7
|
+
paymentId: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
currency: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -66,7 +66,8 @@ export declare enum Subjects {
|
|
|
66
66
|
QRQueryOrderStatus = "events.qrqueryorder.status",
|
|
67
67
|
QRQueryStatusDelay = "events.qrqueryorder.delay",
|
|
68
68
|
QRQueryStatusComplete = "events.qrqueryorder.complete",
|
|
69
|
-
VirtualFixedAccountCreatedEvent = "events.virtualfixedaccount.created"
|
|
69
|
+
VirtualFixedAccountCreatedEvent = "events.virtualfixedaccount.created",
|
|
70
|
+
CardOtpResend = "events.card.otp.resend"
|
|
70
71
|
}
|
|
71
72
|
export declare enum ResSubjects {
|
|
72
73
|
VirtualDynamicAccountCreatedEvent = "res.virtual.dynamicaccount.created",
|
|
@@ -76,5 +77,7 @@ export declare enum ResSubjects {
|
|
|
76
77
|
NIBSSInstitutions = "res.nibss.institution.list",
|
|
77
78
|
QRDynamicCodeCreated = "res.dynamic.code.created",
|
|
78
79
|
CardInitiationTransaction = "res.card.initiation.transaction",
|
|
80
|
+
CardAuthenticatedOTP = "res.card.auth.otp",
|
|
81
|
+
CardAuthorized3DS = "res.card.ath.threeds",
|
|
79
82
|
CashierInitiation = "res.cashier.initiation"
|
|
80
83
|
}
|
package/build/events/subjects.js
CHANGED
|
@@ -93,6 +93,9 @@ var Subjects;
|
|
|
93
93
|
Subjects["QRQueryStatusComplete"] = "events.qrqueryorder.complete";
|
|
94
94
|
//Virtual Fixed Account
|
|
95
95
|
Subjects["VirtualFixedAccountCreatedEvent"] = "events.virtualfixedaccount.created";
|
|
96
|
+
//Interswitch
|
|
97
|
+
//Card
|
|
98
|
+
Subjects["CardOtpResend"] = "events.card.otp.resend";
|
|
96
99
|
})(Subjects = exports.Subjects || (exports.Subjects = {}));
|
|
97
100
|
var ResSubjects;
|
|
98
101
|
(function (ResSubjects) {
|
|
@@ -108,6 +111,8 @@ var ResSubjects;
|
|
|
108
111
|
ResSubjects["QRDynamicCodeCreated"] = "res.dynamic.code.created";
|
|
109
112
|
//Interswitch
|
|
110
113
|
ResSubjects["CardInitiationTransaction"] = "res.card.initiation.transaction";
|
|
114
|
+
ResSubjects["CardAuthenticatedOTP"] = "res.card.auth.otp";
|
|
115
|
+
ResSubjects["CardAuthorized3DS"] = "res.card.ath.threeds";
|
|
111
116
|
//Opay
|
|
112
117
|
ResSubjects["CashierInitiation"] = "res.cashier.initiation";
|
|
113
118
|
})(ResSubjects = exports.ResSubjects || (exports.ResSubjects = {}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PLAN_INTERVAL } from "./plan-types";
|
|
2
2
|
export declare const formatDate: (dataString: string) => string;
|
|
3
|
+
export declare const interswitchRefundDateFormat: (dataString: string) => string;
|
|
3
4
|
export declare const formatDateTime: (dataString: string) => string;
|
|
4
5
|
export declare const convertToDate: (date: string) => Date;
|
|
5
6
|
export declare const getPreviousDayRange: () => {
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDuration = exports.convertDateToUTC = exports.convertDateToUTCString = exports.convertDateToUTCRange = exports.convertDateToUTCRangeString = exports.getCurrentDayRange = exports.getPreviousDayRange = exports.convertToDate = exports.formatDateTime = exports.formatDate = void 0;
|
|
6
|
+
exports.getDuration = exports.convertDateToUTC = exports.convertDateToUTCString = exports.convertDateToUTCRange = exports.convertDateToUTCRangeString = exports.getCurrentDayRange = exports.getPreviousDayRange = exports.convertToDate = exports.formatDateTime = exports.interswitchRefundDateFormat = exports.formatDate = void 0;
|
|
7
7
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
8
|
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
9
9
|
// Extend dayjs with the UTC plugin
|
|
@@ -13,6 +13,10 @@ const formatDate = (dataString) => {
|
|
|
13
13
|
return (0, dayjs_1.default)(dataString).format("YYYY-MM-DD");
|
|
14
14
|
};
|
|
15
15
|
exports.formatDate = formatDate;
|
|
16
|
+
const interswitchRefundDateFormat = (dataString) => {
|
|
17
|
+
return (0, dayjs_1.default)(dataString).format("DD/MM/YYYY");
|
|
18
|
+
};
|
|
19
|
+
exports.interswitchRefundDateFormat = interswitchRefundDateFormat;
|
|
16
20
|
const formatDateTime = (dataString) => {
|
|
17
21
|
return (0, dayjs_1.default)(dataString).format("YYYY-MM-DD HH:mm:ss");
|
|
18
22
|
};
|