@houlak/plexo-sdk 0.1.8 → 0.1.9-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 +23 -12
- package/lib/handler/PlexoHandler.js +183 -33
- package/lib/handler/services/evaluator.service.js +6 -6
- 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 +10 -9
- package/lib/sdk/PaymentGatewayClient.d.ts +13 -12
- package/lib/sdk/PaymentGatewayClient.js +278 -197
- package/lib/sdk/PaymentGatewayMock.d.ts +2 -2
- package/lib/sdk/PaymentGatewayMock.js +14 -20
- 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 +74 -205
- 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 +27 -24
- 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/CancelRequest.d.ts +1 -1
- package/lib/sdk/models/CancelRequest.js +2 -2
- package/lib/sdk/models/CodeRequest.d.ts +4 -2
- package/lib/sdk/models/CodeRequest.js +28 -0
- package/lib/sdk/models/CommerceIdRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceIdRequest.js +27 -0
- package/lib/sdk/models/CommerceIssuerIdRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceIssuerIdRequest.js +28 -0
- package/lib/sdk/models/CommerceModifyRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceModifyRequest.js +28 -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 +4 -2
- package/lib/sdk/models/CreateBankInstrumentRequest.js +29 -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 +6 -0
- package/lib/sdk/models/FixedCustomData.js +12 -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 +2 -2
- 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 +6 -2
- package/lib/sdk/models/IssuerData.js +31 -0
- package/lib/sdk/models/PaymentInstrument.d.ts +11 -11
- package/lib/sdk/models/PaymentRequest.d.ts +3 -2
- package/lib/sdk/models/PaymentRequest.js +33 -14
- package/lib/sdk/models/Reference.d.ts +4 -2
- package/lib/sdk/models/Reference.js +25 -5
- package/lib/sdk/models/Reserve.d.ts +1 -1
- package/lib/sdk/models/Reserve.js +2 -2
- package/lib/sdk/models/ReserveRequest.d.ts +1 -1
- package/lib/sdk/models/ReserveRequest.js +2 -2
- 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/TokenizationSettings.d.ts +5 -0
- package/lib/sdk/models/TokenizationSettings.js +10 -0
- package/lib/sdk/models/Transaction.d.ts +3 -3
- package/lib/sdk/models/TransactionCallback.d.ts +4 -4
- package/lib/sdk/models/TransactionCallback.js +3 -3
- package/lib/sdk/models/TransactionQuery.d.ts +4 -2
- package/lib/sdk/models/TransactionQuery.js +30 -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
|
@@ -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");
|
|
54
|
+
var utils_1 = require("../utils");
|
|
55
55
|
var client = axios_1.default.create({
|
|
56
|
-
baseURL:
|
|
56
|
+
baseURL: "https://testing.plexo.com.uy:4043/SecurePaymentGateway.svc",
|
|
57
57
|
});
|
|
58
|
-
var requestToPlexo = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var requestToPlexo = function (endpoint, request, fixedCustomData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
59
59
|
var object, stateObject, signedClientRequest, data, err_1;
|
|
60
60
|
return __generator(this, function (_a) {
|
|
61
61
|
switch (_a.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
_a.trys.push([0, 3, , 4]);
|
|
64
64
|
object = {
|
|
65
|
-
client:
|
|
65
|
+
client: fixedCustomData.plexoClientName,
|
|
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
|
-
return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
73
|
+
return [4 /*yield*/, signatureHelper_1.SignatureHelper.signRequest(stateObject, fixedCustomData.plexoCertificatePassword, fixedCustomData.plexoCertificatePath)];
|
|
74
74
|
case 1:
|
|
75
75
|
signedClientRequest = _a.sent();
|
|
76
|
-
logger_lib_1.default.debug("URL PX
|
|
77
|
-
logger_lib_1.default.debug(
|
|
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,323 @@ 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) {
|
|
95
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
-
return __generator(this, function (_a) {
|
|
97
|
-
switch (_a.label) {
|
|
98
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Add', commerce)];
|
|
99
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
94
|
PaymentGatewayClient.prototype.AddIssuerCommerceAsync = function (issuerData) {
|
|
105
|
-
|
|
106
|
-
return __generator(this, function (_a) {
|
|
107
|
-
switch (_a.label) {
|
|
108
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Add', issuerData)];
|
|
109
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
});
|
|
95
|
+
throw new Error('Method not implemented.');
|
|
113
96
|
};
|
|
114
97
|
PaymentGatewayClient.prototype.DeleteCommerceAsync = function (commerceIdRequest) {
|
|
115
|
-
|
|
116
|
-
return __generator(this, function (_a) {
|
|
117
|
-
switch (_a.label) {
|
|
118
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Delete', commerceIdRequest)];
|
|
119
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
});
|
|
98
|
+
throw new Error('Method not implemented.');
|
|
123
99
|
};
|
|
124
100
|
PaymentGatewayClient.prototype.DeleteInstrumentAsync = function (info) {
|
|
125
|
-
|
|
126
|
-
return __generator(this, function (_a) {
|
|
127
|
-
switch (_a.label) {
|
|
128
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Instruments/Delete', info)];
|
|
129
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
101
|
+
throw new Error('Method not implemented.');
|
|
133
102
|
};
|
|
134
103
|
PaymentGatewayClient.prototype.DeleteIssuerCommerceAsync = function (commerceIssuerIdRequest) {
|
|
135
|
-
|
|
136
|
-
return __generator(this, function (_a) {
|
|
137
|
-
switch (_a.label) {
|
|
138
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer/Delete', commerceIssuerIdRequest)];
|
|
139
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
104
|
+
throw new Error('Method not implemented.');
|
|
143
105
|
};
|
|
144
106
|
PaymentGatewayClient.prototype.GetCommerceIssuersAsync = function (commerceIdRequest) {
|
|
145
|
-
|
|
146
|
-
return __generator(this, function (_a) {
|
|
147
|
-
switch (_a.label) {
|
|
148
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Issuer', commerceIdRequest)];
|
|
149
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
});
|
|
107
|
+
throw new Error('Method not implemented.');
|
|
153
108
|
};
|
|
154
|
-
PaymentGatewayClient.prototype.GetCommercesAsync = function () {
|
|
155
|
-
|
|
156
|
-
return __generator(this, function (_a) {
|
|
157
|
-
switch (_a.label) {
|
|
158
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce', '')];
|
|
159
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
});
|
|
109
|
+
PaymentGatewayClient.prototype.GetCommercesAsync = function (fixedCustomData) {
|
|
110
|
+
throw new Error('Method not implemented.');
|
|
163
111
|
};
|
|
164
|
-
PaymentGatewayClient.prototype.GetSupportedIssuersAsync = function () {
|
|
165
|
-
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
switch (_a.label) {
|
|
168
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Issuer', '')];
|
|
169
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
});
|
|
112
|
+
PaymentGatewayClient.prototype.GetSupportedIssuersAsync = function (fixedCustomData) {
|
|
113
|
+
throw new Error('Method not implemented.');
|
|
173
114
|
};
|
|
174
|
-
PaymentGatewayClient.prototype.GetSupportedPaymentProcessorsAsync = function () {
|
|
175
|
-
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
switch (_a.label) {
|
|
178
|
-
case 0: return [4 /*yield*/, requestToPlexo('/PaymentProcessors', '')];
|
|
179
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
});
|
|
115
|
+
PaymentGatewayClient.prototype.GetSupportedPaymentProcessorsAsync = function (fixedCustomData) {
|
|
116
|
+
throw new Error('Method not implemented.');
|
|
183
117
|
};
|
|
184
118
|
PaymentGatewayClient.prototype.ModifyCommerceAsync = function (commerceModifyRequest) {
|
|
185
|
-
|
|
186
|
-
return __generator(this, function (_a) {
|
|
187
|
-
switch (_a.label) {
|
|
188
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Modify', commerceModifyRequest)];
|
|
189
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
});
|
|
119
|
+
throw new Error('Method not implemented.');
|
|
193
120
|
};
|
|
194
121
|
PaymentGatewayClient.prototype.GetInstrumentsAsync = function (authorizationInfo) {
|
|
195
|
-
|
|
196
|
-
return __generator(this, function (_a) {
|
|
197
|
-
switch (_a.label) {
|
|
198
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Instruments', authorizationInfo)];
|
|
199
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
});
|
|
122
|
+
throw new Error('Method not implemented.');
|
|
203
123
|
};
|
|
204
124
|
PaymentGatewayClient.prototype.SetDefaultCommerceAsync = function (commerceIdRequest) {
|
|
205
|
-
|
|
206
|
-
return __generator(this, function (_a) {
|
|
207
|
-
switch (_a.label) {
|
|
208
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/SetDefault', commerceIdRequest)];
|
|
209
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
});
|
|
125
|
+
throw new Error('Method not implemented.');
|
|
213
126
|
};
|
|
214
127
|
PaymentGatewayClient.prototype.AuthorizeAsync = function (authorization) {
|
|
215
|
-
|
|
216
|
-
return __generator(this, function (_a) {
|
|
217
|
-
switch (_a.label) {
|
|
218
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Auth', authorization)];
|
|
219
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
});
|
|
128
|
+
throw new Error('Method not implemented.');
|
|
223
129
|
};
|
|
224
130
|
PaymentGatewayClient.prototype.CancelAsync = function (cancel) {
|
|
225
|
-
|
|
226
|
-
return __generator(this, function (_a) {
|
|
227
|
-
switch (_a.label) {
|
|
228
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Cancel', cancel)];
|
|
229
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
});
|
|
131
|
+
throw new Error('Method not implemented.');
|
|
233
132
|
};
|
|
234
133
|
PaymentGatewayClient.prototype.CodeActionAsync = function (request) {
|
|
235
|
-
|
|
236
|
-
return __generator(this, function (_a) {
|
|
237
|
-
switch (_a.label) {
|
|
238
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Code', request)];
|
|
239
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
134
|
+
throw new Error('Method not implemented.');
|
|
243
135
|
};
|
|
244
136
|
PaymentGatewayClient.prototype.StartReserveAsync = function (payment) {
|
|
245
|
-
|
|
246
|
-
return __generator(this, function (_a) {
|
|
247
|
-
switch (_a.label) {
|
|
248
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/StartReserve', payment)];
|
|
249
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
137
|
+
throw new Error('Method not implemented.');
|
|
253
138
|
};
|
|
254
139
|
PaymentGatewayClient.prototype.StatusAsync = function (payment) {
|
|
255
|
-
|
|
256
|
-
return __generator(this, function (_a) {
|
|
257
|
-
switch (_a.label) {
|
|
258
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Status', payment)];
|
|
259
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
PaymentGatewayClient.prototype.ExpressCheckoutAsync = function (expressCheckout) {
|
|
265
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
266
|
-
return __generator(this, function (_a) {
|
|
267
|
-
switch (_a.label) {
|
|
268
|
-
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', expressCheckout)];
|
|
269
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
});
|
|
140
|
+
throw new Error('Method not implemented.');
|
|
273
141
|
};
|
|
274
142
|
PaymentGatewayClient.prototype.ObtainCsvTransactionsAsync = function (query) {
|
|
275
|
-
|
|
276
|
-
return __generator(this, function (_a) {
|
|
277
|
-
switch (_a.label) {
|
|
278
|
-
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', query)];
|
|
279
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
});
|
|
143
|
+
throw new Error('Method not implemented.');
|
|
283
144
|
};
|
|
284
145
|
PaymentGatewayClient.prototype.ObtainTransactionsAsync = function (query) {
|
|
285
|
-
|
|
286
|
-
return __generator(this, function (_a) {
|
|
287
|
-
switch (_a.label) {
|
|
288
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Transactions', query)];
|
|
289
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
});
|
|
146
|
+
throw new Error('Method not implemented.');
|
|
293
147
|
};
|
|
294
148
|
PaymentGatewayClient.prototype.PurchaseAsync = function (payment) {
|
|
295
|
-
|
|
296
|
-
return __generator(this, function (_a) {
|
|
297
|
-
switch (_a.label) {
|
|
298
|
-
case 0: return [4 /*yield*/, requestToPlexo('/Operation/Purchase', payment)];
|
|
299
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
});
|
|
149
|
+
throw new Error('Method not implemented.');
|
|
303
150
|
};
|
|
304
151
|
PaymentGatewayClient.prototype.CreateBankInstrumentAsync = function (request) {
|
|
152
|
+
throw new Error('Method not implemented.');
|
|
153
|
+
};
|
|
154
|
+
PaymentGatewayClient.prototype.EndReserveAsync = function (reserve) {
|
|
155
|
+
throw new Error('Method not implemented.');
|
|
156
|
+
};
|
|
157
|
+
PaymentGatewayClient.prototype.AddCommerceAsync = function (commerce, fixedCustomData) {
|
|
305
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
306
159
|
return __generator(this, function (_a) {
|
|
307
160
|
switch (_a.label) {
|
|
308
|
-
case 0: return [4 /*yield*/, requestToPlexo('/
|
|
161
|
+
case 0: return [4 /*yield*/, requestToPlexo('/Commerce/Add', commerce, fixedCustomData)];
|
|
309
162
|
case 1: return [2 /*return*/, _a.sent()];
|
|
310
163
|
}
|
|
311
164
|
});
|
|
312
165
|
});
|
|
313
166
|
};
|
|
314
|
-
|
|
167
|
+
/*async AddIssuerCommerceAsync(issuerData: IssuerData): Promise<ServerResponse<IssuerData>> {
|
|
168
|
+
return await requestToPlexo<IssuerData, ServerResponse<IssuerData>>(
|
|
169
|
+
'/Commerce/Issuer/Add',
|
|
170
|
+
issuerData,
|
|
171
|
+
issuerData.plexoClientName,
|
|
172
|
+
issuerData.plexoCertificatePassword,
|
|
173
|
+
issuerData.plexoCertificatePath,
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async DeleteCommerceAsync(
|
|
178
|
+
commerceIdRequest: CommerceIdRequest,
|
|
179
|
+
): Promise<ServerResponse<BaseServerResponse>> {
|
|
180
|
+
return await requestToPlexo<CommerceIdRequest, ServerResponse<BaseServerResponse>>(
|
|
181
|
+
'/Commerce/Delete',
|
|
182
|
+
commerceIdRequest,
|
|
183
|
+
commerceIdRequest.plexoClientName,
|
|
184
|
+
commerceIdRequest.plexoCertificatePassword,
|
|
185
|
+
commerceIdRequest.plexoCertificatePath,
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async DeleteInstrumentAsync(
|
|
190
|
+
info: DeleteInstrumentRequest,
|
|
191
|
+
): Promise<ServerResponse<BaseServerResponse>> {
|
|
192
|
+
return await requestToPlexo<DeleteInstrumentRequest, ServerResponse<BaseServerResponse>>(
|
|
193
|
+
'/Instruments/Delete',
|
|
194
|
+
info,
|
|
195
|
+
info.plexoClientName,
|
|
196
|
+
info.plexoCertificatePassword,
|
|
197
|
+
info.plexoCertificatePath,
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async DeleteIssuerCommerceAsync(
|
|
202
|
+
commerceIssuerIdRequest: CommerceIssuerIdRequest,
|
|
203
|
+
): Promise<ServerResponse<BaseServerResponse>> {
|
|
204
|
+
return await requestToPlexo<CommerceIssuerIdRequest, ServerResponse<BaseServerResponse>>(
|
|
205
|
+
'/Commerce/Issuer/Delete',
|
|
206
|
+
commerceIssuerIdRequest,
|
|
207
|
+
commerceIssuerIdRequest.plexoClientName,
|
|
208
|
+
commerceIssuerIdRequest.plexoCertificatePassword,
|
|
209
|
+
commerceIssuerIdRequest.plexoCertificatePath,
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async GetCommerceIssuersAsync(
|
|
214
|
+
commerceIdRequest: CommerceIdRequest,
|
|
215
|
+
): Promise<ServerResponse<IssuerData[]>> {
|
|
216
|
+
return await requestToPlexo<CommerceIdRequest, ServerResponse<IssuerData[]>>(
|
|
217
|
+
'/Commerce/Issuer',
|
|
218
|
+
commerceIdRequest,
|
|
219
|
+
commerceIdRequest.plexoClientName,
|
|
220
|
+
commerceIdRequest.plexoCertificatePassword,
|
|
221
|
+
commerceIdRequest.plexoCertificatePath,
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async GetCommercesAsync(fixedCustomData: FixedCustomData): Promise<ServerResponse<Commerce[]>> {
|
|
226
|
+
return await requestToPlexo<string, ServerResponse<Commerce[]>>(
|
|
227
|
+
'/Commerce',
|
|
228
|
+
'',
|
|
229
|
+
fixedCustomData.plexoClientName,
|
|
230
|
+
fixedCustomData.plexoCertificatePassword,
|
|
231
|
+
fixedCustomData.plexoCertificatePath,
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
async GetSupportedIssuersAsync(
|
|
236
|
+
fixedCustomData: FixedCustomData,
|
|
237
|
+
): Promise<ServerResponse<IssuerInfo[]>> {
|
|
238
|
+
return await requestToPlexo<string, ServerResponse<IssuerInfo[]>>(
|
|
239
|
+
'/Issuer',
|
|
240
|
+
'',
|
|
241
|
+
fixedCustomData.plexoClientName,
|
|
242
|
+
fixedCustomData.plexoCertificatePassword,
|
|
243
|
+
fixedCustomData.plexoCertificatePath,
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async GetSupportedPaymentProcessorsAsync(
|
|
248
|
+
fixedCustomData: FixedCustomData,
|
|
249
|
+
): Promise<ServerResponse<IssuerProcessor[]>> {
|
|
250
|
+
return await requestToPlexo<string, ServerResponse<IssuerProcessor[]>>(
|
|
251
|
+
'/PaymentProcessors',
|
|
252
|
+
'',
|
|
253
|
+
fixedCustomData.plexoClientName,
|
|
254
|
+
fixedCustomData.plexoCertificatePassword,
|
|
255
|
+
fixedCustomData.plexoCertificatePath,
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async ModifyCommerceAsync(
|
|
260
|
+
commerceModifyRequest: CommerceModifyRequest,
|
|
261
|
+
): Promise<ServerResponse<Commerce>> {
|
|
262
|
+
return await requestToPlexo<CommerceModifyRequest, ServerResponse<Commerce>>(
|
|
263
|
+
'/Commerce/Modify',
|
|
264
|
+
commerceModifyRequest,
|
|
265
|
+
commerceModifyRequest.plexoClientName,
|
|
266
|
+
commerceModifyRequest.plexoCertificatePassword,
|
|
267
|
+
commerceModifyRequest.plexoCertificatePath,
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async GetInstrumentsAsync(
|
|
272
|
+
authorizationInfo: AuthorizationInfo,
|
|
273
|
+
): Promise<ServerResponse<PaymentInstrument[]>> {
|
|
274
|
+
return await requestToPlexo<AuthorizationInfo, ServerResponse<PaymentInstrument[]>>(
|
|
275
|
+
'/Instruments',
|
|
276
|
+
authorizationInfo,
|
|
277
|
+
authorizationInfo.plexoClientName,
|
|
278
|
+
authorizationInfo.plexoCertificatePassword,
|
|
279
|
+
authorizationInfo.plexoCertificatePath,
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async SetDefaultCommerceAsync(commerceIdRequest: CommerceIdRequest): Promise<BaseServerResponse> {
|
|
284
|
+
return await requestToPlexo<CommerceIdRequest, BaseServerResponse>(
|
|
285
|
+
'/Commerce/SetDefault',
|
|
286
|
+
commerceIdRequest,
|
|
287
|
+
commerceIdRequest.plexoClientName,
|
|
288
|
+
commerceIdRequest.plexoCertificatePassword,
|
|
289
|
+
commerceIdRequest.plexoCertificatePath,
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async AuthorizeAsync(authorization: Authorization): Promise<ServerResponse<Session>> {
|
|
294
|
+
return await requestToPlexo<Authorization, ServerResponse<Session>>(
|
|
295
|
+
'/Auth',
|
|
296
|
+
authorization,
|
|
297
|
+
authorization.plexoClientName,
|
|
298
|
+
authorization.plexoCertificatePassword,
|
|
299
|
+
authorization.plexoCertificatePath,
|
|
300
|
+
)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
async CancelAsync(cancel: CancelRequest): Promise<ServerResponse<Transaction>> {
|
|
304
|
+
return await requestToPlexo<CancelRequest, ServerResponse<Transaction>>(
|
|
305
|
+
'/Operation/Cancel',
|
|
306
|
+
cancel,
|
|
307
|
+
cancel.plexoClientName,
|
|
308
|
+
cancel.plexoCertificatePassword,
|
|
309
|
+
cancel.plexoCertificatePath,
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
async CodeActionAsync(request: CodeRequest): Promise<ServerResponse<Transaction>> {
|
|
314
|
+
return await requestToPlexo<CodeRequest, ServerResponse<Transaction>>(
|
|
315
|
+
'/Code',
|
|
316
|
+
request,
|
|
317
|
+
request.plexoClientName,
|
|
318
|
+
request.plexoCertificatePassword,
|
|
319
|
+
request.plexoCertificatePath,
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
async StartReserveAsync(payment: ReserveRequest): Promise<ServerResponse<Transaction>> {
|
|
324
|
+
return await requestToPlexo<ReserveRequest, ServerResponse<Transaction>>(
|
|
325
|
+
'/Operation/StartReserve',
|
|
326
|
+
payment,
|
|
327
|
+
payment.plexoClientName,
|
|
328
|
+
payment.plexoCertificatePassword,
|
|
329
|
+
payment.plexoCertificatePath,
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async StatusAsync(payment: Reference): Promise<ServerResponse<Transaction>> {
|
|
334
|
+
return await requestToPlexo<Reference, ServerResponse<Transaction>>(
|
|
335
|
+
'/Operation/Status',
|
|
336
|
+
payment,
|
|
337
|
+
payment.plexoClientName,
|
|
338
|
+
payment.plexoCertificatePassword,
|
|
339
|
+
payment.plexoCertificatePath,
|
|
340
|
+
)
|
|
341
|
+
}*/
|
|
342
|
+
PaymentGatewayClient.prototype.ExpressCheckoutAsync = function (expressCheckout, fixedCustomData) {
|
|
315
343
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
344
|
return __generator(this, function (_a) {
|
|
317
345
|
switch (_a.label) {
|
|
318
|
-
case 0: return [4 /*yield*/, requestToPlexo('/
|
|
346
|
+
case 0: return [4 /*yield*/, requestToPlexo('/ExpressCheckout', expressCheckout, fixedCustomData)];
|
|
319
347
|
case 1: return [2 /*return*/, _a.sent()];
|
|
320
348
|
}
|
|
321
349
|
});
|
|
322
350
|
});
|
|
323
351
|
};
|
|
324
|
-
|
|
352
|
+
/*async ObtainCsvTransactionsAsync(query: TransactionQuery): Promise<ServerResponse<string>> {
|
|
353
|
+
return await requestToPlexo<TransactionQuery, ServerResponse<string>>(
|
|
354
|
+
'/ExpressCheckout',
|
|
355
|
+
query,
|
|
356
|
+
query.plexoClientName,
|
|
357
|
+
query.plexoCertificatePassword,
|
|
358
|
+
query.plexoCertificatePath,
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
async ObtainTransactionsAsync(
|
|
363
|
+
query: TransactionQuery,
|
|
364
|
+
): Promise<ServerResponse<TransactionCursor>> {
|
|
365
|
+
return await requestToPlexo<TransactionQuery, ServerResponse<TransactionCursor>>(
|
|
366
|
+
'/Transactions',
|
|
367
|
+
query,
|
|
368
|
+
query.plexoClientName,
|
|
369
|
+
query.plexoCertificatePassword,
|
|
370
|
+
query.plexoCertificatePath,
|
|
371
|
+
)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
async PurchaseAsync(payment: PaymentRequest): Promise<ServerResponse<Transaction>> {
|
|
375
|
+
return await requestToPlexo<PaymentRequest, ServerResponse<Transaction>>(
|
|
376
|
+
'/Operation/Purchase',
|
|
377
|
+
payment,
|
|
378
|
+
payment.plexoClientName,
|
|
379
|
+
payment.plexoCertificatePassword,
|
|
380
|
+
payment.plexoCertificatePath,
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async CreateBankInstrumentAsync(
|
|
385
|
+
request: CreateBankInstrumentRequest,
|
|
386
|
+
): Promise<ServerResponse<PaymentInstrument>> {
|
|
387
|
+
return await requestToPlexo<CreateBankInstrumentRequest, ServerResponse<PaymentInstrument>>(
|
|
388
|
+
'/Instruments/Bank',
|
|
389
|
+
request,
|
|
390
|
+
request.plexoClientName,
|
|
391
|
+
request.plexoCertificatePassword,
|
|
392
|
+
request.plexoCertificatePath,
|
|
393
|
+
)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async EndReserveAsync(reserve: Reserve): Promise<ServerResponse<Transaction>> {
|
|
397
|
+
return await requestToPlexo<Reserve, ServerResponse<Transaction>>(
|
|
398
|
+
'/Operation/EndReserve',
|
|
399
|
+
reserve,
|
|
400
|
+
reserve.plexoClientName,
|
|
401
|
+
reserve.plexoCertificatePassword,
|
|
402
|
+
reserve.plexoCertificatePath,
|
|
403
|
+
)
|
|
404
|
+
}*/
|
|
405
|
+
PaymentGatewayClient.prototype.UnwrapInstrumentCallbackAsync = function (serverSignedInstrumentCallback, plexoUrl) {
|
|
325
406
|
return __awaiter(this, void 0, void 0, function () {
|
|
326
407
|
var verify;
|
|
327
408
|
return __generator(this, function (_a) {
|
|
328
409
|
switch (_a.label) {
|
|
329
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
410
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.unwrapCallback(serverSignedInstrumentCallback.object.fingerprint, serverSignedInstrumentCallback, plexoUrl)];
|
|
330
411
|
case 1:
|
|
331
412
|
verify = _a.sent();
|
|
332
413
|
return [2 /*return*/, verify];
|
|
@@ -334,12 +415,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
334
415
|
});
|
|
335
416
|
});
|
|
336
417
|
};
|
|
337
|
-
PaymentGatewayClient.prototype.UnwrapTransactionCallbackAsync = function (serverSignedTransactionCallback) {
|
|
418
|
+
PaymentGatewayClient.prototype.UnwrapTransactionCallbackAsync = function (serverSignedTransactionCallback, plexoUrl) {
|
|
338
419
|
return __awaiter(this, void 0, void 0, function () {
|
|
339
420
|
var verify;
|
|
340
421
|
return __generator(this, function (_a) {
|
|
341
422
|
switch (_a.label) {
|
|
342
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
423
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.unwrapCallback(serverSignedTransactionCallback.object.fingerprint, serverSignedTransactionCallback, plexoUrl)];
|
|
343
424
|
case 1:
|
|
344
425
|
verify = _a.sent();
|
|
345
426
|
return [2 /*return*/, verify];
|
|
@@ -347,12 +428,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
347
428
|
});
|
|
348
429
|
});
|
|
349
430
|
};
|
|
350
|
-
PaymentGatewayClient.prototype.SignInstrumentCallback = function (serverResponse) {
|
|
431
|
+
PaymentGatewayClient.prototype.SignInstrumentCallback = function (serverResponse, plexoCertificatePath, plexoCertificatePassword) {
|
|
351
432
|
return __awaiter(this, void 0, void 0, function () {
|
|
352
433
|
var response;
|
|
353
434
|
return __generator(this, function (_a) {
|
|
354
435
|
switch (_a.label) {
|
|
355
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
436
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.signCallback(serverResponse, plexoCertificatePath, plexoCertificatePassword)];
|
|
356
437
|
case 1:
|
|
357
438
|
response = _a.sent();
|
|
358
439
|
return [2 /*return*/, response];
|
|
@@ -360,12 +441,12 @@ var PaymentGatewayClient = /** @class */ (function () {
|
|
|
360
441
|
});
|
|
361
442
|
});
|
|
362
443
|
};
|
|
363
|
-
PaymentGatewayClient.prototype.SignTransactionCallback = function (serverResponse) {
|
|
444
|
+
PaymentGatewayClient.prototype.SignTransactionCallback = function (serverResponse, plexoCertificatePath, plexoCertificatePassword) {
|
|
364
445
|
return __awaiter(this, void 0, void 0, function () {
|
|
365
446
|
var response;
|
|
366
447
|
return __generator(this, function (_a) {
|
|
367
448
|
switch (_a.label) {
|
|
368
|
-
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.
|
|
449
|
+
case 0: return [4 /*yield*/, signatureHelper_1.SignatureHelper.signCallback(serverResponse, plexoCertificatePath, plexoCertificatePassword)];
|
|
369
450
|
case 1:
|
|
370
451
|
response = _a.sent();
|
|
371
452
|
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
|
}
|