@konplit-services/common 1.0.353 → 1.0.355
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.
|
@@ -5,8 +5,7 @@ export interface TransactionWebhookEvent {
|
|
|
5
5
|
streamName: StreamName.name;
|
|
6
6
|
streamEvents: StreamEvent.Event;
|
|
7
7
|
data: {
|
|
8
|
-
|
|
9
|
-
sign: string;
|
|
8
|
+
event: TRANSACTION_WEBHOOK_TYPES;
|
|
10
9
|
merchantId: string;
|
|
11
10
|
accountId: string;
|
|
12
11
|
id: string;
|
package/build/helper/keys.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.generateTimestampUUIDShort = exports.generateOpaySign = exports.generateTransactionID = exports.generateBase64KeyNibssBVN = exports.generateSignatureCipher = exports.generateBase64Key = exports.generateOrderId = exports.authData = exports.generateSignMD5Fedilty = exports.generateSignMD5 = exports.hashingKey = exports.generateMAC = void 0;
|
|
27
30
|
const crypto_1 = __importStar(require("crypto"));
|
|
@@ -29,6 +32,11 @@ const forge = __importStar(require("node-forge"));
|
|
|
29
32
|
const timestamp_1 = require("./timestamp");
|
|
30
33
|
const app_configs_1 = require("../app.configs");
|
|
31
34
|
const nanoid_1 = require("nanoid");
|
|
35
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
36
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
37
|
+
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
38
|
+
dayjs_1.default.extend(utc_1.default);
|
|
39
|
+
dayjs_1.default.extend(timezone_1.default);
|
|
32
40
|
/**
|
|
33
41
|
* Hashing a secret using sha256
|
|
34
42
|
* @param secret - the secret to hash
|
|
@@ -159,13 +167,13 @@ exports.generateOrderId = generateOrderId;
|
|
|
159
167
|
* @returns the generated transaction ID
|
|
160
168
|
*/
|
|
161
169
|
const generateTransactionID = (clientCode) => {
|
|
162
|
-
const now =
|
|
163
|
-
const year = now.
|
|
164
|
-
const month =
|
|
165
|
-
const day =
|
|
166
|
-
const hours =
|
|
167
|
-
const minutes =
|
|
168
|
-
const seconds =
|
|
170
|
+
const now = (0, dayjs_1.default)().tz("Africa/Lagos"); // West Africa Time (UTC+1)
|
|
171
|
+
const year = now.format("YY");
|
|
172
|
+
const month = now.format("MM");
|
|
173
|
+
const day = now.format("DD");
|
|
174
|
+
const hours = now.format("HH");
|
|
175
|
+
const minutes = now.format("mm");
|
|
176
|
+
const seconds = now.format("ss");
|
|
169
177
|
const random12Digits = Math.floor(100000000000 + Math.random() * 900000000000);
|
|
170
178
|
return `${clientCode}${year}${month}${day}${hours}${minutes}${seconds}${random12Digits}`;
|
|
171
179
|
};
|