@houlak/plexo-sdk 0.1.0 → 0.1.1-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.
Files changed (139) hide show
  1. package/lib/handler/PlexoHandler.d.ts +21 -10
  2. package/lib/handler/PlexoHandler.js +179 -29
  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/models/Authorization.d.ts +2 -0
  8. package/lib/models/BuiltInPagesOptionsDto.d.ts +4 -0
  9. package/lib/models/BuiltInPagesOptionsDto.js +9 -0
  10. package/lib/models/DisplayOptionsDto.d.ts +7 -0
  11. package/lib/models/DisplayOptionsDto.js +9 -0
  12. package/lib/models/ExpressCheckoutSettingsDto.d.ts +6 -0
  13. package/lib/models/ExpressCheckoutSettingsDto.js +9 -0
  14. package/lib/models/IssuerProcessor.d.ts +4 -4
  15. package/lib/models/IssuerProcessor.js +4 -4
  16. package/lib/models/TokenizationSettingsDto.d.ts +4 -0
  17. package/lib/models/TokenizationSettingsDto.js +9 -0
  18. package/lib/models/UIOptionsDto.d.ts +7 -0
  19. package/lib/models/UIOptionsDto.js +13 -0
  20. package/lib/models/WebFormSettingsDto.d.ts +8 -0
  21. package/lib/models/WebFormSettingsDto.js +9 -0
  22. package/lib/sdk/IPaymentGatewayClient.d.ts +8 -7
  23. package/lib/sdk/PaymentGatewayClient.d.ts +8 -7
  24. package/lib/sdk/PaymentGatewayClient.js +45 -45
  25. package/lib/sdk/PaymentGatewayMock.d.ts +2 -2
  26. package/lib/sdk/PaymentGatewayMock.js +2 -8
  27. package/lib/sdk/enums/plexo-error-enum.d.ts +1 -0
  28. package/lib/sdk/enums/plexo-error-enum.js +1 -0
  29. package/lib/sdk/helpers/signature/signatureHelper.d.ts +3 -7
  30. package/lib/sdk/helpers/signature/signatureHelper.js +71 -201
  31. package/lib/sdk/helpers/signature/signatureUtils.d.ts +10 -0
  32. package/lib/sdk/helpers/signature/signatureUtils.js +155 -0
  33. package/lib/sdk/helpers/signature/stringifyWithFloats.js +2 -0
  34. package/lib/sdk/mocks/mocks.js +2 -0
  35. package/lib/sdk/models/Authorization.d.ts +4 -5
  36. package/lib/sdk/models/Authorization.js +3 -2
  37. package/lib/sdk/models/AuthorizationInfo.d.ts +3 -2
  38. package/lib/sdk/models/AuthorizationInfo.js +24 -5
  39. package/lib/sdk/models/BuiltInPagesOptions.d.ts +5 -0
  40. package/lib/sdk/models/BuiltInPagesOptions.js +11 -0
  41. package/lib/sdk/models/CancelRequest.d.ts +1 -1
  42. package/lib/sdk/models/CancelRequest.js +2 -2
  43. package/lib/sdk/models/CodeRequest.d.ts +4 -2
  44. package/lib/sdk/models/CodeRequest.js +28 -0
  45. package/lib/sdk/models/CommerceIdRequest.d.ts +4 -2
  46. package/lib/sdk/models/CommerceIdRequest.js +27 -0
  47. package/lib/sdk/models/CommerceIssuerIdRequest.d.ts +4 -2
  48. package/lib/sdk/models/CommerceIssuerIdRequest.js +28 -0
  49. package/lib/sdk/models/CommerceModifyRequest.d.ts +4 -2
  50. package/lib/sdk/models/CommerceModifyRequest.js +28 -0
  51. package/lib/sdk/models/CommerceRequest.d.ts +4 -2
  52. package/lib/sdk/models/CommerceRequest.js +27 -0
  53. package/lib/sdk/models/CreateBankInstrumentRequest.d.ts +4 -2
  54. package/lib/sdk/models/CreateBankInstrumentRequest.js +29 -0
  55. package/lib/sdk/models/DeleteInstrumentRequest.d.ts +1 -1
  56. package/lib/sdk/models/DeleteInstrumentRequest.js +2 -2
  57. package/lib/sdk/models/DisplayOptions.d.ts +8 -0
  58. package/lib/sdk/models/DisplayOptions.js +14 -0
  59. package/lib/sdk/models/ExpressCheckoutSettings.d.ts +7 -0
  60. package/lib/sdk/models/ExpressCheckoutSettings.js +11 -0
  61. package/lib/sdk/models/FieldType.d.ts +6 -0
  62. package/lib/sdk/models/FieldType.js +6 -0
  63. package/lib/sdk/models/FixedCustomData.d.ts +5 -0
  64. package/lib/sdk/models/FixedCustomData.js +11 -0
  65. package/lib/sdk/models/IndexSDK.d.ts +8 -6
  66. package/lib/sdk/models/IndexSDK.js +32 -14
  67. package/lib/sdk/models/IssuerData.d.ts +6 -2
  68. package/lib/sdk/models/IssuerData.js +31 -0
  69. package/lib/sdk/models/PaymentRequest.d.ts +3 -2
  70. package/lib/sdk/models/PaymentRequest.js +33 -14
  71. package/lib/sdk/models/Reference.d.ts +4 -2
  72. package/lib/sdk/models/Reference.js +25 -5
  73. package/lib/sdk/models/Reserve.d.ts +1 -1
  74. package/lib/sdk/models/Reserve.js +2 -2
  75. package/lib/sdk/models/ReserveRequest.d.ts +1 -1
  76. package/lib/sdk/models/ReserveRequest.js +2 -2
  77. package/lib/sdk/models/TokenizationSettings.d.ts +5 -0
  78. package/lib/sdk/models/TokenizationSettings.js +10 -0
  79. package/lib/sdk/models/TransactionQuery.d.ts +4 -2
  80. package/lib/sdk/models/TransactionQuery.js +30 -1
  81. package/lib/sdk/models/TransactionsCSV.d.ts +3 -0
  82. package/lib/sdk/models/TransactionsCSV.js +2 -0
  83. package/lib/sdk/models/UIOptions.d.ts +8 -0
  84. package/lib/sdk/models/UIOptions.js +13 -0
  85. package/lib/sdk/models/WebFormSettings.d.ts +9 -0
  86. package/lib/sdk/models/WebFormSettings.js +12 -0
  87. package/lib/sdk/models/webhook/Address.d.ts +9 -0
  88. package/lib/sdk/models/webhook/Address.js +15 -0
  89. package/lib/sdk/models/webhook/CancellationInfo.d.ts +11 -0
  90. package/lib/sdk/models/webhook/CancellationInfo.js +17 -0
  91. package/lib/sdk/models/webhook/Client.d.ts +9 -0
  92. package/lib/sdk/models/webhook/Client.js +14 -0
  93. package/lib/sdk/models/webhook/Commerce.d.ts +6 -0
  94. package/lib/sdk/models/webhook/Commerce.js +12 -0
  95. package/lib/sdk/models/webhook/Currency.d.ts +8 -0
  96. package/lib/sdk/models/webhook/Currency.js +14 -0
  97. package/lib/sdk/models/webhook/Customer.d.ts +17 -0
  98. package/lib/sdk/models/webhook/Customer.js +22 -0
  99. package/lib/sdk/models/webhook/Document.d.ts +5 -0
  100. package/lib/sdk/models/webhook/Document.js +11 -0
  101. package/lib/sdk/models/webhook/IndexWebhook.d.ts +21 -0
  102. package/lib/sdk/models/webhook/IndexWebhook.js +45 -0
  103. package/lib/sdk/models/webhook/Instrument.d.ts +17 -0
  104. package/lib/sdk/models/webhook/Instrument.js +21 -0
  105. package/lib/sdk/models/webhook/Issuer.d.ts +8 -0
  106. package/lib/sdk/models/webhook/Issuer.js +14 -0
  107. package/lib/sdk/models/webhook/IssuerData.d.ts +8 -0
  108. package/lib/sdk/models/webhook/IssuerData.js +13 -0
  109. package/lib/sdk/models/webhook/IssuerDto.d.ts +5 -0
  110. package/lib/sdk/models/webhook/IssuerDto.js +11 -0
  111. package/lib/sdk/models/webhook/Item.d.ts +14 -0
  112. package/lib/sdk/models/webhook/Item.js +19 -0
  113. package/lib/sdk/models/webhook/PartialRefundsInfo.d.ts +12 -0
  114. package/lib/sdk/models/webhook/PartialRefundsInfo.js +18 -0
  115. package/lib/sdk/models/webhook/PaymentFacilitator.d.ts +8 -0
  116. package/lib/sdk/models/webhook/PaymentFacilitator.js +13 -0
  117. package/lib/sdk/models/webhook/PaymentProcessor.d.ts +5 -0
  118. package/lib/sdk/models/webhook/PaymentProcessor.js +11 -0
  119. package/lib/sdk/models/webhook/PurchaseInfo.d.ts +16 -0
  120. package/lib/sdk/models/webhook/PurchaseInfo.js +22 -0
  121. package/lib/sdk/models/webhook/RefundInfo.d.ts +12 -0
  122. package/lib/sdk/models/webhook/RefundInfo.js +18 -0
  123. package/lib/sdk/models/webhook/ReserveInfo.d.ts +13 -0
  124. package/lib/sdk/models/webhook/ReserveInfo.js +19 -0
  125. package/lib/sdk/models/webhook/Shipping.d.ts +7 -0
  126. package/lib/sdk/models/webhook/Shipping.js +12 -0
  127. package/lib/sdk/models/webhook/Transaction.d.ts +31 -0
  128. package/lib/sdk/models/webhook/Transaction.js +36 -0
  129. package/lib/sdk/models/webhook/TransactionResult.d.ts +5 -0
  130. package/lib/sdk/models/webhook/TransactionResult.js +10 -0
  131. package/lib/sdk/models/webhook/index.d.ts +21 -0
  132. package/lib/sdk/models/webhook/index.js +45 -0
  133. package/lib/utils/boolean.utils.d.ts +4 -0
  134. package/lib/utils/boolean.utils.js +53 -0
  135. package/lib/utils/case.util.d.ts +4 -0
  136. package/lib/utils/case.util.js +61 -0
  137. package/lib/utils/index.d.ts +1 -0
  138. package/lib/utils/index.js +5 -0
  139. package/package.json +3 -3
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartialRefundsInfo = void 0;
4
+ var PartialRefundsInfo = /** @class */ (function () {
5
+ function PartialRefundsInfo(amount, status, externalId, transactionCode, resultText, executionDate, authorization, metadata, ticket) {
6
+ this.amount = amount;
7
+ this.status = status;
8
+ this.externalId = externalId;
9
+ this.transactionCode = transactionCode;
10
+ this.resultText = resultText;
11
+ this.executionDate = executionDate;
12
+ this.authorization = authorization;
13
+ this.metadata = metadata;
14
+ this.ticket = ticket;
15
+ }
16
+ return PartialRefundsInfo;
17
+ }());
18
+ exports.PartialRefundsInfo = PartialRefundsInfo;
@@ -0,0 +1,8 @@
1
+ import { Client } from '.';
2
+ export declare class PaymentFacilitator {
3
+ id: number;
4
+ name: string;
5
+ clientId: number;
6
+ client: Client;
7
+ constructor(id: number, name: string, clientId: number, client: Client);
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentFacilitator = void 0;
4
+ var PaymentFacilitator = /** @class */ (function () {
5
+ function PaymentFacilitator(id, name, clientId, client) {
6
+ this.id = id;
7
+ this.name = name;
8
+ this.clientId = clientId;
9
+ this.client = client;
10
+ }
11
+ return PaymentFacilitator;
12
+ }());
13
+ exports.PaymentFacilitator = PaymentFacilitator;
@@ -0,0 +1,5 @@
1
+ export declare class PaymentProcessor {
2
+ id?: number;
3
+ acquirer: string;
4
+ constructor(id: number, acquirer: string);
5
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentProcessor = void 0;
4
+ var PaymentProcessor = /** @class */ (function () {
5
+ function PaymentProcessor(id, acquirer) {
6
+ this.id = id;
7
+ this.acquirer = acquirer;
8
+ }
9
+ return PaymentProcessor;
10
+ }());
11
+ exports.PaymentProcessor = PaymentProcessor;
@@ -0,0 +1,16 @@
1
+ export declare class PurchaseInfo {
2
+ externalId: string;
3
+ resultText: string;
4
+ authorization: string;
5
+ ticket: string;
6
+ metadata: string;
7
+ appliedLaw: number;
8
+ discount: number;
9
+ taxAmount?: number;
10
+ commitFinalAmount?: number;
11
+ status?: number;
12
+ executionDate?: Date;
13
+ expirationDate?: Date;
14
+ transactionCode?: number;
15
+ constructor(externalId: string, resultText: string, authorization: string, ticket: string, metadata: string, appliedLaw: number, discount: number, taxAmount: number, commitFinalAmount: number, status: number, executionDate: Date, expirationDate: Date, transactionCode: number);
16
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PurchaseInfo = void 0;
4
+ var PurchaseInfo = /** @class */ (function () {
5
+ function PurchaseInfo(externalId, resultText, authorization, ticket, metadata, appliedLaw, discount, taxAmount, commitFinalAmount, status, executionDate, expirationDate, transactionCode) {
6
+ this.externalId = externalId;
7
+ this.resultText = resultText;
8
+ this.authorization = authorization;
9
+ this.ticket = ticket;
10
+ this.metadata = metadata;
11
+ this.appliedLaw = appliedLaw;
12
+ this.discount = discount;
13
+ this.taxAmount = taxAmount;
14
+ this.commitFinalAmount = commitFinalAmount;
15
+ this.status = status;
16
+ this.executionDate = executionDate;
17
+ this.expirationDate = expirationDate;
18
+ this.transactionCode = transactionCode;
19
+ }
20
+ return PurchaseInfo;
21
+ }());
22
+ exports.PurchaseInfo = PurchaseInfo;
@@ -0,0 +1,12 @@
1
+ export declare class RefundInfo {
2
+ amount?: number;
3
+ status?: number;
4
+ externalId: string;
5
+ transactionCode?: number;
6
+ resultText: string;
7
+ executionDate?: Date;
8
+ authorization: string;
9
+ metadata: string;
10
+ ticket: string;
11
+ constructor(amount: number, status: number, externalId: string, transactionCode: number, resultText: string, executionDate: Date, authorization: string, metadata: string, ticket: string);
12
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RefundInfo = void 0;
4
+ var RefundInfo = /** @class */ (function () {
5
+ function RefundInfo(amount, status, externalId, transactionCode, resultText, executionDate, authorization, metadata, ticket) {
6
+ this.amount = amount;
7
+ this.status = status;
8
+ this.externalId = externalId;
9
+ this.transactionCode = transactionCode;
10
+ this.resultText = resultText;
11
+ this.executionDate = executionDate;
12
+ this.authorization = authorization;
13
+ this.metadata = metadata;
14
+ this.ticket = ticket;
15
+ }
16
+ return RefundInfo;
17
+ }());
18
+ exports.RefundInfo = RefundInfo;
@@ -0,0 +1,13 @@
1
+ export declare class ReserveInfo {
2
+ externalId: string;
3
+ status?: number;
4
+ executionDate?: Date;
5
+ expirationDate?: Date;
6
+ transactionCode?: number;
7
+ resultText: string;
8
+ authorization: string;
9
+ ticket: string;
10
+ metadata: string;
11
+ taxAmount?: number;
12
+ constructor(externalId: string, status: number, executionDate: Date, expirationDate: Date, transactionCode: number, resultText: string, authorization: string, ticket: string, metadata: string, taxAmount: number);
13
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReserveInfo = void 0;
4
+ var ReserveInfo = /** @class */ (function () {
5
+ function ReserveInfo(externalId, status, executionDate, expirationDate, transactionCode, resultText, authorization, ticket, metadata, taxAmount) {
6
+ this.externalId = externalId;
7
+ this.status = status;
8
+ this.executionDate = executionDate;
9
+ this.expirationDate = expirationDate;
10
+ this.transactionCode = transactionCode;
11
+ this.resultText = resultText;
12
+ this.authorization = authorization;
13
+ this.ticket = ticket;
14
+ this.metadata = metadata;
15
+ this.taxAmount = taxAmount;
16
+ }
17
+ return ReserveInfo;
18
+ }());
19
+ exports.ReserveInfo = ReserveInfo;
@@ -0,0 +1,7 @@
1
+ import { Address } from '.';
2
+ export declare class Shipping {
3
+ address: Address;
4
+ name: string;
5
+ phone: string;
6
+ constructor(address: Address, name: string, phone: string);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Shipping = void 0;
4
+ var Shipping = /** @class */ (function () {
5
+ function Shipping(address, name, phone) {
6
+ this.address = address;
7
+ this.name = name;
8
+ this.phone = phone;
9
+ }
10
+ return Shipping;
11
+ }());
12
+ exports.Shipping = Shipping;
@@ -0,0 +1,31 @@
1
+ import { CancellationInfo, Client, Currency, Customer, Instrument, Item, PaymentFacilitator, PaymentProcessor, PurchaseInfo, RefundInfo, ReserveInfo } from '.';
2
+ export declare class Transaction {
3
+ id: string;
4
+ batchId?: number;
5
+ externalId: string;
6
+ invoiceNumber: string;
7
+ creationDate: Date;
8
+ expiration?: Date;
9
+ metadata: string;
10
+ state: number;
11
+ amount: number;
12
+ installments?: number;
13
+ taxedAmount: number;
14
+ tipAmount: number;
15
+ billedAmount: number;
16
+ loyaltyProgramAmount?: number;
17
+ law: number;
18
+ client: Client;
19
+ instrument: Instrument;
20
+ currency: Currency;
21
+ purchaseInfo?: PurchaseInfo;
22
+ cancellationInfo?: CancellationInfo;
23
+ refundInfo?: RefundInfo;
24
+ reserveInfo?: ReserveInfo;
25
+ partialRefundsInfo?: RefundInfo[];
26
+ items: Item[];
27
+ customer: Customer;
28
+ paymentProcessor: PaymentProcessor;
29
+ paymentFacilitator: PaymentFacilitator;
30
+ constructor(id: string, externalId: string, invoiceNumber: string, creationDate: Date, metadata: string, state: number, amount: number, taxedAmount: number, tipAmount: number, billedAmount: number, law: number, client: Client, instrument: Instrument, currency: Currency, items: Item[], customer: Customer, paymentProcessor: PaymentProcessor, paymentFacilitator: PaymentFacilitator, loyaltyProgramAmount?: number, installments?: number, expiration?: Date, batchId?: number, purchaseInfo?: PurchaseInfo, cancellationInfo?: CancellationInfo, refundInfo?: RefundInfo, reserveInfo?: ReserveInfo, partialRefundsInfo?: RefundInfo[]);
31
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Transaction = void 0;
4
+ var Transaction = /** @class */ (function () {
5
+ function Transaction(id, externalId, invoiceNumber, creationDate, metadata, state, amount, taxedAmount, tipAmount, billedAmount, law, client, instrument, currency, items, customer, paymentProcessor, paymentFacilitator, loyaltyProgramAmount, installments, expiration, batchId, purchaseInfo, cancellationInfo, refundInfo, reserveInfo, partialRefundsInfo) {
6
+ this.id = id;
7
+ this.batchId = batchId;
8
+ this.externalId = externalId;
9
+ this.invoiceNumber = invoiceNumber;
10
+ this.creationDate = creationDate;
11
+ this.expiration = expiration;
12
+ this.metadata = metadata;
13
+ this.state = state;
14
+ this.amount = amount;
15
+ this.installments = installments;
16
+ this.taxedAmount = taxedAmount;
17
+ this.tipAmount = tipAmount;
18
+ this.billedAmount = billedAmount;
19
+ this.loyaltyProgramAmount = loyaltyProgramAmount;
20
+ this.law = law;
21
+ this.client = client;
22
+ this.instrument = instrument;
23
+ this.currency = currency;
24
+ this.purchaseInfo = purchaseInfo;
25
+ this.cancellationInfo = cancellationInfo;
26
+ this.refundInfo = refundInfo;
27
+ this.reserveInfo = reserveInfo;
28
+ this.partialRefundsInfo = partialRefundsInfo;
29
+ this.items = items;
30
+ this.customer = customer;
31
+ this.paymentProcessor = paymentProcessor;
32
+ this.paymentFacilitator = paymentFacilitator;
33
+ }
34
+ return Transaction;
35
+ }());
36
+ exports.Transaction = Transaction;
@@ -0,0 +1,5 @@
1
+ import { Transaction } from '.';
2
+ export declare class TransactionResult {
3
+ results: Transaction[];
4
+ constructor(results: Transaction[]);
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionResult = void 0;
4
+ var TransactionResult = /** @class */ (function () {
5
+ function TransactionResult(results) {
6
+ this.results = results;
7
+ }
8
+ return TransactionResult;
9
+ }());
10
+ exports.TransactionResult = TransactionResult;
@@ -0,0 +1,21 @@
1
+ export { Address } from './Address';
2
+ export { CancellationInfo } from './CancellationInfo';
3
+ export { Client } from './Client';
4
+ export { Commerce } from './Commerce';
5
+ export { Currency } from './Currency';
6
+ export { Customer } from './Customer';
7
+ export { Document } from './Document';
8
+ export { Instrument } from './Instrument';
9
+ export { Issuer } from './Issuer';
10
+ export { IssuerData } from './IssuerData';
11
+ export { IssuerDto } from './IssuerDto';
12
+ export { Item } from './Item';
13
+ export { PartialRefundsInfo } from './PartialRefundsInfo';
14
+ export { PaymentFacilitator } from './PaymentFacilitator';
15
+ export { PaymentProcessor } from './PaymentProcessor';
16
+ export { PurchaseInfo } from './PurchaseInfo';
17
+ export { RefundInfo } from './RefundInfo';
18
+ export { ReserveInfo } from './ReserveInfo';
19
+ export { Shipping } from './Shipping';
20
+ export { Transaction } from './Transaction';
21
+ export { TransactionResult } from './TransactionResult';
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionResult = exports.Transaction = exports.Shipping = exports.ReserveInfo = exports.RefundInfo = exports.PurchaseInfo = exports.PaymentProcessor = exports.PaymentFacilitator = exports.PartialRefundsInfo = exports.Item = exports.IssuerDto = exports.IssuerData = exports.Issuer = exports.Instrument = exports.Document = exports.Customer = exports.Currency = exports.Commerce = exports.Client = exports.CancellationInfo = exports.Address = void 0;
4
+ var Address_1 = require("./Address");
5
+ Object.defineProperty(exports, "Address", { enumerable: true, get: function () { return Address_1.Address; } });
6
+ var CancellationInfo_1 = require("./CancellationInfo");
7
+ Object.defineProperty(exports, "CancellationInfo", { enumerable: true, get: function () { return CancellationInfo_1.CancellationInfo; } });
8
+ var Client_1 = require("./Client");
9
+ Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
10
+ var Commerce_1 = require("./Commerce");
11
+ Object.defineProperty(exports, "Commerce", { enumerable: true, get: function () { return Commerce_1.Commerce; } });
12
+ var Currency_1 = require("./Currency");
13
+ Object.defineProperty(exports, "Currency", { enumerable: true, get: function () { return Currency_1.Currency; } });
14
+ var Customer_1 = require("./Customer");
15
+ Object.defineProperty(exports, "Customer", { enumerable: true, get: function () { return Customer_1.Customer; } });
16
+ var Document_1 = require("./Document");
17
+ Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return Document_1.Document; } });
18
+ var Instrument_1 = require("./Instrument");
19
+ Object.defineProperty(exports, "Instrument", { enumerable: true, get: function () { return Instrument_1.Instrument; } });
20
+ var Issuer_1 = require("./Issuer");
21
+ Object.defineProperty(exports, "Issuer", { enumerable: true, get: function () { return Issuer_1.Issuer; } });
22
+ var IssuerData_1 = require("./IssuerData");
23
+ Object.defineProperty(exports, "IssuerData", { enumerable: true, get: function () { return IssuerData_1.IssuerData; } });
24
+ var IssuerDto_1 = require("./IssuerDto");
25
+ Object.defineProperty(exports, "IssuerDto", { enumerable: true, get: function () { return IssuerDto_1.IssuerDto; } });
26
+ var Item_1 = require("./Item");
27
+ Object.defineProperty(exports, "Item", { enumerable: true, get: function () { return Item_1.Item; } });
28
+ var PartialRefundsInfo_1 = require("./PartialRefundsInfo");
29
+ Object.defineProperty(exports, "PartialRefundsInfo", { enumerable: true, get: function () { return PartialRefundsInfo_1.PartialRefundsInfo; } });
30
+ var PaymentFacilitator_1 = require("./PaymentFacilitator");
31
+ Object.defineProperty(exports, "PaymentFacilitator", { enumerable: true, get: function () { return PaymentFacilitator_1.PaymentFacilitator; } });
32
+ var PaymentProcessor_1 = require("./PaymentProcessor");
33
+ Object.defineProperty(exports, "PaymentProcessor", { enumerable: true, get: function () { return PaymentProcessor_1.PaymentProcessor; } });
34
+ var PurchaseInfo_1 = require("./PurchaseInfo");
35
+ Object.defineProperty(exports, "PurchaseInfo", { enumerable: true, get: function () { return PurchaseInfo_1.PurchaseInfo; } });
36
+ var RefundInfo_1 = require("./RefundInfo");
37
+ Object.defineProperty(exports, "RefundInfo", { enumerable: true, get: function () { return RefundInfo_1.RefundInfo; } });
38
+ var ReserveInfo_1 = require("./ReserveInfo");
39
+ Object.defineProperty(exports, "ReserveInfo", { enumerable: true, get: function () { return ReserveInfo_1.ReserveInfo; } });
40
+ var Shipping_1 = require("./Shipping");
41
+ Object.defineProperty(exports, "Shipping", { enumerable: true, get: function () { return Shipping_1.Shipping; } });
42
+ var Transaction_1 = require("./Transaction");
43
+ Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_1.Transaction; } });
44
+ var TransactionResult_1 = require("./TransactionResult");
45
+ Object.defineProperty(exports, "TransactionResult", { enumerable: true, get: function () { return TransactionResult_1.TransactionResult; } });
@@ -0,0 +1,4 @@
1
+ export declare const booleanUtils: {
2
+ stringifyBooleans: <T extends object>(object: T) => T;
3
+ booleanizeStrings: <T_1 extends object>(object: T_1) => T_1;
4
+ };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.booleanUtils = void 0;
4
+ var signatureUtils_1 = require("../sdk/helpers/signature/signatureUtils");
5
+ var booleanValues = [
6
+ 'CrossBankTransfers'
7
+ ];
8
+ var stringifyBooleans = function (object) {
9
+ booleanValues.forEach(function (word) {
10
+ if (JSON.stringify(object).includes(word)) {
11
+ substituteValueRecursively(object, word, true);
12
+ }
13
+ });
14
+ return object;
15
+ };
16
+ var substituteValueRecursively = function (object, specialWord, toString) {
17
+ if (object && typeof object === 'object') {
18
+ Object.keys(object).map(function (key) {
19
+ if (key === specialWord) {
20
+ if (toString)
21
+ if (object[key] === true) {
22
+ object[key] = 'True';
23
+ }
24
+ else {
25
+ object[key] = 'False';
26
+ }
27
+ else {
28
+ if (object[key] === 'True') {
29
+ object[key] = true;
30
+ }
31
+ else {
32
+ object[key] = false;
33
+ }
34
+ }
35
+ }
36
+ if (typeof object[key] === 'object') {
37
+ substituteValueRecursively(object[key], specialWord, toString);
38
+ }
39
+ });
40
+ }
41
+ };
42
+ var booleanizeStrings = function (object) {
43
+ booleanValues.forEach(function (specialWord) {
44
+ if (JSON.stringify(object).includes(specialWord)) {
45
+ substituteValueRecursively(object, specialWord, false);
46
+ }
47
+ });
48
+ return signatureUtils_1.signatureUtils.sortObject(object);
49
+ };
50
+ exports.booleanUtils = {
51
+ stringifyBooleans: stringifyBooleans,
52
+ booleanizeStrings: booleanizeStrings,
53
+ };
@@ -0,0 +1,4 @@
1
+ export declare const caseUtils: {
2
+ toCamelKeys: <T extends object>(object: T) => T;
3
+ toPascalKeys: <T_1 extends object>(object: T_1) => T_1;
4
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.caseUtils = void 0;
4
+ var js_convert_case_1 = require("js-convert-case");
5
+ var signatureUtils_1 = require("../sdk/helpers/signature/signatureUtils");
6
+ var specialWords = [
7
+ { word: 'UtcUnixTimeExpiration', substitute: 'UTCUnixTimeExpiration' },
8
+ { word: 'UtcunixTimeExpiration', substitute: 'UTCUnixTimeExpiration' },
9
+ { word: 'VatAmount', substitute: 'VATAmount' },
10
+ { word: 'InstrumentExpirationUtc', substitute: 'InstrumentExpirationUTC' },
11
+ { word: 'Mcc', substitute: 'MCC' },
12
+ { word: 'CommerceRut', substitute: 'CommerceRUT' },
13
+ { word: 'Ui', substitute: 'UI' },
14
+ { word: 'Background', substitute: 'background' },
15
+ { word: 'Primary', substitute: 'primary' },
16
+ { word: 'Secondary', substitute: 'secondary' },
17
+ ];
18
+ var camelCaseSpecialWords = [
19
+ {
20
+ word: 'instrumentExpirationUtc',
21
+ substitute: 'instrumentExpirationUTC',
22
+ },
23
+ ];
24
+ var toCamelKeys = function (object) {
25
+ var parsedObject = (0, js_convert_case_1.camelKeys)(object, { recursive: true, recursiveInArray: true });
26
+ camelCaseSpecialWords.forEach(function (specialWord) {
27
+ if (JSON.stringify(parsedObject).includes(specialWord.word)) {
28
+ substituteWordRecursively(parsedObject, specialWord.word, specialWord.substitute);
29
+ }
30
+ });
31
+ return parsedObject;
32
+ };
33
+ var substituteWordRecursively = function (theParsedObject, word, substitute) {
34
+ var deleteObject = function (obj, key) {
35
+ delete obj[key];
36
+ };
37
+ if (theParsedObject && typeof theParsedObject === 'object') {
38
+ Object.keys(theParsedObject).map(function (key) {
39
+ if (key === word) {
40
+ Object.defineProperty(theParsedObject, substitute, Object.getOwnPropertyDescriptor(theParsedObject, word) || '');
41
+ deleteObject(theParsedObject, word);
42
+ }
43
+ if (typeof theParsedObject[key] === 'object') {
44
+ substituteWordRecursively(theParsedObject[key], word, substitute);
45
+ }
46
+ });
47
+ }
48
+ };
49
+ var toPascalKeys = function (object) {
50
+ var parsedObject = (0, js_convert_case_1.pascalKeys)(object, { recursive: true, recursiveInArray: true });
51
+ specialWords.forEach(function (specialWord) {
52
+ if (JSON.stringify(parsedObject).includes(specialWord.word)) {
53
+ substituteWordRecursively(parsedObject, specialWord.word, specialWord.substitute);
54
+ }
55
+ });
56
+ return signatureUtils_1.signatureUtils.sortObject(parsedObject);
57
+ };
58
+ exports.caseUtils = {
59
+ toCamelKeys: toCamelKeys,
60
+ toPascalKeys: toPascalKeys,
61
+ };
@@ -0,0 +1 @@
1
+ export { caseUtils } from './case.util';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.caseUtils = void 0;
4
+ var case_util_1 = require("./case.util");
5
+ Object.defineProperty(exports, "caseUtils", { enumerable: true, get: function () { return case_util_1.caseUtils; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houlak/plexo-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-fx",
4
4
  "description": "Node SDK for Plexo payment services",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -44,9 +44,9 @@
44
44
  }
45
45
  },
46
46
  "engines": {
47
- "node": "16"
47
+ "node": "20"
48
48
  },
49
49
  "files": [
50
50
  "lib/**/*"
51
51
  ]
52
- }
52
+ }