@houlak/plexo-sdk 0.1.68 → 0.1.69
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/README.md +14 -14
- package/lib/config/config.d.ts +12 -12
- package/lib/config/config.js +16 -16
- package/lib/handler/PlexoHandler.d.ts +31 -31
- package/lib/handler/PlexoHandler.js +421 -421
- package/lib/handler/services/evaluator.service.d.ts +6 -6
- package/lib/handler/services/evaluator.service.js +118 -118
- package/lib/handler/types/BaseResponse.d.ts +8 -8
- package/lib/handler/types/BaseResponse.js +16 -16
- package/lib/index.d.ts +3 -3
- package/lib/index.js +9 -9
- package/lib/lib/logger.lib.d.ts +10 -10
- package/lib/lib/logger.lib.js +33 -33
- package/lib/sdk/IPaymentGatewayClient.d.ts +31 -31
- package/lib/sdk/IPaymentGatewayClient.js +2 -2
- package/lib/sdk/PaymentGatewayClient.d.ts +32 -32
- package/lib/sdk/PaymentGatewayClient.js +379 -379
- package/lib/sdk/PaymentGatewayMock.d.ts +31 -31
- package/lib/sdk/PaymentGatewayMock.js +330 -330
- package/lib/sdk/enums/plexo-error-enum.d.ts +38 -38
- package/lib/sdk/enums/plexo-error-enum.js +46 -46
- package/lib/sdk/helpers/signature/signatureHelper.d.ts +6 -6
- package/lib/sdk/helpers/signature/signatureHelper.js +175 -175
- package/lib/sdk/helpers/signature/signatureUtils.d.ts +10 -10
- package/lib/sdk/helpers/signature/signatureUtils.js +157 -157
- package/lib/sdk/helpers/signature/stringifyWithFloats.d.ts +1 -1
- package/lib/sdk/helpers/signature/stringifyWithFloats.js +73 -73
- package/lib/sdk/index.d.ts +4 -4
- package/lib/sdk/index.js +22 -22
- package/lib/sdk/mocks/mocks.d.ts +24 -24
- package/lib/sdk/mocks/mocks.js +180 -180
- package/lib/sdk/models/ActionType.d.ts +9 -9
- package/lib/sdk/models/ActionType.js +13 -13
- package/lib/sdk/models/AmountLimit.d.ts +7 -7
- package/lib/sdk/models/AmountLimit.js +2 -2
- package/lib/sdk/models/Authorization.d.ts +17 -18
- package/lib/sdk/models/Authorization.js +33 -33
- package/lib/sdk/models/AuthorizationInfo.d.ts +6 -6
- package/lib/sdk/models/AuthorizationInfo.js +11 -11
- package/lib/sdk/models/AuthorizationType.d.ts +5 -5
- package/lib/sdk/models/AuthorizationType.js +9 -9
- package/lib/sdk/models/BaseServerResponse.d.ts +7 -7
- package/lib/sdk/models/BaseServerResponse.js +12 -12
- package/lib/sdk/models/BuiltInPagesOptions.d.ts +5 -5
- package/lib/sdk/models/BuiltInPagesOptions.js +11 -11
- package/lib/sdk/models/CancelRequest.d.ts +6 -6
- package/lib/sdk/models/CancelRequest.js +29 -29
- package/lib/sdk/models/CardStatus.d.ts +7 -7
- package/lib/sdk/models/CardStatus.js +11 -11
- package/lib/sdk/models/CardTypes.d.ts +9 -9
- package/lib/sdk/models/CardTypes.js +13 -13
- package/lib/sdk/models/ClientRequest.d.ts +4 -4
- package/lib/sdk/models/ClientRequest.js +10 -10
- package/lib/sdk/models/ClientResponse.d.ts +6 -6
- package/lib/sdk/models/ClientResponse.js +29 -29
- package/lib/sdk/models/ClientSignedRequest.d.ts +4 -4
- package/lib/sdk/models/ClientSignedRequest.js +27 -27
- package/lib/sdk/models/ClientSignedResponse.d.ts +4 -4
- package/lib/sdk/models/ClientSignedResponse.js +27 -27
- package/lib/sdk/models/CodeAction.d.ts +10 -10
- package/lib/sdk/models/CodeAction.js +10 -10
- package/lib/sdk/models/CodeRequest.d.ts +5 -5
- package/lib/sdk/models/CodeRequest.js +2 -2
- package/lib/sdk/models/Commerce.d.ts +4 -4
- package/lib/sdk/models/Commerce.js +2 -2
- package/lib/sdk/models/CommerceIdRequest.d.ts +3 -3
- package/lib/sdk/models/CommerceIdRequest.js +2 -2
- package/lib/sdk/models/CommerceIssuerIdRequest.d.ts +4 -4
- package/lib/sdk/models/CommerceIssuerIdRequest.js +2 -2
- package/lib/sdk/models/CommerceModifyRequest.d.ts +4 -4
- package/lib/sdk/models/CommerceModifyRequest.js +2 -2
- package/lib/sdk/models/CommerceRequest.d.ts +3 -3
- package/lib/sdk/models/CommerceRequest.js +2 -2
- package/lib/sdk/models/CreateBankInstrumentRequest.d.ts +6 -6
- package/lib/sdk/models/CreateBankInstrumentRequest.js +2 -2
- package/lib/sdk/models/Currency.d.ts +6 -6
- package/lib/sdk/models/Currency.js +2 -2
- package/lib/sdk/models/DeleteInstrumentRequest.d.ts +6 -6
- package/lib/sdk/models/DeleteInstrumentRequest.js +29 -29
- package/lib/sdk/models/DisplayOptions.d.ts +8 -8
- package/lib/sdk/models/DisplayOptions.js +14 -14
- package/lib/sdk/models/ExpressCheckoutRequest.d.ts +6 -6
- package/lib/sdk/models/ExpressCheckoutRequest.js +2 -2
- package/lib/sdk/models/ExpressCheckoutSettings.d.ts +7 -7
- package/lib/sdk/models/ExpressCheckoutSettings.js +11 -11
- package/lib/sdk/models/ExtendedCredit.d.ts +4 -4
- package/lib/sdk/models/ExtendedCredit.js +2 -2
- package/lib/sdk/models/FieldInfo.d.ts +6 -6
- package/lib/sdk/models/FieldInfo.js +2 -2
- package/lib/sdk/models/FieldInfoPaymentProcessors.d.ts +6 -6
- package/lib/sdk/models/FieldInfoPaymentProcessors.js +11 -11
- package/lib/sdk/models/FieldType.d.ts +82 -82
- package/lib/sdk/models/FieldType.js +95 -95
- package/lib/sdk/models/FinancialInclusion.d.ts +9 -9
- package/lib/sdk/models/FinancialInclusion.js +2 -2
- package/lib/sdk/models/FinancialInclusionResult.d.ts +6 -6
- package/lib/sdk/models/FinancialInclusionResult.js +2 -2
- package/lib/sdk/models/GenericClientRequest.d.ts +5 -5
- package/lib/sdk/models/GenericClientRequest.js +29 -29
- package/lib/sdk/models/GenericClientSignedRequest.d.ts +4 -4
- package/lib/sdk/models/GenericClientSignedRequest.js +27 -27
- package/lib/sdk/models/GenericIssuerRequest.d.ts +5 -5
- package/lib/sdk/models/GenericIssuerRequest.js +29 -29
- package/lib/sdk/models/GenericIssuerSignedRequest.d.ts +4 -4
- package/lib/sdk/models/GenericIssuerSignedRequest.js +27 -27
- package/lib/sdk/models/GenericServerSignedResponse.d.ts +4 -4
- package/lib/sdk/models/GenericServerSignedResponse.js +27 -27
- package/lib/sdk/models/GenericSignedObject.d.ts +6 -6
- package/lib/sdk/models/GenericSignedObject.js +11 -11
- package/lib/sdk/models/GenericStateObject.d.ts +5 -5
- package/lib/sdk/models/GenericStateObject.js +29 -29
- package/lib/sdk/models/IClientCallback.d.ts +3 -3
- package/lib/sdk/models/IClientCallback.js +2 -2
- package/lib/sdk/models/IdentificationType.d.ts +6 -6
- package/lib/sdk/models/IdentificationType.js +10 -10
- package/lib/sdk/models/InclusionType.d.ts +5 -5
- package/lib/sdk/models/InclusionType.js +9 -9
- package/lib/sdk/models/IndexSDK.d.ts +86 -86
- package/lib/sdk/models/IndexSDK.js +114 -114
- package/lib/sdk/models/InfoLine.d.ts +4 -4
- package/lib/sdk/models/InfoLine.js +2 -2
- package/lib/sdk/models/InstrumentCallback.d.ts +9 -9
- package/lib/sdk/models/InstrumentCallback.js +31 -31
- package/lib/sdk/models/InstrumentWithMetadata.d.ts +6 -6
- package/lib/sdk/models/InstrumentWithMetadata.js +11 -11
- package/lib/sdk/models/IssuerData.d.ts +7 -7
- package/lib/sdk/models/IssuerData.js +2 -2
- package/lib/sdk/models/IssuerInfo.d.ts +14 -14
- package/lib/sdk/models/IssuerInfo.js +2 -2
- package/lib/sdk/models/IssuerProcessor.d.ts +7 -7
- package/lib/sdk/models/IssuerProcessor.js +12 -12
- package/lib/sdk/models/IssuerRequest.d.ts +4 -4
- package/lib/sdk/models/IssuerRequest.js +10 -10
- package/lib/sdk/models/IssuerSignedRequest.d.ts +4 -4
- package/lib/sdk/models/IssuerSignedRequest.js +27 -27
- package/lib/sdk/models/Item.d.ts +8 -8
- package/lib/sdk/models/Item.js +2 -2
- package/lib/sdk/models/PaymentInstrument.d.ts +18 -18
- package/lib/sdk/models/PaymentInstrument.js +2 -2
- package/lib/sdk/models/PaymentInstrumentInput.d.ts +6 -6
- package/lib/sdk/models/PaymentInstrumentInput.js +2 -2
- package/lib/sdk/models/PaymentProcessor.d.ts +6 -6
- package/lib/sdk/models/PaymentProcessor.js +11 -11
- package/lib/sdk/models/PaymentRequest.d.ts +17 -17
- package/lib/sdk/models/PaymentRequest.js +20 -20
- package/lib/sdk/models/PlexoSdkSettings.d.ts +8 -8
- package/lib/sdk/models/PlexoSdkSettings.js +14 -14
- package/lib/sdk/models/PublicKeyInfo.d.ts +4 -4
- package/lib/sdk/models/PublicKeyInfo.js +2 -2
- package/lib/sdk/models/Reference.d.ts +6 -6
- package/lib/sdk/models/Reference.js +11 -11
- package/lib/sdk/models/ReferenceType.d.ts +6 -6
- package/lib/sdk/models/ReferenceType.js +10 -10
- package/lib/sdk/models/Reserve.d.ts +6 -6
- package/lib/sdk/models/Reserve.js +29 -29
- package/lib/sdk/models/ReserveRequest.d.ts +6 -6
- package/lib/sdk/models/ReserveRequest.js +29 -29
- package/lib/sdk/models/ResultCodes.d.ts +30 -30
- package/lib/sdk/models/ResultCodes.js +35 -35
- package/lib/sdk/models/ServerResponse.d.ts +6 -6
- package/lib/sdk/models/ServerResponse.js +29 -29
- package/lib/sdk/models/ServerSignedCallback.d.ts +3 -3
- package/lib/sdk/models/ServerSignedCallback.js +27 -27
- package/lib/sdk/models/ServerSignedRequest.d.ts +3 -3
- package/lib/sdk/models/ServerSignedRequest.js +27 -27
- package/lib/sdk/models/ServerSignedResponse.d.ts +4 -4
- package/lib/sdk/models/ServerSignedResponse.js +27 -27
- package/lib/sdk/models/Session.d.ts +5 -5
- package/lib/sdk/models/Session.js +2 -2
- package/lib/sdk/models/Settings.d.ts +11 -11
- package/lib/sdk/models/Settings.js +19 -19
- package/lib/sdk/models/SignedObject.d.ts +6 -6
- package/lib/sdk/models/SignedObject.js +11 -11
- package/lib/sdk/models/StateObject.d.ts +5 -5
- package/lib/sdk/models/StateObject.js +11 -11
- package/lib/sdk/models/TimeLimit.d.ts +5 -5
- package/lib/sdk/models/TimeLimit.js +2 -2
- package/lib/sdk/models/TokenizationSettings.d.ts +5 -5
- package/lib/sdk/models/TokenizationSettings.js +10 -10
- package/lib/sdk/models/Transaction.d.ts +31 -31
- package/lib/sdk/models/Transaction.js +26 -26
- package/lib/sdk/models/TransactionCallback.d.ts +7 -7
- package/lib/sdk/models/TransactionCallback.js +29 -29
- package/lib/sdk/models/TransactionCursor.d.ts +6 -6
- package/lib/sdk/models/TransactionCursor.js +2 -2
- package/lib/sdk/models/TransactionInfo.d.ts +12 -12
- package/lib/sdk/models/TransactionInfo.js +2 -2
- package/lib/sdk/models/TransactionOrder.d.ts +5 -5
- package/lib/sdk/models/TransactionOrder.js +2 -2
- package/lib/sdk/models/TransactionQuery.d.ts +54 -54
- package/lib/sdk/models/TransactionQuery.js +47 -47
- package/lib/sdk/models/TransactionResult.d.ts +13 -13
- package/lib/sdk/models/TransactionResult.js +17 -17
- package/lib/sdk/models/TransactionType.d.ts +5 -5
- package/lib/sdk/models/TransactionType.js +9 -9
- package/lib/sdk/models/TransactionsCSV.d.ts +3 -3
- package/lib/sdk/models/TransactionsCSV.js +2 -2
- package/lib/sdk/models/UIOptions.d.ts +8 -8
- package/lib/sdk/models/UIOptions.js +13 -13
- package/lib/sdk/models/WebFormSettings.d.ts +9 -9
- package/lib/sdk/models/WebFormSettings.js +12 -12
- package/lib/sdk/models/webhook/Address.d.ts +9 -9
- package/lib/sdk/models/webhook/Address.js +15 -15
- package/lib/sdk/models/webhook/CancellationInfo.d.ts +11 -11
- package/lib/sdk/models/webhook/CancellationInfo.js +17 -17
- package/lib/sdk/models/webhook/Client.d.ts +9 -9
- package/lib/sdk/models/webhook/Client.js +14 -14
- package/lib/sdk/models/webhook/Commerce.d.ts +6 -6
- package/lib/sdk/models/webhook/Commerce.js +12 -12
- package/lib/sdk/models/webhook/Currency.d.ts +8 -8
- package/lib/sdk/models/webhook/Currency.js +14 -14
- package/lib/sdk/models/webhook/Customer.d.ts +17 -17
- package/lib/sdk/models/webhook/Customer.js +22 -22
- package/lib/sdk/models/webhook/Document.d.ts +5 -5
- package/lib/sdk/models/webhook/Document.js +11 -11
- package/lib/sdk/models/webhook/Instrument.d.ts +17 -17
- package/lib/sdk/models/webhook/Instrument.js +21 -21
- package/lib/sdk/models/webhook/Issuer.d.ts +8 -8
- package/lib/sdk/models/webhook/Issuer.js +14 -14
- package/lib/sdk/models/webhook/IssuerData.d.ts +8 -8
- package/lib/sdk/models/webhook/IssuerData.js +13 -13
- package/lib/sdk/models/webhook/IssuerDto.d.ts +5 -5
- package/lib/sdk/models/webhook/IssuerDto.js +11 -11
- package/lib/sdk/models/webhook/Item.d.ts +14 -14
- package/lib/sdk/models/webhook/Item.js +19 -19
- package/lib/sdk/models/webhook/PartialRefundsInfo.d.ts +12 -12
- package/lib/sdk/models/webhook/PartialRefundsInfo.js +18 -18
- package/lib/sdk/models/webhook/PaymentFacilitator.d.ts +8 -8
- package/lib/sdk/models/webhook/PaymentFacilitator.js +13 -13
- package/lib/sdk/models/webhook/PaymentProcessor.d.ts +5 -5
- package/lib/sdk/models/webhook/PaymentProcessor.js +11 -11
- package/lib/sdk/models/webhook/PurchaseInfo.d.ts +16 -16
- package/lib/sdk/models/webhook/PurchaseInfo.js +22 -22
- package/lib/sdk/models/webhook/RefundInfo.d.ts +12 -12
- package/lib/sdk/models/webhook/RefundInfo.js +18 -18
- package/lib/sdk/models/webhook/ReserveInfo.d.ts +13 -13
- package/lib/sdk/models/webhook/ReserveInfo.js +19 -19
- package/lib/sdk/models/webhook/Shipping.d.ts +7 -7
- package/lib/sdk/models/webhook/Shipping.js +12 -12
- package/lib/sdk/models/webhook/Transaction.d.ts +31 -31
- package/lib/sdk/models/webhook/Transaction.js +36 -36
- package/lib/sdk/models/webhook/TransactionResult.d.ts +5 -5
- package/lib/sdk/models/webhook/TransactionResult.js +10 -10
- package/lib/sdk/models/webhook/index.d.ts +21 -21
- package/lib/sdk/models/webhook/index.js +45 -45
- package/lib/sdk/types/signatureHelper.type.d.ts +5 -5
- package/lib/sdk/types/signatureHelper.type.js +2 -2
- package/lib/sdk/types/ui_options_dto.type.d.ts +6 -6
- package/lib/sdk/types/ui_options_dto.type.js +2 -2
- package/lib/utils/boolean.utils.d.ts +4 -4
- package/lib/utils/boolean.utils.js +53 -53
- package/lib/utils/case.util.d.ts +4 -4
- package/lib/utils/case.util.js +61 -61
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +5 -5
- package/package.json +52 -52
- package/lib/IPaymentGatewayClient.d.ts +0 -31
- package/lib/IPaymentGatewayClient.js +0 -2
- package/lib/PaymentGatewayClient.d.ts +0 -32
- package/lib/PaymentGatewayClient.js +0 -90
- package/lib/helpers/signature/signatureHelper.d.ts +0 -1
- package/lib/helpers/signature/signatureHelper.js +0 -52
- package/lib/models/ActionType.d.ts +0 -9
- package/lib/models/ActionType.js +0 -13
- package/lib/models/AmountLimit.d.ts +0 -7
- package/lib/models/AmountLimit.js +0 -2
- package/lib/models/Authorization.d.ts +0 -18
- package/lib/models/Authorization.js +0 -32
- package/lib/models/AuthorizationInfo.d.ts +0 -6
- package/lib/models/AuthorizationInfo.js +0 -11
- package/lib/models/AuthorizationType.d.ts +0 -5
- package/lib/models/AuthorizationType.js +0 -9
- package/lib/models/BaseServerResponse.d.ts +0 -7
- package/lib/models/BaseServerResponse.js +0 -12
- package/lib/models/BuiltInPagesOptionsDto.d.ts +0 -4
- package/lib/models/BuiltInPagesOptionsDto.js +0 -9
- package/lib/models/CancelRequest.d.ts +0 -6
- package/lib/models/CancelRequest.js +0 -29
- package/lib/models/CardStatus.d.ts +0 -7
- package/lib/models/CardStatus.js +0 -11
- package/lib/models/CardTypes.d.ts +0 -9
- package/lib/models/CardTypes.js +0 -13
- package/lib/models/ClientRequest.d.ts +0 -4
- package/lib/models/ClientRequest.js +0 -10
- package/lib/models/ClientResponse.d.ts +0 -6
- package/lib/models/ClientResponse.js +0 -29
- package/lib/models/ClientSignedRequest.d.ts +0 -4
- package/lib/models/ClientSignedRequest.js +0 -27
- package/lib/models/ClientSignedResponse.d.ts +0 -4
- package/lib/models/ClientSignedResponse.js +0 -27
- package/lib/models/CodeAction.d.ts +0 -10
- package/lib/models/CodeAction.js +0 -10
- package/lib/models/CodeRequest.d.ts +0 -5
- package/lib/models/CodeRequest.js +0 -2
- package/lib/models/Commerce.d.ts +0 -4
- package/lib/models/Commerce.js +0 -2
- package/lib/models/CommerceIdRequest.d.ts +0 -3
- package/lib/models/CommerceIdRequest.js +0 -2
- package/lib/models/CommerceIssuerIdRequest.d.ts +0 -4
- package/lib/models/CommerceIssuerIdRequest.js +0 -2
- package/lib/models/CommerceModifyRequest.d.ts +0 -4
- package/lib/models/CommerceModifyRequest.js +0 -2
- package/lib/models/CommerceRequest.d.ts +0 -3
- package/lib/models/CommerceRequest.js +0 -2
- package/lib/models/CreateBankInstrumentRequest.d.ts +0 -6
- package/lib/models/CreateBankInstrumentRequest.js +0 -2
- package/lib/models/Currency.d.ts +0 -6
- package/lib/models/Currency.js +0 -2
- package/lib/models/DeleteInstrumentRequest.d.ts +0 -6
- package/lib/models/DeleteInstrumentRequest.js +0 -29
- package/lib/models/DisplayOptionsDto.d.ts +0 -7
- package/lib/models/DisplayOptionsDto.js +0 -9
- package/lib/models/ExpressCheckoutRequest.d.ts +0 -6
- package/lib/models/ExpressCheckoutRequest.js +0 -2
- package/lib/models/ExpressCheckoutSettingsDto.d.ts +0 -6
- package/lib/models/ExpressCheckoutSettingsDto.js +0 -9
- package/lib/models/ExtendedCredit.d.ts +0 -4
- package/lib/models/ExtendedCredit.js +0 -2
- package/lib/models/FieldInfo.d.ts +0 -6
- package/lib/models/FieldInfo.js +0 -2
- package/lib/models/FieldInfoPaymentProcessors.d.ts +0 -6
- package/lib/models/FieldInfoPaymentProcessors.js +0 -11
- package/lib/models/FieldType.d.ts +0 -76
- package/lib/models/FieldType.js +0 -89
- package/lib/models/FinancialInclusion.d.ts +0 -8
- package/lib/models/FinancialInclusion.js +0 -2
- package/lib/models/FinancialInclusionResult.d.ts +0 -6
- package/lib/models/FinancialInclusionResult.js +0 -2
- package/lib/models/GenericClientRequest.d.ts +0 -5
- package/lib/models/GenericClientRequest.js +0 -29
- package/lib/models/GenericClientSignedRequest.d.ts +0 -4
- package/lib/models/GenericClientSignedRequest.js +0 -27
- package/lib/models/GenericIssuerRequest.d.ts +0 -5
- package/lib/models/GenericIssuerRequest.js +0 -29
- package/lib/models/GenericIssuerSignedRequest.d.ts +0 -4
- package/lib/models/GenericIssuerSignedRequest.js +0 -27
- package/lib/models/GenericServerSignedResponse.d.ts +0 -4
- package/lib/models/GenericServerSignedResponse.js +0 -27
- package/lib/models/GenericSignedObject.d.ts +0 -6
- package/lib/models/GenericSignedObject.js +0 -11
- package/lib/models/GenericStateObject.d.ts +0 -5
- package/lib/models/GenericStateObject.js +0 -29
- package/lib/models/IClientCallback.d.ts +0 -3
- package/lib/models/IClientCallback.js +0 -2
- package/lib/models/IdentificationType.d.ts +0 -6
- package/lib/models/IdentificationType.js +0 -10
- package/lib/models/InclusionType.d.ts +0 -5
- package/lib/models/InclusionType.js +0 -9
- package/lib/models/IndexSDK.d.ts +0 -33
- package/lib/models/IndexSDK.js +0 -39
- package/lib/models/InfoLine.d.ts +0 -4
- package/lib/models/InfoLine.js +0 -2
- package/lib/models/InstrumentCallback.d.ts +0 -9
- package/lib/models/InstrumentCallback.js +0 -31
- package/lib/models/InstrumentWithMetadata.d.ts +0 -6
- package/lib/models/InstrumentWithMetadata.js +0 -11
- package/lib/models/IssuerData.d.ts +0 -5
- package/lib/models/IssuerData.js +0 -2
- package/lib/models/IssuerInfo.d.ts +0 -14
- package/lib/models/IssuerInfo.js +0 -2
- package/lib/models/IssuerProcessor.d.ts +0 -7
- package/lib/models/IssuerProcessor.js +0 -12
- package/lib/models/IssuerRequest.d.ts +0 -4
- package/lib/models/IssuerRequest.js +0 -10
- package/lib/models/IssuerSignedRequest.d.ts +0 -4
- package/lib/models/IssuerSignedRequest.js +0 -27
- package/lib/models/Item.d.ts +0 -8
- package/lib/models/Item.js +0 -2
- package/lib/models/PaymentInstrument.d.ts +0 -20
- package/lib/models/PaymentInstrument.js +0 -2
- package/lib/models/PaymentInstrumentInput.d.ts +0 -6
- package/lib/models/PaymentInstrumentInput.js +0 -2
- package/lib/models/PaymentProcessor.d.ts +0 -6
- package/lib/models/PaymentProcessor.js +0 -11
- package/lib/models/PaymentRequest.d.ts +0 -17
- package/lib/models/PaymentRequest.js +0 -20
- package/lib/models/PublicKeyInfo.d.ts +0 -4
- package/lib/models/PublicKeyInfo.js +0 -2
- package/lib/models/Reference.d.ts +0 -6
- package/lib/models/Reference.js +0 -11
- package/lib/models/ReferenceType.d.ts +0 -6
- package/lib/models/ReferenceType.js +0 -10
- package/lib/models/Reserve.d.ts +0 -6
- package/lib/models/Reserve.js +0 -29
- package/lib/models/ReserveRequest.d.ts +0 -6
- package/lib/models/ReserveRequest.js +0 -29
- package/lib/models/ResultCodes.d.ts +0 -30
- package/lib/models/ResultCodes.js +0 -35
- package/lib/models/ServerResponse.d.ts +0 -6
- package/lib/models/ServerResponse.js +0 -29
- package/lib/models/ServerSignedCallback.d.ts +0 -3
- package/lib/models/ServerSignedCallback.js +0 -27
- package/lib/models/ServerSignedRequest.d.ts +0 -3
- package/lib/models/ServerSignedRequest.js +0 -27
- package/lib/models/ServerSignedResponse.d.ts +0 -4
- package/lib/models/ServerSignedResponse.js +0 -27
- package/lib/models/Session.d.ts +0 -5
- package/lib/models/Session.js +0 -2
- package/lib/models/SignedObject.d.ts +0 -6
- package/lib/models/SignedObject.js +0 -11
- package/lib/models/StateObject.d.ts +0 -5
- package/lib/models/StateObject.js +0 -11
- package/lib/models/TimeLimit.d.ts +0 -5
- package/lib/models/TimeLimit.js +0 -2
- package/lib/models/TokenizationSettingsDto.d.ts +0 -4
- package/lib/models/TokenizationSettingsDto.js +0 -9
- package/lib/models/Transaction.d.ts +0 -26
- package/lib/models/Transaction.js +0 -26
- package/lib/models/TransactionCallback.d.ts +0 -7
- package/lib/models/TransactionCallback.js +0 -29
- package/lib/models/TransactionCursor.d.ts +0 -6
- package/lib/models/TransactionCursor.js +0 -2
- package/lib/models/TransactionInfo.d.ts +0 -12
- package/lib/models/TransactionInfo.js +0 -2
- package/lib/models/TransactionOrder.d.ts +0 -5
- package/lib/models/TransactionOrder.js +0 -2
- package/lib/models/TransactionQuery.d.ts +0 -54
- package/lib/models/TransactionQuery.js +0 -47
- package/lib/models/TransactionResult.d.ts +0 -13
- package/lib/models/TransactionResult.js +0 -17
- package/lib/models/TransactionType.d.ts +0 -5
- package/lib/models/TransactionType.js +0 -9
- package/lib/models/UIOptionsDto.d.ts +0 -7
- package/lib/models/UIOptionsDto.js +0 -13
- package/lib/models/WebFormSettingsDto.d.ts +0 -8
- package/lib/models/WebFormSettingsDto.js +0 -9
- package/lib/sdk/models/BuiltInPagesOptionsDto.d.ts +0 -4
- package/lib/sdk/models/BuiltInPagesOptionsDto.js +0 -9
- package/lib/sdk/models/DisplayOptionsDto.d.ts +0 -7
- package/lib/sdk/models/DisplayOptionsDto.js +0 -9
- package/lib/sdk/models/ExpressCheckoutSettingsDto.d.ts +0 -6
- package/lib/sdk/models/ExpressCheckoutSettingsDto.js +0 -9
- package/lib/sdk/models/TokenizationSettingsDto.d.ts +0 -4
- package/lib/sdk/models/TokenizationSettingsDto.js +0 -9
- package/lib/sdk/models/UIOptionsDto.d.ts +0 -8
- package/lib/sdk/models/UIOptionsDto.js +0 -13
- package/lib/sdk/models/WebFormSettingsDto.d.ts +0 -8
- package/lib/sdk/models/WebFormSettingsDto.js +0 -9
- package/lib/sdk/models/webhook/IndexWebhook.d.ts +0 -21
- package/lib/sdk/models/webhook/IndexWebhook.js +0 -45
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.signatureUtils = void 0;
|
|
40
|
-
var crypto_1 = require("crypto");
|
|
41
|
-
var fs = require("fs");
|
|
42
|
-
var pem = require("pem");
|
|
43
|
-
var util_1 = require("util");
|
|
44
|
-
var config_1 = require("../../../config/config");
|
|
45
|
-
var logger_lib_1 = require("../../../lib/logger.lib");
|
|
46
|
-
var stringifyWithFloats_1 = require("./stringifyWithFloats");
|
|
47
|
-
var canonizeJson = function (object, keysToSkip) {
|
|
48
|
-
var cleanObject = deleteObjectUndefined(object, keysToSkip);
|
|
49
|
-
return sortObject(cleanObject);
|
|
50
|
-
};
|
|
51
|
-
var sortObject = function (object) {
|
|
52
|
-
if (Array.isArray(object)) {
|
|
53
|
-
var newArray_1 = [];
|
|
54
|
-
object.map(function (item) { return newArray_1.push(sortObject(item)); });
|
|
55
|
-
return newArray_1;
|
|
56
|
-
}
|
|
57
|
-
if (object && typeof object === 'object') {
|
|
58
|
-
var newObject_1 = {};
|
|
59
|
-
Object.keys(object)
|
|
60
|
-
.sort()
|
|
61
|
-
.map(function (key) { return (newObject_1[key] = sortObject(object[key])); });
|
|
62
|
-
return newObject_1;
|
|
63
|
-
}
|
|
64
|
-
return object;
|
|
65
|
-
};
|
|
66
|
-
var deleteObjectUndefined = function (object, keysToSkip) {
|
|
67
|
-
if (Array.isArray(object)) {
|
|
68
|
-
object = object
|
|
69
|
-
.filter(function (item) { return item !== undefined || !item.length; })
|
|
70
|
-
.map(function (item) {
|
|
71
|
-
return (item && typeof item === 'object') || Array.isArray(item)
|
|
72
|
-
? deleteObjectUndefined(item, keysToSkip)
|
|
73
|
-
: null;
|
|
74
|
-
});
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (object && typeof object === 'object') {
|
|
78
|
-
Object.keys(object).map(function (key) {
|
|
79
|
-
if (keysToSkip === null || keysToSkip === void 0 ? void 0 : keysToSkip.includes(key)) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (object[key] && typeof object[key] === 'object') {
|
|
83
|
-
if (Object.entries(object[key]).length === 0) {
|
|
84
|
-
delete object[key];
|
|
85
|
-
}
|
|
86
|
-
deleteObjectUndefined(object[key], keysToSkip);
|
|
87
|
-
}
|
|
88
|
-
if ((!object[key] && object[key] !== 0 && typeof object[key] !== 'boolean') ||
|
|
89
|
-
(!object[key].length && Array.isArray(object[key]))) {
|
|
90
|
-
delete object[key];
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (Array.isArray(object[key]) && object[key].length) {
|
|
94
|
-
deleteObjectUndefined(object[key], keysToSkip);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return object;
|
|
99
|
-
};
|
|
100
|
-
var getFingerprint = function (content, algorithm, inputEncoding, outputEncoding) {
|
|
101
|
-
if (algorithm === void 0) { algorithm = 'sha1'; }
|
|
102
|
-
if (inputEncoding === void 0) { inputEncoding = 'utf8'; }
|
|
103
|
-
if (outputEncoding === void 0) { outputEncoding = 'base64'; }
|
|
104
|
-
var shaSum = (0, crypto_1.createHash)(algorithm);
|
|
105
|
-
shaSum.update(content, inputEncoding);
|
|
106
|
-
var res = shaSum.digest(outputEncoding);
|
|
107
|
-
return res;
|
|
108
|
-
};
|
|
109
|
-
var getCertificate = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
-
var pathPfx, pfx, certs;
|
|
111
|
-
return __generator(this, function (_a) {
|
|
112
|
-
switch (_a.label) {
|
|
113
|
-
case 0:
|
|
114
|
-
pathPfx = config_1.config.plexoClient.certificatePath;
|
|
115
|
-
pfx = fs.readFileSync(pathPfx);
|
|
116
|
-
return [4 /*yield*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
-
return __generator(this, function (_a) {
|
|
118
|
-
switch (_a.label) {
|
|
119
|
-
case 0: return [4 /*yield*/, pem.readPkcs12(pfx, { p12Password: config_1.config.plexoClient.certificatePassword }, function (_err, cert) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
-
var privateKey, stringifiedCert;
|
|
121
|
-
return __generator(this, function (_a) {
|
|
122
|
-
if (_err) {
|
|
123
|
-
return [2 /*return*/, reject(_err)];
|
|
124
|
-
}
|
|
125
|
-
privateKey = cert.key;
|
|
126
|
-
stringifiedCert = cert.cert;
|
|
127
|
-
resolve({ privateKey: privateKey, cert: stringifiedCert });
|
|
128
|
-
return [2 /*return*/];
|
|
129
|
-
});
|
|
130
|
-
}); })];
|
|
131
|
-
case 1:
|
|
132
|
-
_a.sent();
|
|
133
|
-
return [2 /*return*/];
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}); })];
|
|
137
|
-
case 1:
|
|
138
|
-
certs = _a.sent();
|
|
139
|
-
return [2 /*return*/, certs];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}); };
|
|
143
|
-
var generateSignature = function (object, privateKey) {
|
|
144
|
-
var canonizedString = (0, stringifyWithFloats_1.stringifyAmountsWithFloats)(object);
|
|
145
|
-
logger_lib_1.default.debug(canonizedString, 'String to sign');
|
|
146
|
-
var canonizedStringEncoded = new util_1.TextEncoder().encode(canonizedString);
|
|
147
|
-
var signKey = (0, crypto_1.sign)('SHA512', canonizedStringEncoded, privateKey).toString('base64');
|
|
148
|
-
return signKey;
|
|
149
|
-
};
|
|
150
|
-
exports.signatureUtils = {
|
|
151
|
-
canonizeJson: canonizeJson,
|
|
152
|
-
sortObject: sortObject,
|
|
153
|
-
deleteObjectUndefined: deleteObjectUndefined,
|
|
154
|
-
getFingerprint: getFingerprint,
|
|
155
|
-
getCertificate: getCertificate,
|
|
156
|
-
generateSignature: generateSignature,
|
|
157
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.signatureUtils = void 0;
|
|
40
|
+
var crypto_1 = require("crypto");
|
|
41
|
+
var fs = require("fs");
|
|
42
|
+
var pem = require("pem");
|
|
43
|
+
var util_1 = require("util");
|
|
44
|
+
var config_1 = require("../../../config/config");
|
|
45
|
+
var logger_lib_1 = require("../../../lib/logger.lib");
|
|
46
|
+
var stringifyWithFloats_1 = require("./stringifyWithFloats");
|
|
47
|
+
var canonizeJson = function (object, keysToSkip) {
|
|
48
|
+
var cleanObject = deleteObjectUndefined(object, keysToSkip);
|
|
49
|
+
return sortObject(cleanObject);
|
|
50
|
+
};
|
|
51
|
+
var sortObject = function (object) {
|
|
52
|
+
if (Array.isArray(object)) {
|
|
53
|
+
var newArray_1 = [];
|
|
54
|
+
object.map(function (item) { return newArray_1.push(sortObject(item)); });
|
|
55
|
+
return newArray_1;
|
|
56
|
+
}
|
|
57
|
+
if (object && typeof object === 'object') {
|
|
58
|
+
var newObject_1 = {};
|
|
59
|
+
Object.keys(object)
|
|
60
|
+
.sort()
|
|
61
|
+
.map(function (key) { return (newObject_1[key] = sortObject(object[key])); });
|
|
62
|
+
return newObject_1;
|
|
63
|
+
}
|
|
64
|
+
return object;
|
|
65
|
+
};
|
|
66
|
+
var deleteObjectUndefined = function (object, keysToSkip) {
|
|
67
|
+
if (Array.isArray(object)) {
|
|
68
|
+
object = object
|
|
69
|
+
.filter(function (item) { return item !== undefined || !item.length; })
|
|
70
|
+
.map(function (item) {
|
|
71
|
+
return (item && typeof item === 'object') || Array.isArray(item)
|
|
72
|
+
? deleteObjectUndefined(item, keysToSkip)
|
|
73
|
+
: null;
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (object && typeof object === 'object') {
|
|
78
|
+
Object.keys(object).map(function (key) {
|
|
79
|
+
if (keysToSkip === null || keysToSkip === void 0 ? void 0 : keysToSkip.includes(key)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (object[key] && typeof object[key] === 'object') {
|
|
83
|
+
if (Object.entries(object[key]).length === 0) {
|
|
84
|
+
delete object[key];
|
|
85
|
+
}
|
|
86
|
+
deleteObjectUndefined(object[key], keysToSkip);
|
|
87
|
+
}
|
|
88
|
+
if ((!object[key] && object[key] !== 0 && typeof object[key] !== 'boolean') ||
|
|
89
|
+
(!object[key].length && Array.isArray(object[key]))) {
|
|
90
|
+
delete object[key];
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (Array.isArray(object[key]) && object[key].length) {
|
|
94
|
+
deleteObjectUndefined(object[key], keysToSkip);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return object;
|
|
99
|
+
};
|
|
100
|
+
var getFingerprint = function (content, algorithm, inputEncoding, outputEncoding) {
|
|
101
|
+
if (algorithm === void 0) { algorithm = 'sha1'; }
|
|
102
|
+
if (inputEncoding === void 0) { inputEncoding = 'utf8'; }
|
|
103
|
+
if (outputEncoding === void 0) { outputEncoding = 'base64'; }
|
|
104
|
+
var shaSum = (0, crypto_1.createHash)(algorithm);
|
|
105
|
+
shaSum.update(content, inputEncoding);
|
|
106
|
+
var res = shaSum.digest(outputEncoding);
|
|
107
|
+
return res;
|
|
108
|
+
};
|
|
109
|
+
var getCertificate = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var pathPfx, pfx, certs;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
pathPfx = config_1.config.plexoClient.certificatePath;
|
|
115
|
+
pfx = fs.readFileSync(pathPfx);
|
|
116
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0: return [4 /*yield*/, pem.readPkcs12(pfx, { p12Password: config_1.config.plexoClient.certificatePassword }, function (_err, cert) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var privateKey, stringifiedCert;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
if (_err) {
|
|
123
|
+
return [2 /*return*/, reject(_err)];
|
|
124
|
+
}
|
|
125
|
+
privateKey = cert.key;
|
|
126
|
+
stringifiedCert = cert.cert;
|
|
127
|
+
resolve({ privateKey: privateKey, cert: stringifiedCert });
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
});
|
|
130
|
+
}); })];
|
|
131
|
+
case 1:
|
|
132
|
+
_a.sent();
|
|
133
|
+
return [2 /*return*/];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}); })];
|
|
137
|
+
case 1:
|
|
138
|
+
certs = _a.sent();
|
|
139
|
+
return [2 /*return*/, certs];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}); };
|
|
143
|
+
var generateSignature = function (object, privateKey) {
|
|
144
|
+
var canonizedString = (0, stringifyWithFloats_1.stringifyAmountsWithFloats)(object);
|
|
145
|
+
logger_lib_1.default.debug(canonizedString, 'String to sign');
|
|
146
|
+
var canonizedStringEncoded = new util_1.TextEncoder().encode(canonizedString);
|
|
147
|
+
var signKey = (0, crypto_1.sign)('SHA512', canonizedStringEncoded, privateKey).toString('base64');
|
|
148
|
+
return signKey;
|
|
149
|
+
};
|
|
150
|
+
exports.signatureUtils = {
|
|
151
|
+
canonizeJson: canonizeJson,
|
|
152
|
+
sortObject: sortObject,
|
|
153
|
+
deleteObjectUndefined: deleteObjectUndefined,
|
|
154
|
+
getFingerprint: getFingerprint,
|
|
155
|
+
getCertificate: getCertificate,
|
|
156
|
+
generateSignature: generateSignature,
|
|
157
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const stringifyAmountsWithFloats: (object: any) => string;
|
|
1
|
+
export declare const stringifyAmountsWithFloats: (object: any) => string;
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyAmountsWithFloats = void 0;
|
|
4
|
-
var beginFloat = '~begin~float~';
|
|
5
|
-
var endFloat = '~end~float~';
|
|
6
|
-
var decimalCount = function (numberValue) {
|
|
7
|
-
var numberToString = String(numberValue);
|
|
8
|
-
if (numberToString.includes('.')) {
|
|
9
|
-
return numberToString.split('.')[1].length;
|
|
10
|
-
}
|
|
11
|
-
return 0;
|
|
12
|
-
};
|
|
13
|
-
var stringifyWithFloats = function (config, decimals) {
|
|
14
|
-
if (config === void 0) { config = {}; }
|
|
15
|
-
if (decimals === void 0) { decimals = 1; }
|
|
16
|
-
return function (inputValue, inputReplacer, space) {
|
|
17
|
-
var inputReplacerIsFunction = typeof inputReplacer === 'function';
|
|
18
|
-
var isFirstIteration = true;
|
|
19
|
-
var jsonReplacer = function (key, val) {
|
|
20
|
-
if (isFirstIteration) {
|
|
21
|
-
isFirstIteration = false;
|
|
22
|
-
return inputReplacerIsFunction ? inputReplacer(key, val) : val;
|
|
23
|
-
}
|
|
24
|
-
var value;
|
|
25
|
-
if (inputReplacerIsFunction) {
|
|
26
|
-
value = inputReplacer(key, val);
|
|
27
|
-
}
|
|
28
|
-
else if (Array.isArray(inputReplacer)) {
|
|
29
|
-
// remove the property if it is not included in the inputReplacer array
|
|
30
|
-
value = inputReplacer.indexOf(key) !== -1 ? val : undefined;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
value = val;
|
|
34
|
-
}
|
|
35
|
-
var forceFloat = config[key] === 'float' &&
|
|
36
|
-
(value || value === 0) &&
|
|
37
|
-
typeof value === 'number' &&
|
|
38
|
-
!value.toString().toLowerCase().includes('e') &&
|
|
39
|
-
decimalCount(value) < 2;
|
|
40
|
-
return forceFloat ? "".concat(beginFloat).concat(value).concat(endFloat) : value;
|
|
41
|
-
};
|
|
42
|
-
var json = JSON.stringify(inputValue, jsonReplacer, space);
|
|
43
|
-
var regexReplacer = function (match, num) {
|
|
44
|
-
return num.includes('.') || Number.isNaN(num)
|
|
45
|
-
? Number.isNaN(num)
|
|
46
|
-
? num
|
|
47
|
-
: Number(num).toFixed(decimals)
|
|
48
|
-
: "".concat(num, ".").concat('0'.repeat(decimals));
|
|
49
|
-
};
|
|
50
|
-
var re = new RegExp("\"".concat(beginFloat, "(.+?)").concat(endFloat, "\""), 'g');
|
|
51
|
-
return json.replace(re, regexReplacer);
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
// We are adding this method because we need to replace round numbers for
|
|
55
|
-
// float numbers when generating signature to send to Plexo.
|
|
56
|
-
// By using this, when we have for example Amount: 100, we replace that for Amount: 100.0.
|
|
57
|
-
// If we send just 100, Plexo doesn't like that and we receive a
|
|
58
|
-
// "signature does not match" error message
|
|
59
|
-
var stringifyAmountsWithFloats = function (object) {
|
|
60
|
-
return stringifyWithFloats({
|
|
61
|
-
amount: 'float',
|
|
62
|
-
billedAmount: 'float',
|
|
63
|
-
taxedAmount: 'float',
|
|
64
|
-
vatAmount: 'float',
|
|
65
|
-
tipAmount: 'float',
|
|
66
|
-
Amount: 'float',
|
|
67
|
-
BilledAmount: 'float',
|
|
68
|
-
TaxedAmount: 'float',
|
|
69
|
-
VATAmount: 'float',
|
|
70
|
-
TipAmount: 'float',
|
|
71
|
-
}, 1)(object, null, 0);
|
|
72
|
-
};
|
|
73
|
-
exports.stringifyAmountsWithFloats = stringifyAmountsWithFloats;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringifyAmountsWithFloats = void 0;
|
|
4
|
+
var beginFloat = '~begin~float~';
|
|
5
|
+
var endFloat = '~end~float~';
|
|
6
|
+
var decimalCount = function (numberValue) {
|
|
7
|
+
var numberToString = String(numberValue);
|
|
8
|
+
if (numberToString.includes('.')) {
|
|
9
|
+
return numberToString.split('.')[1].length;
|
|
10
|
+
}
|
|
11
|
+
return 0;
|
|
12
|
+
};
|
|
13
|
+
var stringifyWithFloats = function (config, decimals) {
|
|
14
|
+
if (config === void 0) { config = {}; }
|
|
15
|
+
if (decimals === void 0) { decimals = 1; }
|
|
16
|
+
return function (inputValue, inputReplacer, space) {
|
|
17
|
+
var inputReplacerIsFunction = typeof inputReplacer === 'function';
|
|
18
|
+
var isFirstIteration = true;
|
|
19
|
+
var jsonReplacer = function (key, val) {
|
|
20
|
+
if (isFirstIteration) {
|
|
21
|
+
isFirstIteration = false;
|
|
22
|
+
return inputReplacerIsFunction ? inputReplacer(key, val) : val;
|
|
23
|
+
}
|
|
24
|
+
var value;
|
|
25
|
+
if (inputReplacerIsFunction) {
|
|
26
|
+
value = inputReplacer(key, val);
|
|
27
|
+
}
|
|
28
|
+
else if (Array.isArray(inputReplacer)) {
|
|
29
|
+
// remove the property if it is not included in the inputReplacer array
|
|
30
|
+
value = inputReplacer.indexOf(key) !== -1 ? val : undefined;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
value = val;
|
|
34
|
+
}
|
|
35
|
+
var forceFloat = config[key] === 'float' &&
|
|
36
|
+
(value || value === 0) &&
|
|
37
|
+
typeof value === 'number' &&
|
|
38
|
+
!value.toString().toLowerCase().includes('e') &&
|
|
39
|
+
decimalCount(value) < 2;
|
|
40
|
+
return forceFloat ? "".concat(beginFloat).concat(value).concat(endFloat) : value;
|
|
41
|
+
};
|
|
42
|
+
var json = JSON.stringify(inputValue, jsonReplacer, space);
|
|
43
|
+
var regexReplacer = function (match, num) {
|
|
44
|
+
return num.includes('.') || Number.isNaN(num)
|
|
45
|
+
? Number.isNaN(num)
|
|
46
|
+
? num
|
|
47
|
+
: Number(num).toFixed(decimals)
|
|
48
|
+
: "".concat(num, ".").concat('0'.repeat(decimals));
|
|
49
|
+
};
|
|
50
|
+
var re = new RegExp("\"".concat(beginFloat, "(.+?)").concat(endFloat, "\""), 'g');
|
|
51
|
+
return json.replace(re, regexReplacer);
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
// We are adding this method because we need to replace round numbers for
|
|
55
|
+
// float numbers when generating signature to send to Plexo.
|
|
56
|
+
// By using this, when we have for example Amount: 100, we replace that for Amount: 100.0.
|
|
57
|
+
// If we send just 100, Plexo doesn't like that and we receive a
|
|
58
|
+
// "signature does not match" error message
|
|
59
|
+
var stringifyAmountsWithFloats = function (object) {
|
|
60
|
+
return stringifyWithFloats({
|
|
61
|
+
amount: 'float',
|
|
62
|
+
billedAmount: 'float',
|
|
63
|
+
taxedAmount: 'float',
|
|
64
|
+
vatAmount: 'float',
|
|
65
|
+
tipAmount: 'float',
|
|
66
|
+
Amount: 'float',
|
|
67
|
+
BilledAmount: 'float',
|
|
68
|
+
TaxedAmount: 'float',
|
|
69
|
+
VATAmount: 'float',
|
|
70
|
+
TipAmount: 'float',
|
|
71
|
+
}, 1)(object, null, 0);
|
|
72
|
+
};
|
|
73
|
+
exports.stringifyAmountsWithFloats = stringifyAmountsWithFloats;
|
package/lib/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './models/IndexSDK';
|
|
2
|
-
export { IPaymentGatewayClient } from './IPaymentGatewayClient';
|
|
3
|
-
export { PaymentGatewayClient } from './PaymentGatewayClient';
|
|
4
|
-
export { SignatureHelper } from './helpers/signature/signatureHelper';
|
|
1
|
+
export * from './models/IndexSDK';
|
|
2
|
+
export { IPaymentGatewayClient } from './IPaymentGatewayClient';
|
|
3
|
+
export { PaymentGatewayClient } from './PaymentGatewayClient';
|
|
4
|
+
export { SignatureHelper } from './helpers/signature/signatureHelper';
|
package/lib/sdk/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SignatureHelper = exports.PaymentGatewayClient = void 0;
|
|
18
|
-
__exportStar(require("./models/IndexSDK"), exports);
|
|
19
|
-
var PaymentGatewayClient_1 = require("./PaymentGatewayClient");
|
|
20
|
-
Object.defineProperty(exports, "PaymentGatewayClient", { enumerable: true, get: function () { return PaymentGatewayClient_1.PaymentGatewayClient; } });
|
|
21
|
-
var signatureHelper_1 = require("./helpers/signature/signatureHelper");
|
|
22
|
-
Object.defineProperty(exports, "SignatureHelper", { enumerable: true, get: function () { return signatureHelper_1.SignatureHelper; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SignatureHelper = exports.PaymentGatewayClient = void 0;
|
|
18
|
+
__exportStar(require("./models/IndexSDK"), exports);
|
|
19
|
+
var PaymentGatewayClient_1 = require("./PaymentGatewayClient");
|
|
20
|
+
Object.defineProperty(exports, "PaymentGatewayClient", { enumerable: true, get: function () { return PaymentGatewayClient_1.PaymentGatewayClient; } });
|
|
21
|
+
var signatureHelper_1 = require("./helpers/signature/signatureHelper");
|
|
22
|
+
Object.defineProperty(exports, "SignatureHelper", { enumerable: true, get: function () { return signatureHelper_1.SignatureHelper; } });
|
package/lib/sdk/mocks/mocks.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { PaymentCode } from '../models/CodeAction';
|
|
2
|
-
import { ClientSignedResponse, Commerce, InstrumentCallback, IssuerData, IssuerInfo, IssuerProcessor, PaymentInstrument, Session, Transaction, TransactionCallback, TransactionCursor, AmountLimit, Currency, FieldInfo, FieldInfoPaymentProcessors, FinancialInclusionResult, PaymentProcessor, TimeLimit, TransactionInfo } from '../models/IndexSDK';
|
|
3
|
-
export declare const mocks: {
|
|
4
|
-
currencyMock: Currency;
|
|
5
|
-
amountLimitMock: AmountLimit;
|
|
6
|
-
timeLimitMock: TimeLimit;
|
|
7
|
-
fieldMock: FieldInfo;
|
|
8
|
-
issuerMock: IssuerInfo;
|
|
9
|
-
paymentInstrumentMock: PaymentInstrument;
|
|
10
|
-
financialInclusionMock: FinancialInclusionResult;
|
|
11
|
-
transactionInfoMock: TransactionInfo;
|
|
12
|
-
commerceMock: Commerce;
|
|
13
|
-
paymentCodeMock: PaymentCode;
|
|
14
|
-
issuerDataMock: IssuerData;
|
|
15
|
-
sessionMock: Session;
|
|
16
|
-
transactionMock: Transaction;
|
|
17
|
-
transactionCursorMock: TransactionCursor;
|
|
18
|
-
fieldInfoPaymentProcessorMock: FieldInfoPaymentProcessors;
|
|
19
|
-
paymentProcessorMock: PaymentProcessor;
|
|
20
|
-
issuerProcessorMock: IssuerProcessor;
|
|
21
|
-
clientSignedResponseMock: ClientSignedResponse;
|
|
22
|
-
transactionCallbackMock: TransactionCallback;
|
|
23
|
-
instrumentCallbackMock: InstrumentCallback;
|
|
24
|
-
};
|
|
1
|
+
import { PaymentCode } from '../models/CodeAction';
|
|
2
|
+
import { ClientSignedResponse, Commerce, InstrumentCallback, IssuerData, IssuerInfo, IssuerProcessor, PaymentInstrument, Session, Transaction, TransactionCallback, TransactionCursor, AmountLimit, Currency, FieldInfo, FieldInfoPaymentProcessors, FinancialInclusionResult, PaymentProcessor, TimeLimit, TransactionInfo } from '../models/IndexSDK';
|
|
3
|
+
export declare const mocks: {
|
|
4
|
+
currencyMock: Currency;
|
|
5
|
+
amountLimitMock: AmountLimit;
|
|
6
|
+
timeLimitMock: TimeLimit;
|
|
7
|
+
fieldMock: FieldInfo;
|
|
8
|
+
issuerMock: IssuerInfo;
|
|
9
|
+
paymentInstrumentMock: PaymentInstrument;
|
|
10
|
+
financialInclusionMock: FinancialInclusionResult;
|
|
11
|
+
transactionInfoMock: TransactionInfo;
|
|
12
|
+
commerceMock: Commerce;
|
|
13
|
+
paymentCodeMock: PaymentCode;
|
|
14
|
+
issuerDataMock: IssuerData;
|
|
15
|
+
sessionMock: Session;
|
|
16
|
+
transactionMock: Transaction;
|
|
17
|
+
transactionCursorMock: TransactionCursor;
|
|
18
|
+
fieldInfoPaymentProcessorMock: FieldInfoPaymentProcessors;
|
|
19
|
+
paymentProcessorMock: PaymentProcessor;
|
|
20
|
+
issuerProcessorMock: IssuerProcessor;
|
|
21
|
+
clientSignedResponseMock: ClientSignedResponse;
|
|
22
|
+
transactionCallbackMock: TransactionCallback;
|
|
23
|
+
instrumentCallbackMock: InstrumentCallback;
|
|
24
|
+
};
|