@payabli/sdk-node 0.0.117 → 0.0.126
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 +25 -13
- package/dist/cjs/BaseClient.d.ts +7 -7
- package/dist/cjs/BaseClient.js +3 -1
- package/dist/cjs/Client.d.ts +1 -2
- package/dist/cjs/api/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/errors/ConflictError.js +5 -1
- package/dist/cjs/api/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/errors/ServiceUnavailableError.js +5 -1
- package/dist/cjs/api/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/bill/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/bill/types/BillResponseData.d.ts +2 -1
- package/dist/cjs/api/resources/boarding/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/cloud/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/customer/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/export/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/export/client/Client.js +5 -21
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/import/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/import/client/Client.js +5 -21
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/invoice/client/Client.d.ts +6 -5
- package/dist/cjs/api/resources/invoice/client/Client.js +5 -3
- package/dist/cjs/api/resources/invoice/client/requests/AddInvoiceRequest.d.ts +5 -3
- package/dist/cjs/api/resources/lineItem/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/lineItem/client/Client.js +5 -21
- package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +248 -4
- package/dist/cjs/api/resources/moneyIn/client/Client.js +518 -2
- package/dist/cjs/api/resources/moneyIn/client/requests/RequestPaymentAuthorizeV2.d.ts +31 -0
- package/dist/cjs/api/resources/moneyIn/client/requests/RequestPaymentV2.d.ts +99 -0
- package/dist/cjs/api/resources/moneyIn/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +5 -1
- package/dist/cjs/api/resources/moneyIn/errors/InvalidTransStatusError.js +5 -1
- package/dist/cjs/api/resources/moneyIn/types/AuthResponseResponseData.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/types/CaptureResponseData.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/types/GetPaidResponseData.d.ts +3 -3
- package/dist/cjs/api/resources/moneyIn/types/ResponseDataRefunds.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/types/TransactionDetailResponseData.d.ts +7 -3
- package/dist/cjs/api/resources/moneyIn/types/ValidateResponseData.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/types/VoidResponseData.d.ts +2 -2
- package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthCapturePayoutResponse.d.ts +2 -2
- package/dist/cjs/api/resources/notification/client/Client.d.ts +14 -7
- package/dist/cjs/api/resources/notification/client/Client.js +18 -21
- package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/notificationlogs/client/Client.js +5 -21
- package/dist/cjs/api/resources/ocr/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/ocr/client/Client.js +5 -21
- package/dist/cjs/api/resources/organization/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/organization/client/Client.js +5 -21
- package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +4 -10
- package/dist/cjs/api/resources/paymentLink/client/Client.js +8 -24
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataBill.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataOut.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/types/PaymentPageRequestBody.d.ts +2 -2
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +5 -21
- package/dist/cjs/api/resources/paypoint/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/paypoint/client/Client.js +5 -21
- package/dist/cjs/api/resources/query/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/query/client/Client.js +5 -21
- package/dist/cjs/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.ts +158 -0
- package/dist/cjs/api/resources/statistic/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/statistic/client/Client.js +5 -21
- package/dist/cjs/api/resources/subscription/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/subscription/client/Client.js +5 -21
- package/dist/cjs/api/resources/templates/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/templates/client/Client.js +5 -21
- package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +52 -7
- package/dist/cjs/api/resources/tokenStorage/client/Client.js +56 -21
- package/dist/cjs/api/resources/tokenStorage/client/requests/AddMethodRequest.d.ts +23 -0
- package/dist/cjs/api/resources/tokenStorage/client/requests/GetMethodRequest.d.ts +6 -0
- package/dist/cjs/api/resources/tokenStorage/client/requests/UpdateMethodRequest.d.ts +22 -0
- package/dist/cjs/api/resources/tokenStorage/types/GetMethodResponse.d.ts +101 -1
- package/dist/cjs/api/resources/tokenStorage/types/RequestTokenStorage.d.ts +1 -0
- package/dist/cjs/api/resources/tokenStorage/types/VendorDataRequest.d.ts +9 -0
- package/dist/cjs/api/resources/tokenStorage/types/VendorDataRequest.js +3 -0
- package/dist/cjs/api/resources/tokenStorage/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/tokenStorage/types/index.js +1 -0
- package/dist/cjs/api/resources/user/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/user/client/Client.js +5 -21
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestAuthResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestAuthResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestCaptureResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestCaptureResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestRefundResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestRefundResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestVoidResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/BadRequestVoidResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedAuthResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedAuthResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedCaptureResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedCaptureResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedRefundResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedRefundResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedVoidResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/DeclinedVoidResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/InternalServerResponseErrorV2.d.ts +6 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/InternalServerResponseErrorV2.js +54 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/index.d.ts +9 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/errors/index.js +25 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/index.d.ts +2 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/index.js +18 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2BadRequestError.d.ts +22 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2BadRequestError.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2BadRequestErrorDetail.d.ts +9 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2BadRequestErrorDetail.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2DeclinedTransactionResponseWrapper.d.ts +761 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2DeclinedTransactionResponseWrapper.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2InternalServerError.d.ts +21 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2InternalServerError.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseAction.d.ts +4 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseAction.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseCode.d.ts +4 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseCode.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseExplanation.d.ts +4 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseExplanation.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseReason.d.ts +4 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2ResponseReason.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionDetailResponseData.d.ts +65 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionDetailResponseData.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionDetails.d.ts +1003 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionDetails.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionResponseWrapper.d.ts +13 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionResponseWrapper.js +3 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/index.d.ts +11 -0
- package/dist/cjs/api/resources/v2MoneyInTypes/types/index.js +27 -0
- package/dist/cjs/api/resources/vendor/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/vendor/client/Client.js +5 -21
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/wallet/client/Client.js +5 -21
- package/dist/cjs/api/types/ApplicationData.d.ts +1 -0
- package/dist/cjs/api/types/ApplicationDataManaged.d.ts +1 -0
- package/dist/cjs/api/types/ApplicationDataOdp.d.ts +1 -0
- package/dist/cjs/api/types/ApplicationDataPayIn.d.ts +1 -0
- package/dist/cjs/api/types/{Avsresponsetext.d.ts → AvsResponse.d.ts} +1 -1
- package/dist/cjs/api/types/AvsResponse.js +3 -0
- package/dist/{esm/api/types/Avsresponsetext.d.mts → cjs/api/types/AvsResponseText.d.ts} +1 -1
- package/dist/cjs/api/types/AvsResponseText.js +3 -0
- package/dist/cjs/api/types/CustomerVaultId.d.ts +1 -0
- package/dist/cjs/api/types/CustomerVaultId.js +3 -0
- package/dist/cjs/api/types/{Cvvresponsetext.d.ts → CvvResponse.d.ts} +1 -1
- package/dist/cjs/api/types/CvvResponse.js +3 -0
- package/dist/{esm/api/types/Cvvresponsetext.d.mts → cjs/api/types/CvvResponseText.d.ts} +1 -1
- package/dist/cjs/api/types/CvvResponseText.js +3 -0
- package/dist/cjs/api/types/EmvAuthResponseData.d.ts +4 -0
- package/dist/cjs/api/types/EmvAuthResponseData.js +3 -0
- package/dist/cjs/api/types/Frequency.d.ts +1 -1
- package/dist/cjs/api/types/Frequency.js +1 -1
- package/dist/cjs/api/types/FrequencyList.d.ts +1 -1
- package/dist/cjs/api/types/MaxTicket.d.ts +4 -0
- package/dist/cjs/api/types/MaxTicket.js +3 -0
- package/dist/cjs/api/types/MinTicket.d.ts +4 -0
- package/dist/cjs/api/types/MinTicket.js +3 -0
- package/dist/cjs/api/types/OnCreate.d.ts +4 -0
- package/dist/cjs/api/types/OnCreate.js +3 -0
- package/dist/cjs/api/types/PayabliApiResponse0.d.ts +2 -2
- package/dist/cjs/api/types/PayabliApiResponse0000.d.ts +2 -2
- package/dist/cjs/api/types/PayabliCredentialsPascal.d.ts +3 -2
- package/dist/cjs/api/types/PayorDataResponse.d.ts +1 -1
- package/dist/cjs/api/types/QueryResponseData.d.ts +41 -10
- package/dist/cjs/api/types/QueryResponseSettlements.d.ts +134 -0
- package/dist/cjs/api/types/QuerySubscriptionResponse.d.ts +1 -1
- package/dist/cjs/api/types/QueryTransactionPayorData.d.ts +1 -1
- package/dist/cjs/api/types/ResultCodeText.d.ts +4 -0
- package/dist/cjs/api/types/ResultCodeText.js +3 -0
- package/dist/cjs/api/types/ResultCodev2.d.ts +4 -0
- package/dist/cjs/api/types/ResultCodev2.js +3 -0
- package/dist/cjs/api/types/index.d.ts +11 -2
- package/dist/cjs/api/types/index.js +11 -2
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +4 -2
- package/dist/cjs/errors/PayabliError.js +5 -1
- package/dist/cjs/errors/PayabliTimeoutError.js +5 -1
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +4 -0
- package/dist/esm/BaseClient.d.mts +7 -7
- package/dist/esm/BaseClient.mjs +3 -1
- package/dist/esm/Client.d.mts +1 -2
- package/dist/esm/api/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/errors/ConflictError.mjs +5 -1
- package/dist/esm/api/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/errors/ServiceUnavailableError.mjs +5 -1
- package/dist/esm/api/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/bill/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/bill/types/BillResponseData.d.mts +2 -1
- package/dist/esm/api/resources/boarding/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/checkCapture/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/cloud/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/customer/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/export/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/export/client/Client.mjs +5 -21
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/import/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/import/client/Client.mjs +5 -21
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/invoice/client/Client.d.mts +6 -5
- package/dist/esm/api/resources/invoice/client/Client.mjs +5 -3
- package/dist/esm/api/resources/invoice/client/requests/AddInvoiceRequest.d.mts +5 -3
- package/dist/esm/api/resources/lineItem/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/lineItem/client/Client.mjs +5 -21
- package/dist/esm/api/resources/moneyIn/client/Client.d.mts +248 -4
- package/dist/esm/api/resources/moneyIn/client/Client.mjs +518 -2
- package/dist/esm/api/resources/moneyIn/client/requests/RequestPaymentAuthorizeV2.d.mts +31 -0
- package/dist/esm/api/resources/moneyIn/client/requests/RequestPaymentV2.d.mts +99 -0
- package/dist/esm/api/resources/moneyIn/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +5 -1
- package/dist/esm/api/resources/moneyIn/errors/InvalidTransStatusError.mjs +5 -1
- package/dist/esm/api/resources/moneyIn/types/AuthResponseResponseData.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/types/CaptureResponseData.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/types/GetPaidResponseData.d.mts +3 -3
- package/dist/esm/api/resources/moneyIn/types/ResponseDataRefunds.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/types/TransactionDetailResponseData.d.mts +7 -3
- package/dist/esm/api/resources/moneyIn/types/ValidateResponseData.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/types/VoidResponseData.d.mts +2 -2
- package/dist/esm/api/resources/moneyOut/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/moneyOutTypes/types/AuthCapturePayoutResponse.d.mts +2 -2
- package/dist/esm/api/resources/notification/client/Client.d.mts +14 -7
- package/dist/esm/api/resources/notification/client/Client.mjs +18 -21
- package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/notificationlogs/client/Client.mjs +5 -21
- package/dist/esm/api/resources/ocr/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/ocr/client/Client.mjs +5 -21
- package/dist/esm/api/resources/organization/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/organization/client/Client.mjs +5 -21
- package/dist/esm/api/resources/paymentLink/client/Client.d.mts +4 -10
- package/dist/esm/api/resources/paymentLink/client/Client.mjs +8 -24
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataBill.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataOut.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/types/PaymentPageRequestBody.d.mts +2 -2
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +5 -21
- package/dist/esm/api/resources/paypoint/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/paypoint/client/Client.mjs +5 -21
- package/dist/esm/api/resources/query/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/query/client/Client.mjs +5 -21
- package/dist/esm/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.mts +158 -0
- package/dist/esm/api/resources/statistic/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/statistic/client/Client.mjs +5 -21
- package/dist/esm/api/resources/subscription/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/subscription/client/Client.mjs +5 -21
- package/dist/esm/api/resources/templates/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/templates/client/Client.mjs +5 -21
- package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +52 -7
- package/dist/esm/api/resources/tokenStorage/client/Client.mjs +56 -21
- package/dist/esm/api/resources/tokenStorage/client/requests/AddMethodRequest.d.mts +23 -0
- package/dist/esm/api/resources/tokenStorage/client/requests/GetMethodRequest.d.mts +6 -0
- package/dist/esm/api/resources/tokenStorage/client/requests/UpdateMethodRequest.d.mts +22 -0
- package/dist/esm/api/resources/tokenStorage/types/GetMethodResponse.d.mts +101 -1
- package/dist/esm/api/resources/tokenStorage/types/RequestTokenStorage.d.mts +1 -0
- package/dist/esm/api/resources/tokenStorage/types/VendorDataRequest.d.mts +9 -0
- package/dist/esm/api/resources/tokenStorage/types/VendorDataRequest.mjs +2 -0
- package/dist/esm/api/resources/tokenStorage/types/index.d.mts +1 -0
- package/dist/esm/api/resources/tokenStorage/types/index.mjs +1 -0
- package/dist/esm/api/resources/user/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/user/client/Client.mjs +5 -21
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestAuthResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestAuthResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestCaptureResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestCaptureResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestRefundResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestRefundResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestVoidResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/BadRequestVoidResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedAuthResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedAuthResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedCaptureResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedCaptureResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedRefundResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedRefundResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedVoidResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/DeclinedVoidResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/InternalServerResponseErrorV2.d.mts +6 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/InternalServerResponseErrorV2.mjs +17 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/index.d.mts +9 -0
- package/dist/esm/api/resources/v2MoneyInTypes/errors/index.mjs +9 -0
- package/dist/esm/api/resources/v2MoneyInTypes/index.d.mts +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/index.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2BadRequestError.d.mts +22 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2BadRequestError.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2BadRequestErrorDetail.d.mts +9 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2BadRequestErrorDetail.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2DeclinedTransactionResponseWrapper.d.mts +761 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2DeclinedTransactionResponseWrapper.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2InternalServerError.d.mts +21 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2InternalServerError.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseAction.d.mts +4 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseAction.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseCode.d.mts +4 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseCode.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseExplanation.d.mts +4 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseExplanation.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseReason.d.mts +4 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2ResponseReason.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionDetailResponseData.d.mts +65 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionDetailResponseData.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionDetails.d.mts +1003 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionDetails.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionResponseWrapper.d.mts +13 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionResponseWrapper.mjs +2 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/index.d.mts +11 -0
- package/dist/esm/api/resources/v2MoneyInTypes/types/index.mjs +11 -0
- package/dist/esm/api/resources/vendor/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/vendor/client/Client.mjs +5 -21
- package/dist/esm/api/resources/wallet/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/wallet/client/Client.mjs +5 -21
- package/dist/esm/api/types/ApplicationData.d.mts +1 -0
- package/dist/esm/api/types/ApplicationDataManaged.d.mts +1 -0
- package/dist/esm/api/types/ApplicationDataOdp.d.mts +1 -0
- package/dist/esm/api/types/ApplicationDataPayIn.d.mts +1 -0
- package/dist/esm/api/types/AvsResponse.d.mts +4 -0
- package/dist/esm/api/types/AvsResponse.mjs +2 -0
- package/dist/esm/api/types/AvsResponseText.d.mts +4 -0
- package/dist/esm/api/types/AvsResponseText.mjs +2 -0
- package/dist/esm/api/types/CustomerVaultId.d.mts +1 -0
- package/dist/esm/api/types/CustomerVaultId.mjs +2 -0
- package/dist/esm/api/types/CvvResponse.d.mts +4 -0
- package/dist/esm/api/types/CvvResponse.mjs +2 -0
- package/dist/esm/api/types/CvvResponseText.d.mts +4 -0
- package/dist/esm/api/types/CvvResponseText.mjs +2 -0
- package/dist/esm/api/types/EmvAuthResponseData.d.mts +4 -0
- package/dist/esm/api/types/EmvAuthResponseData.mjs +2 -0
- package/dist/esm/api/types/Frequency.d.mts +1 -1
- package/dist/esm/api/types/Frequency.mjs +1 -1
- package/dist/esm/api/types/FrequencyList.d.mts +1 -1
- package/dist/esm/api/types/MaxTicket.d.mts +4 -0
- package/dist/esm/api/types/MaxTicket.mjs +2 -0
- package/dist/esm/api/types/MinTicket.d.mts +4 -0
- package/dist/esm/api/types/MinTicket.mjs +2 -0
- package/dist/esm/api/types/OnCreate.d.mts +4 -0
- package/dist/esm/api/types/OnCreate.mjs +2 -0
- package/dist/esm/api/types/PayabliApiResponse0.d.mts +2 -2
- package/dist/esm/api/types/PayabliApiResponse0000.d.mts +2 -2
- package/dist/esm/api/types/PayabliCredentialsPascal.d.mts +3 -2
- package/dist/esm/api/types/PayorDataResponse.d.mts +1 -1
- package/dist/esm/api/types/QueryResponseData.d.mts +41 -10
- package/dist/esm/api/types/QueryResponseSettlements.d.mts +134 -0
- package/dist/esm/api/types/QuerySubscriptionResponse.d.mts +1 -1
- package/dist/esm/api/types/QueryTransactionPayorData.d.mts +1 -1
- package/dist/esm/api/types/ResultCodeText.d.mts +4 -0
- package/dist/esm/api/types/ResultCodeText.mjs +2 -0
- package/dist/esm/api/types/ResultCodev2.d.mts +4 -0
- package/dist/esm/api/types/ResultCodev2.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +11 -2
- package/dist/esm/api/types/index.mjs +11 -2
- package/dist/esm/auth/HeaderAuthProvider.d.mts +4 -2
- package/dist/esm/errors/PayabliError.mjs +5 -1
- package/dist/esm/errors/PayabliTimeoutError.mjs +5 -1
- package/dist/esm/version.d.mts +1 -0
- package/dist/esm/version.mjs +1 -0
- package/package.json +7 -4
- package/reference.md +475 -8
- /package/dist/cjs/api/{types/Avsresponsetext.js → resources/moneyIn/client/requests/RequestPaymentAuthorizeV2.js} +0 -0
- /package/dist/cjs/api/{types/Cvvresponsetext.js → resources/moneyIn/client/requests/RequestPaymentV2.js} +0 -0
- /package/dist/esm/api/{types/Avsresponsetext.mjs → resources/moneyIn/client/requests/RequestPaymentAuthorizeV2.mjs} +0 -0
- /package/dist/esm/api/{types/Cvvresponsetext.mjs → resources/moneyIn/client/requests/RequestPaymentV2.mjs} +0 -0
|
@@ -68,8 +68,10 @@ class MoneyInClient {
|
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until [captured](/api-reference/moneyin/capture-an-authorized-transaction).
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* Only card transactions can be authorized. This endpoint can't be used for ACH transactions.
|
|
72
|
+
* <Tip>
|
|
73
|
+
* Consider migrating to the [v2 Authorize endpoint](/developers/api-reference/moneyinV2/authorize-a-transaction) to take advantage of unified response codes and improved response consistency.
|
|
74
|
+
* </Tip>
|
|
73
75
|
*
|
|
74
76
|
* @param {Payabli.RequestPaymentAuthorize} request
|
|
75
77
|
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -222,6 +224,10 @@ class MoneyInClient {
|
|
|
222
224
|
*
|
|
223
225
|
* You can use this endpoint to capture both full and partial amounts of the original authorized transaction. See [Capture an authorized transaction](/developers/developer-guides/pay-in-auth-and-capture) for more information about this endpoint.
|
|
224
226
|
*
|
|
227
|
+
* <Tip>
|
|
228
|
+
* Consider migrating to the [v2 Capture endpoint](/developers/api-reference/moneyinV2/capture-an-authorized-transaction) to take advantage of unified response codes and improved response consistency.
|
|
229
|
+
* </Tip>
|
|
230
|
+
*
|
|
225
231
|
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
226
232
|
* @param {Payabli.CaptureRequest} request
|
|
227
233
|
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -474,6 +480,10 @@ class MoneyInClient {
|
|
|
474
480
|
/**
|
|
475
481
|
* Make a single transaction. This method authorizes and captures a payment in one step.
|
|
476
482
|
*
|
|
483
|
+
* <Tip>
|
|
484
|
+
* Consider migrating to the [v2 Make a transaction endpoint](/developers/api-reference/moneyinV2/make-a-transaction) to take advantage of unified response codes and improved response consistency.
|
|
485
|
+
* </Tip>
|
|
486
|
+
*
|
|
477
487
|
* @param {Payabli.RequestPayment} request
|
|
478
488
|
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
479
489
|
*
|
|
@@ -762,6 +772,10 @@ class MoneyInClient {
|
|
|
762
772
|
/**
|
|
763
773
|
* Refund a transaction that has settled and send money back to the account holder. If a transaction hasn't been settled, void it instead.
|
|
764
774
|
*
|
|
775
|
+
* <Tip>
|
|
776
|
+
* Consider migrating to the [v2 Refund endpoint](/developers/api-reference/moneyinV2/refund-a-settled-transaction) to take advantage of unified response codes and improved response consistency.
|
|
777
|
+
* </Tip>
|
|
778
|
+
*
|
|
765
779
|
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
766
780
|
* @param {number} amount -
|
|
767
781
|
* Amount to refund from original transaction, minus any service fees charged on the original transaction.
|
|
@@ -1125,6 +1139,10 @@ class MoneyInClient {
|
|
|
1125
1139
|
/**
|
|
1126
1140
|
* Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. If a transaction has been settled, refund it instead.
|
|
1127
1141
|
*
|
|
1142
|
+
* <Tip>
|
|
1143
|
+
* Consider migrating to the [v2 Void endpoint](/developers/api-reference/moneyinV2/void-a-transaction) to take advantage of unified response codes and improved response consistency.
|
|
1144
|
+
* </Tip>
|
|
1145
|
+
*
|
|
1128
1146
|
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
1129
1147
|
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1130
1148
|
*
|
|
@@ -1179,5 +1197,503 @@ class MoneyInClient {
|
|
|
1179
1197
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyIn/void/{transId}");
|
|
1180
1198
|
});
|
|
1181
1199
|
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Make a single transaction. This method authorizes and captures a payment in one step. This is the v2 version of the `api/MoneyIn/getpaid` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1202
|
+
*
|
|
1203
|
+
* @param {Payabli.RequestPaymentV2} request
|
|
1204
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1205
|
+
*
|
|
1206
|
+
* @throws {@link Payabli.BadRequestAuthResponseErrorV2}
|
|
1207
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1208
|
+
* @throws {@link Payabli.DeclinedAuthResponseErrorV2}
|
|
1209
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1210
|
+
*
|
|
1211
|
+
* @example
|
|
1212
|
+
* await client.moneyIn.getpaidv2({
|
|
1213
|
+
* body: {
|
|
1214
|
+
* customerData: {
|
|
1215
|
+
* customerId: 4440
|
|
1216
|
+
* },
|
|
1217
|
+
* entryPoint: "f743aed24a",
|
|
1218
|
+
* ipaddress: "255.255.255.255",
|
|
1219
|
+
* paymentDetails: {
|
|
1220
|
+
* serviceFee: 0,
|
|
1221
|
+
* totalAmount: 100
|
|
1222
|
+
* },
|
|
1223
|
+
* paymentMethod: {
|
|
1224
|
+
* cardcvv: "999",
|
|
1225
|
+
* cardexp: "02/27",
|
|
1226
|
+
* cardHolder: "John Cassian",
|
|
1227
|
+
* cardnumber: "4111111111111111",
|
|
1228
|
+
* cardzip: "12345",
|
|
1229
|
+
* initiator: "payor",
|
|
1230
|
+
* method: "card"
|
|
1231
|
+
* }
|
|
1232
|
+
* }
|
|
1233
|
+
* })
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* await client.moneyIn.getpaidv2({
|
|
1237
|
+
* body: {
|
|
1238
|
+
* customerData: {
|
|
1239
|
+
* customerId: 4440
|
|
1240
|
+
* },
|
|
1241
|
+
* entryPoint: "f743aed24a",
|
|
1242
|
+
* ipaddress: "255.255.255.255",
|
|
1243
|
+
* paymentDetails: {
|
|
1244
|
+
* serviceFee: 0,
|
|
1245
|
+
* totalAmount: 100
|
|
1246
|
+
* },
|
|
1247
|
+
* paymentMethod: {
|
|
1248
|
+
* initiator: "payor",
|
|
1249
|
+
* method: "card",
|
|
1250
|
+
* storedMethodId: "1ec55af9-7b5a-4ff0-81ed-c12d2f95e135-4440",
|
|
1251
|
+
* storedMethodUsageType: "unscheduled"
|
|
1252
|
+
* }
|
|
1253
|
+
* }
|
|
1254
|
+
* })
|
|
1255
|
+
*
|
|
1256
|
+
* @example
|
|
1257
|
+
* await client.moneyIn.getpaidv2({
|
|
1258
|
+
* body: {
|
|
1259
|
+
* customerData: {
|
|
1260
|
+
* customerId: 4440
|
|
1261
|
+
* },
|
|
1262
|
+
* entryPoint: "f743aed24a",
|
|
1263
|
+
* ipaddress: "255.255.255.255",
|
|
1264
|
+
* paymentDetails: {
|
|
1265
|
+
* serviceFee: 0,
|
|
1266
|
+
* totalAmount: 100
|
|
1267
|
+
* },
|
|
1268
|
+
* paymentMethod: {
|
|
1269
|
+
* achAccount: "123123123",
|
|
1270
|
+
* achAccountType: "Checking",
|
|
1271
|
+
* achCode: "WEB",
|
|
1272
|
+
* achHolder: "John Cassian",
|
|
1273
|
+
* achHolderType: "personal",
|
|
1274
|
+
* achRouting: "123123123",
|
|
1275
|
+
* method: "ach"
|
|
1276
|
+
* }
|
|
1277
|
+
* }
|
|
1278
|
+
* })
|
|
1279
|
+
*
|
|
1280
|
+
* @example
|
|
1281
|
+
* await client.moneyIn.getpaidv2({
|
|
1282
|
+
* body: {
|
|
1283
|
+
* customerData: {
|
|
1284
|
+
* customerId: 4440
|
|
1285
|
+
* },
|
|
1286
|
+
* entryPoint: "f743aed24a",
|
|
1287
|
+
* ipaddress: "255.255.255.255",
|
|
1288
|
+
* paymentDetails: {
|
|
1289
|
+
* serviceFee: 0,
|
|
1290
|
+
* totalAmount: 100
|
|
1291
|
+
* },
|
|
1292
|
+
* paymentMethod: {
|
|
1293
|
+
* device: "6c361c7d-674c-44cc-b790-382b75d1xxx",
|
|
1294
|
+
* method: "cloud",
|
|
1295
|
+
* saveIfSuccess: true
|
|
1296
|
+
* }
|
|
1297
|
+
* }
|
|
1298
|
+
* })
|
|
1299
|
+
*/
|
|
1300
|
+
getpaidv2(request, requestOptions) {
|
|
1301
|
+
return core.HttpResponsePromise.fromPromise(this.__getpaidv2(request, requestOptions));
|
|
1302
|
+
}
|
|
1303
|
+
__getpaidv2(request, requestOptions) {
|
|
1304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1305
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1306
|
+
const { achValidation, forceCustomerCreation, idempotencyKey, validationCode, body: _body } = request;
|
|
1307
|
+
const _queryParams = {};
|
|
1308
|
+
if (achValidation != null) {
|
|
1309
|
+
_queryParams.achValidation = achValidation.toString();
|
|
1310
|
+
}
|
|
1311
|
+
if (forceCustomerCreation != null) {
|
|
1312
|
+
_queryParams.forceCustomerCreation = forceCustomerCreation.toString();
|
|
1313
|
+
}
|
|
1314
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1315
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
1316
|
+
idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined,
|
|
1317
|
+
validationCode: validationCode != null ? validationCode : undefined,
|
|
1318
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1319
|
+
const _response = yield core.fetcher({
|
|
1320
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "v2/MoneyIn/getpaid"),
|
|
1321
|
+
method: "POST",
|
|
1322
|
+
headers: _headers,
|
|
1323
|
+
contentType: "application/json",
|
|
1324
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1325
|
+
requestType: "json",
|
|
1326
|
+
body: _body,
|
|
1327
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1328
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1329
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1330
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1331
|
+
logging: this._options.logging,
|
|
1332
|
+
});
|
|
1333
|
+
if (_response.ok) {
|
|
1334
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1335
|
+
}
|
|
1336
|
+
if (_response.error.reason === "status-code") {
|
|
1337
|
+
switch (_response.error.statusCode) {
|
|
1338
|
+
case 400:
|
|
1339
|
+
throw new Payabli.BadRequestAuthResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1340
|
+
case 401:
|
|
1341
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1342
|
+
case 402:
|
|
1343
|
+
throw new Payabli.DeclinedAuthResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1344
|
+
case 500:
|
|
1345
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1346
|
+
default:
|
|
1347
|
+
throw new errors.PayabliError({
|
|
1348
|
+
statusCode: _response.error.statusCode,
|
|
1349
|
+
body: _response.error.body,
|
|
1350
|
+
rawResponse: _response.rawResponse,
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/getpaid");
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until captured. This is the v2 version of the `api/MoneyIn/authorize` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1359
|
+
*
|
|
1360
|
+
* **Note**: Only card transactions can be authorized. This endpoint can't be used for ACH transactions.
|
|
1361
|
+
*
|
|
1362
|
+
* @param {Payabli.RequestPaymentAuthorizeV2} request
|
|
1363
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1364
|
+
*
|
|
1365
|
+
* @throws {@link Payabli.BadRequestAuthResponseErrorV2}
|
|
1366
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1367
|
+
* @throws {@link Payabli.DeclinedAuthResponseErrorV2}
|
|
1368
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1369
|
+
*
|
|
1370
|
+
* @example
|
|
1371
|
+
* await client.moneyIn.authorizev2({
|
|
1372
|
+
* body: {
|
|
1373
|
+
* customerData: {
|
|
1374
|
+
* customerId: 4440
|
|
1375
|
+
* },
|
|
1376
|
+
* entryPoint: "f743aed24a",
|
|
1377
|
+
* ipaddress: "255.255.255.255",
|
|
1378
|
+
* paymentDetails: {
|
|
1379
|
+
* serviceFee: 0,
|
|
1380
|
+
* totalAmount: 100
|
|
1381
|
+
* },
|
|
1382
|
+
* paymentMethod: {
|
|
1383
|
+
* cardcvv: "999",
|
|
1384
|
+
* cardexp: "02/27",
|
|
1385
|
+
* cardHolder: "John Cassian",
|
|
1386
|
+
* cardnumber: "4111111111111111",
|
|
1387
|
+
* cardzip: "12345",
|
|
1388
|
+
* initiator: "payor",
|
|
1389
|
+
* method: "card"
|
|
1390
|
+
* }
|
|
1391
|
+
* }
|
|
1392
|
+
* })
|
|
1393
|
+
*/
|
|
1394
|
+
authorizev2(request, requestOptions) {
|
|
1395
|
+
return core.HttpResponsePromise.fromPromise(this.__authorizev2(request, requestOptions));
|
|
1396
|
+
}
|
|
1397
|
+
__authorizev2(request, requestOptions) {
|
|
1398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1399
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1400
|
+
const { forceCustomerCreation, idempotencyKey, body: _body } = request;
|
|
1401
|
+
const _queryParams = {};
|
|
1402
|
+
if (forceCustomerCreation != null) {
|
|
1403
|
+
_queryParams.forceCustomerCreation = forceCustomerCreation.toString();
|
|
1404
|
+
}
|
|
1405
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1406
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1407
|
+
const _response = yield core.fetcher({
|
|
1408
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "v2/MoneyIn/authorize"),
|
|
1409
|
+
method: "POST",
|
|
1410
|
+
headers: _headers,
|
|
1411
|
+
contentType: "application/json",
|
|
1412
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1413
|
+
requestType: "json",
|
|
1414
|
+
body: _body,
|
|
1415
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1416
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1417
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1418
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1419
|
+
logging: this._options.logging,
|
|
1420
|
+
});
|
|
1421
|
+
if (_response.ok) {
|
|
1422
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1423
|
+
}
|
|
1424
|
+
if (_response.error.reason === "status-code") {
|
|
1425
|
+
switch (_response.error.statusCode) {
|
|
1426
|
+
case 400:
|
|
1427
|
+
throw new Payabli.BadRequestAuthResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1428
|
+
case 401:
|
|
1429
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1430
|
+
case 402:
|
|
1431
|
+
throw new Payabli.DeclinedAuthResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1432
|
+
case 500:
|
|
1433
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1434
|
+
default:
|
|
1435
|
+
throw new errors.PayabliError({
|
|
1436
|
+
statusCode: _response.error.statusCode,
|
|
1437
|
+
body: _response.error.body,
|
|
1438
|
+
rawResponse: _response.rawResponse,
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/authorize");
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Capture an authorized transaction to complete the transaction and move funds from the customer to merchant account. This is the v2 version of the `api/MoneyIn/capture/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1447
|
+
*
|
|
1448
|
+
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
1449
|
+
* @param {Payabli.CaptureRequest} request
|
|
1450
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1451
|
+
*
|
|
1452
|
+
* @throws {@link Payabli.BadRequestCaptureResponseErrorV2}
|
|
1453
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1454
|
+
* @throws {@link Payabli.DeclinedCaptureResponseErrorV2}
|
|
1455
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1456
|
+
*
|
|
1457
|
+
* @example
|
|
1458
|
+
* await client.moneyIn.capturev2("10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13", {
|
|
1459
|
+
* paymentDetails: {
|
|
1460
|
+
* totalAmount: 105,
|
|
1461
|
+
* serviceFee: 5
|
|
1462
|
+
* }
|
|
1463
|
+
* })
|
|
1464
|
+
*
|
|
1465
|
+
* @example
|
|
1466
|
+
* await client.moneyIn.capturev2("10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13", {
|
|
1467
|
+
* paymentDetails: {
|
|
1468
|
+
* totalAmount: 89,
|
|
1469
|
+
* serviceFee: 4
|
|
1470
|
+
* }
|
|
1471
|
+
* })
|
|
1472
|
+
*/
|
|
1473
|
+
capturev2(transId, request, requestOptions) {
|
|
1474
|
+
return core.HttpResponsePromise.fromPromise(this.__capturev2(transId, request, requestOptions));
|
|
1475
|
+
}
|
|
1476
|
+
__capturev2(transId, request, requestOptions) {
|
|
1477
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1478
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1479
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1480
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1481
|
+
const _response = yield core.fetcher({
|
|
1482
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `v2/MoneyIn/capture/${core.url.encodePathParam(transId)}`),
|
|
1483
|
+
method: "POST",
|
|
1484
|
+
headers: _headers,
|
|
1485
|
+
contentType: "application/json",
|
|
1486
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1487
|
+
requestType: "json",
|
|
1488
|
+
body: request,
|
|
1489
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1490
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1491
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1492
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1493
|
+
logging: this._options.logging,
|
|
1494
|
+
});
|
|
1495
|
+
if (_response.ok) {
|
|
1496
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1497
|
+
}
|
|
1498
|
+
if (_response.error.reason === "status-code") {
|
|
1499
|
+
switch (_response.error.statusCode) {
|
|
1500
|
+
case 400:
|
|
1501
|
+
throw new Payabli.BadRequestCaptureResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1502
|
+
case 401:
|
|
1503
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1504
|
+
case 402:
|
|
1505
|
+
throw new Payabli.DeclinedCaptureResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1506
|
+
case 500:
|
|
1507
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1508
|
+
default:
|
|
1509
|
+
throw new errors.PayabliError({
|
|
1510
|
+
statusCode: _response.error.statusCode,
|
|
1511
|
+
body: _response.error.body,
|
|
1512
|
+
rawResponse: _response.rawResponse,
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/capture/{transId}");
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Give a full refund for a transaction that has settled and send money back to the account holder. To perform a partial refund, see [Partially refund a transaction](developers/api-reference/moneyinV2/partial-refund-a-settled-transaction).
|
|
1521
|
+
*
|
|
1522
|
+
* This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1523
|
+
*
|
|
1524
|
+
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
1525
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1526
|
+
*
|
|
1527
|
+
* @throws {@link Payabli.BadRequestRefundResponseErrorV2}
|
|
1528
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1529
|
+
* @throws {@link Payabli.DeclinedRefundResponseErrorV2}
|
|
1530
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1531
|
+
*
|
|
1532
|
+
* @example
|
|
1533
|
+
* await client.moneyIn.refundv2("10-3ffa27df-b171-44e0-b251-e95fbfc7a723")
|
|
1534
|
+
*/
|
|
1535
|
+
refundv2(transId, requestOptions) {
|
|
1536
|
+
return core.HttpResponsePromise.fromPromise(this.__refundv2(transId, requestOptions));
|
|
1537
|
+
}
|
|
1538
|
+
__refundv2(transId, requestOptions) {
|
|
1539
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1540
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1541
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1542
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1543
|
+
const _response = yield core.fetcher({
|
|
1544
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `v2/MoneyIn/refund/${core.url.encodePathParam(transId)}`),
|
|
1545
|
+
method: "POST",
|
|
1546
|
+
headers: _headers,
|
|
1547
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1548
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1549
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1550
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1551
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1552
|
+
logging: this._options.logging,
|
|
1553
|
+
});
|
|
1554
|
+
if (_response.ok) {
|
|
1555
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1556
|
+
}
|
|
1557
|
+
if (_response.error.reason === "status-code") {
|
|
1558
|
+
switch (_response.error.statusCode) {
|
|
1559
|
+
case 400:
|
|
1560
|
+
throw new Payabli.BadRequestRefundResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1561
|
+
case 401:
|
|
1562
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1563
|
+
case 402:
|
|
1564
|
+
throw new Payabli.DeclinedRefundResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1565
|
+
case 500:
|
|
1566
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1567
|
+
default:
|
|
1568
|
+
throw new errors.PayabliError({
|
|
1569
|
+
statusCode: _response.error.statusCode,
|
|
1570
|
+
body: _response.error.body,
|
|
1571
|
+
rawResponse: _response.rawResponse,
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/refund/{transId}");
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Refund a transaction that has settled and send money back to the account holder. If `amount` is omitted or set to 0, performs a full refund. When a non-zero `amount` is provided, this endpoint performs a partial refund.
|
|
1580
|
+
*
|
|
1581
|
+
* This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1582
|
+
*
|
|
1583
|
+
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
1584
|
+
* @param {number} amount - Amount to refund from original transaction, minus any service fees charged on the original transaction. If omitted or set to 0, performs a full refund.
|
|
1585
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1586
|
+
*
|
|
1587
|
+
* @throws {@link Payabli.BadRequestRefundResponseErrorV2}
|
|
1588
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1589
|
+
* @throws {@link Payabli.DeclinedRefundResponseErrorV2}
|
|
1590
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1591
|
+
*
|
|
1592
|
+
* @example
|
|
1593
|
+
* await client.moneyIn.refundv2Amount("10-3ffa27df-b171-44e0-b251-e95fbfc7a723", 0)
|
|
1594
|
+
*
|
|
1595
|
+
* @example
|
|
1596
|
+
* await client.moneyIn.refundv2Amount("10-3ffa27df-b171-44e0-b251-e95fbfc7a723", 100.99)
|
|
1597
|
+
*/
|
|
1598
|
+
refundv2Amount(transId, amount, requestOptions) {
|
|
1599
|
+
return core.HttpResponsePromise.fromPromise(this.__refundv2Amount(transId, amount, requestOptions));
|
|
1600
|
+
}
|
|
1601
|
+
__refundv2Amount(transId, amount, requestOptions) {
|
|
1602
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1603
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1604
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1605
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1606
|
+
const _response = yield core.fetcher({
|
|
1607
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `v2/MoneyIn/refund/${core.url.encodePathParam(transId)}/${core.url.encodePathParam(amount)}`),
|
|
1608
|
+
method: "POST",
|
|
1609
|
+
headers: _headers,
|
|
1610
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1611
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1612
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1613
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1614
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1615
|
+
logging: this._options.logging,
|
|
1616
|
+
});
|
|
1617
|
+
if (_response.ok) {
|
|
1618
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1619
|
+
}
|
|
1620
|
+
if (_response.error.reason === "status-code") {
|
|
1621
|
+
switch (_response.error.statusCode) {
|
|
1622
|
+
case 400:
|
|
1623
|
+
throw new Payabli.BadRequestRefundResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1624
|
+
case 401:
|
|
1625
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1626
|
+
case 402:
|
|
1627
|
+
throw new Payabli.DeclinedRefundResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1628
|
+
case 500:
|
|
1629
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1630
|
+
default:
|
|
1631
|
+
throw new errors.PayabliError({
|
|
1632
|
+
statusCode: _response.error.statusCode,
|
|
1633
|
+
body: _response.error.body,
|
|
1634
|
+
rawResponse: _response.rawResponse,
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/refund/{transId}/{amount}");
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. This is the v2 version of the `api/MoneyIn/void/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/developers/references/pay-in-unified-response-codes) for more information.
|
|
1643
|
+
*
|
|
1644
|
+
* @param {string} transId - ReferenceId for the transaction (PaymentId).
|
|
1645
|
+
* @param {MoneyInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1646
|
+
*
|
|
1647
|
+
* @throws {@link Payabli.BadRequestVoidResponseErrorV2}
|
|
1648
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
1649
|
+
* @throws {@link Payabli.DeclinedVoidResponseErrorV2}
|
|
1650
|
+
* @throws {@link Payabli.InternalServerResponseErrorV2}
|
|
1651
|
+
*
|
|
1652
|
+
* @example
|
|
1653
|
+
* await client.moneyIn.voidv2("10-3ffa27df-b171-44e0-b251-e95fbfc7a723")
|
|
1654
|
+
*/
|
|
1655
|
+
voidv2(transId, requestOptions) {
|
|
1656
|
+
return core.HttpResponsePromise.fromPromise(this.__voidv2(transId, requestOptions));
|
|
1657
|
+
}
|
|
1658
|
+
__voidv2(transId, requestOptions) {
|
|
1659
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1660
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1661
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1662
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1663
|
+
const _response = yield core.fetcher({
|
|
1664
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `v2/MoneyIn/void/${core.url.encodePathParam(transId)}`),
|
|
1665
|
+
method: "POST",
|
|
1666
|
+
headers: _headers,
|
|
1667
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1668
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1669
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1670
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1671
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1672
|
+
logging: this._options.logging,
|
|
1673
|
+
});
|
|
1674
|
+
if (_response.ok) {
|
|
1675
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1676
|
+
}
|
|
1677
|
+
if (_response.error.reason === "status-code") {
|
|
1678
|
+
switch (_response.error.statusCode) {
|
|
1679
|
+
case 400:
|
|
1680
|
+
throw new Payabli.BadRequestVoidResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1681
|
+
case 401:
|
|
1682
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1683
|
+
case 402:
|
|
1684
|
+
throw new Payabli.DeclinedVoidResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1685
|
+
case 500:
|
|
1686
|
+
throw new Payabli.InternalServerResponseErrorV2(_response.error.body, _response.rawResponse);
|
|
1687
|
+
default:
|
|
1688
|
+
throw new errors.PayabliError({
|
|
1689
|
+
statusCode: _response.error.statusCode,
|
|
1690
|
+
body: _response.error.body,
|
|
1691
|
+
rawResponse: _response.rawResponse,
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/MoneyIn/void/{transId}");
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1182
1698
|
}
|
|
1183
1699
|
exports.MoneyInClient = MoneyInClient;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as Payabli from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* body: {
|
|
6
|
+
* customerData: {
|
|
7
|
+
* customerId: 4440
|
|
8
|
+
* },
|
|
9
|
+
* entryPoint: "f743aed24a",
|
|
10
|
+
* ipaddress: "255.255.255.255",
|
|
11
|
+
* paymentDetails: {
|
|
12
|
+
* serviceFee: 0,
|
|
13
|
+
* totalAmount: 100
|
|
14
|
+
* },
|
|
15
|
+
* paymentMethod: {
|
|
16
|
+
* cardcvv: "999",
|
|
17
|
+
* cardexp: "02/27",
|
|
18
|
+
* cardHolder: "John Cassian",
|
|
19
|
+
* cardnumber: "4111111111111111",
|
|
20
|
+
* cardzip: "12345",
|
|
21
|
+
* initiator: "payor",
|
|
22
|
+
* method: "card"
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
export interface RequestPaymentAuthorizeV2 {
|
|
28
|
+
forceCustomerCreation?: Payabli.ForceCustomerCreation | undefined;
|
|
29
|
+
idempotencyKey?: Payabli.IdempotencyKey;
|
|
30
|
+
body: Payabli.TransRequestBody;
|
|
31
|
+
}
|