@tonder.io/rn-sdk 0.1.0-beta.DEV1355.1
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/LICENSE +20 -0
- package/README.md +33 -0
- package/lib/commonjs/core/3DSHandler.js +108 -0
- package/lib/commonjs/core/3DSHandler.js.map +1 -0
- package/lib/commonjs/core/BaseCheckout/index.js +337 -0
- package/lib/commonjs/core/BaseCheckout/index.js.map +1 -0
- package/lib/commonjs/core/BaseEnrollment/index.js +86 -0
- package/lib/commonjs/core/BaseEnrollment/index.js.map +1 -0
- package/lib/commonjs/core/BaseSDK/index.js +75 -0
- package/lib/commonjs/core/BaseSDK/index.js.map +1 -0
- package/lib/commonjs/core/EnrollmentContainer/index.js +87 -0
- package/lib/commonjs/core/EnrollmentContainer/index.js.map +1 -0
- package/lib/commonjs/core/PaymentInlineContainer/index.js +111 -0
- package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -0
- package/lib/commonjs/core/PaymentLiteContainer/index.js +158 -0
- package/lib/commonjs/core/PaymentLiteContainer/index.js.map +1 -0
- package/lib/commonjs/core/Tonder/index.js +134 -0
- package/lib/commonjs/core/Tonder/index.js.map +1 -0
- package/lib/commonjs/hooks/useTonder/index-old.js +37 -0
- package/lib/commonjs/hooks/useTonder/index-old.js.map +1 -0
- package/lib/commonjs/hooks/useTonder/index.js +16 -0
- package/lib/commonjs/hooks/useTonder/index.js.map +1 -0
- package/lib/commonjs/index.js +121 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/infrastructure/HttpClient.js +108 -0
- package/lib/commonjs/infrastructure/HttpClient.js.map +1 -0
- package/lib/commonjs/infrastructure/ServiceManager.js +32 -0
- package/lib/commonjs/infrastructure/ServiceManager.js.map +1 -0
- package/lib/commonjs/infrastructure/index.js +28 -0
- package/lib/commonjs/infrastructure/index.js.map +1 -0
- package/lib/commonjs/services/BusinessService.js +36 -0
- package/lib/commonjs/services/BusinessService.js.map +1 -0
- package/lib/commonjs/services/CardService.js +89 -0
- package/lib/commonjs/services/CardService.js.map +1 -0
- package/lib/commonjs/services/CheckoutService.js +121 -0
- package/lib/commonjs/services/CheckoutService.js.map +1 -0
- package/lib/commonjs/services/CustomerService.js +62 -0
- package/lib/commonjs/services/CustomerService.js.map +1 -0
- package/lib/commonjs/services/MercadoPagoService.js +27 -0
- package/lib/commonjs/services/MercadoPagoService.js.map +1 -0
- package/lib/commonjs/services/OpenPayService.js +25 -0
- package/lib/commonjs/services/OpenPayService.js.map +1 -0
- package/lib/commonjs/services/PaymentMethodService.js +37 -0
- package/lib/commonjs/services/PaymentMethodService.js.map +1 -0
- package/lib/commonjs/services/SkyflowService.js +53 -0
- package/lib/commonjs/services/SkyflowService.js.map +1 -0
- package/lib/commonjs/services/StorageService.js +49 -0
- package/lib/commonjs/services/StorageService.js.map +1 -0
- package/lib/commonjs/services/TokenService.js +46 -0
- package/lib/commonjs/services/TokenService.js.map +1 -0
- package/lib/commonjs/services/TransactionService.js +26 -0
- package/lib/commonjs/services/TransactionService.js.map +1 -0
- package/lib/commonjs/services/index.js +127 -0
- package/lib/commonjs/services/index.js.map +1 -0
- package/lib/commonjs/shared/catalog/cardBrandCatalog.js +19 -0
- package/lib/commonjs/shared/catalog/cardBrandCatalog.js.map +1 -0
- package/lib/commonjs/shared/catalog/paymentMethodsCatalog.js +252 -0
- package/lib/commonjs/shared/catalog/paymentMethodsCatalog.js.map +1 -0
- package/lib/commonjs/shared/constants/environments.js +13 -0
- package/lib/commonjs/shared/constants/environments.js.map +1 -0
- package/lib/commonjs/shared/constants/index.js +28 -0
- package/lib/commonjs/shared/constants/index.js.map +1 -0
- package/lib/commonjs/shared/constants/messages.js +101 -0
- package/lib/commonjs/shared/constants/messages.js.map +1 -0
- package/lib/commonjs/shared/constants/paymentMethods.js +68 -0
- package/lib/commonjs/shared/constants/paymentMethods.js.map +1 -0
- package/lib/commonjs/shared/constants/skyflow.js +47 -0
- package/lib/commonjs/shared/constants/skyflow.js.map +1 -0
- package/lib/commonjs/shared/enum/ErrorKeyEnum.js +55 -0
- package/lib/commonjs/shared/enum/ErrorKeyEnum.js.map +1 -0
- package/lib/commonjs/shared/enum/index.js +17 -0
- package/lib/commonjs/shared/enum/index.js.map +1 -0
- package/lib/commonjs/shared/index.js +39 -0
- package/lib/commonjs/shared/index.js.map +1 -0
- package/lib/commonjs/shared/utils/common.js +47 -0
- package/lib/commonjs/shared/utils/common.js.map +1 -0
- package/lib/commonjs/shared/utils/errors.js +21 -0
- package/lib/commonjs/shared/utils/errors.js.map +1 -0
- package/lib/commonjs/shared/utils/numberUtils.js +17 -0
- package/lib/commonjs/shared/utils/numberUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/paymentMethodUtils.js +21 -0
- package/lib/commonjs/shared/utils/paymentMethodUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/stringUtils.js +11 -0
- package/lib/commonjs/shared/utils/stringUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/styleUtils.js +21 -0
- package/lib/commonjs/shared/utils/styleUtils.js.map +1 -0
- package/lib/commonjs/types/base.js +14 -0
- package/lib/commonjs/types/base.js.map +1 -0
- package/lib/commonjs/types/baseCheckout.js +6 -0
- package/lib/commonjs/types/baseCheckout.js.map +1 -0
- package/lib/commonjs/types/baseEnrollment.js +6 -0
- package/lib/commonjs/types/baseEnrollment.js.map +1 -0
- package/lib/commonjs/types/baseSDK.js +6 -0
- package/lib/commonjs/types/baseSDK.js.map +1 -0
- package/lib/commonjs/types/business.js +2 -0
- package/lib/commonjs/types/business.js.map +1 -0
- package/lib/commonjs/types/card.js +2 -0
- package/lib/commonjs/types/card.js.map +1 -0
- package/lib/commonjs/types/checkout.js +6 -0
- package/lib/commonjs/types/checkout.js.map +1 -0
- package/lib/commonjs/types/common.js +6 -0
- package/lib/commonjs/types/common.js.map +1 -0
- package/lib/commonjs/types/customer.js +2 -0
- package/lib/commonjs/types/customer.js.map +1 -0
- package/lib/commonjs/types/enrollment.js +6 -0
- package/lib/commonjs/types/enrollment.js.map +1 -0
- package/lib/commonjs/types/index.js +204 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/inlineCheckout.js +6 -0
- package/lib/commonjs/types/inlineCheckout.js.map +1 -0
- package/lib/commonjs/types/input.js +6 -0
- package/lib/commonjs/types/input.js.map +1 -0
- package/lib/commonjs/types/liteCheckout.js +6 -0
- package/lib/commonjs/types/liteCheckout.js.map +1 -0
- package/lib/commonjs/types/openpay-react-native.d.js +2 -0
- package/lib/commonjs/types/openpay-react-native.d.js.map +1 -0
- package/lib/commonjs/types/openpay.js +2 -0
- package/lib/commonjs/types/openpay.js.map +1 -0
- package/lib/commonjs/types/payment.js +6 -0
- package/lib/commonjs/types/payment.js.map +1 -0
- package/lib/commonjs/types/secure.js +2 -0
- package/lib/commonjs/types/secure.js.map +1 -0
- package/lib/commonjs/types/skyflow-react-native.d.js +2 -0
- package/lib/commonjs/types/skyflow-react-native.d.js.map +1 -0
- package/lib/commonjs/types/threeDSHandler.js +6 -0
- package/lib/commonjs/types/threeDSHandler.js.map +1 -0
- package/lib/commonjs/types/transaction.js +2 -0
- package/lib/commonjs/types/transaction.js.map +1 -0
- package/lib/commonjs/ui/components/Button/ProcessButton.js +50 -0
- package/lib/commonjs/ui/components/Button/ProcessButton.js.map +1 -0
- package/lib/commonjs/ui/components/CardForm/index.js +80 -0
- package/lib/commonjs/ui/components/CardForm/index.js.map +1 -0
- package/lib/commonjs/ui/components/Checkbox/Checkbox.js +62 -0
- package/lib/commonjs/ui/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardCVVInput.js +83 -0
- package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js +91 -0
- package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +84 -0
- package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +84 -0
- package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardHolderInput.js +83 -0
- package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -0
- package/lib/commonjs/ui/components/Input/CardNumberInput.js +83 -0
- package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -0
- package/lib/commonjs/ui/components/PaymentMethodsList/index.js +105 -0
- package/lib/commonjs/ui/components/PaymentMethodsList/index.js.map +1 -0
- package/lib/commonjs/ui/components/RadioButton/index.js +57 -0
- package/lib/commonjs/ui/components/RadioButton/index.js.map +1 -0
- package/lib/commonjs/ui/components/SavedCardsList/index.js +126 -0
- package/lib/commonjs/ui/components/SavedCardsList/index.js.map +1 -0
- package/lib/commonjs/ui/components/Skeleton/CardFormSkeleton.js +102 -0
- package/lib/commonjs/ui/components/Skeleton/CardFormSkeleton.js.map +1 -0
- package/lib/commonjs/ui/components/WebView/ThreeDSWebView.js +105 -0
- package/lib/commonjs/ui/components/WebView/ThreeDSWebView.js.map +1 -0
- package/lib/commonjs/ui/features/TonderEnrollment/index.js +119 -0
- package/lib/commonjs/ui/features/TonderEnrollment/index.js.map +1 -0
- package/lib/commonjs/ui/features/TonderPayment/index.js +195 -0
- package/lib/commonjs/ui/features/TonderPayment/index.js.map +1 -0
- package/lib/commonjs/ui/providers/InnerProvider/index.js +25 -0
- package/lib/commonjs/ui/providers/InnerProvider/index.js.map +1 -0
- package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js +31 -0
- package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js.map +1 -0
- package/lib/commonjs/ui/providers/TonderProvider/context.js +16 -0
- package/lib/commonjs/ui/providers/TonderProvider/context.js.map +1 -0
- package/lib/commonjs/ui/providers/TonderProvider/hook.js +15 -0
- package/lib/commonjs/ui/providers/TonderProvider/hook.js.map +1 -0
- package/lib/commonjs/ui/providers/TonderProvider/index.js +96 -0
- package/lib/commonjs/ui/providers/TonderProvider/index.js.map +1 -0
- package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js +61 -0
- package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js.map +1 -0
- package/lib/commonjs/ui/styles/payment.js +27 -0
- package/lib/commonjs/ui/styles/payment.js.map +1 -0
- package/lib/commonjs/ui/styles/skyflow.js +54 -0
- package/lib/commonjs/ui/styles/skyflow.js.map +1 -0
- package/lib/module/core/3DSHandler.js +102 -0
- package/lib/module/core/3DSHandler.js.map +1 -0
- package/lib/module/core/BaseCheckout/index.js +332 -0
- package/lib/module/core/BaseCheckout/index.js.map +1 -0
- package/lib/module/core/BaseEnrollment/index.js +81 -0
- package/lib/module/core/BaseEnrollment/index.js.map +1 -0
- package/lib/module/core/BaseSDK/index.js +70 -0
- package/lib/module/core/BaseSDK/index.js.map +1 -0
- package/lib/module/core/EnrollmentContainer/index.js +81 -0
- package/lib/module/core/EnrollmentContainer/index.js.map +1 -0
- package/lib/module/core/PaymentInlineContainer/index.js +106 -0
- package/lib/module/core/PaymentInlineContainer/index.js.map +1 -0
- package/lib/module/core/PaymentLiteContainer/index.js +153 -0
- package/lib/module/core/PaymentLiteContainer/index.js.map +1 -0
- package/lib/module/core/Tonder/index.js +129 -0
- package/lib/module/core/Tonder/index.js.map +1 -0
- package/lib/module/hooks/useTonder/index-old.js +37 -0
- package/lib/module/hooks/useTonder/index-old.js.map +1 -0
- package/lib/module/hooks/useTonder/index.js +11 -0
- package/lib/module/hooks/useTonder/index.js.map +1 -0
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/infrastructure/HttpClient.js +102 -0
- package/lib/module/infrastructure/HttpClient.js.map +1 -0
- package/lib/module/infrastructure/ServiceManager.js +27 -0
- package/lib/module/infrastructure/ServiceManager.js.map +1 -0
- package/lib/module/infrastructure/index.js +5 -0
- package/lib/module/infrastructure/index.js.map +1 -0
- package/lib/module/services/BusinessService.js +30 -0
- package/lib/module/services/BusinessService.js.map +1 -0
- package/lib/module/services/CardService.js +83 -0
- package/lib/module/services/CardService.js.map +1 -0
- package/lib/module/services/CheckoutService.js +115 -0
- package/lib/module/services/CheckoutService.js.map +1 -0
- package/lib/module/services/CustomerService.js +56 -0
- package/lib/module/services/CustomerService.js.map +1 -0
- package/lib/module/services/MercadoPagoService.js +22 -0
- package/lib/module/services/MercadoPagoService.js.map +1 -0
- package/lib/module/services/OpenPayService.js +20 -0
- package/lib/module/services/OpenPayService.js.map +1 -0
- package/lib/module/services/PaymentMethodService.js +31 -0
- package/lib/module/services/PaymentMethodService.js.map +1 -0
- package/lib/module/services/SkyflowService.js +47 -0
- package/lib/module/services/SkyflowService.js.map +1 -0
- package/lib/module/services/StorageService.js +43 -0
- package/lib/module/services/StorageService.js.map +1 -0
- package/lib/module/services/TokenService.js +40 -0
- package/lib/module/services/TokenService.js.map +1 -0
- package/lib/module/services/TransactionService.js +20 -0
- package/lib/module/services/TransactionService.js.map +1 -0
- package/lib/module/services/index.js +15 -0
- package/lib/module/services/index.js.map +1 -0
- package/lib/module/shared/catalog/cardBrandCatalog.js +14 -0
- package/lib/module/shared/catalog/cardBrandCatalog.js.map +1 -0
- package/lib/module/shared/catalog/paymentMethodsCatalog.js +247 -0
- package/lib/module/shared/catalog/paymentMethodsCatalog.js.map +1 -0
- package/lib/module/shared/constants/environments.js +10 -0
- package/lib/module/shared/constants/environments.js.map +1 -0
- package/lib/module/shared/constants/index.js +5 -0
- package/lib/module/shared/constants/index.js.map +1 -0
- package/lib/module/shared/constants/messages.js +97 -0
- package/lib/module/shared/constants/messages.js.map +1 -0
- package/lib/module/shared/constants/paymentMethods.js +65 -0
- package/lib/module/shared/constants/paymentMethods.js.map +1 -0
- package/lib/module/shared/constants/skyflow.js +43 -0
- package/lib/module/shared/constants/skyflow.js.map +1 -0
- package/lib/module/shared/enum/ErrorKeyEnum.js +51 -0
- package/lib/module/shared/enum/ErrorKeyEnum.js.map +1 -0
- package/lib/module/shared/enum/index.js +4 -0
- package/lib/module/shared/enum/index.js.map +1 -0
- package/lib/module/shared/index.js +6 -0
- package/lib/module/shared/index.js.map +1 -0
- package/lib/module/shared/utils/common.js +41 -0
- package/lib/module/shared/utils/common.js.map +1 -0
- package/lib/module/shared/utils/errors.js +17 -0
- package/lib/module/shared/utils/errors.js.map +1 -0
- package/lib/module/shared/utils/numberUtils.js +13 -0
- package/lib/module/shared/utils/numberUtils.js.map +1 -0
- package/lib/module/shared/utils/paymentMethodUtils.js +16 -0
- package/lib/module/shared/utils/paymentMethodUtils.js.map +1 -0
- package/lib/module/shared/utils/stringUtils.js +6 -0
- package/lib/module/shared/utils/stringUtils.js.map +1 -0
- package/lib/module/shared/utils/styleUtils.js +17 -0
- package/lib/module/shared/utils/styleUtils.js.map +1 -0
- package/lib/module/types/base.js +13 -0
- package/lib/module/types/base.js.map +1 -0
- package/lib/module/types/baseCheckout.js +4 -0
- package/lib/module/types/baseCheckout.js.map +1 -0
- package/lib/module/types/baseEnrollment.js +4 -0
- package/lib/module/types/baseEnrollment.js.map +1 -0
- package/lib/module/types/baseSDK.js +4 -0
- package/lib/module/types/baseSDK.js.map +1 -0
- package/lib/module/types/business.js +2 -0
- package/lib/module/types/business.js.map +1 -0
- package/lib/module/types/card.js +2 -0
- package/lib/module/types/card.js.map +1 -0
- package/lib/module/types/checkout.js +4 -0
- package/lib/module/types/checkout.js.map +1 -0
- package/lib/module/types/common.js +4 -0
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/customer.js +2 -0
- package/lib/module/types/customer.js.map +1 -0
- package/lib/module/types/enrollment.js +4 -0
- package/lib/module/types/enrollment.js.map +1 -0
- package/lib/module/types/index.js +21 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/inlineCheckout.js +4 -0
- package/lib/module/types/inlineCheckout.js.map +1 -0
- package/lib/module/types/input.js +4 -0
- package/lib/module/types/input.js.map +1 -0
- package/lib/module/types/liteCheckout.js +4 -0
- package/lib/module/types/liteCheckout.js.map +1 -0
- package/lib/module/types/openpay-react-native.d.js +2 -0
- package/lib/module/types/openpay-react-native.d.js.map +1 -0
- package/lib/module/types/openpay.js +2 -0
- package/lib/module/types/openpay.js.map +1 -0
- package/lib/module/types/payment.js +4 -0
- package/lib/module/types/payment.js.map +1 -0
- package/lib/module/types/secure.js +2 -0
- package/lib/module/types/secure.js.map +1 -0
- package/lib/module/types/skyflow-react-native.d.js +2 -0
- package/lib/module/types/skyflow-react-native.d.js.map +1 -0
- package/lib/module/types/threeDSHandler.js +4 -0
- package/lib/module/types/threeDSHandler.js.map +1 -0
- package/lib/module/types/transaction.js +2 -0
- package/lib/module/types/transaction.js.map +1 -0
- package/lib/module/ui/components/Button/ProcessButton.js +44 -0
- package/lib/module/ui/components/Button/ProcessButton.js.map +1 -0
- package/lib/module/ui/components/CardForm/index.js +74 -0
- package/lib/module/ui/components/CardForm/index.js.map +1 -0
- package/lib/module/ui/components/Checkbox/Checkbox.js +56 -0
- package/lib/module/ui/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/module/ui/components/Input/CardCVVInput.js +75 -0
- package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -0
- package/lib/module/ui/components/Input/CardExpirationDateInput.js +84 -0
- package/lib/module/ui/components/Input/CardExpirationDateInput.js.map +1 -0
- package/lib/module/ui/components/Input/CardExpirationMonthInput.js +77 -0
- package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -0
- package/lib/module/ui/components/Input/CardExpirationYearInput.js +76 -0
- package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -0
- package/lib/module/ui/components/Input/CardHolderInput.js +75 -0
- package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -0
- package/lib/module/ui/components/Input/CardNumberInput.js +75 -0
- package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -0
- package/lib/module/ui/components/PaymentMethodsList/index.js +100 -0
- package/lib/module/ui/components/PaymentMethodsList/index.js.map +1 -0
- package/lib/module/ui/components/RadioButton/index.js +50 -0
- package/lib/module/ui/components/RadioButton/index.js.map +1 -0
- package/lib/module/ui/components/SavedCardsList/index.js +121 -0
- package/lib/module/ui/components/SavedCardsList/index.js.map +1 -0
- package/lib/module/ui/components/Skeleton/CardFormSkeleton.js +97 -0
- package/lib/module/ui/components/Skeleton/CardFormSkeleton.js.map +1 -0
- package/lib/module/ui/components/WebView/ThreeDSWebView.js +96 -0
- package/lib/module/ui/components/WebView/ThreeDSWebView.js.map +1 -0
- package/lib/module/ui/features/TonderEnrollment/index.js +114 -0
- package/lib/module/ui/features/TonderEnrollment/index.js.map +1 -0
- package/lib/module/ui/features/TonderPayment/index.js +188 -0
- package/lib/module/ui/features/TonderPayment/index.js.map +1 -0
- package/lib/module/ui/providers/InnerProvider/index.js +19 -0
- package/lib/module/ui/providers/InnerProvider/index.js.map +1 -0
- package/lib/module/ui/providers/SkyflowContainerWrapper/index.js +24 -0
- package/lib/module/ui/providers/SkyflowContainerWrapper/index.js.map +1 -0
- package/lib/module/ui/providers/TonderProvider/context.js +10 -0
- package/lib/module/ui/providers/TonderProvider/context.js.map +1 -0
- package/lib/module/ui/providers/TonderProvider/hook.js +10 -0
- package/lib/module/ui/providers/TonderProvider/hook.js.map +1 -0
- package/lib/module/ui/providers/TonderProvider/index.js +88 -0
- package/lib/module/ui/providers/TonderProvider/index.js.map +1 -0
- package/lib/module/ui/providers/TonderProvider/uiWrapper.js +57 -0
- package/lib/module/ui/providers/TonderProvider/uiWrapper.js.map +1 -0
- package/lib/module/ui/styles/payment.js +25 -0
- package/lib/module/ui/styles/payment.js.map +1 -0
- package/lib/module/ui/styles/skyflow.js +52 -0
- package/lib/module/ui/styles/skyflow.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/core/3DSHandler.d.ts +23 -0
- package/lib/typescript/commonjs/src/core/3DSHandler.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts +28 -0
- package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts +16 -0
- package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts +19 -0
- package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts +15 -0
- package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts +17 -0
- package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts +21 -0
- package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/Tonder/index.d.ts +33 -0
- package/lib/typescript/commonjs/src/core/Tonder/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useTonder/index-old.d.ts +1 -0
- package/lib/typescript/commonjs/src/hooks/useTonder/index-old.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useTonder/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/hooks/useTonder/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +12 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/infrastructure/HttpClient.d.ts +20 -0
- package/lib/typescript/commonjs/src/infrastructure/HttpClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/infrastructure/ServiceManager.d.ts +19 -0
- package/lib/typescript/commonjs/src/infrastructure/ServiceManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/infrastructure/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/infrastructure/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/BusinessService.d.ts +15 -0
- package/lib/typescript/commonjs/src/services/BusinessService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/CardService.d.ts +28 -0
- package/lib/typescript/commonjs/src/services/CardService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/CheckoutService.d.ts +37 -0
- package/lib/typescript/commonjs/src/services/CheckoutService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/CustomerService.d.ts +24 -0
- package/lib/typescript/commonjs/src/services/CustomerService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/MercadoPagoService.d.ts +4 -0
- package/lib/typescript/commonjs/src/services/MercadoPagoService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/OpenPayService.d.ts +4 -0
- package/lib/typescript/commonjs/src/services/OpenPayService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/PaymentMethodService.d.ts +15 -0
- package/lib/typescript/commonjs/src/services/PaymentMethodService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/SkyflowService.d.ts +15 -0
- package/lib/typescript/commonjs/src/services/SkyflowService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/StorageService.d.ts +7 -0
- package/lib/typescript/commonjs/src/services/StorageService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/TokenService.d.ts +16 -0
- package/lib/typescript/commonjs/src/services/TokenService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/TransactionService.d.ts +8 -0
- package/lib/typescript/commonjs/src/services/TransactionService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/index.d.ts +13 -0
- package/lib/typescript/commonjs/src/services/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/catalog/cardBrandCatalog.d.ts +2 -0
- package/lib/typescript/commonjs/src/shared/catalog/cardBrandCatalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/catalog/paymentMethodsCatalog.d.ts +5 -0
- package/lib/typescript/commonjs/src/shared/catalog/paymentMethodsCatalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/constants/environments.d.ts +8 -0
- package/lib/typescript/commonjs/src/shared/constants/environments.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/constants/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/shared/constants/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/constants/messages.d.ts +94 -0
- package/lib/typescript/commonjs/src/shared/constants/messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/constants/paymentMethods.d.ts +63 -0
- package/lib/typescript/commonjs/src/shared/constants/paymentMethods.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/constants/skyflow.d.ts +38 -0
- package/lib/typescript/commonjs/src/shared/constants/skyflow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/enum/ErrorKeyEnum.d.ts +48 -0
- package/lib/typescript/commonjs/src/shared/enum/ErrorKeyEnum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/enum/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/shared/enum/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/shared/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/common.d.ts +9 -0
- package/lib/typescript/commonjs/src/shared/utils/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/errors.d.ts +16 -0
- package/lib/typescript/commonjs/src/shared/utils/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/numberUtils.d.ts +2 -0
- package/lib/typescript/commonjs/src/shared/utils/numberUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/paymentMethodUtils.d.ts +2 -0
- package/lib/typescript/commonjs/src/shared/utils/paymentMethodUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/stringUtils.d.ts +2 -0
- package/lib/typescript/commonjs/src/shared/utils/stringUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/shared/utils/styleUtils.d.ts +8 -0
- package/lib/typescript/commonjs/src/shared/utils/styleUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/base.d.ts +48 -0
- package/lib/typescript/commonjs/src/types/base.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/baseCheckout.d.ts +29 -0
- package/lib/typescript/commonjs/src/types/baseCheckout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts +11 -0
- package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/baseSDK.d.ts +10 -0
- package/lib/typescript/commonjs/src/types/baseSDK.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/business.d.ts +36 -0
- package/lib/typescript/commonjs/src/types/business.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/card.d.ts +33 -0
- package/lib/typescript/commonjs/src/types/card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/checkout.d.ts +150 -0
- package/lib/typescript/commonjs/src/types/checkout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/common.d.ts +60 -0
- package/lib/typescript/commonjs/src/types/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/customer.d.ts +28 -0
- package/lib/typescript/commonjs/src/types/customer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/enrollment.d.ts +66 -0
- package/lib/typescript/commonjs/src/types/enrollment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/index.d.ts +19 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts +78 -0
- package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/input.d.ts +13 -0
- package/lib/typescript/commonjs/src/types/input.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/liteCheckout.d.ts +90 -0
- package/lib/typescript/commonjs/src/types/liteCheckout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/openpay.d.ts +11 -0
- package/lib/typescript/commonjs/src/types/openpay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/payment.d.ts +59 -0
- package/lib/typescript/commonjs/src/types/payment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/secure.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/secure.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts +7 -0
- package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/transaction.d.ts +103 -0
- package/lib/typescript/commonjs/src/types/transaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Button/ProcessButton.d.ts +11 -0
- package/lib/typescript/commonjs/src/ui/components/Button/ProcessButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts +13 -0
- package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Checkbox/Checkbox.d.ts +9 -0
- package/lib/typescript/commonjs/src/ui/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/PaymentMethodsList/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/RadioButton/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/ui/components/RadioButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/Skeleton/CardFormSkeleton.d.ts +5 -0
- package/lib/typescript/commonjs/src/ui/components/Skeleton/CardFormSkeleton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/WebView/ThreeDSWebView.d.ts +9 -0
- package/lib/typescript/commonjs/src/ui/components/WebView/ThreeDSWebView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/features/TonderEnrollment/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/ui/features/TonderEnrollment/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/context.d.ts +5 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/hook.d.ts +4 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/hook.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/uiWrapper.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/styles/payment.d.ts +20 -0
- package/lib/typescript/commonjs/src/ui/styles/payment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/styles/skyflow.d.ts +44 -0
- package/lib/typescript/commonjs/src/ui/styles/skyflow.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/core/3DSHandler.d.ts +23 -0
- package/lib/typescript/module/src/core/3DSHandler.d.ts.map +1 -0
- package/lib/typescript/module/src/core/BaseCheckout/index.d.ts +28 -0
- package/lib/typescript/module/src/core/BaseCheckout/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts +16 -0
- package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/BaseSDK/index.d.ts +19 -0
- package/lib/typescript/module/src/core/BaseSDK/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts +15 -0
- package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts +17 -0
- package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts +21 -0
- package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts.map +1 -0
- package/lib/typescript/module/src/core/Tonder/index.d.ts +33 -0
- package/lib/typescript/module/src/core/Tonder/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useTonder/index-old.d.ts +1 -0
- package/lib/typescript/module/src/hooks/useTonder/index-old.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useTonder/index.d.ts +4 -0
- package/lib/typescript/module/src/hooks/useTonder/index.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +12 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/infrastructure/HttpClient.d.ts +20 -0
- package/lib/typescript/module/src/infrastructure/HttpClient.d.ts.map +1 -0
- package/lib/typescript/module/src/infrastructure/ServiceManager.d.ts +19 -0
- package/lib/typescript/module/src/infrastructure/ServiceManager.d.ts.map +1 -0
- package/lib/typescript/module/src/infrastructure/index.d.ts +3 -0
- package/lib/typescript/module/src/infrastructure/index.d.ts.map +1 -0
- package/lib/typescript/module/src/services/BusinessService.d.ts +15 -0
- package/lib/typescript/module/src/services/BusinessService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/CardService.d.ts +28 -0
- package/lib/typescript/module/src/services/CardService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/CheckoutService.d.ts +37 -0
- package/lib/typescript/module/src/services/CheckoutService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/CustomerService.d.ts +24 -0
- package/lib/typescript/module/src/services/CustomerService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/MercadoPagoService.d.ts +4 -0
- package/lib/typescript/module/src/services/MercadoPagoService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/OpenPayService.d.ts +4 -0
- package/lib/typescript/module/src/services/OpenPayService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/PaymentMethodService.d.ts +15 -0
- package/lib/typescript/module/src/services/PaymentMethodService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/SkyflowService.d.ts +15 -0
- package/lib/typescript/module/src/services/SkyflowService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/StorageService.d.ts +7 -0
- package/lib/typescript/module/src/services/StorageService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/TokenService.d.ts +16 -0
- package/lib/typescript/module/src/services/TokenService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/TransactionService.d.ts +8 -0
- package/lib/typescript/module/src/services/TransactionService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/index.d.ts +13 -0
- package/lib/typescript/module/src/services/index.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/catalog/cardBrandCatalog.d.ts +2 -0
- package/lib/typescript/module/src/shared/catalog/cardBrandCatalog.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/catalog/paymentMethodsCatalog.d.ts +5 -0
- package/lib/typescript/module/src/shared/catalog/paymentMethodsCatalog.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/constants/environments.d.ts +8 -0
- package/lib/typescript/module/src/shared/constants/environments.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/constants/index.d.ts +3 -0
- package/lib/typescript/module/src/shared/constants/index.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/constants/messages.d.ts +94 -0
- package/lib/typescript/module/src/shared/constants/messages.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/constants/paymentMethods.d.ts +63 -0
- package/lib/typescript/module/src/shared/constants/paymentMethods.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/constants/skyflow.d.ts +38 -0
- package/lib/typescript/module/src/shared/constants/skyflow.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/enum/ErrorKeyEnum.d.ts +48 -0
- package/lib/typescript/module/src/shared/enum/ErrorKeyEnum.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/enum/index.d.ts +2 -0
- package/lib/typescript/module/src/shared/enum/index.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/index.d.ts +4 -0
- package/lib/typescript/module/src/shared/index.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/common.d.ts +9 -0
- package/lib/typescript/module/src/shared/utils/common.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/errors.d.ts +16 -0
- package/lib/typescript/module/src/shared/utils/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/numberUtils.d.ts +2 -0
- package/lib/typescript/module/src/shared/utils/numberUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/paymentMethodUtils.d.ts +2 -0
- package/lib/typescript/module/src/shared/utils/paymentMethodUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/stringUtils.d.ts +2 -0
- package/lib/typescript/module/src/shared/utils/stringUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/shared/utils/styleUtils.d.ts +8 -0
- package/lib/typescript/module/src/shared/utils/styleUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/types/base.d.ts +48 -0
- package/lib/typescript/module/src/types/base.d.ts.map +1 -0
- package/lib/typescript/module/src/types/baseCheckout.d.ts +29 -0
- package/lib/typescript/module/src/types/baseCheckout.d.ts.map +1 -0
- package/lib/typescript/module/src/types/baseEnrollment.d.ts +11 -0
- package/lib/typescript/module/src/types/baseEnrollment.d.ts.map +1 -0
- package/lib/typescript/module/src/types/baseSDK.d.ts +10 -0
- package/lib/typescript/module/src/types/baseSDK.d.ts.map +1 -0
- package/lib/typescript/module/src/types/business.d.ts +36 -0
- package/lib/typescript/module/src/types/business.d.ts.map +1 -0
- package/lib/typescript/module/src/types/card.d.ts +33 -0
- package/lib/typescript/module/src/types/card.d.ts.map +1 -0
- package/lib/typescript/module/src/types/checkout.d.ts +150 -0
- package/lib/typescript/module/src/types/checkout.d.ts.map +1 -0
- package/lib/typescript/module/src/types/common.d.ts +60 -0
- package/lib/typescript/module/src/types/common.d.ts.map +1 -0
- package/lib/typescript/module/src/types/customer.d.ts +28 -0
- package/lib/typescript/module/src/types/customer.d.ts.map +1 -0
- package/lib/typescript/module/src/types/enrollment.d.ts +66 -0
- package/lib/typescript/module/src/types/enrollment.d.ts.map +1 -0
- package/lib/typescript/module/src/types/index.d.ts +19 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types/inlineCheckout.d.ts +78 -0
- package/lib/typescript/module/src/types/inlineCheckout.d.ts.map +1 -0
- package/lib/typescript/module/src/types/input.d.ts +13 -0
- package/lib/typescript/module/src/types/input.d.ts.map +1 -0
- package/lib/typescript/module/src/types/liteCheckout.d.ts +90 -0
- package/lib/typescript/module/src/types/liteCheckout.d.ts.map +1 -0
- package/lib/typescript/module/src/types/openpay.d.ts +11 -0
- package/lib/typescript/module/src/types/openpay.d.ts.map +1 -0
- package/lib/typescript/module/src/types/payment.d.ts +59 -0
- package/lib/typescript/module/src/types/payment.d.ts.map +1 -0
- package/lib/typescript/module/src/types/secure.d.ts +4 -0
- package/lib/typescript/module/src/types/secure.d.ts.map +1 -0
- package/lib/typescript/module/src/types/threeDSHandler.d.ts +7 -0
- package/lib/typescript/module/src/types/threeDSHandler.d.ts.map +1 -0
- package/lib/typescript/module/src/types/transaction.d.ts +103 -0
- package/lib/typescript/module/src/types/transaction.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Button/ProcessButton.d.ts +11 -0
- package/lib/typescript/module/src/ui/components/Button/ProcessButton.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/CardForm/index.d.ts +13 -0
- package/lib/typescript/module/src/ui/components/CardForm/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Checkbox/Checkbox.d.ts +9 -0
- package/lib/typescript/module/src/ui/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts +4 -0
- package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts +10 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts +4 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts +4 -0
- package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts +4 -0
- package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts +4 -0
- package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/PaymentMethodsList/index.d.ts +11 -0
- package/lib/typescript/module/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/RadioButton/index.d.ts +14 -0
- package/lib/typescript/module/src/ui/components/RadioButton/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts +14 -0
- package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/Skeleton/CardFormSkeleton.d.ts +5 -0
- package/lib/typescript/module/src/ui/components/Skeleton/CardFormSkeleton.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/WebView/ThreeDSWebView.d.ts +9 -0
- package/lib/typescript/module/src/ui/components/WebView/ThreeDSWebView.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/features/TonderEnrollment/index.d.ts +6 -0
- package/lib/typescript/module/src/ui/features/TonderEnrollment/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts +6 -0
- package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts +10 -0
- package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts +10 -0
- package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/context.d.ts +5 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/context.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/hook.d.ts +4 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/hook.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/index.d.ts +8 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/uiWrapper.d.ts +10 -0
- package/lib/typescript/module/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/styles/payment.d.ts +20 -0
- package/lib/typescript/module/src/ui/styles/payment.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/styles/skyflow.d.ts +44 -0
- package/lib/typescript/module/src/ui/styles/skyflow.d.ts.map +1 -0
- package/package.json +206 -0
- package/src/core/3DSHandler.ts +140 -0
- package/src/core/BaseCheckout/index.ts +420 -0
- package/src/core/BaseEnrollment/index.ts +99 -0
- package/src/core/BaseSDK/index.ts +93 -0
- package/src/core/EnrollmentContainer/index.ts +105 -0
- package/src/core/PaymentInlineContainer/index.ts +127 -0
- package/src/core/PaymentLiteContainer/index.ts +201 -0
- package/src/core/Tonder/index.ts +147 -0
- package/src/hooks/useTonder/index-old.ts +35 -0
- package/src/hooks/useTonder/index.ts +10 -0
- package/src/index.tsx +11 -0
- package/src/infrastructure/HttpClient.ts +121 -0
- package/src/infrastructure/ServiceManager.ts +54 -0
- package/src/infrastructure/index.ts +2 -0
- package/src/services/BusinessService.ts +33 -0
- package/src/services/CardService.ts +118 -0
- package/src/services/CheckoutService.ts +135 -0
- package/src/services/CustomerService.ts +59 -0
- package/src/services/MercadoPagoService.ts +19 -0
- package/src/services/OpenPayService.ts +22 -0
- package/src/services/PaymentMethodService.ts +38 -0
- package/src/services/SkyflowService.ts +50 -0
- package/src/services/StorageService.ts +56 -0
- package/src/services/TokenService.ts +45 -0
- package/src/services/TransactionService.ts +23 -0
- package/src/services/index.ts +12 -0
- package/src/shared/catalog/cardBrandCatalog.ts +16 -0
- package/src/shared/catalog/paymentMethodsCatalog.ts +252 -0
- package/src/shared/constants/environments.ts +8 -0
- package/src/shared/constants/index.ts +2 -0
- package/src/shared/constants/messages.ts +119 -0
- package/src/shared/constants/paymentMethods.ts +63 -0
- package/src/shared/constants/skyflow.ts +60 -0
- package/src/shared/enum/ErrorKeyEnum.ts +47 -0
- package/src/shared/enum/index.ts +1 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/utils/common.ts +46 -0
- package/src/shared/utils/errors.ts +25 -0
- package/src/shared/utils/numberUtils.ts +10 -0
- package/src/shared/utils/paymentMethodUtils.ts +17 -0
- package/src/shared/utils/stringUtils.ts +3 -0
- package/src/shared/utils/styleUtils.ts +11 -0
- package/src/types/base.ts +79 -0
- package/src/types/baseCheckout.ts +42 -0
- package/src/types/baseEnrollment.ts +17 -0
- package/src/types/baseSDK.ts +10 -0
- package/src/types/business.ts +34 -0
- package/src/types/card.ts +38 -0
- package/src/types/checkout.ts +157 -0
- package/src/types/common.ts +68 -0
- package/src/types/customer.ts +29 -0
- package/src/types/enrollment.ts +70 -0
- package/src/types/index.ts +18 -0
- package/src/types/inlineCheckout.ts +96 -0
- package/src/types/input.ts +17 -0
- package/src/types/liteCheckout.ts +108 -0
- package/src/types/openpay-react-native.d.ts +3 -0
- package/src/types/openpay.ts +8 -0
- package/src/types/payment.ts +66 -0
- package/src/types/secure.ts +3 -0
- package/src/types/skyflow-react-native.d.ts +81 -0
- package/src/types/threeDSHandler.ts +10 -0
- package/src/types/transaction.ts +106 -0
- package/src/ui/components/Button/ProcessButton.tsx +57 -0
- package/src/ui/components/CardForm/index.tsx +91 -0
- package/src/ui/components/Checkbox/Checkbox.tsx +56 -0
- package/src/ui/components/Input/CardCVVInput.tsx +91 -0
- package/src/ui/components/Input/CardExpirationDateInput.tsx +95 -0
- package/src/ui/components/Input/CardExpirationMonthInput.tsx +90 -0
- package/src/ui/components/Input/CardExpirationYearInput.tsx +91 -0
- package/src/ui/components/Input/CardHolderInput.tsx +91 -0
- package/src/ui/components/Input/CardNumberInput.tsx +90 -0
- package/src/ui/components/PaymentMethodsList/index.tsx +103 -0
- package/src/ui/components/RadioButton/index.tsx +57 -0
- package/src/ui/components/SavedCardsList/index.tsx +137 -0
- package/src/ui/components/Skeleton/CardFormSkeleton.tsx +109 -0
- package/src/ui/components/WebView/ThreeDSWebView.tsx +110 -0
- package/src/ui/features/TonderEnrollment/index.tsx +141 -0
- package/src/ui/features/TonderPayment/index.tsx +243 -0
- package/src/ui/providers/InnerProvider/index.tsx +24 -0
- package/src/ui/providers/SkyflowContainerWrapper/index.tsx +35 -0
- package/src/ui/providers/TonderProvider/context.tsx +11 -0
- package/src/ui/providers/TonderProvider/hook.ts +10 -0
- package/src/ui/providers/TonderProvider/index.tsx +110 -0
- package/src/ui/providers/TonderProvider/uiWrapper.ts +67 -0
- package/src/ui/styles/payment.ts +23 -0
- package/src/ui/styles/skyflow.ts +58 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hook = _interopRequireDefault(require("@ui/providers/TonderProvider/hook"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const useTonder = () => {
|
|
10
|
+
const {
|
|
11
|
+
sdk
|
|
12
|
+
} = (0, _hook.default)();
|
|
13
|
+
return sdk;
|
|
14
|
+
};
|
|
15
|
+
var _default = exports.default = useTonder;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hook","_interopRequireDefault","require","e","__esModule","default","useTonder","sdk","useTonderContext","_default","exports"],"sourceRoot":"../../../../src","sources":["hooks/useTonder/index.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjE,MAAMG,SAAS,GAAGA,CAAA,KAAyB;EACzC,MAAM;IAAEC;EAAI,CAAC,GAAG,IAAAC,aAAgB,EAAI,CAAC;EAErC,OAAOD,GAAG;AACZ,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEaC,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
TonderProvider: true,
|
|
8
|
+
useTonder: true,
|
|
9
|
+
TonderPayment: true,
|
|
10
|
+
TonderEnrollment: true,
|
|
11
|
+
TonderError: true
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "TonderEnrollment", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _index4.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "TonderError", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _errors.default;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "TonderPayment", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _index3.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "TonderProvider", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _index.default;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "useTonder", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _index2.default;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var _CardHolderInput = require("./ui/components/Input/CardHolderInput.js");
|
|
44
|
+
Object.keys(_CardHolderInput).forEach(function (key) {
|
|
45
|
+
if (key === "default" || key === "__esModule") return;
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
47
|
+
if (key in exports && exports[key] === _CardHolderInput[key]) return;
|
|
48
|
+
Object.defineProperty(exports, key, {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _CardHolderInput[key];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
var _CardExpirationMonthInput = require("./ui/components/Input/CardExpirationMonthInput.js");
|
|
56
|
+
Object.keys(_CardExpirationMonthInput).forEach(function (key) {
|
|
57
|
+
if (key === "default" || key === "__esModule") return;
|
|
58
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
59
|
+
if (key in exports && exports[key] === _CardExpirationMonthInput[key]) return;
|
|
60
|
+
Object.defineProperty(exports, key, {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _CardExpirationMonthInput[key];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
var _CardExpirationYearInput = require("./ui/components/Input/CardExpirationYearInput.js");
|
|
68
|
+
Object.keys(_CardExpirationYearInput).forEach(function (key) {
|
|
69
|
+
if (key === "default" || key === "__esModule") return;
|
|
70
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
71
|
+
if (key in exports && exports[key] === _CardExpirationYearInput[key]) return;
|
|
72
|
+
Object.defineProperty(exports, key, {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _CardExpirationYearInput[key];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
var _CardCVVInput = require("./ui/components/Input/CardCVVInput.js");
|
|
80
|
+
Object.keys(_CardCVVInput).forEach(function (key) {
|
|
81
|
+
if (key === "default" || key === "__esModule") return;
|
|
82
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
83
|
+
if (key in exports && exports[key] === _CardCVVInput[key]) return;
|
|
84
|
+
Object.defineProperty(exports, key, {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _CardCVVInput[key];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
var _CardNumberInput = require("./ui/components/Input/CardNumberInput.js");
|
|
92
|
+
Object.keys(_CardNumberInput).forEach(function (key) {
|
|
93
|
+
if (key === "default" || key === "__esModule") return;
|
|
94
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
95
|
+
if (key in exports && exports[key] === _CardNumberInput[key]) return;
|
|
96
|
+
Object.defineProperty(exports, key, {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _CardNumberInput[key];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
var _index = _interopRequireDefault(require("./ui/providers/TonderProvider/index.js"));
|
|
104
|
+
var _index2 = _interopRequireDefault(require("./hooks/useTonder/index.js"));
|
|
105
|
+
var _index3 = _interopRequireDefault(require("./ui/features/TonderPayment/index.js"));
|
|
106
|
+
var _index4 = _interopRequireDefault(require("./ui/features/TonderEnrollment/index.js"));
|
|
107
|
+
var _errors = _interopRequireDefault(require("./shared/utils/errors.js"));
|
|
108
|
+
var _index5 = require("./types/index.js");
|
|
109
|
+
Object.keys(_index5).forEach(function (key) {
|
|
110
|
+
if (key === "default" || key === "__esModule") return;
|
|
111
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
112
|
+
if (key in exports && exports[key] === _index5[key]) return;
|
|
113
|
+
Object.defineProperty(exports, key, {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function () {
|
|
116
|
+
return _index5[key];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_CardHolderInput","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_CardExpirationMonthInput","_CardExpirationYearInput","_CardCVVInput","_CardNumberInput","_index","_interopRequireDefault","_index2","_index3","_index4","_errors","_index5","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,yBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,yBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,yBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EA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AA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAY,gBAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,gBAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,MAAA,GAAAC,sBAAA,CAAAlB,OAAA;AACA,IAAAmB,OAAA,GAAAD,sBAAA,CAAAlB,OAAA;AACA,IAAAoB,OAAA,GAAAF,sBAAA,CAAAlB,OAAA;AACA,IAAAqB,OAAA,GAAAH,sBAAA,CAAAlB,OAAA;AACA,IAAAsB,OAAA,GAAAJ,sBAAA,CAAAlB,OAAA;AACA,IAAAuB,OAAA,GAAAvB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAqB,OAAA,EAAApB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAmB,OAAA,CAAAnB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAW,OAAA,CAAAnB,GAAA;IAAA;EAAA;AAAA;AAAwB,SAAAc,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HttpClient = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _constants = require("@shared/constants");
|
|
9
|
+
var _enum = require("@shared/enum");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
class HttpClient {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.validateConfig(config);
|
|
14
|
+
this.apiKey = config.apiKey;
|
|
15
|
+
this.baseUrl = _constants.TONDER_URL_BY_MODE[config.mode];
|
|
16
|
+
this.abortController = new AbortController();
|
|
17
|
+
}
|
|
18
|
+
getApiKey() {
|
|
19
|
+
return this.apiKey;
|
|
20
|
+
}
|
|
21
|
+
validateConfig(config) {
|
|
22
|
+
if (!config.apiKey) {
|
|
23
|
+
throw new _errors.default({
|
|
24
|
+
code: _enum.ErrorKeyEnum.MERCHANT_CREDENTIAL_REQUIRED
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async request(endpoint, options = {}) {
|
|
29
|
+
try {
|
|
30
|
+
const headers = new Headers({
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
'Authorization': `Token ${this.apiKey}`,
|
|
33
|
+
...options.headers
|
|
34
|
+
});
|
|
35
|
+
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
36
|
+
...options,
|
|
37
|
+
headers: headers,
|
|
38
|
+
signal: options.signal || this.abortController.signal
|
|
39
|
+
});
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw await this.handleRequestError(response);
|
|
42
|
+
}
|
|
43
|
+
if (response.status === 204) {
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
return response.json();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
throw this.handleError(error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
get(endpoint, options = {}) {
|
|
52
|
+
return this.request(endpoint, {
|
|
53
|
+
...options,
|
|
54
|
+
method: 'GET'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
post(endpoint, data, options = {}) {
|
|
58
|
+
return this.request(endpoint, {
|
|
59
|
+
...options,
|
|
60
|
+
method: 'POST',
|
|
61
|
+
body: JSON.stringify(data)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
delete(endpoint, options = {}) {
|
|
65
|
+
return this.request(endpoint, {
|
|
66
|
+
...options,
|
|
67
|
+
method: 'DELETE'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async handleRequestError(response) {
|
|
71
|
+
const errorData = await response.json().catch(() => ({}));
|
|
72
|
+
throw new _errors.default({
|
|
73
|
+
code: `HTTP_${response.status}`,
|
|
74
|
+
details: errorData,
|
|
75
|
+
message: errorData.detail || 'Request failed'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
handleError(error) {
|
|
79
|
+
if (error instanceof _errors.default) {
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
if (error instanceof Error) {
|
|
83
|
+
if (error.name === 'AbortError') {
|
|
84
|
+
throw new _errors.default({
|
|
85
|
+
code: _enum.ErrorKeyEnum.REQUEST_ABORTED,
|
|
86
|
+
details: error
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
throw new _errors.default({
|
|
90
|
+
code: _enum.ErrorKeyEnum.REQUEST_FAILED,
|
|
91
|
+
details: error
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
throw new _errors.default({
|
|
95
|
+
code: _enum.ErrorKeyEnum.UNKNOWN_ERROR,
|
|
96
|
+
details: error
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Cleanup method to abort any pending requests
|
|
102
|
+
*/
|
|
103
|
+
cleanup() {
|
|
104
|
+
this.abortController.abort();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.HttpClient = HttpClient;
|
|
108
|
+
//# sourceMappingURL=HttpClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_constants","_enum","e","__esModule","default","HttpClient","constructor","config","validateConfig","apiKey","baseUrl","TONDER_URL_BY_MODE","mode","abortController","AbortController","getApiKey","TonderError","code","ErrorKeyEnum","MERCHANT_CREDENTIAL_REQUIRED","request","endpoint","options","headers","Headers","response","fetch","signal","ok","handleRequestError","status","json","error","handleError","get","method","post","data","body","JSON","stringify","delete","errorData","catch","details","message","detail","Error","name","REQUEST_ABORTED","REQUEST_FAILED","UNKNOWN_ERROR","cleanup","abort","exports"],"sourceRoot":"../../../src","sources":["infrastructure/HttpClient.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA4C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,MAAMG,UAAU,CAAC;EAKtBC,WAAWA,CAACC,MAAkB,EAAE;IAC9B,IAAI,CAACC,cAAc,CAACD,MAAM,CAAC;IAC3B,IAAI,CAACE,MAAM,GAAGF,MAAM,CAACE,MAAM;IAC3B,IAAI,CAACC,OAAO,GAAGC,6BAAkB,CAACJ,MAAM,CAACK,IAAI,CAAC;IAC9C,IAAI,CAACC,eAAe,GAAG,IAAIC,eAAe,CAAC,CAAC;EAC9C;EAEOC,SAASA,CAAA,EAAW;IACzB,OAAO,IAAI,CAACN,MAAM;EACpB;EAEQD,cAAcA,CAACD,MAAkB,EAAQ;IAC/C,IAAI,CAACA,MAAM,CAACE,MAAM,EAAE;MAClB,MAAM,IAAIO,eAAW,CAAC;QACpBC,IAAI,EAAEC,kBAAY,CAACC;MACrB,CAAC,CAAC;IACJ;EACF;EAEA,MAAgBC,OAAOA,CACrBC,QAAgB,EAChBC,OAAoB,GAAG,CAAC,CAAC,EACb;IACZ,IAAI;MACF,MAAMC,OAAO,GAAG,IAAIC,OAAO,CAAC;QAC1B,cAAc,EAAE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void 0;
|
|
7
|
+
var _HttpClient = require("@infrastructure/HttpClient");
|
|
8
|
+
var _services = require("@services");
|
|
9
|
+
class ServiceManager {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.http = new _HttpClient.HttpClient({
|
|
12
|
+
apiKey: config.apiKey,
|
|
13
|
+
mode: config.mode
|
|
14
|
+
});
|
|
15
|
+
this.business = new _services.BusinessService(this.http);
|
|
16
|
+
this.card = new _services.CardService(this.http);
|
|
17
|
+
this.checkout = new _services.CheckoutService(this.http);
|
|
18
|
+
this.customer = new _services.CustomerService(this.http);
|
|
19
|
+
this.paymentMethod = new _services.PaymentMethodService(this.http);
|
|
20
|
+
this.skyflow = new _services.SkyflowService(this.http);
|
|
21
|
+
this.token = new _services.TokenService(this.http);
|
|
22
|
+
this.openPay = new _services.OpenPayService();
|
|
23
|
+
this.mercadoPago = new _services.MercadoPagoService();
|
|
24
|
+
this.storage = new _services.StorageService();
|
|
25
|
+
this.transaction = new _services.TransactionService(this.http);
|
|
26
|
+
}
|
|
27
|
+
cleanup() {
|
|
28
|
+
this.http.cleanup();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ServiceManager = ServiceManager;
|
|
32
|
+
//# sourceMappingURL=ServiceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_HttpClient","require","_services","ServiceManager","constructor","config","http","HttpClient","apiKey","mode","business","BusinessService","card","CardService","checkout","CheckoutService","customer","CustomerService","paymentMethod","PaymentMethodService","skyflow","SkyflowService","token","TokenService","openPay","OpenPayService","mercadoPago","MercadoPagoService","storage","StorageService","transaction","TransactionService","cleanup","exports"],"sourceRoot":"../../../src","sources":["infrastructure/ServiceManager.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAcO,MAAME,cAAc,CAAC;EAe1BC,WAAWA,CAACC,MAAsB,EAAE;IAClC,IAAI,CAACC,IAAI,GAAG,IAAIC,sBAAU,CAAC;MACzBC,MAAM,EAAEH,MAAM,CAACG,MAAM;MACrBC,IAAI,EAAEJ,MAAM,CAACI;IACf,CAAC,CAAC;IAEF,IAAI,CAACC,QAAQ,GAAG,IAAIC,yBAAe,CAAC,IAAI,CAACL,IAAI,CAAC;IAC9C,IAAI,CAACM,IAAI,GAAG,IAAIC,qBAAW,CAAC,IAAI,CAACP,IAAI,CAAC;IACtC,IAAI,CAACQ,QAAQ,GAAG,IAAIC,yBAAe,CAAC,IAAI,CAACT,IAAI,CAAC;IAC9C,IAAI,CAACU,QAAQ,GAAG,IAAIC,yBAAe,CAAC,IAAI,CAACX,IAAI,CAAC;IAC9C,IAAI,CAACY,aAAa,GAAG,IAAIC,8BAAoB,CAAC,IAAI,CAACb,IAAI,CAAC;IACxD,IAAI,CAACc,OAAO,GAAG,IAAIC,wBAAc,CAAC,IAAI,CAACf,IAAI,CAAC;IAC5C,IAAI,CAACgB,KAAK,GAAG,IAAIC,sBAAY,CAAC,IAAI,CAACjB,IAAI,CAAC;IACxC,IAAI,CAACkB,OAAO,GAAG,IAAIC,wBAAc,CAAC,CAAC;IACnC,IAAI,CAACC,WAAW,GAAG,IAAIC,4BAAkB,CAAC,CAAC;IAC3C,IAAI,CAACC,OAAO,GAAG,IAAIC,wBAAc,CAAC,CAAC;IACnC,IAAI,CAACC,WAAW,GAAG,IAAIC,4BAAkB,CAAC,IAAI,CAACzB,IAAI,CAAC;EACtD;EAEO0B,OAAOA,CAAA,EAAS;IACrB,IAAI,CAAC1B,IAAI,CAAC0B,OAAO,CAAC,CAAC;EACrB;AACF;AAACC,OAAA,CAAA9B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _ServiceManager = require("./ServiceManager.js");
|
|
7
|
+
Object.keys(_ServiceManager).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ServiceManager[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ServiceManager[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _HttpClient = require("./HttpClient.js");
|
|
18
|
+
Object.keys(_HttpClient).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _HttpClient[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _HttpClient[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ServiceManager","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_HttpClient"],"sourceRoot":"../../../src","sources":["infrastructure/index.ts"],"mappings":";;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,eAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,eAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,eAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,WAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,WAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,WAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,WAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BusinessService = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class BusinessService {
|
|
11
|
+
BASE_PATH = '/api/v1/payments/business';
|
|
12
|
+
constructor(http) {
|
|
13
|
+
this.http = http;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetches business information from the API
|
|
18
|
+
* @param signal Optional AbortSignal for request cancellation
|
|
19
|
+
* @returns Business information
|
|
20
|
+
* @throws {TonderError} If the request fails
|
|
21
|
+
*/
|
|
22
|
+
async fetchBusiness(signal) {
|
|
23
|
+
try {
|
|
24
|
+
return await this.http.get(`${this.BASE_PATH}/${this.http.getApiKey()}`, {
|
|
25
|
+
signal
|
|
26
|
+
});
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw new _errors.default({
|
|
29
|
+
code: _enum.ErrorKeyEnum.FETCH_BUSINESS_ERROR,
|
|
30
|
+
details: error
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.BusinessService = BusinessService;
|
|
36
|
+
//# sourceMappingURL=BusinessService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","e","__esModule","default","BusinessService","BASE_PATH","constructor","http","fetchBusiness","signal","get","getApiKey","error","TonderError","code","ErrorKeyEnum","FETCH_BUSINESS_ERROR","details","exports"],"sourceRoot":"../../../src","sources":["services/BusinessService.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,MAAMG,eAAe,CAAC;EACVC,SAAS,GAAG,2BAA2B;EAGxDC,WAAWA,CAACC,IAAgB,EAAE;IAC5B,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAMC,aAAaA,CAACC,MAAoB,EAAgC;IACtE,IAAI;MACF,OAAO,MAAM,IAAI,CAACF,IAAI,CAACG,GAAG,CACxB,GAAG,IAAI,CAACL,SAAS,IAAI,IAAI,CAACE,IAAI,CAACI,SAAS,CAAC,CAAC,EAAE,EAC5C;QAAEF;MAAO,CACX,CAAC;IACH,CAAC,CAAC,OAAOG,KAAK,EAAE;MACd,MAAM,IAAIC,eAAW,CAAC;QACpBC,IAAI,EAAEC,kBAAY,CAACC,oBAAoB;QACvCC,OAAO,EAAEL;MACX,CAAC,CAAC;IACJ;EACF;AACF;AAACM,OAAA,CAAAd,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CardService = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _constants = require("@shared/constants");
|
|
9
|
+
var _enum = require("@shared/enum");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
class CardService {
|
|
12
|
+
BASE_PATH = '/api/v1/business';
|
|
13
|
+
constructor(http) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetches customer cards from the API
|
|
18
|
+
* @throws {TonderError} If the request fails
|
|
19
|
+
*/
|
|
20
|
+
async fetchCustomerCards(customerToken, secureToken, businessId) {
|
|
21
|
+
this.validateSecureToken(secureToken);
|
|
22
|
+
try {
|
|
23
|
+
return await this.http.get(`${this.BASE_PATH}/${businessId}/cards/`, {
|
|
24
|
+
headers: this.buildAuthHeaders(secureToken, customerToken)
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
throw new _errors.default({
|
|
28
|
+
code: _enum.ErrorKeyEnum.FETCH_CARDS_ERROR,
|
|
29
|
+
details: error
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Saves a customer card
|
|
36
|
+
* @throws {TonderError} If the request fails
|
|
37
|
+
*/
|
|
38
|
+
async saveCustomerCard(customerToken, secureToken, businessId, cardData) {
|
|
39
|
+
this.validateSecureToken(secureToken);
|
|
40
|
+
try {
|
|
41
|
+
return await this.http.post(`${this.BASE_PATH}/${businessId}/cards/`, cardData, {
|
|
42
|
+
headers: this.buildAuthHeaders(secureToken, customerToken)
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw new _errors.default({
|
|
46
|
+
code: _enum.ErrorKeyEnum.SAVE_CARD_ERROR,
|
|
47
|
+
details: error
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Removes a customer card
|
|
54
|
+
* @throws {TonderError} If the request fails
|
|
55
|
+
*/
|
|
56
|
+
async removeCustomerCard(customerToken, secureToken, skyflowId, businessId) {
|
|
57
|
+
this.validateSecureToken(secureToken);
|
|
58
|
+
try {
|
|
59
|
+
await this.http.delete(`${this.BASE_PATH}/${businessId}/cards/${skyflowId}/`, {
|
|
60
|
+
headers: this.buildAuthHeaders(secureToken, customerToken)
|
|
61
|
+
});
|
|
62
|
+
return _constants.MESSAGES_EN.REMOVE_CARD;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
throw new _errors.default({
|
|
65
|
+
code: _enum.ErrorKeyEnum.REMOVE_CARD_ERROR,
|
|
66
|
+
details: error
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
validateSecureToken(token) {
|
|
71
|
+
if (!token) {
|
|
72
|
+
throw new _errors.default({
|
|
73
|
+
code: _enum.ErrorKeyEnum.SECURE_TOKEN_INVALID
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Builds authentication headers for card operations
|
|
80
|
+
*/
|
|
81
|
+
buildAuthHeaders(secureToken, customerToken) {
|
|
82
|
+
return {
|
|
83
|
+
'Authorization': `Bearer ${secureToken}`,
|
|
84
|
+
'User-token': customerToken
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.CardService = CardService;
|
|
89
|
+
//# sourceMappingURL=CardService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_constants","_enum","e","__esModule","default","CardService","BASE_PATH","constructor","http","fetchCustomerCards","customerToken","secureToken","businessId","validateSecureToken","get","headers","buildAuthHeaders","error","TonderError","code","ErrorKeyEnum","FETCH_CARDS_ERROR","details","saveCustomerCard","cardData","post","SAVE_CARD_ERROR","removeCustomerCard","skyflowId","delete","MESSAGES_EN","REMOVE_CARD","REMOVE_CARD_ERROR","token","SECURE_TOKEN_INVALID","exports"],"sourceRoot":"../../../src","sources":["services/CardService.ts"],"mappings":";;;;;;AAKA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;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OAAO,EAAEL;MACX,CAAC,CAAC;IACJ;EACF;;EAEA;AACF;AACA;AACA;EACE,MAAMU,kBAAkBA,CACtBjB,aAAqB,EACrBC,WAAmB,EACnBiB,SAAiB,EACjBhB,UAA2B,EACV;IACjB,IAAI,CAACC,mBAAmB,CAACF,WAAW,CAAC;IAErC,IAAI;MACF,MAAM,IAAI,CAACH,IAAI,CAACqB,MAAM,CACpB,GAAG,IAAI,CAACvB,SAAS,IAAIM,UAAU,UAAUgB,SAAS,GAAG,EACrD;QACEb,OAAO,EAAE,IAAI,CAACC,gBAAgB,CAACL,WAAW,EAAED,aAAa;MAC3D,CACF,CAAC;MAED,OAAOoB,sBAAW,CAACC,WAAW;IAChC,CAAC,CAAC,OAAOd,KAAK,EAAE;MACd,MAAM,IAAIC,eAAW,CAAC;QACpBC,IAAI,EAAEC,kBAAY,CAACY,iBAAiB;QACpCV,OAAO,EAAEL;MACX,CAAC,CAAC;IACJ;EACF;EAEQJ,mBAAmBA,CAACoB,KAAa,EAAQ;IAC/C,IAAI,CAACA,KAAK,EAAE;MACV,MAAM,IAAIf,eAAW,CAAC;QAAEC,IAAI,EAAEC,kBAAY,CAACc;MAAqB,CAAC,CAAC;IACpE;EACF;;EAEA;AACF;AACA;EACUlB,gBAAgBA,CACtBL,WAAmB,EACnBD,aAAqB,EACG;IACxB,OAAO;MACL,eAAe,EAAE,UAAUC,WAAW,EAAE;MACxC,YAAY,EAAED;IAChB,CAAC;EACH;AACF;AAACyB,OAAA,CAAA9B,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CheckoutService = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class CheckoutService {
|
|
11
|
+
BASE_PATHS = {
|
|
12
|
+
orders: '/api/v1/orders/',
|
|
13
|
+
payments: '/api/v1/business',
|
|
14
|
+
checkout: '/api/v1/checkout-router/'
|
|
15
|
+
};
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new order
|
|
21
|
+
* @param orderItems Order data to create
|
|
22
|
+
* @throws {TonderError} If order creation fails
|
|
23
|
+
*/
|
|
24
|
+
async createOrder(orderItems) {
|
|
25
|
+
try {
|
|
26
|
+
this.validateOrderData(orderItems);
|
|
27
|
+
return await this.http.post(this.BASE_PATHS.orders, orderItems);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
throw new _errors.default({
|
|
30
|
+
code: _enum.ErrorKeyEnum.CREATE_ORDER_ERROR,
|
|
31
|
+
details: error
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new payment
|
|
38
|
+
* @param paymentItems Payment data to create
|
|
39
|
+
* @throws {TonderError} If payment creation fails
|
|
40
|
+
*/
|
|
41
|
+
async createPayment(paymentItems) {
|
|
42
|
+
try {
|
|
43
|
+
this.validatePaymentData(paymentItems);
|
|
44
|
+
return await this.http.post(`${this.BASE_PATHS.payments}/${paymentItems.business_pk}/payments/`, paymentItems);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
throw new _errors.default({
|
|
47
|
+
code: _enum.ErrorKeyEnum.CREATE_PAYMENT_ERROR,
|
|
48
|
+
details: error
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Starts or continues a checkout process
|
|
55
|
+
* @param routerItems Checkout data or checkout ID
|
|
56
|
+
* @param deviceSessionId Optional device session ID for MercadoPago
|
|
57
|
+
* @throws {TonderError} If checkout process fails
|
|
58
|
+
*/
|
|
59
|
+
async startCheckoutRouter(routerItems, deviceSessionId) {
|
|
60
|
+
try {
|
|
61
|
+
const payload = {
|
|
62
|
+
...routerItems,
|
|
63
|
+
...(deviceSessionId ? {
|
|
64
|
+
mp_device_session_id: deviceSessionId
|
|
65
|
+
} : {})
|
|
66
|
+
};
|
|
67
|
+
return await this.http.post(this.BASE_PATHS.checkout, payload);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
throw new _errors.default({
|
|
70
|
+
code: _enum.ErrorKeyEnum.START_CHECKOUT_ERROR,
|
|
71
|
+
details: error
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Validates order data before creation
|
|
78
|
+
* @throws {TonderError} If order data is invalid
|
|
79
|
+
*/
|
|
80
|
+
validateOrderData(orderItems) {
|
|
81
|
+
if (!orderItems.business) {
|
|
82
|
+
throw new _errors.default({
|
|
83
|
+
code: _enum.ErrorKeyEnum.BUSINESS_ID_REQUIRED
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (!orderItems.amount || orderItems.amount <= 0) {
|
|
87
|
+
throw new _errors.default({
|
|
88
|
+
code: _enum.ErrorKeyEnum.INVALID_AMOUNT
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (!orderItems.items?.length) {
|
|
92
|
+
throw new _errors.default({
|
|
93
|
+
code: _enum.ErrorKeyEnum.INVALID_ITEMS
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Validates payment data before creation
|
|
100
|
+
* @throws {TonderError} If payment data is invalid
|
|
101
|
+
*/
|
|
102
|
+
validatePaymentData(paymentItems) {
|
|
103
|
+
if (!paymentItems.business_pk) {
|
|
104
|
+
throw new _errors.default({
|
|
105
|
+
code: _enum.ErrorKeyEnum.BUSINESS_ID_REQUIRED
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (!paymentItems.client_id) {
|
|
109
|
+
throw new _errors.default({
|
|
110
|
+
code: _enum.ErrorKeyEnum.CLIENT_ID_REQUIRED
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (!paymentItems.amount || paymentItems.amount <= 0) {
|
|
114
|
+
throw new _errors.default({
|
|
115
|
+
code: _enum.ErrorKeyEnum.INVALID_AMOUNT
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.CheckoutService = CheckoutService;
|
|
121
|
+
//# sourceMappingURL=CheckoutService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","e","__esModule","default","CheckoutService","BASE_PATHS","orders","payments","checkout","constructor","http","createOrder","orderItems","validateOrderData","post","error","TonderError","code","ErrorKeyEnum","CREATE_ORDER_ERROR","details","createPayment","paymentItems","validatePaymentData","business_pk","CREATE_PAYMENT_ERROR","startCheckoutRouter","routerItems","deviceSessionId","payload","mp_device_session_id","START_CHECKOUT_ERROR","business","BUSINESS_ID_REQUIRED","amount","INVALID_AMOUNT","items","length","INVALID_ITEMS","client_id","CLIENT_ID_REQUIRED","exports"],"sourceRoot":"../../../src","sources":["services/CheckoutService.ts"],"mappings":";;;;;;AASA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,MAAMG,eAAe,CAAC;EACVC,UAAU,GAAG;IAC5BC,MAAM,EAAE,iBAAiB;IACzBC,QAAQ,EAAE,kBAAkB;IAC5BC,QAAQ,EAAE;EACZ,CAAC;EAIDC,WAAWA,CAACC,IAAgB,EAAE;IAC5B,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EACA;AACF;AACA;AACA;AACA;EACE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|
|
5
|
+
});
|
|
6
|
+
exports.CustomerService = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class CustomerService {
|
|
11
|
+
BASE_PATH = '/api/v1/customer/';
|
|
12
|
+
constructor(http) {
|
|
13
|
+
this.http = http;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registers a new customer or fetches existing one
|
|
17
|
+
* @param customer Customer data
|
|
18
|
+
* @param signal Optional AbortSignal for request cancellation
|
|
19
|
+
* @throws {TonderError} If registration/fetch fails or validation fails
|
|
20
|
+
*/
|
|
21
|
+
async registerOrFetchCustomer(customer, signal) {
|
|
22
|
+
try {
|
|
23
|
+
this.validateCustomerData(customer);
|
|
24
|
+
return await this.http.post(this.BASE_PATH, customer, {
|
|
25
|
+
signal
|
|
26
|
+
});
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('CUSTOMER_OPERATION_ERROR', error);
|
|
29
|
+
throw new _errors.default({
|
|
30
|
+
code: _enum.ErrorKeyEnum.CUSTOMER_OPERATION_ERROR,
|
|
31
|
+
details: error
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Validates customer data before processing
|
|
38
|
+
* @throws {TonderError} If customer data is invalid
|
|
39
|
+
*/
|
|
40
|
+
validateCustomerData(customer) {
|
|
41
|
+
if (!customer.email) {
|
|
42
|
+
throw new _errors.default({
|
|
43
|
+
code: _enum.ErrorKeyEnum.INVALID_EMAIL
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (!this.isValidEmail(customer.email)) {
|
|
47
|
+
throw new _errors.default({
|
|
48
|
+
code: _enum.ErrorKeyEnum.INVALID_EMAIL
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Validates email format
|
|
55
|
+
*/
|
|
56
|
+
isValidEmail(email) {
|
|
57
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
58
|
+
return emailRegex.test(email);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.CustomerService = CustomerService;
|
|
62
|
+
//# sourceMappingURL=CustomerService.js.map
|