@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,420 @@
|
|
|
1
|
+
import type Tonder from '@core/Tonder';
|
|
2
|
+
import BaseSDK from '@core/BaseSDK';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type {
|
|
5
|
+
ICardPaymentFields,
|
|
6
|
+
ICheckoutResponse,
|
|
7
|
+
ICreateOrderResponse,
|
|
8
|
+
ICreatePaymentResponse,
|
|
9
|
+
IInternalProcessPaymentRequest,
|
|
10
|
+
IProcessPaymentRequest,
|
|
11
|
+
ISaveCardResponse,
|
|
12
|
+
IStartCheckoutRequest,
|
|
13
|
+
IThreeDSHandler,
|
|
14
|
+
ITransaction,
|
|
15
|
+
} from '@types';
|
|
16
|
+
import { SDKType } from '@types';
|
|
17
|
+
import { executeCallback, getAppInfo } from '@shared/utils/common';
|
|
18
|
+
import { defaultTo, get } from 'lodash';
|
|
19
|
+
import { MESSAGES_ES } from '@shared/constants';
|
|
20
|
+
import TonderError from '@shared/utils/errors';
|
|
21
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
22
|
+
import { ThreeDSHandler } from '@core/3DSHandler';
|
|
23
|
+
import { getPaymentMethodDetails } from '@shared/catalog/paymentMethodsCatalog';
|
|
24
|
+
|
|
25
|
+
class BaseCheckout extends BaseSDK {
|
|
26
|
+
#process3ds: IThreeDSHandler;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
tonderClient: Tonder,
|
|
30
|
+
getState: () => Readonly<any>,
|
|
31
|
+
setState: (newState: Partial<any>) => void,
|
|
32
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
33
|
+
) {
|
|
34
|
+
super(tonderClient, getState, setState, setSkyflowConfig);
|
|
35
|
+
this.#process3ds = new ThreeDSHandler(
|
|
36
|
+
this.tonderClient.getConfig(),
|
|
37
|
+
this.tonderClient.getService(),
|
|
38
|
+
(eventName: string, data: any) => this.tonderClient.emit(eventName, data),
|
|
39
|
+
(checkoutId) => this.resumeCheckout(checkoutId)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public create = async (): Promise<{ error?: TonderError }> => {
|
|
44
|
+
try {
|
|
45
|
+
await this.getInitialData();
|
|
46
|
+
await this.initializeProviders();
|
|
47
|
+
|
|
48
|
+
if (this.tonderClient.getConfig().type === SDKType.INLINE) {
|
|
49
|
+
await this.getUIData({});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
this.setState({ isCreated: true, isCreating: false });
|
|
53
|
+
|
|
54
|
+
return {};
|
|
55
|
+
} catch (error) {
|
|
56
|
+
const err =
|
|
57
|
+
error instanceof TonderError
|
|
58
|
+
? error
|
|
59
|
+
: new TonderError({
|
|
60
|
+
code: ErrorKeyEnum.CREATE_ERROR,
|
|
61
|
+
details: error,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
await this.setState({
|
|
65
|
+
error: err,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return { error: err };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
public setupPaymentFlow = async (
|
|
73
|
+
data: IProcessPaymentRequest
|
|
74
|
+
): Promise<ITransaction> => {
|
|
75
|
+
await this.setState({
|
|
76
|
+
isProcessing: true,
|
|
77
|
+
});
|
|
78
|
+
const callbacks = this.getState().callbacks;
|
|
79
|
+
|
|
80
|
+
// Execute user callbacks
|
|
81
|
+
await executeCallback({
|
|
82
|
+
callbacks,
|
|
83
|
+
callback: 'beforePayment',
|
|
84
|
+
throwError: true,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const payment_data: IInternalProcessPaymentRequest =
|
|
88
|
+
await this.prepareCheckoutData(data);
|
|
89
|
+
|
|
90
|
+
await this.setState({
|
|
91
|
+
customer: payment_data.customer,
|
|
92
|
+
internalPaymentData: payment_data,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
await this.getOrRegisterCustomer(
|
|
96
|
+
this.getState().internalPaymentData?.customer
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// Save card based on the configuration or card selector for future payments.
|
|
100
|
+
await this.validateAndSaveCard(
|
|
101
|
+
payment_data.card?.skyflow_id,
|
|
102
|
+
this.getState().customization?.saveCards?.autoSave ||
|
|
103
|
+
this.getState().uiData?.saveCard
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// Refresh customer cards.
|
|
107
|
+
try {
|
|
108
|
+
this.getUIData({ cards: true, paymentMethods: false });
|
|
109
|
+
} catch (e) {}
|
|
110
|
+
|
|
111
|
+
// Make init checkout
|
|
112
|
+
const response = await this.handleCheckout({
|
|
113
|
+
card: payment_data.card,
|
|
114
|
+
payment_method: payment_data.payment_method,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Execute 3DS flow
|
|
118
|
+
return await this.handle3DSFlow(response);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
private async prepareCheckoutData(
|
|
122
|
+
data: IProcessPaymentRequest
|
|
123
|
+
): Promise<IInternalProcessPaymentRequest> {
|
|
124
|
+
let card_data = defaultTo(data.card, '');
|
|
125
|
+
let card_tokens = {};
|
|
126
|
+
let payment_method_data = defaultTo(data.payment_method, '');
|
|
127
|
+
|
|
128
|
+
if (card_data === '' && payment_method_data === '') {
|
|
129
|
+
const cardFields = await this.getState().skyflowContainer.collect();
|
|
130
|
+
card_tokens = cardFields?.records[0]?.fields;
|
|
131
|
+
}
|
|
132
|
+
if (card_data !== '') {
|
|
133
|
+
card_tokens = {
|
|
134
|
+
skyflow_id: card_data,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
...data,
|
|
139
|
+
...(Object.keys(card_tokens).length > 0
|
|
140
|
+
? { card: card_tokens }
|
|
141
|
+
: { payment_method: payment_method_data }),
|
|
142
|
+
currency: data.currency || 'mxn',
|
|
143
|
+
metadata: data.metadata || {},
|
|
144
|
+
} as IInternalProcessPaymentRequest;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
public validateAndSaveCard = async (
|
|
148
|
+
cardId?: string,
|
|
149
|
+
saveCard?: boolean
|
|
150
|
+
): Promise<ISaveCardResponse | void> => {
|
|
151
|
+
if (cardId && saveCard) {
|
|
152
|
+
const { customerToken, secureToken, businessId } = this.getDataForCards();
|
|
153
|
+
const response = await this.tonderClient
|
|
154
|
+
.getService()
|
|
155
|
+
.card.saveCustomerCard(customerToken, secureToken, businessId, {
|
|
156
|
+
skyflow_id: cardId!,
|
|
157
|
+
});
|
|
158
|
+
await this.setState({
|
|
159
|
+
message: MESSAGES_ES.CARD_SAVED_SUCCESSFULLY,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return response;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
private async handleCheckout({
|
|
167
|
+
card,
|
|
168
|
+
payment_method,
|
|
169
|
+
}: {
|
|
170
|
+
card?: ICardPaymentFields;
|
|
171
|
+
payment_method?: string;
|
|
172
|
+
}): Promise<ICheckoutResponse> {
|
|
173
|
+
try {
|
|
174
|
+
const orderResponse = await this.createOrder();
|
|
175
|
+
|
|
176
|
+
const paymentResponse = await this.createPayment(
|
|
177
|
+
orderResponse.id as string
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
return await this.startCheckoutRouter(
|
|
181
|
+
orderResponse.id as string,
|
|
182
|
+
paymentResponse.pk as string,
|
|
183
|
+
payment_method,
|
|
184
|
+
card
|
|
185
|
+
);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private async createOrder(): Promise<ICreateOrderResponse> {
|
|
192
|
+
const state = this.getState();
|
|
193
|
+
|
|
194
|
+
const orderItems = {
|
|
195
|
+
business: this.tonderClient.getConfig().apiKey,
|
|
196
|
+
client: state.customerData?.auth_token!,
|
|
197
|
+
billing_address_id: null,
|
|
198
|
+
shipping_address_id: null,
|
|
199
|
+
amount: state.internalPaymentData!.cart.total,
|
|
200
|
+
status: 'A',
|
|
201
|
+
reference: state.merchantData?.reference!,
|
|
202
|
+
is_oneclick: true,
|
|
203
|
+
items: state.internalPaymentData!.cart.items,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
return await this.tonderClient
|
|
207
|
+
.getService()
|
|
208
|
+
.checkout.createOrder(orderItems);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
private async createPayment(
|
|
212
|
+
orderId: string
|
|
213
|
+
): Promise<ICreatePaymentResponse> {
|
|
214
|
+
const state = this.getState();
|
|
215
|
+
const now = new Date();
|
|
216
|
+
const dateString = now.toISOString();
|
|
217
|
+
|
|
218
|
+
const request = {
|
|
219
|
+
business_pk: state.merchantData?.business.pk!,
|
|
220
|
+
client_id: state.customerData?.id!,
|
|
221
|
+
amount: state.internalPaymentData!.cart.total,
|
|
222
|
+
date: dateString,
|
|
223
|
+
order_id: orderId,
|
|
224
|
+
};
|
|
225
|
+
return await this.tonderClient.getService().checkout.createPayment(request);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private async startCheckoutRouter(
|
|
229
|
+
orderId: string,
|
|
230
|
+
paymentPK: string,
|
|
231
|
+
paymentMethod?: string,
|
|
232
|
+
card?: ICardPaymentFields
|
|
233
|
+
): Promise<ICheckoutResponse> {
|
|
234
|
+
const state = this.getState();
|
|
235
|
+
const { openpay_keys, business } = state.merchantData;
|
|
236
|
+
let deviceSessionIdTonder: string = '';
|
|
237
|
+
if (openpay_keys.merchant_id && openpay_keys.public_key) {
|
|
238
|
+
deviceSessionIdTonder = await this.tonderClient
|
|
239
|
+
.getService()
|
|
240
|
+
.openPay.getDeviceSessionId(
|
|
241
|
+
openpay_keys.merchant_id,
|
|
242
|
+
openpay_keys.public_key,
|
|
243
|
+
true
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const routerItems = {
|
|
248
|
+
name: state.internalPaymentData?.customer?.firstName || '',
|
|
249
|
+
last_name: state.internalPaymentData?.customer?.lastName || '',
|
|
250
|
+
email_client: state.internalPaymentData?.customer?.email || '',
|
|
251
|
+
phone_number: state.internalPaymentData?.customer?.phone || '',
|
|
252
|
+
return_url: this.tonderClient.getConfig().returnURL,
|
|
253
|
+
id_product: 'no_id',
|
|
254
|
+
quantity_product: 1,
|
|
255
|
+
id_ship: '0',
|
|
256
|
+
instance_id_ship: '0',
|
|
257
|
+
amount: state.internalPaymentData!.cart.total,
|
|
258
|
+
title_ship: 'shipping',
|
|
259
|
+
description: 'transaction',
|
|
260
|
+
device_session_id: deviceSessionIdTonder,
|
|
261
|
+
token_id: '',
|
|
262
|
+
order_id: orderId,
|
|
263
|
+
business_id: business.pk as string,
|
|
264
|
+
payment_id: paymentPK,
|
|
265
|
+
source: 'rn-sdk',
|
|
266
|
+
metadata: state.internalPaymentData!.metadata,
|
|
267
|
+
browser_info: getAppInfo(),
|
|
268
|
+
currency: state.internalPaymentData!.currency,
|
|
269
|
+
...(paymentMethod ? { payment_method: paymentMethod! } : { card: card! }),
|
|
270
|
+
} as IStartCheckoutRequest;
|
|
271
|
+
return await this.tonderClient
|
|
272
|
+
.getService()
|
|
273
|
+
.checkout.startCheckoutRouter(routerItems);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private handle3DSFlow(response: ICheckoutResponse) {
|
|
277
|
+
return new Promise<ITransaction>((resolve, reject) => {
|
|
278
|
+
this.#process3ds.handle3DS(response, async (finalResponse) => {
|
|
279
|
+
try {
|
|
280
|
+
await this.setState({ isProcessing: false });
|
|
281
|
+
|
|
282
|
+
if (finalResponse instanceof TonderError) {
|
|
283
|
+
reject(
|
|
284
|
+
new TonderError({
|
|
285
|
+
code: ErrorKeyEnum.PAYMENT_PROCESS_ERROR,
|
|
286
|
+
details: finalResponse?.details || finalResponse,
|
|
287
|
+
})
|
|
288
|
+
);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
await executeCallback({
|
|
293
|
+
callbacks: this.getState().callbacks,
|
|
294
|
+
callback: 'onFinishPayment',
|
|
295
|
+
data: { response: finalResponse },
|
|
296
|
+
});
|
|
297
|
+
resolve(finalResponse);
|
|
298
|
+
} catch (error) {
|
|
299
|
+
reject(error);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public async handlePaymentError(error: any): Promise<TonderError> {
|
|
306
|
+
let err;
|
|
307
|
+
let message = MESSAGES_ES.PAYMENT_PROCESS_ERROR;
|
|
308
|
+
if ((error?.message || '').includes('Incomplete inputs')) {
|
|
309
|
+
err = new TonderError({
|
|
310
|
+
code: ErrorKeyEnum.INVALID_CARD_DATA,
|
|
311
|
+
details: error,
|
|
312
|
+
});
|
|
313
|
+
message = MESSAGES_ES.INVALID_CARD_DATA;
|
|
314
|
+
} else {
|
|
315
|
+
err =
|
|
316
|
+
error instanceof TonderError
|
|
317
|
+
? error
|
|
318
|
+
: new TonderError({
|
|
319
|
+
code: ErrorKeyEnum.PAYMENT_PROCESS_ERROR,
|
|
320
|
+
details: error,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
await this.setState({
|
|
325
|
+
error: error as TonderError,
|
|
326
|
+
isProcessing: false,
|
|
327
|
+
message: message,
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
await executeCallback({
|
|
331
|
+
callbacks: this.getState().callbacks,
|
|
332
|
+
callback: 'onFinishPayment',
|
|
333
|
+
data: { error: err },
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
return err;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
private async resumeCheckout(checkoutId: string) {
|
|
340
|
+
return await this.tonderClient.getService().checkout.startCheckoutRouter({
|
|
341
|
+
checkout_id: checkoutId,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
private async getUIData(data: {
|
|
346
|
+
cards?: boolean;
|
|
347
|
+
paymentMethods?: boolean;
|
|
348
|
+
}): Promise<void> {
|
|
349
|
+
const { cards = true, paymentMethods = true } = data;
|
|
350
|
+
|
|
351
|
+
const tasks: Promise<any>[] = [];
|
|
352
|
+
|
|
353
|
+
if (cards && this.getState().customization?.saveCards?.showSaved) {
|
|
354
|
+
tasks.push(this.getCards());
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (paymentMethods && this.getState().customization?.paymentMethods?.show) {
|
|
358
|
+
tasks.push(this.getPaymentMethods());
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
await Promise.allSettled(tasks);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
private async getCards() {
|
|
365
|
+
try {
|
|
366
|
+
const { customerToken, secureToken, businessId } = this.getDataForCards();
|
|
367
|
+
|
|
368
|
+
const response = await this.tonderClient
|
|
369
|
+
.getService()
|
|
370
|
+
.card.fetchCustomerCards(customerToken, secureToken, businessId);
|
|
371
|
+
|
|
372
|
+
await this.tonderClient.updateUIState({
|
|
373
|
+
...(response ? { cards: response.cards || [] } : {}),
|
|
374
|
+
});
|
|
375
|
+
return response.cards;
|
|
376
|
+
} catch (e) {
|
|
377
|
+
console.warn('[BaseCheckout | getCards | ERROR]', e);
|
|
378
|
+
return [];
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
private async getPaymentMethods() {
|
|
383
|
+
try {
|
|
384
|
+
const response = await this.tonderClient
|
|
385
|
+
.getService()
|
|
386
|
+
.paymentMethod.fetchPaymentMethods();
|
|
387
|
+
|
|
388
|
+
const pym = defaultTo(get(response, 'results'), [])
|
|
389
|
+
.filter((pmItem) => pmItem.category.toLowerCase() !== 'cards')
|
|
390
|
+
.map((pmItem) => {
|
|
391
|
+
return {
|
|
392
|
+
id: pmItem.pk,
|
|
393
|
+
payment_method: pmItem.payment_method,
|
|
394
|
+
priority: pmItem.priority,
|
|
395
|
+
category: pmItem.category,
|
|
396
|
+
...getPaymentMethodDetails(pmItem.payment_method),
|
|
397
|
+
};
|
|
398
|
+
})
|
|
399
|
+
.sort((a, b) => a.priority - b.priority);
|
|
400
|
+
|
|
401
|
+
await this.tonderClient.updateUIState({
|
|
402
|
+
...(pym ? { paymentMethods: pym } : {}),
|
|
403
|
+
});
|
|
404
|
+
return pym;
|
|
405
|
+
} catch (e) {
|
|
406
|
+
console.warn('[BaseCheckout | getPaymentMethods | ERROR]', e);
|
|
407
|
+
return [];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
private getDataForCards() {
|
|
412
|
+
const secureToken = this.tonderClient.getSecureToken();
|
|
413
|
+
const businessId = this.tonderClient.getBusinessPK();
|
|
414
|
+
const customerToken = this.tonderClient.getCustomerAuthToken();
|
|
415
|
+
|
|
416
|
+
return { secureToken, businessId, customerToken };
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export default BaseCheckout;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import TonderError from '@shared/utils/errors';
|
|
2
|
+
import { MESSAGES_ES } from '@shared/constants';
|
|
3
|
+
import type {
|
|
4
|
+
ISaveCardResponse,
|
|
5
|
+
SDKOptions,
|
|
6
|
+
IEnrollmentCustomizationOptions,
|
|
7
|
+
} from '@types';
|
|
8
|
+
import { SDKType } from '@types';
|
|
9
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
10
|
+
import BaseSDK from '@core/BaseSDK';
|
|
11
|
+
import type Tonder from '@core/Tonder';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
|
|
14
|
+
class BaseEnrollment extends BaseSDK {
|
|
15
|
+
#defaultCustomization: IEnrollmentCustomizationOptions = {
|
|
16
|
+
saveButton: {
|
|
17
|
+
show: true,
|
|
18
|
+
text: 'Guardar',
|
|
19
|
+
},
|
|
20
|
+
showMessages: true,
|
|
21
|
+
};
|
|
22
|
+
constructor(
|
|
23
|
+
tonderClient: Tonder,
|
|
24
|
+
getState: () => Readonly<any>,
|
|
25
|
+
setState: (newState: Partial<any>) => void,
|
|
26
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
27
|
+
) {
|
|
28
|
+
super(tonderClient, getState, setState, setSkyflowConfig);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public create = async (
|
|
32
|
+
data: SDKOptions<SDKType.ENROLLMENT>
|
|
33
|
+
): Promise<{ error?: TonderError }> => {
|
|
34
|
+
try {
|
|
35
|
+
await this.setState({
|
|
36
|
+
...data,
|
|
37
|
+
isCreated: false,
|
|
38
|
+
isCreating: true,
|
|
39
|
+
customization: {
|
|
40
|
+
...this.#defaultCustomization,
|
|
41
|
+
...(data.customization || {}),
|
|
42
|
+
saveButton: {
|
|
43
|
+
...this.#defaultCustomization.saveButton,
|
|
44
|
+
...(data.customization?.saveButton || {}),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
...(data.customer ? { customer: data.customer } : {}),
|
|
48
|
+
...(data.secureToken ? { secureToken: data.secureToken } : {}),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
await this.getInitialData();
|
|
52
|
+
|
|
53
|
+
await this.initializeProviders({ mercadoPago: false });
|
|
54
|
+
|
|
55
|
+
await this.setState({
|
|
56
|
+
isCreated: true,
|
|
57
|
+
isCreating: false,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return {};
|
|
61
|
+
} catch (error) {
|
|
62
|
+
const err =
|
|
63
|
+
error instanceof TonderError
|
|
64
|
+
? error
|
|
65
|
+
: new TonderError({
|
|
66
|
+
code: ErrorKeyEnum.CREATE_ERROR,
|
|
67
|
+
details: error,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await this.setState({
|
|
71
|
+
error: error as TonderError,
|
|
72
|
+
message: MESSAGES_ES[ErrorKeyEnum.ERROR_LOAD_ENROLLMENT_FORM],
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return { error: err };
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
public saveCard = async (cardId?: string): Promise<ISaveCardResponse> => {
|
|
80
|
+
if (cardId) {
|
|
81
|
+
const secureToken = this.tonderClient.getSecureToken();
|
|
82
|
+
const businessId = this.tonderClient.getBusinessPK();
|
|
83
|
+
const customerToken = this.tonderClient.getCustomerAuthToken();
|
|
84
|
+
const response = await this.tonderClient
|
|
85
|
+
.getService()
|
|
86
|
+
.card.saveCustomerCard(customerToken, secureToken, businessId, {
|
|
87
|
+
skyflow_id: cardId!,
|
|
88
|
+
});
|
|
89
|
+
await this.setState({
|
|
90
|
+
message: MESSAGES_ES.CARD_SAVED_SUCCESSFULLY,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
throw new TonderError({ code: ErrorKeyEnum.INVALID_CARD_DATA });
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default BaseEnrollment;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type Tonder from '@core/Tonder';
|
|
2
|
+
import type { ICustomer, ICustomerResponse } from '@types';
|
|
3
|
+
import TonderError from '@shared/utils/errors';
|
|
4
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
class BaseSDK {
|
|
8
|
+
tonderClient: Tonder;
|
|
9
|
+
getState: () => Readonly<any>;
|
|
10
|
+
setState: (newState: Partial<any>) => void;
|
|
11
|
+
private readonly setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>;
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
tonderClient: Tonder,
|
|
15
|
+
getState: () => Readonly<any>,
|
|
16
|
+
setState: (newState: Partial<any>) => void,
|
|
17
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
18
|
+
) {
|
|
19
|
+
this.tonderClient = tonderClient;
|
|
20
|
+
this.setSkyflowConfig = setSkyflowConfig;
|
|
21
|
+
this.getState = getState;
|
|
22
|
+
this.setState = setState;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async getInitialData(): Promise<void> {
|
|
26
|
+
const merchantData = await this.tonderClient
|
|
27
|
+
.getService()
|
|
28
|
+
.business.fetchBusiness();
|
|
29
|
+
|
|
30
|
+
await this.setState({ merchantData });
|
|
31
|
+
|
|
32
|
+
// Init customer, if it's exist in state
|
|
33
|
+
try {
|
|
34
|
+
await this.getOrRegisterCustomer(
|
|
35
|
+
this.getState().paymentData?.customer || this.getState().customer
|
|
36
|
+
);
|
|
37
|
+
} catch (e) {}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected async getOrRegisterCustomer(
|
|
41
|
+
customer?: ICustomer
|
|
42
|
+
): Promise<ICustomerResponse | null> {
|
|
43
|
+
try {
|
|
44
|
+
const customerInput = customer;
|
|
45
|
+
if (customerInput && Object.keys(customerInput).length > 0) {
|
|
46
|
+
const customerData = await this.tonderClient
|
|
47
|
+
.getService()
|
|
48
|
+
.customer.registerOrFetchCustomer(customerInput as ICustomer);
|
|
49
|
+
await this.setState({ customerData });
|
|
50
|
+
return customerData;
|
|
51
|
+
}
|
|
52
|
+
console.log('Customer data was not provided, skipping get/register.');
|
|
53
|
+
return null;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
if (error instanceof TonderError) {
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
throw new TonderError({ code: ErrorKeyEnum.STATE_ERROR, details: error });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public async initializeProviders(providers?: {
|
|
63
|
+
mercadoPago?: boolean;
|
|
64
|
+
}): Promise<void> {
|
|
65
|
+
if (providers?.mercadoPago) {
|
|
66
|
+
this.initMercadoPago();
|
|
67
|
+
}
|
|
68
|
+
await this.initSkyflow();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private initMercadoPago() {
|
|
72
|
+
const merchantData = this.getState().merchantData;
|
|
73
|
+
// Init mercado pago, if it's active
|
|
74
|
+
if (!!merchantData?.mercado_pago && !!merchantData?.mercado_pago?.active) {
|
|
75
|
+
this.tonderClient.getService().mercadoPago.injectMercadoPagoSecurity();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private async initSkyflow() {
|
|
80
|
+
const merchantData = this.getState().merchantData;
|
|
81
|
+
if (merchantData?.vault_id && merchantData?.vault_url) {
|
|
82
|
+
const skyflowConfig = await this.tonderClient
|
|
83
|
+
.getService()
|
|
84
|
+
.skyflow.createSkyflowConfig(merchantData);
|
|
85
|
+
|
|
86
|
+
this.setSkyflowConfig(skyflowConfig);
|
|
87
|
+
|
|
88
|
+
await this.setState({ skyflowConfig });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default BaseSDK;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IBaseResponse,
|
|
3
|
+
IEnrollment,
|
|
4
|
+
ISaveCardResponse,
|
|
5
|
+
SDKOptions,
|
|
6
|
+
} from '@types';
|
|
7
|
+
import TonderError from '@shared/utils/errors';
|
|
8
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
9
|
+
import { MESSAGES_ES } from '@shared/constants';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { executeCallback } from '@shared/utils/common';
|
|
12
|
+
import BaseEnrollment from '@core/BaseEnrollment';
|
|
13
|
+
import { SDKType } from '@types';
|
|
14
|
+
import Tonder from '@core/Tonder';
|
|
15
|
+
|
|
16
|
+
export class EnrollmentContainer implements IEnrollment {
|
|
17
|
+
#tonderClient: Tonder;
|
|
18
|
+
#baseSDK: BaseEnrollment;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
tonderClient: Tonder,
|
|
22
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
23
|
+
) {
|
|
24
|
+
this.#tonderClient = tonderClient;
|
|
25
|
+
this.#baseSDK = new BaseEnrollment(
|
|
26
|
+
tonderClient,
|
|
27
|
+
tonderClient.getState,
|
|
28
|
+
tonderClient.setState,
|
|
29
|
+
setSkyflowConfig
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public create = async (
|
|
34
|
+
data: SDKOptions<SDKType.ENROLLMENT>
|
|
35
|
+
): Promise<{ error?: TonderError }> => {
|
|
36
|
+
return await this.#baseSDK.create(data);
|
|
37
|
+
};
|
|
38
|
+
public async saveCustomerCard(): Promise<IBaseResponse<ISaveCardResponse>> {
|
|
39
|
+
const currentCallbacks = this.#baseSDK.getState().callbacks;
|
|
40
|
+
try {
|
|
41
|
+
await this.#baseSDK.setState({
|
|
42
|
+
isProcessing: true,
|
|
43
|
+
});
|
|
44
|
+
await executeCallback({
|
|
45
|
+
callbacks: currentCallbacks,
|
|
46
|
+
callback: 'beforeSave',
|
|
47
|
+
throwError: true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const cardFields = await this.#baseSDK
|
|
51
|
+
.getState()
|
|
52
|
+
.skyflowContainer.collect();
|
|
53
|
+
const card_data = cardFields?.records[0]?.fields;
|
|
54
|
+
const response = await this.#baseSDK.saveCard(card_data.skyflow_id);
|
|
55
|
+
|
|
56
|
+
await this.#baseSDK.setState({
|
|
57
|
+
isProcessing: false,
|
|
58
|
+
});
|
|
59
|
+
await executeCallback({
|
|
60
|
+
callbacks: currentCallbacks,
|
|
61
|
+
callback: 'onFinishSave',
|
|
62
|
+
data: { response },
|
|
63
|
+
});
|
|
64
|
+
return { response };
|
|
65
|
+
} catch (error) {
|
|
66
|
+
let err;
|
|
67
|
+
let message = MESSAGES_ES.SAVE_CARD_PROCESS_ERROR;
|
|
68
|
+
if (
|
|
69
|
+
(error && 'message' in error ? error?.message : '').includes(
|
|
70
|
+
'Incomplete inputs'
|
|
71
|
+
)
|
|
72
|
+
) {
|
|
73
|
+
err = new TonderError({
|
|
74
|
+
code: ErrorKeyEnum.INVALID_CARD_DATA,
|
|
75
|
+
details: error,
|
|
76
|
+
});
|
|
77
|
+
message = MESSAGES_ES.INVALID_CARD_DATA;
|
|
78
|
+
} else {
|
|
79
|
+
err =
|
|
80
|
+
error instanceof TonderError
|
|
81
|
+
? error
|
|
82
|
+
: new TonderError({
|
|
83
|
+
code: ErrorKeyEnum.SAVE_CARD_PROCESS_ERROR,
|
|
84
|
+
details: error,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
await this.#baseSDK.setState({
|
|
88
|
+
error: error as TonderError,
|
|
89
|
+
isProcessing: false,
|
|
90
|
+
message: message,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
await executeCallback({
|
|
94
|
+
callbacks: currentCallbacks,
|
|
95
|
+
callback: 'onFinishSave',
|
|
96
|
+
data: { error: err },
|
|
97
|
+
});
|
|
98
|
+
return { error: err };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
reset = (): void => {
|
|
103
|
+
this.#tonderClient.reset();
|
|
104
|
+
};
|
|
105
|
+
}
|