@houlak/plexo-sdk 0.1.11 → 0.1.12-fx
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.d.ts +29 -18
- package/lib/handler/PlexoHandler.js +199 -49
- package/lib/handler/services/evaluator.service.js +3 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -1
- package/lib/lib/logger.lib.js +3 -3
- package/lib/sdk/IPaymentGatewayClient.d.ts +28 -27
- package/lib/sdk/PaymentGatewayClient.d.ts +28 -27
- package/lib/sdk/PaymentGatewayClient.js +66 -68
- package/lib/sdk/PaymentGatewayMock.d.ts +2 -2
- package/lib/sdk/PaymentGatewayMock.js +5 -11
- package/lib/sdk/enums/plexo-error-enum.d.ts +1 -0
- package/lib/sdk/enums/plexo-error-enum.js +1 -0
- package/lib/sdk/helpers/signature/signatureHelper.d.ts +3 -7
- package/lib/sdk/helpers/signature/signatureHelper.js +78 -210
- package/lib/sdk/helpers/signature/signatureUtils.d.ts +10 -0
- package/lib/sdk/helpers/signature/signatureUtils.js +155 -0
- package/lib/sdk/helpers/signature/stringifyWithFloats.js +2 -0
- package/lib/sdk/mocks/mocks.js +19 -19
- package/lib/sdk/models/Authorization.d.ts +4 -5
- package/lib/sdk/models/Authorization.js +7 -1
- package/lib/sdk/models/BuiltInPagesOptions.d.ts +5 -0
- package/lib/sdk/models/BuiltInPagesOptions.js +11 -0
- package/lib/sdk/models/CodeRequest.d.ts +3 -2
- package/lib/sdk/models/CodeRequest.js +9 -0
- package/lib/sdk/models/CommerceIdRequest.d.ts +3 -2
- package/lib/sdk/models/CommerceIdRequest.js +8 -0
- package/lib/sdk/models/CommerceIssuerIdRequest.d.ts +3 -2
- package/lib/sdk/models/CommerceIssuerIdRequest.js +9 -0
- package/lib/sdk/models/CommerceModifyRequest.d.ts +3 -2
- package/lib/sdk/models/CommerceModifyRequest.js +9 -0
- package/lib/sdk/models/CommerceRequest.d.ts +3 -2
- package/lib/sdk/models/CommerceRequest.js +8 -0
- package/lib/sdk/models/CreateBankInstrumentRequest.d.ts +3 -2
- package/lib/sdk/models/CreateBankInstrumentRequest.js +10 -0
- package/lib/sdk/models/DisplayOptions.d.ts +8 -0
- package/lib/sdk/models/DisplayOptions.js +14 -0
- package/lib/sdk/models/ExpressCheckoutSettings.d.ts +7 -0
- package/lib/sdk/models/ExpressCheckoutSettings.js +11 -0
- package/lib/sdk/models/FieldType.d.ts +6 -0
- package/lib/sdk/models/FieldType.js +6 -0
- package/lib/sdk/models/FixedCustomData.d.ts +7 -0
- package/lib/sdk/models/FixedCustomData.js +13 -0
- package/lib/sdk/models/GenericSignedObject.d.ts +3 -3
- package/lib/sdk/models/GenericSignedObject.js +3 -3
- package/lib/sdk/models/GenericStateObject.d.ts +1 -1
- package/lib/sdk/models/GenericStateObject.js +3 -3
- package/lib/sdk/models/IndexSDK.d.ts +8 -6
- package/lib/sdk/models/IndexSDK.js +32 -14
- package/lib/sdk/models/InstrumentCallback.d.ts +5 -5
- package/lib/sdk/models/InstrumentCallback.js +5 -5
- package/lib/sdk/models/InstrumentWithMetadata.d.ts +3 -3
- package/lib/sdk/models/InstrumentWithMetadata.js +3 -3
- package/lib/sdk/models/IssuerData.d.ts +5 -2
- package/lib/sdk/models/IssuerData.js +12 -0
- package/lib/sdk/models/PaymentInstrument.d.ts +11 -11
- package/lib/sdk/models/StateObject.d.ts +2 -2
- package/lib/sdk/models/StateObject.js +2 -2
- package/lib/sdk/models/TokenizationSettings.d.ts +5 -0
- package/lib/sdk/models/TokenizationSettings.js +10 -0
- package/lib/sdk/models/TransactionCallback.d.ts +4 -4
- package/lib/sdk/models/TransactionCallback.js +3 -3
- package/lib/sdk/models/TransactionQuery.d.ts +3 -2
- package/lib/sdk/models/TransactionQuery.js +11 -1
- package/lib/sdk/models/TransactionsCSV.d.ts +3 -0
- package/lib/sdk/models/TransactionsCSV.js +2 -0
- package/lib/sdk/models/UIOptions.d.ts +8 -0
- package/lib/sdk/models/UIOptions.js +13 -0
- package/lib/sdk/models/WebFormSettings.d.ts +9 -0
- package/lib/sdk/models/WebFormSettings.js +12 -0
- package/lib/sdk/models/webhook/Address.d.ts +9 -0
- package/lib/sdk/models/webhook/Address.js +15 -0
- package/lib/sdk/models/webhook/CancellationInfo.d.ts +11 -0
- package/lib/sdk/models/webhook/CancellationInfo.js +17 -0
- package/lib/sdk/models/webhook/Client.d.ts +9 -0
- package/lib/sdk/models/webhook/Client.js +14 -0
- package/lib/sdk/models/webhook/Commerce.d.ts +6 -0
- package/lib/sdk/models/webhook/Commerce.js +12 -0
- package/lib/sdk/models/webhook/Currency.d.ts +8 -0
- package/lib/sdk/models/webhook/Currency.js +14 -0
- package/lib/sdk/models/webhook/Customer.d.ts +17 -0
- package/lib/sdk/models/webhook/Customer.js +22 -0
- package/lib/sdk/models/webhook/Document.d.ts +5 -0
- package/lib/sdk/models/webhook/Document.js +11 -0
- package/lib/sdk/models/webhook/IndexWebhook.d.ts +21 -0
- package/lib/sdk/models/webhook/IndexWebhook.js +45 -0
- package/lib/sdk/models/webhook/Instrument.d.ts +17 -0
- package/lib/sdk/models/webhook/Instrument.js +21 -0
- package/lib/sdk/models/webhook/Issuer.d.ts +8 -0
- package/lib/sdk/models/webhook/Issuer.js +14 -0
- package/lib/sdk/models/webhook/IssuerData.d.ts +8 -0
- package/lib/sdk/models/webhook/IssuerData.js +13 -0
- package/lib/sdk/models/webhook/IssuerDto.d.ts +5 -0
- package/lib/sdk/models/webhook/IssuerDto.js +11 -0
- package/lib/sdk/models/webhook/Item.d.ts +14 -0
- package/lib/sdk/models/webhook/Item.js +19 -0
- package/lib/sdk/models/webhook/PartialRefundsInfo.d.ts +12 -0
- package/lib/sdk/models/webhook/PartialRefundsInfo.js +18 -0
- package/lib/sdk/models/webhook/PaymentFacilitator.d.ts +8 -0
- package/lib/sdk/models/webhook/PaymentFacilitator.js +13 -0
- package/lib/sdk/models/webhook/PaymentProcessor.d.ts +5 -0
- package/lib/sdk/models/webhook/PaymentProcessor.js +11 -0
- package/lib/sdk/models/webhook/PurchaseInfo.d.ts +16 -0
- package/lib/sdk/models/webhook/PurchaseInfo.js +22 -0
- package/lib/sdk/models/webhook/RefundInfo.d.ts +12 -0
- package/lib/sdk/models/webhook/RefundInfo.js +18 -0
- package/lib/sdk/models/webhook/ReserveInfo.d.ts +13 -0
- package/lib/sdk/models/webhook/ReserveInfo.js +19 -0
- package/lib/sdk/models/webhook/Shipping.d.ts +7 -0
- package/lib/sdk/models/webhook/Shipping.js +12 -0
- package/lib/sdk/models/webhook/Transaction.d.ts +31 -0
- package/lib/sdk/models/webhook/Transaction.js +36 -0
- package/lib/sdk/models/webhook/TransactionResult.d.ts +5 -0
- package/lib/sdk/models/webhook/TransactionResult.js +10 -0
- package/lib/sdk/models/webhook/index.d.ts +21 -0
- package/lib/sdk/models/webhook/index.js +45 -0
- package/lib/utils/boolean.utils.d.ts +4 -0
- package/lib/utils/boolean.utils.js +53 -0
- package/lib/utils/case.util.d.ts +4 -0
- package/lib/utils/case.util.js +61 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +5 -0
- package/package.json +3 -3
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { Authorization, AuthorizationInfo, CancelRequest, ClientSignedResponse, CodeRequest, Commerce, CommerceIdRequest, CommerceIssuerIdRequest, CommerceModifyRequest, CommerceRequest, CreateBankInstrumentRequest, DeleteInstrumentRequest, ExpressCheckoutRequest, InstrumentCallback, IssuerData, IssuerInfo, PaymentRequest, PaymentInstrument, Reference, Reserve, ReserveRequest, BaseServerResponse, ServerResponse, ServerSignedCallback, Session, Transaction, TransactionCallback, TransactionCursor, TransactionQuery } from './models/IndexSDK';
|
|
2
2
|
import { IssuerProcessor } from './index';
|
|
3
3
|
import { IPaymentGatewayClient } from './IPaymentGatewayClient';
|
|
4
|
+
import { FixedCustomData } from './models/FixedCustomData';
|
|
4
5
|
export declare class PaymentGatewayClient implements IPaymentGatewayClient {
|
|
5
|
-
AddCommerceAsync(commerce: CommerceRequest): Promise<ServerResponse<Commerce>>;
|
|
6
|
-
AddIssuerCommerceAsync(issuerData: IssuerData): Promise<ServerResponse<IssuerData>>;
|
|
7
|
-
DeleteCommerceAsync(commerceIdRequest: CommerceIdRequest): Promise<ServerResponse<BaseServerResponse>>;
|
|
8
|
-
DeleteInstrumentAsync(info: DeleteInstrumentRequest): Promise<ServerResponse<BaseServerResponse>>;
|
|
9
|
-
DeleteIssuerCommerceAsync(commerceIssuerIdRequest: CommerceIssuerIdRequest): Promise<ServerResponse<BaseServerResponse>>;
|
|
10
|
-
GetCommerceIssuersAsync(commerceIdRequest: CommerceIdRequest): Promise<ServerResponse<IssuerData[]>>;
|
|
11
|
-
GetCommercesAsync(): Promise<ServerResponse<Commerce[]>>;
|
|
12
|
-
GetSupportedIssuersAsync(): Promise<ServerResponse<IssuerInfo[]>>;
|
|
13
|
-
GetSupportedPaymentProcessorsAsync(): Promise<ServerResponse<IssuerProcessor[]>>;
|
|
14
|
-
ModifyCommerceAsync(commerceModifyRequest: CommerceModifyRequest): Promise<ServerResponse<Commerce>>;
|
|
15
|
-
GetInstrumentsAsync(authorizationInfo: AuthorizationInfo): Promise<ServerResponse<PaymentInstrument[]>>;
|
|
16
|
-
SetDefaultCommerceAsync(commerceIdRequest: CommerceIdRequest): Promise<BaseServerResponse>;
|
|
17
|
-
AuthorizeAsync(authorization: Authorization): Promise<ServerResponse<Session>>;
|
|
18
|
-
CancelAsync(cancel: CancelRequest): Promise<ServerResponse<Transaction>>;
|
|
19
|
-
CodeActionAsync(request: CodeRequest): Promise<ServerResponse<Transaction>>;
|
|
20
|
-
StartReserveAsync(payment: ReserveRequest): Promise<ServerResponse<Transaction>>;
|
|
21
|
-
StatusAsync(payment: Reference): Promise<ServerResponse<Transaction>>;
|
|
22
|
-
ExpressCheckoutAsync(expressCheckout: ExpressCheckoutRequest): Promise<ServerResponse<Session>>;
|
|
23
|
-
ObtainCsvTransactionsAsync(query: TransactionQuery): Promise<ServerResponse<string>>;
|
|
24
|
-
ObtainTransactionsAsync(query: TransactionQuery): Promise<ServerResponse<TransactionCursor>>;
|
|
25
|
-
PurchaseAsync(payment: PaymentRequest): Promise<ServerResponse<Transaction>>;
|
|
26
|
-
CreateBankInstrumentAsync(request: CreateBankInstrumentRequest): Promise<ServerResponse<PaymentInstrument>>;
|
|
27
|
-
EndReserveAsync(reserve: Reserve): Promise<ServerResponse<Transaction>>;
|
|
28
|
-
UnwrapInstrumentCallbackAsync(serverSignedInstrumentCallback: ServerSignedCallback<InstrumentCallback
|
|
29
|
-
UnwrapTransactionCallbackAsync(serverSignedTransactionCallback: ServerSignedCallback<TransactionCallback
|
|
30
|
-
SignInstrumentCallback(serverResponse: ServerResponse<InstrumentCallback
|
|
31
|
-
SignTransactionCallback(serverResponse: ServerResponse<TransactionCallback
|
|
6
|
+
AddCommerceAsync(commerce: CommerceRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Commerce>>;
|
|
7
|
+
AddIssuerCommerceAsync(issuerData: IssuerData, fixedCustomData: FixedCustomData): Promise<ServerResponse<IssuerData>>;
|
|
8
|
+
DeleteCommerceAsync(commerceIdRequest: CommerceIdRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<BaseServerResponse>>;
|
|
9
|
+
DeleteInstrumentAsync(info: DeleteInstrumentRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<BaseServerResponse>>;
|
|
10
|
+
DeleteIssuerCommerceAsync(commerceIssuerIdRequest: CommerceIssuerIdRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<BaseServerResponse>>;
|
|
11
|
+
GetCommerceIssuersAsync(commerceIdRequest: CommerceIdRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<IssuerData[]>>;
|
|
12
|
+
GetCommercesAsync(fixedCustomData: FixedCustomData): Promise<ServerResponse<Commerce[]>>;
|
|
13
|
+
GetSupportedIssuersAsync(fixedCustomData: FixedCustomData): Promise<ServerResponse<IssuerInfo[]>>;
|
|
14
|
+
GetSupportedPaymentProcessorsAsync(fixedCustomData: FixedCustomData): Promise<ServerResponse<IssuerProcessor[]>>;
|
|
15
|
+
ModifyCommerceAsync(commerceModifyRequest: CommerceModifyRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Commerce>>;
|
|
16
|
+
GetInstrumentsAsync(authorizationInfo: AuthorizationInfo, fixedCustomData: FixedCustomData): Promise<ServerResponse<PaymentInstrument[]>>;
|
|
17
|
+
SetDefaultCommerceAsync(commerceIdRequest: CommerceIdRequest, fixedCustomData: FixedCustomData): Promise<BaseServerResponse>;
|
|
18
|
+
AuthorizeAsync(authorization: Authorization, fixedCustomData: FixedCustomData): Promise<ServerResponse<Session>>;
|
|
19
|
+
CancelAsync(cancel: CancelRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
20
|
+
CodeActionAsync(request: CodeRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
21
|
+
StartReserveAsync(payment: ReserveRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
22
|
+
StatusAsync(payment: Reference, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
23
|
+
ExpressCheckoutAsync(expressCheckout: ExpressCheckoutRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Session>>;
|
|
24
|
+
ObtainCsvTransactionsAsync(query: TransactionQuery, fixedCustomData: FixedCustomData): Promise<ServerResponse<string>>;
|
|
25
|
+
ObtainTransactionsAsync(query: TransactionQuery, fixedCustomData: FixedCustomData): Promise<ServerResponse<TransactionCursor>>;
|
|
26
|
+
PurchaseAsync(payment: PaymentRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
27
|
+
CreateBankInstrumentAsync(request: CreateBankInstrumentRequest, fixedCustomData: FixedCustomData): Promise<ServerResponse<PaymentInstrument>>;
|
|
28
|
+
EndReserveAsync(reserve: Reserve, fixedCustomData: FixedCustomData): Promise<ServerResponse<Transaction>>;
|
|
29
|
+
UnwrapInstrumentCallbackAsync(serverSignedInstrumentCallback: ServerSignedCallback<InstrumentCallback>, plexoUrl: string): Promise<ServerResponse<InstrumentCallback>>;
|
|
30
|
+
UnwrapTransactionCallbackAsync(serverSignedTransactionCallback: ServerSignedCallback<TransactionCallback>, plexoUrl: string): Promise<ServerResponse<TransactionCallback>>;
|
|
31
|
+
SignInstrumentCallback(serverResponse: ServerResponse<InstrumentCallback>, plexoCertificatePath: string, plexoCertificatePassword: string): Promise<ClientSignedResponse>;
|
|
32
|
+
SignTransactionCallback(serverResponse: ServerResponse<TransactionCallback>, plexoCertificatePath: string, plexoCertificatePassword: string): Promise<ClientSignedResponse>;
|
|
32
33
|
}
|
|
@@ -50,36 +50,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
50
50
|
exports.PaymentGatewayClient = void 0;
|
|
51
51
|
var axios_1 = require("axios");
|
|
52
52
|
var logger_lib_1 = require("../lib/logger.lib");
|
|
53
|
-
var config_1 = require("../config/config");
|
|
54
53
|
var signatureHelper_1 = require("./helpers/signature/signatureHelper");
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var requestToPlexo = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {
|
|
59
|
-
var object, stateObject, signedClientRequest, data, err_1;
|
|
54
|
+
var utils_1 = require("../utils");
|
|
55
|
+
var requestToPlexo = function (endpoint, request, fixedCustomData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
+
var object, stateObject, signedClientRequest, client, data, err_1;
|
|
60
57
|
return __generator(this, function (_a) {
|
|
61
58
|
switch (_a.label) {
|
|
62
59
|
case 0:
|
|
63
60
|
_a.trys.push([0, 3, , 4]);
|
|
64
61
|
object = {
|
|
65
|
-
client:
|
|
62
|
+
client: fixedCustomData.plexoClientName,
|
|
66
63
|
request: request,
|
|
67
64
|
};
|
|
68
65
|
stateObject = {
|
|
69
|
-
|
|
66
|
+
fingerprint: '',
|
|
70
67
|
utcUnixTimeExpiration: Date.parse(new Date().toString()),
|
|
71
68
|
object: object,
|
|
72
69
|
};
|
|
73
|
-
return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
70
|
+
return [4 /*yield*/, signatureHelper_1.SignatureHelper.signRequest(stateObject, fixedCustomData.plexoCertificatePassword, fixedCustomData.plexoCertificatePath)];
|
|
74
71
|
case 1:
|
|
75
72
|
signedClientRequest = _a.sent();
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
client = axios_1.default.create({
|
|
74
|
+
baseURL: fixedCustomData.plexoUrl,
|
|
75
|
+
});
|
|
76
|
+
logger_lib_1.default.debug("URL PX: ".concat(endpoint));
|
|
77
|
+
logger_lib_1.default.debug(signedClientRequest, 'Signed client request');
|
|
78
78
|
return [4 /*yield*/, client.post(endpoint, __assign({}, signedClientRequest))];
|
|
79
79
|
case 2:
|
|
80
80
|
data = (_a.sent()).data;
|
|
81
81
|
logger_lib_1.default.debug({ data: data });
|
|
82
|
-
return [2 /*return*/,
|
|
82
|
+
return [2 /*return*/, utils_1.caseUtils.toCamelKeys(data.Object.Object)];
|
|
83
83
|
case 3:
|
|
84
84
|
err_1 = _a.sent();
|
|
85
85
|
logger_lib_1.default.error({ err: err_1 });
|
|
@@ -91,242 +91,242 @@ var requestToPlexo = function (endpoint, request) { return __awaiter(void 0, voi
|
|
|
91
91
|
var PaymentGatewayClient = /** @class */ (function () {
|
|
92
92
|
function PaymentGatewayClient() {
|
|
93
93
|
}
|
|
94
|
-
PaymentGatewayClient.prototype.AddCommerceAsync = function (commerce) {
|
|
94
|
+
PaymentGatewayClient.prototype.AddCommerceAsync = function (commerce, fixedCustomData) {
|
|
95
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
96
96
|
return __generator(this, function (_a) {
|
|
97
97
|
switch (_a.label) {
|
|
98
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Add', commerce)];
|
|
98
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Add', commerce, fixedCustomData)];
|
|
99
99
|
case 1: return [2 /*return*/, _a.sent()];
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
PaymentGatewayClient.prototype.AddIssuerCommerceAsync = function (issuerData) {
|
|
104
|
+
PaymentGatewayClient.prototype.AddIssuerCommerceAsync = function (issuerData, fixedCustomData) {
|
|
105
105
|
return __awaiter(this, void 0, void 0, function () {
|
|
106
106
|
return __generator(this, function (_a) {
|
|
107
107
|
switch (_a.label) {
|
|
108
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Add', issuerData)];
|
|
108
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Add', issuerData, fixedCustomData)];
|
|
109
109
|
case 1: return [2 /*return*/, _a.sent()];
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
};
|
|
114
|
-
PaymentGatewayClient.prototype.DeleteCommerceAsync = function (commerceIdRequest) {
|
|
114
|
+
PaymentGatewayClient.prototype.DeleteCommerceAsync = function (commerceIdRequest, fixedCustomData) {
|
|
115
115
|
return __awaiter(this, void 0, void 0, function () {
|
|
116
116
|
return __generator(this, function (_a) {
|
|
117
117
|
switch (_a.label) {
|
|
118
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Delete', commerceIdRequest)];
|
|
118
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Delete', commerceIdRequest, fixedCustomData)];
|
|
119
119
|
case 1: return [2 /*return*/, _a.sent()];
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
PaymentGatewayClient.prototype.DeleteInstrumentAsync = function (info) {
|
|
124
|
+
PaymentGatewayClient.prototype.DeleteInstrumentAsync = function (info, fixedCustomData) {
|
|
125
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
126
126
|
return __generator(this, function (_a) {
|
|
127
127
|
switch (_a.label) {
|
|
128
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Instruments/Delete', info)];
|
|
128
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Instruments/Delete', info, fixedCustomData)];
|
|
129
129
|
case 1: return [2 /*return*/, _a.sent()];
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
133
|
};
|
|
134
|
-
PaymentGatewayClient.prototype.DeleteIssuerCommerceAsync = function (commerceIssuerIdRequest) {
|
|
134
|
+
PaymentGatewayClient.prototype.DeleteIssuerCommerceAsync = function (commerceIssuerIdRequest, fixedCustomData) {
|
|
135
135
|
return __awaiter(this, void 0, void 0, function () {
|
|
136
136
|
return __generator(this, function (_a) {
|
|
137
137
|
switch (_a.label) {
|
|
138
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Delete', commerceIssuerIdRequest)];
|
|
138
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Delete', commerceIssuerIdRequest, fixedCustomData)];
|
|
139
139
|
case 1: return [2 /*return*/, _a.sent()];
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
});
|
|
143
143
|
};
|
|
144
|
-
PaymentGatewayClient.prototype.GetCommerceIssuersAsync = function (commerceIdRequest) {
|
|
144
|
+
PaymentGatewayClient.prototype.GetCommerceIssuersAsync = function (commerceIdRequest, fixedCustomData) {
|
|
145
145
|
return __awaiter(this, void 0, void 0, function () {
|
|
146
146
|
return __generator(this, function (_a) {
|
|
147
147
|
switch (_a.label) {
|
|
148
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer', commerceIdRequest)];
|
|
148
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer', commerceIdRequest, fixedCustomData)];
|
|
149
149
|
case 1: return [2 /*return*/, _a.sent()];
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
|
-
PaymentGatewayClient.prototype.GetCommercesAsync = function () {
|
|
154
|
+
PaymentGatewayClient.prototype.GetCommercesAsync = function (fixedCustomData) {
|
|
155
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
156
156
|
return __generator(this, function (_a) {
|
|
157
157
|
switch (_a.label) {
|
|
158
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce', '')];
|
|
158
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce', '', fixedCustomData)];
|
|
159
159
|
case 1: return [2 /*return*/, _a.sent()];
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
};
|
|
164
|
-
PaymentGatewayClient.prototype.GetSupportedIssuersAsync = function () {
|
|
164
|
+
PaymentGatewayClient.prototype.GetSupportedIssuersAsync = function (fixedCustomData) {
|
|
165
165
|
return __awaiter(this, void 0, void 0, function () {
|
|
166
166
|
return __generator(this, function (_a) {
|
|
167
167
|
switch (_a.label) {
|
|
168
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Issuer', '')];
|
|
168
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Issuer', '', fixedCustomData)];
|
|
169
169
|
case 1: return [2 /*return*/, _a.sent()];
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
PaymentGatewayClient.prototype.GetSupportedPaymentProcessorsAsync = function () {
|
|
174
|
+
PaymentGatewayClient.prototype.GetSupportedPaymentProcessorsAsync = function (fixedCustomData) {
|
|
175
175
|
return __awaiter(this, void 0, void 0, function () {
|
|
176
176
|
return __generator(this, function (_a) {
|
|
177
177
|
switch (_a.label) {
|
|
178
|
-
case 0: return [4 /*yield*/, requestToPlexo('/PaymentProcessors', '')];
|
|
178
|
+
case 0: return [4 /*yield*/, requestToPlexo('/PaymentProcessors', '', fixedCustomData)];
|
|
179
179
|
case 1: return [2 /*return*/, _a.sent()];
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
183
|
};
|
|
184
|
-
PaymentGatewayClient.prototype.ModifyCommerceAsync = function (commerceModifyRequest) {
|
|
184
|
+
PaymentGatewayClient.prototype.ModifyCommerceAsync = function (commerceModifyRequest, fixedCustomData) {
|
|
185
185
|
return __awaiter(this, void 0, void 0, function () {
|
|
186
186
|
return __generator(this, function (_a) {
|
|
187
187
|
switch (_a.label) {
|
|
188
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Modify', commerceModifyRequest)];
|
|
188
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Modify', commerceModifyRequest, fixedCustomData)];
|
|
189
189
|
case 1: return [2 /*return*/, _a.sent()];
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
193
|
};
|
|
194
|
-
PaymentGatewayClient.prototype.GetInstrumentsAsync = function (authorizationInfo) {
|
|
194
|
+
PaymentGatewayClient.prototype.GetInstrumentsAsync = function (authorizationInfo, fixedCustomData) {
|
|
195
195
|
return __awaiter(this, void 0, void 0, function () {
|
|
196
196
|
return __generator(this, function (_a) {
|
|
197
197
|
switch (_a.label) {
|
|
198
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Instruments', authorizationInfo)];
|
|
198
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Instruments', authorizationInfo, fixedCustomData)];
|
|
199
199
|
case 1: return [2 /*return*/, _a.sent()];
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
};
|
|
204
|
-
PaymentGatewayClient.prototype.SetDefaultCommerceAsync = function (commerceIdRequest) {
|
|
204
|
+
PaymentGatewayClient.prototype.SetDefaultCommerceAsync = function (commerceIdRequest, fixedCustomData) {
|
|
205
205
|
return __awaiter(this, void 0, void 0, function () {
|
|
206
206
|
return __generator(this, function (_a) {
|
|
207
207
|
switch (_a.label) {
|
|
208
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/SetDefault', commerceIdRequest)];
|
|
208
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/SetDefault', commerceIdRequest, fixedCustomData)];
|
|
209
209
|
case 1: return [2 /*return*/, _a.sent()];
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
});
|
|
213
213
|
};
|
|
214
|
-
PaymentGatewayClient.prototype.AuthorizeAsync = function (authorization) {
|
|
214
|
+
PaymentGatewayClient.prototype.AuthorizeAsync = function (authorization, fixedCustomData) {
|
|
215
215
|
return __awaiter(this, void 0, void 0, function () {
|
|
216
216
|
return __generator(this, function (_a) {
|
|
217
217
|
switch (_a.label) {
|
|
218
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Auth', authorization)];
|
|
218
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Auth', authorization, fixedCustomData)];
|
|
219
219
|
case 1: return [2 /*return*/, _a.sent()];
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
});
|
|
223
223
|
};
|
|
224
|
-
PaymentGatewayClient.prototype.CancelAsync = function (cancel) {
|
|
224
|
+
PaymentGatewayClient.prototype.CancelAsync = function (cancel, fixedCustomData) {
|
|
225
225
|
return __awaiter(this, void 0, void 0, function () {
|
|
226
226
|
return __generator(this, function (_a) {
|
|
227
227
|
switch (_a.label) {
|
|
228
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Cancel', cancel)];
|
|
228
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Cancel', cancel, fixedCustomData)];
|
|
229
229
|
case 1: return [2 /*return*/, _a.sent()];
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
233
|
};
|
|
234
|
-
PaymentGatewayClient.prototype.CodeActionAsync = function (request) {
|
|
234
|
+
PaymentGatewayClient.prototype.CodeActionAsync = function (request, fixedCustomData) {
|
|
235
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
236
236
|
return __generator(this, function (_a) {
|
|
237
237
|
switch (_a.label) {
|
|
238
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Code', request)];
|
|
238
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Code', request, fixedCustomData)];
|
|
239
239
|
case 1: return [2 /*return*/, _a.sent()];
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
|
-
PaymentGatewayClient.prototype.StartReserveAsync = function (payment) {
|
|
244
|
+
PaymentGatewayClient.prototype.StartReserveAsync = function (payment, fixedCustomData) {
|
|
245
245
|
return __awaiter(this, void 0, void 0, function () {
|
|
246
246
|
return __generator(this, function (_a) {
|
|
247
247
|
switch (_a.label) {
|
|
248
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/StartReserve', payment)];
|
|
248
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Operation/StartReserve', payment, fixedCustomData)];
|
|
249
249
|
case 1: return [2 /*return*/, _a.sent()];
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
252
|
});
|
|
253
253
|
};
|
|
254
|
-
PaymentGatewayClient.prototype.StatusAsync = function (payment) {
|
|
254
|
+
PaymentGatewayClient.prototype.StatusAsync = function (payment, fixedCustomData) {
|
|
255
255
|
return __awaiter(this, void 0, void 0, function () {
|
|
256
256
|
return __generator(this, function (_a) {
|
|
257
257
|
switch (_a.label) {
|
|
258
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Status', payment)];
|
|
258
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Status', payment, fixedCustomData)];
|
|
259
259
|
case 1: return [2 /*return*/, _a.sent()];
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
});
|
|
263
263
|
};
|
|
264
|
-
PaymentGatewayClient.prototype.ExpressCheckoutAsync = function (expressCheckout) {
|
|
264
|
+
PaymentGatewayClient.prototype.ExpressCheckoutAsync = function (expressCheckout, fixedCustomData) {
|
|
265
265
|
return __awaiter(this, void 0, void 0, function () {
|
|
266
266
|
return __generator(this, function (_a) {
|
|
267
267
|
switch (_a.label) {
|
|
268
|
-
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', expressCheckout)];
|
|
268
|
+
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', expressCheckout, fixedCustomData)];
|
|
269
269
|
case 1: return [2 /*return*/, _a.sent()];
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
};
|
|
274
|
-
PaymentGatewayClient.prototype.ObtainCsvTransactionsAsync = function (query) {
|
|
274
|
+
PaymentGatewayClient.prototype.ObtainCsvTransactionsAsync = function (query, fixedCustomData) {
|
|
275
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
276
276
|
return __generator(this, function (_a) {
|
|
277
277
|
switch (_a.label) {
|
|
278
|
-
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', query)];
|
|
278
|
+
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', query, fixedCustomData)];
|
|
279
279
|
case 1: return [2 /*return*/, _a.sent()];
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
});
|
|
283
283
|
};
|
|
284
|
-
PaymentGatewayClient.prototype.ObtainTransactionsAsync = function (query) {
|
|
284
|
+
PaymentGatewayClient.prototype.ObtainTransactionsAsync = function (query, fixedCustomData) {
|
|
285
285
|
return __awaiter(this, void 0, void 0, function () {
|
|
286
286
|
return __generator(this, function (_a) {
|
|
287
287
|
switch (_a.label) {
|
|
288
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Transactions', query)];
|
|
288
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Transactions', query, fixedCustomData)];
|
|
289
289
|
case 1: return [2 /*return*/, _a.sent()];
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
292
|
});
|
|
293
293
|
};
|
|
294
|
-
PaymentGatewayClient.prototype.PurchaseAsync = function (payment) {
|
|
294
|
+
PaymentGatewayClient.prototype.PurchaseAsync = function (payment, fixedCustomData) {
|
|
295
295
|
return __awaiter(this, void 0, void 0, function () {
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
switch (_a.label) {
|
|
298
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Purchase', payment)];
|
|
298
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Purchase', payment, fixedCustomData)];
|
|
299
299
|
case 1: return [2 /*return*/, _a.sent()];
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
});
|
|
303
303
|
};
|
|
304
|
-
PaymentGatewayClient.prototype.CreateBankInstrumentAsync = function (request) {
|
|
304
|
+
PaymentGatewayClient.prototype.CreateBankInstrumentAsync = function (request, fixedCustomData) {
|
|
305
305
|
return __awaiter(this, void 0, void 0, function () {
|
|
306
306
|
return __generator(this, function (_a) {
|
|
307
307
|
switch (_a.label) {
|
|
308
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Instruments/Bank', request)];
|
|
308
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Instruments/Bank', request, fixedCustomData)];
|
|
309
309
|
case 1: return [2 /*return*/, _a.sent()];
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
});
|
|
313
313
|
};
|
|
314
|
-
PaymentGatewayClient.prototype.EndReserveAsync = function (reserve) {
|
|
314
|
+
PaymentGatewayClient.prototype.EndReserveAsync = function (reserve, fixedCustomData) {
|
|
315
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
316
|
return __generator(this, function (_a) {
|
|
317
317
|
switch (_a.label) {
|
|
318
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/EndReserve', reserve)];
|
|
318
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Operation/EndReserve', reserve, fixedCustomData)];
|
|
319
319
|
case 1: return [2 /*return*/, _a.sent()];
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
|
-
PaymentGatewayClient.prototype.UnwrapInstrumentCallbackAsync = function (serverSignedInstrumentCallback) {
|
|
324
|
+
PaymentGatewayClient.prototype.UnwrapInstrumentCallbackAsync = function (serverSignedInstrumentCallback, plexoUrl) {
|
|
325
325
|
return __awaiter(this, void 0, void 0, 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.
|
|
329
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.unwrapCallback(serverSignedInstrumentCallback.object.fingerprint, serverSignedInstrumentCallback, plexoUrl)];
|
|
330
330
|
case 1:
|
|
331
331
|
verify = _a.sent();
|
|
332
332
|
return [2 /*return*/, verify];
|
|
@@ -334,14 +334,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
336
|
};
|
|
337
|
-
PaymentGatewayClient.prototype.UnwrapTransactionCallbackAsync = function (serverSignedTransactionCallback) {
|
|
337
|
+
PaymentGatewayClient.prototype.UnwrapTransactionCallbackAsync = function (serverSignedTransactionCallback, plexoUrl) {
|
|
338
338
|
return __awaiter(this, void 0, void 0, function () {
|
|
339
339
|
var verify;
|
|
340
340
|
return __generator(this, function (_a) {
|
|
341
341
|
switch (_a.label) {
|
|
342
|
-
case 0:
|
|
343
|
-
logger_lib_1.default.debug("SERVER SIGNED CALLBACK --> ".concat(JSON.stringify(serverSignedTransactionCallback)));
|
|
344
|
-
return [4 /*yield*/, signatureHelper_1.SignatureHelper.getPlexoSignature(serverSignedTransactionCallback.Object.Fingerprint, serverSignedTransactionCallback)];
|
|
342
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.unwrapCallback(serverSignedTransactionCallback.object.fingerprint, serverSignedTransactionCallback, plexoUrl)];
|
|
345
343
|
case 1:
|
|
346
344
|
verify = _a.sent();
|
|
347
345
|
return [2 /*return*/, verify];
|
|
@@ -349,12 +347,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
349
347
|
});
|
|
350
348
|
});
|
|
351
349
|
};
|
|
352
|
-
PaymentGatewayClient.prototype.SignInstrumentCallback = function (serverResponse) {
|
|
350
|
+
PaymentGatewayClient.prototype.SignInstrumentCallback = function (serverResponse, plexoCertificatePath, plexoCertificatePassword) {
|
|
353
351
|
return __awaiter(this, void 0, void 0, function () {
|
|
354
352
|
var response;
|
|
355
353
|
return __generator(this, function (_a) {
|
|
356
354
|
switch (_a.label) {
|
|
357
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
355
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.signCallback(serverResponse, plexoCertificatePath, plexoCertificatePassword)];
|
|
358
356
|
case 1:
|
|
359
357
|
response = _a.sent();
|
|
360
358
|
return [2 /*return*/, response];
|
|
@@ -362,12 +360,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
362
360
|
});
|
|
363
361
|
});
|
|
364
362
|
};
|
|
365
|
-
PaymentGatewayClient.prototype.SignTransactionCallback = function (serverResponse) {
|
|
363
|
+
PaymentGatewayClient.prototype.SignTransactionCallback = function (serverResponse, plexoCertificatePath, plexoCertificatePassword) {
|
|
366
364
|
return __awaiter(this, void 0, void 0, function () {
|
|
367
365
|
var response;
|
|
368
366
|
return __generator(this, function (_a) {
|
|
369
367
|
switch (_a.label) {
|
|
370
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
368
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.signCallback(serverResponse, plexoCertificatePath, plexoCertificatePassword)];
|
|
371
369
|
case 1:
|
|
372
370
|
response = _a.sent();
|
|
373
371
|
return [2 /*return*/, response];
|
|
@@ -26,6 +26,6 @@ export declare class PaymentGatewayMock implements IPaymentGatewayClient {
|
|
|
26
26
|
EndReserveAsync(reserve: Reserve): Promise<ServerResponse<Transaction>>;
|
|
27
27
|
UnwrapInstrumentCallbackAsync(serverSignedInstrumentCallback: ServerSignedCallback<InstrumentCallback>): Promise<ServerResponse<InstrumentCallback>>;
|
|
28
28
|
UnwrapTransactionCallbackAsync(serverSignedTransactionCallback: ServerSignedCallback<TransactionCallback>): Promise<ServerResponse<TransactionCallback>>;
|
|
29
|
-
SignInstrumentCallback(serverResponse: ServerResponse<InstrumentCallback>): Promise<
|
|
30
|
-
SignTransactionCallback(serverResponse: ServerResponse<TransactionCallback>): Promise<
|
|
29
|
+
SignInstrumentCallback(serverResponse: ServerResponse<InstrumentCallback>): Promise<ClientSignedResponse>;
|
|
30
|
+
SignTransactionCallback(serverResponse: ServerResponse<TransactionCallback>): Promise<ClientSignedResponse>;
|
|
31
31
|
}
|
|
@@ -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
|
});
|
|
@@ -314,20 +314,14 @@ var PaymentGatewayMock = /** @class */ (function () {
|
|
|
314
314
|
PaymentGatewayMock.prototype.SignInstrumentCallback = function (serverResponse) {
|
|
315
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
316
|
return __generator(this, function (_a) {
|
|
317
|
-
return [2 /*return*/,
|
|
318
|
-
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
319
|
-
response: mocks_1.mocks.clientSignedResponseMock,
|
|
320
|
-
}];
|
|
317
|
+
return [2 /*return*/, mocks_1.mocks.clientSignedResponseMock];
|
|
321
318
|
});
|
|
322
319
|
});
|
|
323
320
|
};
|
|
324
321
|
PaymentGatewayMock.prototype.SignTransactionCallback = function (serverResponse) {
|
|
325
322
|
return __awaiter(this, void 0, void 0, function () {
|
|
326
323
|
return __generator(this, function (_a) {
|
|
327
|
-
return [2 /*return*/,
|
|
328
|
-
resultCode: IndexSDK_1.ResultCodes.Ok,
|
|
329
|
-
response: mocks_1.mocks.clientSignedResponseMock,
|
|
330
|
-
}];
|
|
324
|
+
return [2 /*return*/, mocks_1.mocks.clientSignedResponseMock];
|
|
331
325
|
});
|
|
332
326
|
});
|
|
333
327
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PlexoErrorEnum = void 0;
|
|
4
4
|
var PlexoErrorEnum;
|
|
5
5
|
(function (PlexoErrorEnum) {
|
|
6
|
+
PlexoErrorEnum[PlexoErrorEnum["CommerceAlreadyExists"] = 25] = "CommerceAlreadyExists";
|
|
6
7
|
PlexoErrorEnum[PlexoErrorEnum["ExceptionHandlingTransaction"] = 1200] = "ExceptionHandlingTransaction";
|
|
7
8
|
PlexoErrorEnum[PlexoErrorEnum["PlexoAuthorizationError"] = 1201] = "PlexoAuthorizationError";
|
|
8
9
|
PlexoErrorEnum[PlexoErrorEnum["InstrumentNotFound"] = 1202] = "InstrumentNotFound";
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { ClientSignedResponse, GenericSignedObject, GenericStateObject, InstrumentCallback, ServerResponse, TransactionCallback } from '../..';
|
|
2
|
-
import { Certificate } from '../../types/signatureHelper.type';
|
|
3
|
-
export declare const canonizeJson: <T>(object: T) => T;
|
|
4
2
|
export declare const SignatureHelper: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getPlexoSignature: <T_1 extends object>(fingerprint: string, response: GenericSignedObject<T_1>) => Promise<ServerResponse<T_1>>;
|
|
9
|
-
toCamelKeys: <T_2 extends object>(object: T_2) => T_2;
|
|
3
|
+
signRequest: <T extends object>(objectToSign: GenericStateObject<T>, plexoCertificatePassword: string, plexoCertificatePath: string) => Promise<GenericSignedObject<T>>;
|
|
4
|
+
unwrapCallback: <T_1 extends object>(fingerprint: string, response: GenericSignedObject<T_1>, plexoUrl: string) => Promise<ServerResponse<T_1>>;
|
|
5
|
+
signCallback: (response: ServerResponse<InstrumentCallback | TransactionCallback>, plexoCertificatePath: string, plexoCertificatePassword: string) => Promise<ClientSignedResponse>;
|
|
10
6
|
};
|