@houlak/plexo-sdk 0.1.3 → 0.1.4-h

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.
Files changed (273) hide show
  1. package/lib/handler/PlexoHandler.d.ts +17 -7
  2. package/lib/handler/PlexoHandler.js +168 -15
  3. package/lib/index.d.ts +1 -0
  4. package/lib/index.js +4 -1
  5. package/lib/lib/logger.lib.d.ts +1 -6
  6. package/lib/lib/logger.lib.js +10 -6
  7. package/lib/sdk/IPaymentGatewayClient.d.ts +2 -2
  8. package/lib/sdk/PaymentGatewayClient.d.ts +2 -2
  9. package/lib/sdk/PaymentGatewayClient.js +9 -8
  10. package/lib/sdk/PaymentGatewayMock.d.ts +2 -2
  11. package/lib/sdk/PaymentGatewayMock.js +2 -8
  12. package/lib/sdk/enums/plexo-error-enum.d.ts +1 -0
  13. package/lib/sdk/enums/plexo-error-enum.js +1 -0
  14. package/lib/sdk/helpers/signature/signatureHelper.d.ts +3 -7
  15. package/lib/sdk/helpers/signature/signatureHelper.js +65 -195
  16. package/lib/sdk/helpers/signature/signatureUtils.d.ts +10 -0
  17. package/lib/{helpers/signature/signatureHelper.js → sdk/helpers/signature/signatureUtils.js} +50 -66
  18. package/lib/sdk/helpers/signature/stringifyWithFloats.js +2 -0
  19. package/lib/sdk/models/Authorization.d.ts +4 -5
  20. package/lib/sdk/models/Authorization.js +2 -1
  21. package/lib/sdk/models/BuiltInPagesOptions.d.ts +5 -0
  22. package/lib/sdk/models/BuiltInPagesOptions.js +11 -0
  23. package/lib/sdk/models/DisplayOptions.d.ts +8 -0
  24. package/lib/sdk/models/DisplayOptions.js +14 -0
  25. package/lib/sdk/models/ExpressCheckoutSettings.d.ts +7 -0
  26. package/lib/{models/ExpressCheckoutSettingsDto.js → sdk/models/ExpressCheckoutSettings.js} +3 -1
  27. package/lib/sdk/models/FieldType.d.ts +23 -14
  28. package/lib/sdk/models/FieldType.js +23 -14
  29. package/lib/sdk/models/IndexSDK.d.ts +8 -6
  30. package/lib/sdk/models/IndexSDK.js +16 -14
  31. package/lib/sdk/models/IssuerData.d.ts +2 -0
  32. package/lib/sdk/models/TokenizationSettings.d.ts +5 -0
  33. package/lib/sdk/models/TokenizationSettings.js +10 -0
  34. package/lib/sdk/models/TransactionsCSV.d.ts +3 -0
  35. package/lib/sdk/models/{UIOptionsDto.d.ts → UIOptions.d.ts} +2 -2
  36. package/lib/{models/UIOptionsDto.js → sdk/models/UIOptions.js} +5 -5
  37. package/lib/sdk/models/WebFormSettings.d.ts +9 -0
  38. package/lib/sdk/models/WebFormSettings.js +12 -0
  39. package/lib/sdk/models/webhook/Address.d.ts +9 -0
  40. package/lib/sdk/models/webhook/Address.js +15 -0
  41. package/lib/sdk/models/webhook/CancellationInfo.d.ts +11 -0
  42. package/lib/sdk/models/webhook/CancellationInfo.js +17 -0
  43. package/lib/sdk/models/webhook/Client.d.ts +9 -0
  44. package/lib/sdk/models/webhook/Client.js +14 -0
  45. package/lib/sdk/models/webhook/Commerce.d.ts +6 -0
  46. package/lib/sdk/models/webhook/Commerce.js +12 -0
  47. package/lib/sdk/models/webhook/Currency.d.ts +8 -0
  48. package/lib/sdk/models/webhook/Currency.js +14 -0
  49. package/lib/sdk/models/webhook/Customer.d.ts +17 -0
  50. package/lib/sdk/models/webhook/Customer.js +22 -0
  51. package/lib/sdk/models/webhook/Document.d.ts +5 -0
  52. package/lib/sdk/models/webhook/Document.js +11 -0
  53. package/lib/sdk/models/webhook/Instrument.d.ts +17 -0
  54. package/lib/sdk/models/webhook/Instrument.js +21 -0
  55. package/lib/sdk/models/webhook/Issuer.d.ts +8 -0
  56. package/lib/sdk/models/webhook/Issuer.js +14 -0
  57. package/lib/sdk/models/webhook/IssuerData.d.ts +8 -0
  58. package/lib/sdk/models/webhook/IssuerData.js +13 -0
  59. package/lib/sdk/models/webhook/IssuerDto.d.ts +5 -0
  60. package/lib/sdk/models/webhook/IssuerDto.js +11 -0
  61. package/lib/sdk/models/webhook/Item.d.ts +14 -0
  62. package/lib/sdk/models/webhook/Item.js +19 -0
  63. package/lib/sdk/models/webhook/PartialRefundsInfo.d.ts +12 -0
  64. package/lib/sdk/models/webhook/PartialRefundsInfo.js +18 -0
  65. package/lib/sdk/models/webhook/PaymentFacilitator.d.ts +8 -0
  66. package/lib/sdk/models/webhook/PaymentFacilitator.js +13 -0
  67. package/lib/sdk/models/webhook/PaymentProcessor.d.ts +5 -0
  68. package/lib/{models → sdk/models/webhook}/PaymentProcessor.js +2 -2
  69. package/lib/sdk/models/webhook/PurchaseInfo.d.ts +16 -0
  70. package/lib/sdk/models/webhook/PurchaseInfo.js +22 -0
  71. package/lib/sdk/models/webhook/RefundInfo.d.ts +12 -0
  72. package/lib/sdk/models/webhook/RefundInfo.js +18 -0
  73. package/lib/sdk/models/webhook/ReserveInfo.d.ts +13 -0
  74. package/lib/sdk/models/webhook/ReserveInfo.js +19 -0
  75. package/lib/sdk/models/webhook/Shipping.d.ts +7 -0
  76. package/lib/sdk/models/webhook/Shipping.js +12 -0
  77. package/lib/sdk/models/webhook/Transaction.d.ts +31 -0
  78. package/lib/sdk/models/webhook/Transaction.js +36 -0
  79. package/lib/sdk/models/webhook/TransactionResult.d.ts +5 -0
  80. package/lib/sdk/models/webhook/TransactionResult.js +10 -0
  81. package/lib/sdk/models/webhook/index.d.ts +21 -0
  82. package/lib/sdk/models/webhook/index.js +45 -0
  83. package/lib/utils/boolean.utils.d.ts +4 -0
  84. package/lib/utils/boolean.utils.js +53 -0
  85. package/lib/utils/case.util.d.ts +4 -0
  86. package/lib/utils/case.util.js +61 -0
  87. package/lib/utils/index.d.ts +1 -0
  88. package/lib/utils/index.js +5 -0
  89. package/package.json +3 -3
  90. package/lib/IPaymentGatewayClient.d.ts +0 -31
  91. package/lib/PaymentGatewayClient.d.ts +0 -33
  92. package/lib/PaymentGatewayClient.js +0 -179
  93. package/lib/helpers/signature/signatureHelper.d.ts +0 -5
  94. package/lib/models/ActionType.d.ts +0 -9
  95. package/lib/models/ActionType.js +0 -13
  96. package/lib/models/AmountLimit.d.ts +0 -7
  97. package/lib/models/AmountLimit.js +0 -2
  98. package/lib/models/Authorization.d.ts +0 -16
  99. package/lib/models/Authorization.js +0 -32
  100. package/lib/models/AuthorizationInfo.d.ts +0 -6
  101. package/lib/models/AuthorizationInfo.js +0 -11
  102. package/lib/models/AuthorizationType.d.ts +0 -5
  103. package/lib/models/AuthorizationType.js +0 -9
  104. package/lib/models/BaseServerResponse.d.ts +0 -7
  105. package/lib/models/BaseServerResponse.js +0 -12
  106. package/lib/models/BuiltInPagesOptionsDto.d.ts +0 -4
  107. package/lib/models/BuiltInPagesOptionsDto.js +0 -9
  108. package/lib/models/CancelRequest.d.ts +0 -6
  109. package/lib/models/CancelRequest.js +0 -29
  110. package/lib/models/CardStatus.d.ts +0 -7
  111. package/lib/models/CardStatus.js +0 -11
  112. package/lib/models/CardTypes.d.ts +0 -9
  113. package/lib/models/CardTypes.js +0 -13
  114. package/lib/models/CertificateHelper.d.ts +0 -0
  115. package/lib/models/CertificateHelper.js +0 -152
  116. package/lib/models/CertificateHelperFactory.js +0 -12
  117. package/lib/models/ClientRequest.d.ts +0 -4
  118. package/lib/models/ClientRequest.js +0 -10
  119. package/lib/models/ClientResponse.d.ts +0 -6
  120. package/lib/models/ClientResponse.js +0 -29
  121. package/lib/models/ClientSignedRequest.d.ts +0 -4
  122. package/lib/models/ClientSignedRequest.js +0 -27
  123. package/lib/models/ClientSignedResponse.d.ts +0 -4
  124. package/lib/models/ClientSignedResponse.js +0 -27
  125. package/lib/models/CodeAction.d.ts +0 -10
  126. package/lib/models/CodeAction.js +0 -10
  127. package/lib/models/CodeRequest.d.ts +0 -5
  128. package/lib/models/CodeRequest.js +0 -2
  129. package/lib/models/Commerce.d.ts +0 -4
  130. package/lib/models/Commerce.js +0 -2
  131. package/lib/models/CommerceIdRequest.d.ts +0 -3
  132. package/lib/models/CommerceIdRequest.js +0 -2
  133. package/lib/models/CommerceIssuerIdRequest.d.ts +0 -4
  134. package/lib/models/CommerceIssuerIdRequest.js +0 -2
  135. package/lib/models/CommerceModifyRequest.d.ts +0 -4
  136. package/lib/models/CommerceModifyRequest.js +0 -2
  137. package/lib/models/CommerceRequest.d.ts +0 -3
  138. package/lib/models/CommerceRequest.js +0 -2
  139. package/lib/models/CreateBankInstrumentRequest.d.ts +0 -6
  140. package/lib/models/CreateBankInstrumentRequest.js +0 -2
  141. package/lib/models/Currency.d.ts +0 -6
  142. package/lib/models/Currency.js +0 -2
  143. package/lib/models/DeleteInstrumentRequest.d.ts +0 -6
  144. package/lib/models/DeleteInstrumentRequest.js +0 -29
  145. package/lib/models/DisplayOptionsDto.d.ts +0 -7
  146. package/lib/models/DisplayOptionsDto.js +0 -9
  147. package/lib/models/ExpressCheckoutRequest.d.ts +0 -6
  148. package/lib/models/ExpressCheckoutRequest.js +0 -2
  149. package/lib/models/ExpressCheckoutSettingsDto.d.ts +0 -6
  150. package/lib/models/ExtendedCredit.d.ts +0 -4
  151. package/lib/models/ExtendedCredit.js +0 -2
  152. package/lib/models/FieldInfo.d.ts +0 -6
  153. package/lib/models/FieldInfo.js +0 -2
  154. package/lib/models/FieldInfoPaymentProcessors.d.ts +0 -6
  155. package/lib/models/FieldInfoPaymentProcessors.js +0 -11
  156. package/lib/models/FieldType.d.ts +0 -76
  157. package/lib/models/FieldType.js +0 -89
  158. package/lib/models/FinancialInclusion.d.ts +0 -8
  159. package/lib/models/FinancialInclusion.js +0 -2
  160. package/lib/models/FinancialInclusionResult.d.ts +0 -6
  161. package/lib/models/FinancialInclusionResult.js +0 -2
  162. package/lib/models/GenericClientRequest.d.ts +0 -5
  163. package/lib/models/GenericClientRequest.js +0 -29
  164. package/lib/models/GenericClientSignedRequest.d.ts +0 -4
  165. package/lib/models/GenericClientSignedRequest.js +0 -27
  166. package/lib/models/GenericIssuerRequest.d.ts +0 -5
  167. package/lib/models/GenericIssuerRequest.js +0 -29
  168. package/lib/models/GenericIssuerSignedRequest.d.ts +0 -4
  169. package/lib/models/GenericIssuerSignedRequest.js +0 -27
  170. package/lib/models/GenericServerSignedResponse.d.ts +0 -4
  171. package/lib/models/GenericServerSignedResponse.js +0 -27
  172. package/lib/models/GenericSignedObject.d.ts +0 -6
  173. package/lib/models/GenericSignedObject.js +0 -11
  174. package/lib/models/GenericStateObject.d.ts +0 -5
  175. package/lib/models/GenericStateObject.js +0 -29
  176. package/lib/models/IClientCallback.d.ts +0 -3
  177. package/lib/models/IClientCallback.js +0 -2
  178. package/lib/models/IdentificationType.d.ts +0 -6
  179. package/lib/models/IdentificationType.js +0 -10
  180. package/lib/models/InclusionType.d.ts +0 -5
  181. package/lib/models/InclusionType.js +0 -9
  182. package/lib/models/IndexSDK.d.ts +0 -33
  183. package/lib/models/IndexSDK.js +0 -39
  184. package/lib/models/InfoLine.d.ts +0 -4
  185. package/lib/models/InfoLine.js +0 -2
  186. package/lib/models/InstrumentCallback.d.ts +0 -9
  187. package/lib/models/InstrumentCallback.js +0 -31
  188. package/lib/models/InstrumentWithMetadata.d.ts +0 -6
  189. package/lib/models/InstrumentWithMetadata.js +0 -11
  190. package/lib/models/IssuerData.d.ts +0 -5
  191. package/lib/models/IssuerData.js +0 -2
  192. package/lib/models/IssuerInfo.d.ts +0 -14
  193. package/lib/models/IssuerInfo.js +0 -2
  194. package/lib/models/IssuerProcessor.d.ts +0 -7
  195. package/lib/models/IssuerProcessor.js +0 -12
  196. package/lib/models/IssuerRequest.d.ts +0 -4
  197. package/lib/models/IssuerRequest.js +0 -10
  198. package/lib/models/IssuerSignedRequest.d.ts +0 -4
  199. package/lib/models/IssuerSignedRequest.js +0 -27
  200. package/lib/models/Item.d.ts +0 -8
  201. package/lib/models/Item.js +0 -2
  202. package/lib/models/PaymentInstrument.d.ts +0 -20
  203. package/lib/models/PaymentInstrument.js +0 -2
  204. package/lib/models/PaymentInstrumentInput.d.ts +0 -6
  205. package/lib/models/PaymentInstrumentInput.js +0 -2
  206. package/lib/models/PaymentProcessor.d.ts +0 -6
  207. package/lib/models/PaymentRequest.d.ts +0 -17
  208. package/lib/models/PaymentRequest.js +0 -20
  209. package/lib/models/PlexoSdkSettings.d.ts +0 -8
  210. package/lib/models/PlexoSdkSettings.js +0 -14
  211. package/lib/models/PublicKeyInfo.d.ts +0 -4
  212. package/lib/models/PublicKeyInfo.js +0 -2
  213. package/lib/models/Reference.d.ts +0 -6
  214. package/lib/models/Reference.js +0 -11
  215. package/lib/models/ReferenceType.d.ts +0 -6
  216. package/lib/models/ReferenceType.js +0 -10
  217. package/lib/models/Reserve.d.ts +0 -6
  218. package/lib/models/Reserve.js +0 -29
  219. package/lib/models/ReserveRequest.d.ts +0 -6
  220. package/lib/models/ReserveRequest.js +0 -29
  221. package/lib/models/ResultCodes.d.ts +0 -30
  222. package/lib/models/ResultCodes.js +0 -35
  223. package/lib/models/ServerResponse.d.ts +0 -6
  224. package/lib/models/ServerResponse.js +0 -29
  225. package/lib/models/ServerSignedCallback.d.ts +0 -3
  226. package/lib/models/ServerSignedCallback.js +0 -27
  227. package/lib/models/ServerSignedRequest.d.ts +0 -3
  228. package/lib/models/ServerSignedRequest.js +0 -27
  229. package/lib/models/ServerSignedResponse.d.ts +0 -4
  230. package/lib/models/ServerSignedResponse.js +0 -27
  231. package/lib/models/Session.d.ts +0 -5
  232. package/lib/models/Session.js +0 -2
  233. package/lib/models/Settings.d.ts +0 -11
  234. package/lib/models/Settings.js +0 -19
  235. package/lib/models/SignedObject.d.ts +0 -6
  236. package/lib/models/SignedObject.js +0 -11
  237. package/lib/models/StateObject.d.ts +0 -5
  238. package/lib/models/StateObject.js +0 -11
  239. package/lib/models/TimeLimit.d.ts +0 -5
  240. package/lib/models/TimeLimit.js +0 -2
  241. package/lib/models/TokenizationSettingsDto.d.ts +0 -4
  242. package/lib/models/TokenizationSettingsDto.js +0 -9
  243. package/lib/models/Transaction.d.ts +0 -26
  244. package/lib/models/Transaction.js +0 -26
  245. package/lib/models/TransactionCallback.d.ts +0 -7
  246. package/lib/models/TransactionCallback.js +0 -29
  247. package/lib/models/TransactionCursor.d.ts +0 -6
  248. package/lib/models/TransactionCursor.js +0 -2
  249. package/lib/models/TransactionInfo.d.ts +0 -12
  250. package/lib/models/TransactionInfo.js +0 -2
  251. package/lib/models/TransactionOrder.d.ts +0 -5
  252. package/lib/models/TransactionOrder.js +0 -2
  253. package/lib/models/TransactionQuery.d.ts +0 -54
  254. package/lib/models/TransactionQuery.js +0 -47
  255. package/lib/models/TransactionResult.d.ts +0 -13
  256. package/lib/models/TransactionResult.js +0 -17
  257. package/lib/models/TransactionType.d.ts +0 -5
  258. package/lib/models/TransactionType.js +0 -9
  259. package/lib/models/UIOptionsDto.d.ts +0 -7
  260. package/lib/models/WebFormSettingsDto.d.ts +0 -8
  261. package/lib/models/WebFormSettingsDto.js +0 -9
  262. package/lib/sdk/models/BuiltInPagesOptionsDto.d.ts +0 -4
  263. package/lib/sdk/models/BuiltInPagesOptionsDto.js +0 -9
  264. package/lib/sdk/models/DisplayOptionsDto.d.ts +0 -7
  265. package/lib/sdk/models/DisplayOptionsDto.js +0 -9
  266. package/lib/sdk/models/ExpressCheckoutSettingsDto.d.ts +0 -6
  267. package/lib/sdk/models/ExpressCheckoutSettingsDto.js +0 -9
  268. package/lib/sdk/models/TokenizationSettingsDto.d.ts +0 -4
  269. package/lib/sdk/models/TokenizationSettingsDto.js +0 -9
  270. package/lib/sdk/models/UIOptionsDto.js +0 -13
  271. package/lib/sdk/models/WebFormSettingsDto.d.ts +0 -8
  272. package/lib/sdk/models/WebFormSettingsDto.js +0 -9
  273. /package/lib/{IPaymentGatewayClient.js → sdk/models/TransactionsCSV.js} +0 -0
@@ -1,179 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.PaymentGatewayClient = void 0;
51
- var axios_1 = require("axios");
52
- var logger_lib_1 = require("../../lib/logger.lib");
53
- var signatureHelper_1 = require("./helpers/signature/signatureHelper");
54
- // TODO: Add plexoURL to envs
55
- var client = axios_1.default.create({
56
- baseURL: 'https://testing.plexo.com.uy:4043/SecurePaymentGateway.svc',
57
- });
58
- var PaymentGatewayClient = /** @class */ (function () {
59
- function PaymentGatewayClient() {
60
- this.baseUrl = process.env.BASE_PLEXO_URL;
61
- }
62
- PaymentGatewayClient.prototype.AddCommerceAsync = function (commerce) {
63
- return __awaiter(this, void 0, void 0, function () {
64
- return __generator(this, function (_a) {
65
- throw new Error('Method not implemented.');
66
- });
67
- });
68
- };
69
- PaymentGatewayClient.prototype.AddIssuerCommerceAsync = function (issuerData) {
70
- throw new Error('Method not implemented.');
71
- };
72
- PaymentGatewayClient.prototype.DeleteCommerceAsync = function (commerceIdRequest) {
73
- throw new Error('Method not implemented.');
74
- };
75
- PaymentGatewayClient.prototype.DeleteInstrumentAsync = function (info) {
76
- throw new Error('Method not implemented.');
77
- };
78
- PaymentGatewayClient.prototype.DeleteIssuerCommerceAsync = function (commerceIssuerIdRequest) {
79
- throw new Error('Method not implemented.');
80
- };
81
- PaymentGatewayClient.prototype.GetCommerceIssuersAsync = function (commerceIdRequest) {
82
- throw new Error('Method not implemented.');
83
- };
84
- PaymentGatewayClient.prototype.GetCommercesAsync = function () {
85
- throw new Error('Method not implemented.');
86
- };
87
- PaymentGatewayClient.prototype.GetSupportedIssuersAsync = function () {
88
- throw new Error('Method not implemented.');
89
- };
90
- PaymentGatewayClient.prototype.GetSupportedPaymentProcessorsAsync = function () {
91
- throw new Error('Method not implemented.');
92
- };
93
- PaymentGatewayClient.prototype.ModifyCommerceAsync = function (commerceModifyRequest) {
94
- throw new Error('Method not implemented.');
95
- };
96
- PaymentGatewayClient.prototype.GetInstrumentsAsync = function (authorizationInfo) {
97
- throw new Error('Method not implemented.');
98
- };
99
- PaymentGatewayClient.prototype.SetDefaultCommerceAsync = function (commerceIdRequest) {
100
- throw new Error('Method not implemented.');
101
- };
102
- PaymentGatewayClient.prototype.AuthorizeAsync = function (authorization) {
103
- return __awaiter(this, void 0, void 0, function () {
104
- var clientRequest, stateObject, signedClientRequest, data, err_1;
105
- return __generator(this, function (_a) {
106
- switch (_a.label) {
107
- case 0:
108
- _a.trys.push([0, 3, , 4]);
109
- clientRequest = {
110
- client: 'Houlak',
111
- request: authorization,
112
- };
113
- stateObject = {
114
- fingerprint: '',
115
- utcUnixTimeExpiration: Date.parse(new Date().toString()),
116
- object: clientRequest,
117
- };
118
- logger_lib_1.default.debug({ stateObject: stateObject });
119
- return [4 /*yield*/, signatureHelper_1.SignatureHelper.getCertificateAssets(stateObject)];
120
- case 1:
121
- signedClientRequest = _a.sent();
122
- logger_lib_1.default.debug({ signedClientRequest: signedClientRequest }, 'AuthorizeAsync');
123
- return [4 /*yield*/, client.post('/Auth', __assign({}, signedClientRequest))];
124
- case 2:
125
- data = (_a.sent()).data;
126
- return [2 /*return*/, data];
127
- case 3:
128
- err_1 = _a.sent();
129
- throw err_1;
130
- case 4: return [2 /*return*/];
131
- }
132
- });
133
- });
134
- };
135
- PaymentGatewayClient.prototype.CancelAsync = function (cancel) {
136
- throw new Error('Method not implemented.');
137
- };
138
- PaymentGatewayClient.prototype.CodeActionAsync = function (request) {
139
- throw new Error('Method not implemented.');
140
- };
141
- PaymentGatewayClient.prototype.StartReserveAsync = function (payment) {
142
- throw new Error('Method not implemented.');
143
- };
144
- PaymentGatewayClient.prototype.StatusAsync = function (payment) {
145
- throw new Error('Method not implemented.');
146
- };
147
- PaymentGatewayClient.prototype.ExpressCheckoutAsync = function (expressCheckout) {
148
- throw new Error('Method not implemented.');
149
- };
150
- PaymentGatewayClient.prototype.ObtainCsvTransactionsAsync = function (query) {
151
- throw new Error('Method not implemented.');
152
- };
153
- PaymentGatewayClient.prototype.ObtainTransactionsAsync = function (query) {
154
- throw new Error('Method not implemented.');
155
- };
156
- PaymentGatewayClient.prototype.PurchaseAsync = function (payment) {
157
- throw new Error('Method not implemented.');
158
- };
159
- PaymentGatewayClient.prototype.CreateBankInstrumentAsync = function (request) {
160
- throw new Error('Method not implemented.');
161
- };
162
- PaymentGatewayClient.prototype.EndReserveAsync = function (reserve) {
163
- throw new Error('Method not implemented.');
164
- };
165
- PaymentGatewayClient.prototype.UnwrapInstrumentCallbackAsync = function (serverSignedInstrumentCallback) {
166
- throw new Error('Method not implemented.');
167
- };
168
- PaymentGatewayClient.prototype.UnwrapTransactionCallbackAsync = function (serverSignedTransactionCallback) {
169
- throw new Error('Method not implemented.');
170
- };
171
- PaymentGatewayClient.prototype.SignInstrumentCallback = function (serverResponse) {
172
- throw new Error('Method not implemented.');
173
- };
174
- PaymentGatewayClient.prototype.SignTransactionCallback = function (serverResponse) {
175
- throw new Error('Method not implemented.');
176
- };
177
- return PaymentGatewayClient;
178
- }());
179
- exports.PaymentGatewayClient = PaymentGatewayClient;
@@ -1,5 +0,0 @@
1
- import { GenericSignedObject, GenericStateObject } from '../..';
2
- export declare const canonizeJson: <T>(object: T) => T;
3
- export declare const SignatureHelper: {
4
- getCertificateAssets: <T extends object>(objectToSign: GenericStateObject<T>) => Promise<GenericSignedObject<T>>;
5
- };
@@ -1,9 +0,0 @@
1
- export declare enum ActionType {
2
- SelectInstrument = 1,
3
- RegisterInstrument = 2,
4
- DeleteInstrument = 4,
5
- SessionExtendAmount = 8,
6
- ClientExtendAmount = 16,
7
- AskForTemporaryItems = 32,
8
- ExpressCheckout = 64
9
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionType = void 0;
4
- var ActionType;
5
- (function (ActionType) {
6
- ActionType[ActionType["SelectInstrument"] = 1] = "SelectInstrument";
7
- ActionType[ActionType["RegisterInstrument"] = 2] = "RegisterInstrument";
8
- ActionType[ActionType["DeleteInstrument"] = 4] = "DeleteInstrument";
9
- ActionType[ActionType["SessionExtendAmount"] = 8] = "SessionExtendAmount";
10
- ActionType[ActionType["ClientExtendAmount"] = 16] = "ClientExtendAmount";
11
- ActionType[ActionType["AskForTemporaryItems"] = 32] = "AskForTemporaryItems";
12
- ActionType[ActionType["ExpressCheckout"] = 64] = "ExpressCheckout";
13
- })(ActionType = exports.ActionType || (exports.ActionType = {}));
@@ -1,7 +0,0 @@
1
- import { Currency } from './Currency';
2
- export declare type AmountLimit = {
3
- amount: number;
4
- extendedAmount: number;
5
- currency: Currency;
6
- supportsExtendedLimit: boolean;
7
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +0,0 @@
1
- import { ESMap } from 'typescript';
2
- import { AuthorizationType } from '..';
3
- import { ActionType } from './ActionType';
4
- import { AuthorizationInfo } from './AuthorizationInfo';
5
- export declare class Authorization extends AuthorizationInfo {
6
- action: ActionType;
7
- redirectUri: string;
8
- limitIssuers: string[];
9
- optionalCommerceId: number;
10
- doNotUseCallback?: boolean;
11
- clientInformation?: any;
12
- optionalMetadata?: string;
13
- promotionInfoIssuers?: ESMap<string, string>;
14
- extendableInstrumentToken?: string;
15
- constructor(action: ActionType, redirectUri: string, limitIssuers: string[], optionalCommerceId: number, type: AuthorizationType, metaReference: string);
16
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Authorization = void 0;
19
- var AuthorizationInfo_1 = require("./AuthorizationInfo");
20
- var Authorization = /** @class */ (function (_super) {
21
- __extends(Authorization, _super);
22
- function Authorization(action, redirectUri, limitIssuers, optionalCommerceId, type, metaReference) {
23
- var _this = _super.call(this, type, metaReference) || this;
24
- _this.action = action;
25
- _this.redirectUri = redirectUri;
26
- _this.limitIssuers = limitIssuers;
27
- _this.optionalCommerceId = optionalCommerceId;
28
- return _this;
29
- }
30
- return Authorization;
31
- }(AuthorizationInfo_1.AuthorizationInfo));
32
- exports.Authorization = Authorization;
@@ -1,6 +0,0 @@
1
- import { AuthorizationType } from './AuthorizationType';
2
- export declare class AuthorizationInfo {
3
- type: AuthorizationType;
4
- metaReference: string;
5
- constructor(type: AuthorizationType, metaReference: string);
6
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthorizationInfo = void 0;
4
- var AuthorizationInfo = /** @class */ (function () {
5
- function AuthorizationInfo(type, metaReference) {
6
- this.type = type;
7
- this.metaReference = metaReference;
8
- }
9
- return AuthorizationInfo;
10
- }());
11
- exports.AuthorizationInfo = AuthorizationInfo;
@@ -1,5 +0,0 @@
1
- export declare enum AuthorizationType {
2
- ClientReference = 0,
3
- Oauth = 1,
4
- Anonymous = 2
5
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthorizationType = void 0;
4
- var AuthorizationType;
5
- (function (AuthorizationType) {
6
- AuthorizationType[AuthorizationType["ClientReference"] = 0] = "ClientReference";
7
- AuthorizationType[AuthorizationType["Oauth"] = 1] = "Oauth";
8
- AuthorizationType[AuthorizationType["Anonymous"] = 2] = "Anonymous";
9
- })(AuthorizationType = exports.AuthorizationType || (exports.AuthorizationType = {}));
@@ -1,7 +0,0 @@
1
- import { ResultCodes } from './ResultCodes';
2
- export declare class BaseServerResponse {
3
- resultCode: ResultCodes;
4
- errorMessage?: string;
5
- i18ErrorMessages?: any;
6
- constructor(resultCode: ResultCodes, errorMessage?: string, i18ErrorMessages?: any);
7
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseServerResponse = void 0;
4
- var BaseServerResponse = /** @class */ (function () {
5
- function BaseServerResponse(resultCode, errorMessage, i18ErrorMessages) {
6
- this.resultCode = resultCode;
7
- this.errorMessage = errorMessage;
8
- this.i18ErrorMessages = i18ErrorMessages;
9
- }
10
- return BaseServerResponse;
11
- }());
12
- exports.BaseServerResponse = BaseServerResponse;
@@ -1,4 +0,0 @@
1
- export declare class BuiltInPagesOptionsDto {
2
- checkoutSuccessPage?: boolean;
3
- checkoutErrorPage?: boolean;
4
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuiltInPagesOptionsDto = void 0;
4
- var BuiltInPagesOptionsDto = /** @class */ (function () {
5
- function BuiltInPagesOptionsDto() {
6
- }
7
- return BuiltInPagesOptionsDto;
8
- }());
9
- exports.BuiltInPagesOptionsDto = BuiltInPagesOptionsDto;
@@ -1,6 +0,0 @@
1
- import { ReferenceType } from '..';
2
- import { Reference } from './Reference';
3
- export declare class CancelRequest extends Reference {
4
- clientReferenceId: string;
5
- constructor(clientReferenceId: string, type: ReferenceType, metaReference: string);
6
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.CancelRequest = void 0;
19
- var Reference_1 = require("./Reference");
20
- var CancelRequest = /** @class */ (function (_super) {
21
- __extends(CancelRequest, _super);
22
- function CancelRequest(clientReferenceId, type, metaReference) {
23
- var _this = _super.call(this, type, metaReference) || this;
24
- _this.clientReferenceId = clientReferenceId;
25
- return _this;
26
- }
27
- return CancelRequest;
28
- }(Reference_1.Reference));
29
- exports.CancelRequest = CancelRequest;
@@ -1,7 +0,0 @@
1
- export declare enum CardStatus {
2
- Ok = 0,
3
- WarningExpirationInLessThanOneMonth = 1,
4
- Expired = 2,
5
- Disabled = 3,
6
- WaitingForConfirmation = 4
7
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CardStatus = void 0;
4
- var CardStatus;
5
- (function (CardStatus) {
6
- CardStatus[CardStatus["Ok"] = 0] = "Ok";
7
- CardStatus[CardStatus["WarningExpirationInLessThanOneMonth"] = 1] = "WarningExpirationInLessThanOneMonth";
8
- CardStatus[CardStatus["Expired"] = 2] = "Expired";
9
- CardStatus[CardStatus["Disabled"] = 3] = "Disabled";
10
- CardStatus[CardStatus["WaitingForConfirmation"] = 4] = "WaitingForConfirmation";
11
- })(CardStatus = exports.CardStatus || (exports.CardStatus = {}));
@@ -1,9 +0,0 @@
1
- export declare enum CardTypes {
2
- UruguayDebit = 1,
3
- UruguayCredit = 2,
4
- UruguayPrepaid = 5,
5
- Debit = 3,
6
- Credit = 4,
7
- Prepaid = 6,
8
- Unknown = 0
9
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CardTypes = void 0;
4
- var CardTypes;
5
- (function (CardTypes) {
6
- CardTypes[CardTypes["UruguayDebit"] = 1] = "UruguayDebit";
7
- CardTypes[CardTypes["UruguayCredit"] = 2] = "UruguayCredit";
8
- CardTypes[CardTypes["UruguayPrepaid"] = 5] = "UruguayPrepaid";
9
- CardTypes[CardTypes["Debit"] = 3] = "Debit";
10
- CardTypes[CardTypes["Credit"] = 4] = "Credit";
11
- CardTypes[CardTypes["Prepaid"] = 6] = "Prepaid";
12
- CardTypes[CardTypes["Unknown"] = 0] = "Unknown";
13
- })(CardTypes = exports.CardTypes || (exports.CardTypes = {}));
File without changes
@@ -1,152 +0,0 @@
1
- "use strict";
2
- /*export class CertificateHelper
3
- {
4
- internal Dictionary<string, SignatureHelper> _verifyKeys = new Dictionary<string,
5
- SignatureHelper>();
6
- internal SemaphoreSlim _serverCertSemaphore = new SemaphoreSlim(1);
7
-
8
- public CertificateHelper()
9
- {
10
- if (string.IsNullOrWhiteSpace(Settings.ClientName))
11
- {
12
- throw new ConfigurationException(("en", "Invalid Client line in configuration"),
13
- ("es", "La Linea del cliente en la configuracion es invalida"));
14
- }
15
-
16
- if (string.IsNullOrWhiteSpace(Settings.CertificateName))
17
- {
18
- throw new ConfigurationException(("en", "Invalid certificate name in conf
19
- iguration"),
20
- ("es", "La Linea del nombre del certificado cliente en la configura
21
- cion es invalida"));
22
- }
23
-
24
- var x509Certificate = SearchCertificate(Settings.CertificateName, Settings.Certi
25
- ficatePassword, Settings.CertificatePath);
26
- if (x509Certificate == null)
27
- {
28
- throw new CertificateException(
29
- ("en",
30
- $"Unable to find Certificate '{Settings.CertificateName.Trim()}' i
31
- n the X509 Store, please make sure that the user using this context has sec
32
- urity access to the certificate"),
33
- ("es",
34
- $"No puedo encontar el certificado '{Settings.CertificateName.Trim()
35
- }' el el Store de Certficado, asegurese que
36
- el certificado este instalado, y que el
37
- usuario que corrar el
38
- contexto de la aplicacion tenga permisos para acceder a este"));
39
- }
40
-
41
- ClientSignKeys.Add(Settings.Clien
42
- tName.Trim(), new SignatureHelper(x509Certificate, true));
43
- }
44
-
45
- private Dictionary<string, SignatureHelper> ClientSignKeys { get; } =
46
- new Dictionary<string, SignatureHelper>();
47
-
48
- public T SignClient<T, TS>(string clientname, TS obj) where T : SignedObject<TS>, new()
49
- {
50
- if (ClientSignKeys.ContainsKey(clientname))
51
- {
52
- return ClientSignKeys[clientname].Sign<T, TS>(obj);
53
- }
54
-
55
- throw new CertificateException(("en", $"Unable to find certi
56
- ficate for client '{clientname}'"),
57
- ("es", $"No puedo encontrar certificado para el cliente '{clientname}'"));
58
- }
59
-
60
- private static byte[] ReadStream(Stream input)
61
- {
62
- byte[] buffer = new byte[16 * 1024];
63
- using (MemoryStream ms = new MemoryStream())
64
- {
65
- int read;
66
- while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
67
- {
68
- ms.Write(buffer, 0, read);
69
- }
70
- return ms.ToArray();
71
- }
72
- }
73
-
74
- private X509Certificate2 SearchCertificate(string certname, string password, string path)
75
- {
76
- StoreName[] stores;
77
- X509Certificate2 localCertificate = null;
78
-
79
- // Get the certificate from the operative system key store
80
- if (PlatformHelper.IsWindows())
81
- {
82
- stores = new StoreName[]
83
- {
84
- StoreName.My, StoreName.TrustedPublisher, StoreName.Tru
85
- stedPeople, StoreName.Root,
86
- StoreName.CertificateAuthority, StoreName.AuthRoot, StoreName.AddressBook
87
- };
88
- }
89
- else if (PlatformHelper.IsLinux())
90
- {
91
- stores = new StoreName[]
92
- {
93
- StoreName.Root,
94
- StoreName.CertificateAuthority
95
- };
96
- }
97
- else
98
- {
99
- throw new PlatformNotSupportedException();
100
- }
101
-
102
- StoreLocation[] locations = { StoreLocation.CurrentU
103
- ser, StoreLocation.LocalMachine };
104
-
105
- foreach (var location in locations)
106
- {
107
- foreach (var s in stores)
108
- {
109
- var store = new X509Store(s, location);
110
- store.Open(OpenFlags.ReadOnly);
111
- foreach (var m in store.Certificates)
112
- {
113
- if (m.Subject.IndexOf("CN=" + certname, 0, StringC
114
- omparison.InvariantCultureIgnoreCase) >= 0 ||
115
- m.Issuer.IndexOf("CN=" + certname, 0, StringComparis
116
- on.InvariantCultureIgnoreCase) >= 0)
117
- {
118
- store.Close();
119
- localCertificate = m;
120
- }
121
- }
122
-
123
- store.Close();
124
- }
125
- }
126
-
127
- // As fallback use application's filesystem private key
128
- if (localCertificate == null)
129
- {
130
- if (string.IsNullOrEmpty(path))
131
- {
132
- throw new ConfigurationException(("en", "A path mu
133
- st be set if certificate is not installed on the system"),
134
- ("es", "Se debe establecer una ruta si el certif
135
- icado no está instalado en el sistema"));
136
- }
137
-
138
- var pathToCertificate = Path.GetFullPath(Path.Combine(path, $"{certname}.pfx"));
139
-
140
- using (var stream = File.Open(pathToCertificate, FileMode.Open))
141
- {
142
- var certificatePassword = password;
143
-
144
- var cert = new X509Certificate2(ReadStre
145
- am(stream), certificatePassword, X509KeyStorageFlags.MachineKeySet);
146
- bool result = cert.Verify();
147
- return cert;
148
- }
149
- }
150
- return localCertificate;
151
- }
152
- }*/
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CertificateHelperFactory = void 0;
4
- var CertificateHelperFactory = /** @class */ (function () {
5
- function CertificateHelperFactory() {
6
- }
7
- CertificateHelperFactory.Instance = CertificateHelperFactory._instance
8
- ? CertificateHelperFactory._instance
9
- : new CertificateHelper();
10
- return CertificateHelperFactory;
11
- }());
12
- exports.CertificateHelperFactory = CertificateHelperFactory;
@@ -1,4 +0,0 @@
1
- export declare class ClientRequest {
2
- client: string;
3
- constructor(client: string);
4
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientRequest = void 0;
4
- var ClientRequest = /** @class */ (function () {
5
- function ClientRequest(client) {
6
- this.client = client;
7
- }
8
- return ClientRequest;
9
- }());
10
- exports.ClientRequest = ClientRequest;
@@ -1,6 +0,0 @@
1
- import { ResultCodes } from '..';
2
- import { BaseServerResponse } from './BaseServerResponse';
3
- export declare class ClientResponse extends BaseServerResponse {
4
- client: string;
5
- constructor(client: string, resultCode: ResultCodes);
6
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ClientResponse = void 0;
19
- var BaseServerResponse_1 = require("./BaseServerResponse");
20
- var ClientResponse = /** @class */ (function (_super) {
21
- __extends(ClientResponse, _super);
22
- function ClientResponse(client, resultCode) {
23
- var _this = _super.call(this, resultCode) || this;
24
- _this.client = client;
25
- return _this;
26
- }
27
- return ClientResponse;
28
- }(BaseServerResponse_1.BaseServerResponse));
29
- exports.ClientResponse = ClientResponse;