@houlak/plexo-sdk 0.1.7 → 0.1.9
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/lib/handler/PlexoHandler.js +2 -2
- package/lib/handler/services/evaluator.service.js +3 -3
- package/lib/sdk/PaymentGatewayClient.js +7 -5
- package/lib/sdk/PaymentGatewayMock.js +3 -3
- package/lib/sdk/helpers/signature/signatureHelper.d.ts +1 -1
- package/lib/sdk/helpers/signature/signatureHelper.js +23 -21
- package/lib/sdk/mocks/mocks.js +22 -22
- package/lib/sdk/models/GenericSignedObject.d.ts +2 -2
- package/lib/sdk/models/GenericSignedObject.js +2 -2
- package/lib/sdk/models/GenericStateObject.d.ts +1 -1
- package/lib/sdk/models/GenericStateObject.js +1 -1
- package/lib/sdk/models/InstrumentCallback.d.ts +3 -3
- package/lib/sdk/models/InstrumentCallback.js +3 -3
- package/lib/sdk/models/InstrumentWithMetadata.d.ts +3 -3
- package/lib/sdk/models/InstrumentWithMetadata.js +3 -3
- package/lib/sdk/models/PaymentInstrument.d.ts +11 -11
- package/lib/sdk/models/SignedObject.d.ts +3 -3
- package/lib/sdk/models/SignedObject.js +3 -3
- package/lib/sdk/models/StateObject.d.ts +2 -2
- package/lib/sdk/models/StateObject.js +2 -2
- package/lib/sdk/models/TransactionCallback.d.ts +1 -1
- package/lib/sdk/models/TransactionCallback.js +1 -1
- package/lib/sdk/models/TransactionType.d.ts +3 -3
- package/lib/sdk/models/TransactionType.js +3 -3
- package/package.json +1 -1
|
@@ -175,7 +175,7 @@ var Cancel = function (cancellation) { return __awaiter(void 0, void 0, void 0,
|
|
|
175
175
|
case 0: return [4 /*yield*/, paymentGatewayClient.CancelAsync(cancellation)];
|
|
176
176
|
case 1:
|
|
177
177
|
transactionResponse = _a.sent();
|
|
178
|
-
return [2 /*return*/, evaluator_service_1.Evaluator.transactionEvaluator(cancellation, transactionResponse, 'Cancellation', index_1.TransactionType.
|
|
178
|
+
return [2 /*return*/, evaluator_service_1.Evaluator.transactionEvaluator(cancellation, transactionResponse, 'Cancellation', index_1.TransactionType.Cancel)];
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
}); };
|
|
@@ -197,7 +197,7 @@ var Purchase = function (purchase) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
197
197
|
case 0: return [4 /*yield*/, paymentGatewayClient.PurchaseAsync(purchase)];
|
|
198
198
|
case 1:
|
|
199
199
|
purchaseResponse = _a.sent();
|
|
200
|
-
return [2 /*return*/, evaluator_service_1.Evaluator.transactionEvaluator(purchase, purchaseResponse, 'Purchase', index_1.TransactionType.
|
|
200
|
+
return [2 /*return*/, evaluator_service_1.Evaluator.transactionEvaluator(purchase, purchaseResponse, 'Purchase', index_1.TransactionType.Purchase)];
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
}); };
|
|
@@ -42,19 +42,19 @@ var index_1 = require("../../sdk/index");
|
|
|
42
42
|
var plexo_error_enum_1 = require("../../sdk/enums/plexo-error-enum");
|
|
43
43
|
var BaseResponse_1 = require("../types/BaseResponse");
|
|
44
44
|
var getTransactionStatus = function (transaction, transactionType) {
|
|
45
|
-
if (transactionType === index_1.TransactionType.
|
|
45
|
+
if (transactionType === index_1.TransactionType.Cancel) {
|
|
46
46
|
return {
|
|
47
47
|
status: index_1.TransactionResult[+transaction.transactions.cancel.status],
|
|
48
48
|
transactionResultText: transaction.transactions.cancel.transactionResultText,
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
if (transactionType === index_1.TransactionType.
|
|
51
|
+
if (transactionType === index_1.TransactionType.Reserve) {
|
|
52
52
|
return {
|
|
53
53
|
status: index_1.TransactionResult[+transaction.transactions.reserve.status],
|
|
54
54
|
transactionResultText: transaction.transactions.reserve.transactionResultText,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
if (transactionType === index_1.TransactionType.
|
|
57
|
+
if (transactionType === index_1.TransactionType.Purchase) {
|
|
58
58
|
return {
|
|
59
59
|
status: index_1.TransactionResult[+transaction.transactions.purchase.status],
|
|
60
60
|
transactionResultText: transaction.transactions.purchase.transactionResultText,
|
|
@@ -66,9 +66,9 @@ var requestToPlexo = function (endpoint, request) { return __awaiter(void 0, voi
|
|
|
66
66
|
request: request,
|
|
67
67
|
};
|
|
68
68
|
stateObject = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
fingerprint: '',
|
|
70
|
+
utcUnixTimeExpiration: Date.parse(new Date().toString()),
|
|
71
|
+
object: object,
|
|
72
72
|
};
|
|
73
73
|
return [4 /*yield*/, signatureHelper_1.SignatureHelper.getSignatureFromPlexo(stateObject)];
|
|
74
74
|
case 1:
|
|
@@ -326,7 +326,7 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
326
326
|
var verify;
|
|
327
327
|
return __generator(this, function (_a) {
|
|
328
328
|
switch (_a.label) {
|
|
329
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.getPlexoSignature(serverSignedInstrumentCallback.
|
|
329
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.getPlexoSignature(serverSignedInstrumentCallback.object.fingerprint, serverSignedInstrumentCallback)];
|
|
330
330
|
case 1:
|
|
331
331
|
verify = _a.sent();
|
|
332
332
|
return [2 /*return*/, verify];
|
|
@@ -339,7 +339,9 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
339
339
|
var verify;
|
|
340
340
|
return __generator(this, function (_a) {
|
|
341
341
|
switch (_a.label) {
|
|
342
|
-
case 0:
|
|
342
|
+
case 0:
|
|
343
|
+
logger_lib_1.default.info("SERVER SIGNED CALLBACK --> ".concat(JSON.stringify(serverSignedTransactionCallback)));
|
|
344
|
+
return [4 /*yield*/, signatureHelper_1.SignatureHelper.getPlexoSignature(serverSignedTransactionCallback.object.fingerprint, serverSignedTransactionCallback)];
|
|
343
345
|
case 1:
|
|
344
346
|
verify = _a.sent();
|
|
345
347
|
return [2 /*return*/, verify];
|
|
@@ -276,7 +276,7 @@ var PaymentGatewayMock = /** @class */ (function () {
|
|
|
276
276
|
return __generator(this, function (_a) {
|
|
277
277
|
return [2 /*return*/, {
|
|
278
278
|
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
279
|
-
response: __assign(__assign({}, mocks_1.mocks.paymentInstrumentMock), {
|
|
279
|
+
response: __assign(__assign({}, mocks_1.mocks.paymentInstrumentMock), { issuer: __assign(__assign({}, mocks_1.mocks.paymentInstrumentMock.issuer), { issuerId: request.issuerId }) }),
|
|
280
280
|
}];
|
|
281
281
|
});
|
|
282
282
|
});
|
|
@@ -296,7 +296,7 @@ var PaymentGatewayMock = /** @class */ (function () {
|
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
return [2 /*return*/, {
|
|
298
298
|
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
299
|
-
response: __assign(__assign({}, mocks_1.mocks.instrumentCallbackMock), serverSignedInstrumentCallback.
|
|
299
|
+
response: __assign(__assign({}, mocks_1.mocks.instrumentCallbackMock), serverSignedInstrumentCallback.object),
|
|
300
300
|
}];
|
|
301
301
|
});
|
|
302
302
|
});
|
|
@@ -306,7 +306,7 @@ var PaymentGatewayMock = /** @class */ (function () {
|
|
|
306
306
|
return __generator(this, function (_a) {
|
|
307
307
|
return [2 /*return*/, {
|
|
308
308
|
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
309
|
-
response: __assign(__assign({}, mocks_1.mocks.transactionCallbackMock), serverSignedTransactionCallback.
|
|
309
|
+
response: __assign(__assign({}, mocks_1.mocks.transactionCallbackMock), serverSignedTransactionCallback.object),
|
|
310
310
|
}];
|
|
311
311
|
});
|
|
312
312
|
});
|
|
@@ -5,6 +5,6 @@ export declare const SignatureHelper: {
|
|
|
5
5
|
getCertificate: () => Promise<Certificate>;
|
|
6
6
|
getSignatureFromPlexo: <T extends object>(objectToSign: GenericStateObject<T>) => Promise<GenericSignedObject<T>>;
|
|
7
7
|
getSignatureFromCallback: (response: ServerResponse<InstrumentCallback | TransactionCallback>) => Promise<ServerResponse<ClientSignedResponse>>;
|
|
8
|
-
getPlexoSignature: <T_1 extends object>(
|
|
8
|
+
getPlexoSignature: <T_1 extends object>(fingerprint: string, response: GenericSignedObject<T_1>) => Promise<ServerResponse<T_1>>;
|
|
9
9
|
toCamelKeys: <T_2 extends object>(object: T_2) => T_2;
|
|
10
10
|
};
|
|
@@ -197,16 +197,16 @@ var getSignatureFromPlexo = function (objectToSign) { return __awaiter(void 0, v
|
|
|
197
197
|
.map(function (line) { return line.trim(); })
|
|
198
198
|
.join('');
|
|
199
199
|
signedObject = {
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
object: objectToSign,
|
|
201
|
+
signature: '',
|
|
202
202
|
};
|
|
203
203
|
thumbnail = getFingerprint(stringifiedCert, 'sha1', 'base64', 'hex').toUpperCase();
|
|
204
|
-
objectToSign.
|
|
204
|
+
objectToSign.fingerprint = thumbnail;
|
|
205
205
|
canonizedObject = (0, exports.canonizeJson)(objectToSign);
|
|
206
206
|
objectoToPascalKeys = toPascalKeys(canonizedObject);
|
|
207
207
|
signKey = generateSignature(objectoToPascalKeys, privateKey);
|
|
208
|
-
signedObject.
|
|
209
|
-
signedObject.
|
|
208
|
+
signedObject.signature = signKey;
|
|
209
|
+
signedObject.object = canonizedObject;
|
|
210
210
|
return [2 /*return*/, signedObject];
|
|
211
211
|
}
|
|
212
212
|
});
|
|
@@ -217,28 +217,28 @@ var getSignatureFromCallback = function (response) { return __awaiter(void 0, vo
|
|
|
217
217
|
switch (_a.label) {
|
|
218
218
|
case 0:
|
|
219
219
|
object = {
|
|
220
|
-
client: response.response.
|
|
220
|
+
client: response.response.client,
|
|
221
221
|
request: response,
|
|
222
222
|
};
|
|
223
223
|
stateObject = {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
fingerprint: '',
|
|
225
|
+
utcUnixTimeExpiration: Date.parse(new Date().toString()),
|
|
226
|
+
object: object,
|
|
227
227
|
};
|
|
228
228
|
return [4 /*yield*/, getSignatureFromPlexo(stateObject)];
|
|
229
229
|
case 1:
|
|
230
230
|
objectSignature = _a.sent();
|
|
231
231
|
serverResponse = {
|
|
232
232
|
response: {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
client: objectSignature.
|
|
233
|
+
object: {
|
|
234
|
+
object: {
|
|
235
|
+
client: objectSignature.object.object.client,
|
|
236
236
|
resultCode: response.resultCode,
|
|
237
237
|
},
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
fingerprint: objectSignature.object.fingerprint,
|
|
239
|
+
utcUnixTimeExpiration: objectSignature.object.utcUnixTimeExpiration,
|
|
240
240
|
},
|
|
241
|
-
|
|
241
|
+
signature: objectSignature.signature,
|
|
242
242
|
},
|
|
243
243
|
resultCode: response.resultCode,
|
|
244
244
|
errorMessage: response.errorMessage,
|
|
@@ -255,6 +255,7 @@ var getPlexoKey = function (fingerprint) { return __awaiter(void 0, void 0, void
|
|
|
255
255
|
case 0: return [4 /*yield*/, client.get("/Key/".concat(fingerprint))];
|
|
256
256
|
case 1:
|
|
257
257
|
plexoResponse = _a.sent();
|
|
258
|
+
logger_lib_1.default.info("GET PLEXO KEY RESPONSE --> ".concat(JSON.stringify(plexoResponse)));
|
|
258
259
|
if (plexoResponse.status !== 200) {
|
|
259
260
|
throw new Error("Invalid or outdated Fingerprint, server returns: ".concat(plexoResponse.data.Object.Object.ErrorMessage));
|
|
260
261
|
}
|
|
@@ -262,13 +263,14 @@ var getPlexoKey = function (fingerprint) { return __awaiter(void 0, void 0, void
|
|
|
262
263
|
}
|
|
263
264
|
});
|
|
264
265
|
}); };
|
|
265
|
-
var getPlexoSignature = function (
|
|
266
|
+
var getPlexoSignature = function (fingerprint, response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
266
267
|
var serverResponse, plexoResponse, err_1, key, objectBuffer, verifySignature;
|
|
267
268
|
return __generator(this, function (_a) {
|
|
268
269
|
switch (_a.label) {
|
|
269
270
|
case 0:
|
|
270
271
|
_a.trys.push([0, 2, , 3]);
|
|
271
|
-
|
|
272
|
+
logger_lib_1.default.info("FINGERPRINT TO GET PLEXO SIGNATURE --> ".concat(fingerprint));
|
|
273
|
+
return [4 /*yield*/, getPlexoKey(fingerprint)];
|
|
272
274
|
case 1:
|
|
273
275
|
plexoResponse = _a.sent();
|
|
274
276
|
return [3 /*break*/, 3];
|
|
@@ -276,19 +278,19 @@ var getPlexoSignature = function (Fingerprint, response) { return __awaiter(void
|
|
|
276
278
|
err_1 = _a.sent();
|
|
277
279
|
logger_lib_1.default.error({ err: err_1 }, 'Error getting plexo certificate');
|
|
278
280
|
serverResponse = {
|
|
279
|
-
response: response.
|
|
281
|
+
response: response.object.object,
|
|
280
282
|
resultCode: __1.ResultCodes.InvalidFingerprint,
|
|
281
283
|
errorMessage: err_1,
|
|
282
284
|
};
|
|
283
285
|
return [2 /*return*/, serverResponse];
|
|
284
286
|
case 3:
|
|
285
287
|
key = "-----BEGIN CERTIFICATE-----\n".concat(plexoResponse.Object.Object.Response.Key, "\n-----END CERTIFICATE-----");
|
|
286
|
-
objectBuffer = new util_1.TextEncoder().encode((0, stringifyWithFloats_1.stringifyAmountsWithFloats)(response.
|
|
288
|
+
objectBuffer = new util_1.TextEncoder().encode((0, stringifyWithFloats_1.stringifyAmountsWithFloats)(response.object));
|
|
287
289
|
verifySignature = (0, crypto_1.createVerify)('SHA512')
|
|
288
290
|
.update(objectBuffer)
|
|
289
|
-
.verify(key, response.
|
|
291
|
+
.verify(key, response.signature, 'base64');
|
|
290
292
|
serverResponse = {
|
|
291
|
-
response: response.
|
|
293
|
+
response: response.object.object,
|
|
292
294
|
resultCode: verifySignature ? __1.ResultCodes.Ok : __1.ResultCodes.InvalidSignature,
|
|
293
295
|
errorMessage: verifySignature ? "Signature do not match" : 'Success',
|
|
294
296
|
};
|
package/lib/sdk/mocks/mocks.js
CHANGED
|
@@ -49,16 +49,16 @@ var issuerMock = {
|
|
|
49
49
|
fields: [fieldMock],
|
|
50
50
|
};
|
|
51
51
|
var paymentInstrumentMock = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
instrumentToken: 'token',
|
|
53
|
+
name: 'mockedInstrument',
|
|
54
|
+
issuer: issuerMock,
|
|
55
|
+
supportedCurrencies: [currencyMock],
|
|
56
|
+
status: IndexSDK_1.CardStatus.Ok,
|
|
57
|
+
instrumentExpirationUTC: 1919276061,
|
|
58
|
+
creditLimits: [amountLimitMock],
|
|
59
|
+
additionalRequirements: [timeLimitMock],
|
|
60
|
+
instrumentInformation: null,
|
|
61
|
+
sessionCreationId: 'MockedId',
|
|
62
62
|
};
|
|
63
63
|
var financialInclusionMock = {
|
|
64
64
|
isApplied: true,
|
|
@@ -106,7 +106,7 @@ var transactionMock = {
|
|
|
106
106
|
installments: 1,
|
|
107
107
|
currency: currencyMock,
|
|
108
108
|
isAnonymous: true,
|
|
109
|
-
currentState: IndexSDK_1.TransactionType.
|
|
109
|
+
currentState: IndexSDK_1.TransactionType.Purchase,
|
|
110
110
|
invoiceNumber: '1',
|
|
111
111
|
financialInclusion: financialInclusionMock,
|
|
112
112
|
transactions: {
|
|
@@ -138,23 +138,23 @@ var issuerProcessorMock = {
|
|
|
138
138
|
paymentProcessors: [paymentProcessorMock],
|
|
139
139
|
};
|
|
140
140
|
var clientSignedResponseMock = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
signature: 'signature',
|
|
142
|
+
object: {
|
|
143
|
+
fingerprint: 'fingerprint',
|
|
144
|
+
utcUnixTimeExpiration: 1919276061,
|
|
145
|
+
object: {
|
|
146
146
|
client: 'PlexoMock',
|
|
147
147
|
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
148
148
|
},
|
|
149
149
|
},
|
|
150
150
|
};
|
|
151
|
-
var transactionCallbackMock = __assign(__assign({}, transactionMock), {
|
|
151
|
+
var transactionCallbackMock = __assign(__assign({}, transactionMock), { client: 'PlexoMock' });
|
|
152
152
|
var instrumentCallbackMock = {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
action: IndexSDK_1.ActionType.RegisterInstrument,
|
|
154
|
+
client: 'PlexoMock',
|
|
155
|
+
sessionId: (0, crypto_1.randomUUID)(),
|
|
156
|
+
optionalMetadata: 'metadata',
|
|
157
|
+
paymentInstrument: paymentInstrumentMock,
|
|
158
158
|
};
|
|
159
159
|
exports.mocks = {
|
|
160
160
|
currencyMock: currencyMock,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenericStateObject } from './GenericStateObject';
|
|
2
2
|
export declare class GenericSignedObject<T> {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
object: GenericStateObject<T>;
|
|
4
|
+
signature: string;
|
|
5
5
|
constructor(Object: GenericStateObject<T>, Signature: string);
|
|
6
6
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GenericSignedObject = void 0;
|
|
4
4
|
var GenericSignedObject = /** @class */ (function () {
|
|
5
5
|
function GenericSignedObject(Object, Signature) {
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
6
|
+
this.object = Object;
|
|
7
|
+
this.signature = Signature;
|
|
8
8
|
}
|
|
9
9
|
return GenericSignedObject;
|
|
10
10
|
}());
|
|
@@ -21,7 +21,7 @@ var GenericStateObject = /** @class */ (function (_super) {
|
|
|
21
21
|
__extends(GenericStateObject, _super);
|
|
22
22
|
function GenericStateObject(Object, Fingerprint, UTCUnixTimeExpiration) {
|
|
23
23
|
var _this = _super.call(this, Fingerprint, UTCUnixTimeExpiration) || this;
|
|
24
|
-
_this.
|
|
24
|
+
_this.object = Object;
|
|
25
25
|
return _this;
|
|
26
26
|
}
|
|
27
27
|
return GenericStateObject;
|
|
@@ -2,8 +2,8 @@ import { PaymentInstrument as PaymentInstrumentModel } from '..';
|
|
|
2
2
|
import { ActionType } from './ActionType';
|
|
3
3
|
import { InstrumentWithMetadata } from './InstrumentWithMetadata';
|
|
4
4
|
export declare class InstrumentCallback extends InstrumentWithMetadata {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
sessionId: string;
|
|
6
|
+
client: string;
|
|
7
|
+
action: ActionType;
|
|
8
8
|
constructor(SessionId: string, Client: string, Action: ActionType, PaymentInstrument: PaymentInstrumentModel, OptionalMetadata: string);
|
|
9
9
|
}
|
|
@@ -21,9 +21,9 @@ var InstrumentCallback = /** @class */ (function (_super) {
|
|
|
21
21
|
__extends(InstrumentCallback, _super);
|
|
22
22
|
function InstrumentCallback(SessionId, Client, Action, PaymentInstrument, OptionalMetadata) {
|
|
23
23
|
var _this = _super.call(this, PaymentInstrument, OptionalMetadata) || this;
|
|
24
|
-
_this.
|
|
25
|
-
_this.
|
|
26
|
-
_this.
|
|
24
|
+
_this.sessionId = SessionId;
|
|
25
|
+
_this.client = Client;
|
|
26
|
+
_this.action = Action;
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
29
29
|
return InstrumentCallback;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PaymentInstrument } from './PaymentInstrument';
|
|
2
2
|
export declare class InstrumentWithMetadata {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
3
|
+
paymentInstrument: PaymentInstrument;
|
|
4
|
+
optionalMetadata: string;
|
|
5
|
+
constructor(paymentInstrument: PaymentInstrument, optionalMetadata: string);
|
|
6
6
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InstrumentWithMetadata = void 0;
|
|
4
4
|
var InstrumentWithMetadata = /** @class */ (function () {
|
|
5
|
-
function InstrumentWithMetadata(
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
5
|
+
function InstrumentWithMetadata(paymentInstrument, optionalMetadata) {
|
|
6
|
+
this.paymentInstrument = paymentInstrument;
|
|
7
|
+
this.optionalMetadata = optionalMetadata;
|
|
8
8
|
}
|
|
9
9
|
return InstrumentWithMetadata;
|
|
10
10
|
}());
|
|
@@ -4,15 +4,15 @@ import { Currency } from './Currency';
|
|
|
4
4
|
import { IssuerInfo } from './IssuerInfo';
|
|
5
5
|
import { TimeLimit } from './TimeLimit';
|
|
6
6
|
export declare type PaymentInstrument = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
instrumentToken: string;
|
|
8
|
+
name: string;
|
|
9
|
+
issuer: IssuerInfo;
|
|
10
|
+
supportedCurrencies: Currency[];
|
|
11
|
+
status: CardStatus;
|
|
12
|
+
instrumentExpirationUTC: number;
|
|
13
|
+
anonInstrumentUsageTimeLimit?: number;
|
|
14
|
+
creditLimits: AmountLimit[];
|
|
15
|
+
additionalRequirements: TimeLimit[];
|
|
16
|
+
instrumentInformation: any;
|
|
17
|
+
sessionCreationId: string;
|
|
18
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateObject } from './StateObject';
|
|
2
2
|
export declare class SignedObject {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
3
|
+
object: StateObject;
|
|
4
|
+
signature: string;
|
|
5
|
+
constructor(object: StateObject, signature: string);
|
|
6
6
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SignedObject = void 0;
|
|
4
4
|
var SignedObject = /** @class */ (function () {
|
|
5
|
-
function SignedObject(
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
5
|
+
function SignedObject(object, signature) {
|
|
6
|
+
this.object = object;
|
|
7
|
+
this.signature = signature;
|
|
8
8
|
}
|
|
9
9
|
return SignedObject;
|
|
10
10
|
}());
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StateObject = void 0;
|
|
4
4
|
var StateObject = /** @class */ (function () {
|
|
5
5
|
function StateObject(fingerprint, utcUnixTimeExpiration) {
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
6
|
+
this.fingerprint = fingerprint;
|
|
7
|
+
this.utcUnixTimeExpiration = utcUnixTimeExpiration;
|
|
8
8
|
}
|
|
9
9
|
return StateObject;
|
|
10
10
|
}());
|
|
@@ -2,6 +2,6 @@ import { Commerce as CommerceModel, Currency as CurrencyModel, FinancialInclusio
|
|
|
2
2
|
import { PaymentCode as PaymentCodeModel } from './CodeAction';
|
|
3
3
|
import { Transaction } from './Transaction';
|
|
4
4
|
export declare class TransactionCallback extends Transaction {
|
|
5
|
-
|
|
5
|
+
client: string;
|
|
6
6
|
constructor(Client: string, TransactionId: string, Commerce: CommerceModel, InstrumentToken: string, InstrumentName: string, Issuer: IssuerInfoModel, Amount: number, Installments: number, Currency: CurrencyModel, IsAnonymous: boolean, CurrentState: TransactionTypeModel, InvoiceNumber: string, FinancialInclusion: FinancialInclusionResultModel, Transactions: any, FieldInformation: any, IsAsyncPayment: boolean, PaymentCode: PaymentCodeModel, UTCUnixTimeExpiration: number);
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ var TransactionCallback = /** @class */ (function (_super) {
|
|
|
21
21
|
__extends(TransactionCallback, _super);
|
|
22
22
|
function TransactionCallback(Client, TransactionId, Commerce, InstrumentToken, InstrumentName, Issuer, Amount, Installments, Currency, IsAnonymous, CurrentState, InvoiceNumber, FinancialInclusion, Transactions, FieldInformation, IsAsyncPayment, PaymentCode, UTCUnixTimeExpiration) {
|
|
23
23
|
var _this = _super.call(this, TransactionId, Commerce, InstrumentToken, InstrumentName, Issuer, Amount, Installments, Currency, IsAnonymous, CurrentState, InvoiceNumber, FinancialInclusion, Transactions, FieldInformation, IsAsyncPayment, PaymentCode, UTCUnixTimeExpiration) || this;
|
|
24
|
-
_this.
|
|
24
|
+
_this.client = Client;
|
|
25
25
|
return _this;
|
|
26
26
|
}
|
|
27
27
|
return TransactionCallback;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TransactionType = void 0;
|
|
4
4
|
var TransactionType;
|
|
5
5
|
(function (TransactionType) {
|
|
6
|
-
TransactionType[TransactionType["
|
|
7
|
-
TransactionType[TransactionType["
|
|
8
|
-
TransactionType[TransactionType["
|
|
6
|
+
TransactionType[TransactionType["Reserve"] = 0] = "Reserve";
|
|
7
|
+
TransactionType[TransactionType["Purchase"] = 1] = "Purchase";
|
|
8
|
+
TransactionType[TransactionType["Cancel"] = 2] = "Cancel";
|
|
9
9
|
})(TransactionType = exports.TransactionType || (exports.TransactionType = {}));
|