@houlak/plexo-sdk 0.1.20 → 0.1.22
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.
|
@@ -42,6 +42,7 @@ var evaluator_service_1 = require("./services/evaluator.service");
|
|
|
42
42
|
var config_1 = require("../config/config");
|
|
43
43
|
var PaymentGatewayMock_1 = require("../sdk/PaymentGatewayMock");
|
|
44
44
|
var utils_1 = require("../utils");
|
|
45
|
+
var logger_lib_1 = require("../lib/logger.lib");
|
|
45
46
|
var isTesting = config_1.config.env === 'TEST';
|
|
46
47
|
var paymentGatewayClient = isTesting
|
|
47
48
|
? new PaymentGatewayMock_1.PaymentGatewayMock()
|
|
@@ -211,6 +212,7 @@ var UnwrapInstrumentCallback = function (instrumentCallback) { return __awaiter(
|
|
|
211
212
|
return [4 /*yield*/, paymentGatewayClient.UnwrapInstrumentCallbackAsync(instrumentCallbackCamelCase)];
|
|
212
213
|
case 1:
|
|
213
214
|
instrumentCallbackResponse = _a.sent();
|
|
215
|
+
logger_lib_1.default.info(instrumentCallbackResponse, 'UnwrapInstrumentCallback response from Plexo');
|
|
214
216
|
return [2 /*return*/, evaluator_service_1.Evaluator.genericEvaluator(instrumentCallback, instrumentCallbackResponse)];
|
|
215
217
|
}
|
|
216
218
|
});
|
|
@@ -234,7 +234,7 @@ var getPlexoKey = function (fingerprint) { return __awaiter(void 0, void 0, void
|
|
|
234
234
|
});
|
|
235
235
|
}); };
|
|
236
236
|
var getPlexoSignature = function (fingerprint, response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
237
|
-
var serverResponse, plexoResponse, err_1, key, objectInPascalCase, objectSorted, objectBuffer, verifySignature;
|
|
237
|
+
var serverResponse, plexoResponse, err_1, key, canonizedObject, objectInPascalCase, objectSorted, objectBuffer, verifySignature;
|
|
238
238
|
return __generator(this, function (_a) {
|
|
239
239
|
switch (_a.label) {
|
|
240
240
|
case 0:
|
|
@@ -254,7 +254,8 @@ var getPlexoSignature = function (fingerprint, response) { return __awaiter(void
|
|
|
254
254
|
return [2 /*return*/, serverResponse];
|
|
255
255
|
case 3:
|
|
256
256
|
key = (0, crypto_1.createPublicKey)("-----BEGIN CERTIFICATE-----\n".concat(plexoResponse.Object.Object.Response.Key, "\n-----END CERTIFICATE-----"));
|
|
257
|
-
|
|
257
|
+
canonizedObject = (0, exports.canonizeJson)(response.object);
|
|
258
|
+
objectInPascalCase = utils_1.caseUtils.toPascalKeys(canonizedObject);
|
|
258
259
|
objectSorted = sort(objectInPascalCase);
|
|
259
260
|
objectBuffer = Buffer.from(JSON.stringify(objectSorted));
|
|
260
261
|
verifySignature = (0, crypto_1.createVerify)('SHA512')
|
package/lib/sdk/mocks/mocks.js
CHANGED
|
@@ -54,7 +54,7 @@ var paymentInstrumentMock = {
|
|
|
54
54
|
issuer: issuerMock,
|
|
55
55
|
supportedCurrencies: [currencyMock],
|
|
56
56
|
status: IndexSDK_1.CardStatus.Ok,
|
|
57
|
-
|
|
57
|
+
instrumentExpirationUTC: 1919276061,
|
|
58
58
|
creditLimits: [amountLimitMock],
|
|
59
59
|
additionalRequirements: [timeLimitMock],
|
|
60
60
|
instrumentInformation: null,
|
|
@@ -9,7 +9,7 @@ export declare type PaymentInstrument = {
|
|
|
9
9
|
issuer: IssuerInfo;
|
|
10
10
|
supportedCurrencies: Currency[];
|
|
11
11
|
status: CardStatus;
|
|
12
|
-
|
|
12
|
+
instrumentExpirationUTC: number;
|
|
13
13
|
anonInstrumentUsageTimeLimit?: number;
|
|
14
14
|
creditLimits: AmountLimit[];
|
|
15
15
|
additionalRequirements: TimeLimit[];
|