@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,127 @@
|
|
|
1
|
+
import type Tonder from '@core/Tonder';
|
|
2
|
+
import TonderError from '@shared/utils/errors';
|
|
3
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type {
|
|
6
|
+
IBaseProcessPaymentRequest,
|
|
7
|
+
IBaseResponse,
|
|
8
|
+
IInlineCustomizationOptions,
|
|
9
|
+
IPaymentInlineContainer,
|
|
10
|
+
IProcessPaymentRequest,
|
|
11
|
+
ITransaction,
|
|
12
|
+
SDKOptions,
|
|
13
|
+
} from '@types';
|
|
14
|
+
import BaseCheckout from '@core/BaseCheckout';
|
|
15
|
+
import { SDKType } from '@types';
|
|
16
|
+
|
|
17
|
+
class PaymentInlineContainer implements IPaymentInlineContainer {
|
|
18
|
+
#tonderClient: Tonder;
|
|
19
|
+
#baseSDK: BaseCheckout;
|
|
20
|
+
#defaultCustomization: IInlineCustomizationOptions = {
|
|
21
|
+
saveCards: {
|
|
22
|
+
showSaveCardOption: true,
|
|
23
|
+
showSaved: true,
|
|
24
|
+
autoSave: false,
|
|
25
|
+
showDeleteOption: true,
|
|
26
|
+
},
|
|
27
|
+
paymentButton: {
|
|
28
|
+
show: true,
|
|
29
|
+
text: 'Pagar',
|
|
30
|
+
showAmount: true,
|
|
31
|
+
},
|
|
32
|
+
paymentMethods: {
|
|
33
|
+
show: true,
|
|
34
|
+
},
|
|
35
|
+
cardForm: {
|
|
36
|
+
show: true,
|
|
37
|
+
},
|
|
38
|
+
showMessages: true,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
tonderClient: Tonder,
|
|
43
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
44
|
+
) {
|
|
45
|
+
this.#tonderClient = tonderClient;
|
|
46
|
+
this.#baseSDK = new BaseCheckout(
|
|
47
|
+
tonderClient,
|
|
48
|
+
tonderClient.getState,
|
|
49
|
+
tonderClient.setState,
|
|
50
|
+
setSkyflowConfig
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public create = async (
|
|
55
|
+
data: SDKOptions<SDKType.INLINE>
|
|
56
|
+
): Promise<{ error?: TonderError }> => {
|
|
57
|
+
this.#baseSDK.setState({
|
|
58
|
+
...data,
|
|
59
|
+
customization: {
|
|
60
|
+
...this.#defaultCustomization,
|
|
61
|
+
...(data.customization || {}),
|
|
62
|
+
saveCards: {
|
|
63
|
+
...this.#defaultCustomization.saveCards,
|
|
64
|
+
...(data.customization?.saveCards || {}),
|
|
65
|
+
},
|
|
66
|
+
paymentMethods: {
|
|
67
|
+
...this.#defaultCustomization.paymentMethods,
|
|
68
|
+
...(data.customization?.paymentMethods || {}),
|
|
69
|
+
},
|
|
70
|
+
cardForm: {
|
|
71
|
+
...this.#defaultCustomization.cardForm,
|
|
72
|
+
...(data.customization?.cardForm || {}),
|
|
73
|
+
},
|
|
74
|
+
paymentButton: {
|
|
75
|
+
...this.#defaultCustomization.paymentButton,
|
|
76
|
+
...(data.customization?.paymentButton || {}),
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
uiData: {
|
|
80
|
+
card: '',
|
|
81
|
+
payment_method: '',
|
|
82
|
+
saveCard: false,
|
|
83
|
+
selectedMethod: 'new',
|
|
84
|
+
paymentMethods: [],
|
|
85
|
+
cards: [],
|
|
86
|
+
},
|
|
87
|
+
isCreating: true,
|
|
88
|
+
isCreated: false,
|
|
89
|
+
});
|
|
90
|
+
return await this.#baseSDK.create();
|
|
91
|
+
};
|
|
92
|
+
public payment = async (
|
|
93
|
+
data?: IBaseProcessPaymentRequest
|
|
94
|
+
): Promise<IBaseResponse<ITransaction>> => {
|
|
95
|
+
try {
|
|
96
|
+
if (data) {
|
|
97
|
+
await this.#tonderClient.setState({ paymentData: data });
|
|
98
|
+
}
|
|
99
|
+
const state = this.#tonderClient.getState();
|
|
100
|
+
const payment_data: IProcessPaymentRequest = {
|
|
101
|
+
...state.paymentData,
|
|
102
|
+
card: state.uiData.card,
|
|
103
|
+
payment_method: state.uiData.payment_method,
|
|
104
|
+
};
|
|
105
|
+
await this.validateProcessPaymentData(payment_data);
|
|
106
|
+
const response = await this.#baseSDK.setupPaymentFlow(payment_data);
|
|
107
|
+
return { response };
|
|
108
|
+
} catch (error) {
|
|
109
|
+
const err = await this.#baseSDK.handlePaymentError(error);
|
|
110
|
+
return { error: err };
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
reset = (): void => {
|
|
115
|
+
this.#tonderClient.reset();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
private validateProcessPaymentData(data: IProcessPaymentRequest) {
|
|
119
|
+
if (!data || (data && Object.keys(data).length === 0)) {
|
|
120
|
+
throw new TonderError({
|
|
121
|
+
code: ErrorKeyEnum.INVALID_PAYMENT_REQUEST,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export default PaymentInlineContainer;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type Tonder from '@core/Tonder';
|
|
2
|
+
import TonderError from '@shared/utils/errors';
|
|
3
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type {
|
|
6
|
+
IBaseResponse,
|
|
7
|
+
ICustomerCardsResponse,
|
|
8
|
+
ILiteCustomizationOptions,
|
|
9
|
+
IPaymentLiteContainer,
|
|
10
|
+
IPaymentMethod,
|
|
11
|
+
IProcessPaymentRequest,
|
|
12
|
+
ISaveCardResponse,
|
|
13
|
+
ITransaction,
|
|
14
|
+
SDKOptions,
|
|
15
|
+
} from '@types';
|
|
16
|
+
import BaseCheckout from '@core/BaseCheckout';
|
|
17
|
+
import { SDKType } from '@types';
|
|
18
|
+
import { defaultTo } from 'lodash';
|
|
19
|
+
import { getPaymentMethodsWithDetails } from '@shared/utils/paymentMethodUtils';
|
|
20
|
+
import { getCardType } from '@shared/catalog/cardBrandCatalog';
|
|
21
|
+
|
|
22
|
+
class PaymentLiteContainer implements IPaymentLiteContainer {
|
|
23
|
+
#tonderClient: Tonder;
|
|
24
|
+
#baseSDK: BaseCheckout;
|
|
25
|
+
#defaultCustomization: ILiteCustomizationOptions = {
|
|
26
|
+
saveCards: {
|
|
27
|
+
autoSave: false,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
tonderClient: Tonder,
|
|
33
|
+
setSkyflowConfig: React.Dispatch<React.SetStateAction<any>>
|
|
34
|
+
) {
|
|
35
|
+
this.#tonderClient = tonderClient;
|
|
36
|
+
this.#baseSDK = new BaseCheckout(
|
|
37
|
+
tonderClient,
|
|
38
|
+
tonderClient.getState,
|
|
39
|
+
tonderClient.setState,
|
|
40
|
+
setSkyflowConfig
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public create = async (
|
|
45
|
+
data: SDKOptions<SDKType.LITE>
|
|
46
|
+
): Promise<{ error?: TonderError }> => {
|
|
47
|
+
this.#baseSDK.setState({
|
|
48
|
+
...data,
|
|
49
|
+
customization: {
|
|
50
|
+
...this.#defaultCustomization,
|
|
51
|
+
...(data.customization || {}),
|
|
52
|
+
saveCards: {
|
|
53
|
+
...this.#defaultCustomization.saveCards,
|
|
54
|
+
...(data.customization?.saveCards || {}),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
isCreating: true,
|
|
58
|
+
isCreated: false,
|
|
59
|
+
});
|
|
60
|
+
return await this.#baseSDK.create();
|
|
61
|
+
};
|
|
62
|
+
public payment = async (
|
|
63
|
+
data?: IProcessPaymentRequest
|
|
64
|
+
): Promise<IBaseResponse<ITransaction>> => {
|
|
65
|
+
try {
|
|
66
|
+
if (data) {
|
|
67
|
+
await this.#tonderClient.setState({ paymentData: data });
|
|
68
|
+
}
|
|
69
|
+
const state = this.#tonderClient.getState();
|
|
70
|
+
const payment_data: IProcessPaymentRequest = {
|
|
71
|
+
...state.paymentData,
|
|
72
|
+
};
|
|
73
|
+
await this.validateProcessPaymentData(payment_data);
|
|
74
|
+
const response = await this.#baseSDK.setupPaymentFlow(payment_data);
|
|
75
|
+
return { response };
|
|
76
|
+
} catch (error) {
|
|
77
|
+
const err = await this.#baseSDK.handlePaymentError(error);
|
|
78
|
+
return { error: err };
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
public saveCustomerCard = async (): Promise<
|
|
83
|
+
IBaseResponse<ISaveCardResponse>
|
|
84
|
+
> => {
|
|
85
|
+
try {
|
|
86
|
+
await this.#baseSDK.setState({
|
|
87
|
+
isProcessing: true,
|
|
88
|
+
});
|
|
89
|
+
const cardFields = await this.#baseSDK
|
|
90
|
+
.getState()
|
|
91
|
+
.skyflowContainer.collect();
|
|
92
|
+
const card_data = cardFields?.records[0]?.fields;
|
|
93
|
+
const response = await this.#baseSDK.validateAndSaveCard(
|
|
94
|
+
card_data.skyflow_id,
|
|
95
|
+
true
|
|
96
|
+
);
|
|
97
|
+
return { response: response as ISaveCardResponse };
|
|
98
|
+
} catch (error) {
|
|
99
|
+
const err =
|
|
100
|
+
error instanceof TonderError
|
|
101
|
+
? error
|
|
102
|
+
: new TonderError({
|
|
103
|
+
code: ErrorKeyEnum.SAVE_CARD_PROCESS_ERROR,
|
|
104
|
+
details: error,
|
|
105
|
+
});
|
|
106
|
+
await this.#baseSDK.setState({
|
|
107
|
+
error: error as TonderError,
|
|
108
|
+
isProcessing: false,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
return { error: err };
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
public getCustomerCards = async (): Promise<
|
|
116
|
+
IBaseResponse<ICustomerCardsResponse>
|
|
117
|
+
> => {
|
|
118
|
+
try {
|
|
119
|
+
const merchantId = this.#tonderClient.getBusinessPK();
|
|
120
|
+
const secureToken: string = this.#tonderClient.getSecureToken();
|
|
121
|
+
const customer_auth_token: string | undefined =
|
|
122
|
+
this.#tonderClient.getCustomerAuthToken();
|
|
123
|
+
|
|
124
|
+
const response = await this.#tonderClient
|
|
125
|
+
.getService()
|
|
126
|
+
.card.fetchCustomerCards(customer_auth_token, secureToken, merchantId);
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
response: {
|
|
130
|
+
...response,
|
|
131
|
+
cards: response.cards.map((ic) => ({
|
|
132
|
+
...ic,
|
|
133
|
+
icon: getCardType(ic.fields.card_scheme),
|
|
134
|
+
})),
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
} catch (error) {
|
|
138
|
+
return { error: error as TonderError };
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
public removeCustomerCard = async (
|
|
143
|
+
id: string
|
|
144
|
+
): Promise<IBaseResponse<string>> => {
|
|
145
|
+
try {
|
|
146
|
+
const merchantId = this.#tonderClient.getBusinessPK();
|
|
147
|
+
const secureToken: string = this.#tonderClient.getSecureToken();
|
|
148
|
+
const customer_auth_token: string | undefined =
|
|
149
|
+
this.#tonderClient.getCustomerAuthToken();
|
|
150
|
+
const response = await this.#tonderClient
|
|
151
|
+
.getService()
|
|
152
|
+
.card.removeCustomerCard(
|
|
153
|
+
customer_auth_token,
|
|
154
|
+
secureToken,
|
|
155
|
+
id,
|
|
156
|
+
merchantId
|
|
157
|
+
);
|
|
158
|
+
return { response };
|
|
159
|
+
} catch (error) {
|
|
160
|
+
return { error: error as TonderError };
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
public getPaymentMethods = async (): Promise<
|
|
165
|
+
IBaseResponse<IPaymentMethod[]>
|
|
166
|
+
> => {
|
|
167
|
+
try {
|
|
168
|
+
const response = await this.#tonderClient
|
|
169
|
+
.getService()
|
|
170
|
+
.paymentMethod.fetchPaymentMethods();
|
|
171
|
+
|
|
172
|
+
const pm_results = getPaymentMethodsWithDetails(response);
|
|
173
|
+
return { response: pm_results };
|
|
174
|
+
} catch (error) {
|
|
175
|
+
return { error: error as TonderError };
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
reset = (): void => {
|
|
180
|
+
this.#tonderClient.reset();
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
private validateProcessPaymentData(data: IProcessPaymentRequest) {
|
|
184
|
+
if (!data || (data && Object.keys(data).length === 0)) {
|
|
185
|
+
throw new TonderError({
|
|
186
|
+
code: ErrorKeyEnum.INVALID_PAYMENT_REQUEST,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
let card_data = defaultTo(data.card, '');
|
|
191
|
+
let payment_method_data = defaultTo(data.payment_method, '');
|
|
192
|
+
|
|
193
|
+
if (card_data !== '' && payment_method_data !== '') {
|
|
194
|
+
throw new TonderError({
|
|
195
|
+
code: ErrorKeyEnum.INVALID_PAYMENT_REQUEST_CARD_PM,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export default PaymentLiteContainer;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ICard,
|
|
3
|
+
ICustomerResponse,
|
|
4
|
+
IPaymentMethod,
|
|
5
|
+
ISDKBaseConfig,
|
|
6
|
+
} from '@types';
|
|
7
|
+
import { ServiceManager } from '@infrastructure/ServiceManager';
|
|
8
|
+
import TonderError from '@shared/utils/errors';
|
|
9
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
10
|
+
import { TONDER_URL_BY_MODE } from '@shared/constants';
|
|
11
|
+
|
|
12
|
+
class Tonder {
|
|
13
|
+
private config: ISDKBaseConfig;
|
|
14
|
+
public service: ServiceManager;
|
|
15
|
+
private state: any;
|
|
16
|
+
private subscribers: (() => void)[] = [];
|
|
17
|
+
private eventListeners: Map<string, Set<(data: any) => void>> = new Map();
|
|
18
|
+
|
|
19
|
+
constructor(config: ISDKBaseConfig) {
|
|
20
|
+
this.initData(config);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private initData(config) {
|
|
24
|
+
this.service = new ServiceManager(config);
|
|
25
|
+
this.config = {
|
|
26
|
+
...config,
|
|
27
|
+
returnURL:
|
|
28
|
+
config.returnURL && config.returnURL !== ''
|
|
29
|
+
? config.returnURL
|
|
30
|
+
: TONDER_URL_BY_MODE[config.mode],
|
|
31
|
+
};
|
|
32
|
+
this.state = {};
|
|
33
|
+
this.eventListeners = new Map();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getConfig(): Readonly<ISDKBaseConfig> {
|
|
37
|
+
return Object.freeze({ ...this.config });
|
|
38
|
+
}
|
|
39
|
+
getService(): ServiceManager {
|
|
40
|
+
return this.service;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public getCustomerAuthToken(): string {
|
|
44
|
+
const customerData: ICustomerResponse | undefined = this.state.customerData;
|
|
45
|
+
if (!customerData?.auth_token) {
|
|
46
|
+
throw new TonderError({
|
|
47
|
+
code: ErrorKeyEnum.CUSTOMER_AUTH_TOKEN_NOT_VALID,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return customerData.auth_token!;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public getSecureToken(): string {
|
|
54
|
+
return this.state.secureToken;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public getBusinessPK(): string {
|
|
58
|
+
return this.state.merchantData?.business?.pk;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public getState = (): Readonly<any> => {
|
|
62
|
+
return Object.freeze({ ...this.state });
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
public setState = (newState: Partial<any>): void => {
|
|
66
|
+
this.state = { ...this.state, ...newState };
|
|
67
|
+
this.notifySubscribers();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
public updateUIState({
|
|
71
|
+
card,
|
|
72
|
+
paymentMethod,
|
|
73
|
+
selectedMethod,
|
|
74
|
+
cards,
|
|
75
|
+
paymentMethods,
|
|
76
|
+
saveCard,
|
|
77
|
+
}: {
|
|
78
|
+
card?: string;
|
|
79
|
+
paymentMethod?: string;
|
|
80
|
+
selectedMethod?: string;
|
|
81
|
+
cards?: ICard[];
|
|
82
|
+
paymentMethods?: IPaymentMethod[];
|
|
83
|
+
saveCard?: boolean;
|
|
84
|
+
}) {
|
|
85
|
+
const selected_data = {
|
|
86
|
+
...(selectedMethod && selectedMethod !== ''
|
|
87
|
+
? {
|
|
88
|
+
...(card && card !== ''
|
|
89
|
+
? { card }
|
|
90
|
+
: paymentMethod && paymentMethod !== ''
|
|
91
|
+
? { payment_method: paymentMethod }
|
|
92
|
+
: { card: '', payment_method: '' }),
|
|
93
|
+
}
|
|
94
|
+
: {}),
|
|
95
|
+
};
|
|
96
|
+
const new_state = {
|
|
97
|
+
uiData: {
|
|
98
|
+
...(this.state.uiData || {}),
|
|
99
|
+
...selected_data,
|
|
100
|
+
...(selectedMethod ? { selectedMethod } : {}),
|
|
101
|
+
...(saveCard !== undefined ? { saveCard } : {}),
|
|
102
|
+
...(cards ? { cards } : {}),
|
|
103
|
+
...(paymentMethods ? { paymentMethods } : {}),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
this.setState(new_state);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public subscribe(callback: () => void): () => void {
|
|
111
|
+
this.subscribers.push(callback);
|
|
112
|
+
return () => {
|
|
113
|
+
this.subscribers = this.subscribers.filter((sub) => sub !== callback);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public emit = (eventName: string, data: any): void => {
|
|
118
|
+
const listeners = this.eventListeners.get(eventName);
|
|
119
|
+
if (listeners) {
|
|
120
|
+
listeners.forEach((listener) => listener(data));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
public on(eventName: string, listener: (data: any) => void): () => void {
|
|
125
|
+
if (!this.eventListeners.has(eventName)) {
|
|
126
|
+
this.eventListeners.set(eventName, new Set());
|
|
127
|
+
}
|
|
128
|
+
this.eventListeners.get(eventName)!.add(listener);
|
|
129
|
+
|
|
130
|
+
return () => {
|
|
131
|
+
this.eventListeners.get(eventName)?.delete(listener);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private notifySubscribers() {
|
|
136
|
+
this.subscribers.forEach((callback) => callback());
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public reset() {
|
|
140
|
+
// this.subscribers = [];
|
|
141
|
+
this.eventListeners.clear();
|
|
142
|
+
this.initData(this.config);
|
|
143
|
+
this.notifySubscribers();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default Tonder;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// import { useCallback, useContext } from 'react';
|
|
2
|
+
// import { TonderContext } from '@ui/providers/TonderProvider';
|
|
3
|
+
// import type { SDKMethodsInstance, SDKType } from '@types';
|
|
4
|
+
// import { TonderError } from '@shared/utils/errors';
|
|
5
|
+
// import { ServiceManager } from '@infrastructure/ServiceManager';
|
|
6
|
+
//
|
|
7
|
+
// export interface IUseTonder<T extends SDKType> {
|
|
8
|
+
// methods: SDKMethodsInstance<T>;
|
|
9
|
+
// error: TonderError | Error | null;
|
|
10
|
+
// isCreated: boolean;
|
|
11
|
+
// create: any;
|
|
12
|
+
// }
|
|
13
|
+
//
|
|
14
|
+
// export function useTonder<T extends SDKType>(): IUseTonder<T> {
|
|
15
|
+
// const context = useContext(TonderContext);
|
|
16
|
+
// const { sdk, config } = context;
|
|
17
|
+
//
|
|
18
|
+
// const service = new ServiceManager(config!);
|
|
19
|
+
//
|
|
20
|
+
// const methods = useCallback(() => {
|
|
21
|
+
// const allowedMethods = sdk?.getAllowedMethods() || {};
|
|
22
|
+
// return {
|
|
23
|
+
// ...allowedMethods,
|
|
24
|
+
// getSecureToken: (secretApiKey: string, signal?: AbortSignal) =>
|
|
25
|
+
// service.token.getSecureToken(secretApiKey, signal),
|
|
26
|
+
// };
|
|
27
|
+
// }, [sdk, service.token]);
|
|
28
|
+
//
|
|
29
|
+
// return {
|
|
30
|
+
// methods: methods(),
|
|
31
|
+
// error: context?.sdkState?.error || null,
|
|
32
|
+
// isCreated: context?.sdkState?.isCreated,
|
|
33
|
+
// isProcessing: context?.sdkState?.isProcessing,
|
|
34
|
+
// } as IUseTonder<T>;
|
|
35
|
+
// }
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './ui/components/Input/CardHolderInput';
|
|
2
|
+
export * from './ui/components/Input/CardExpirationMonthInput';
|
|
3
|
+
export * from './ui/components/Input/CardExpirationYearInput';
|
|
4
|
+
export * from './ui/components/Input/CardCVVInput';
|
|
5
|
+
export * from './ui/components/Input/CardNumberInput';
|
|
6
|
+
export { default as TonderProvider } from './ui/providers/TonderProvider';
|
|
7
|
+
export { default as useTonder } from './hooks/useTonder';
|
|
8
|
+
export { default as TonderPayment } from './ui/features/TonderPayment';
|
|
9
|
+
export { default as TonderEnrollment } from './ui/features/TonderEnrollment';
|
|
10
|
+
export { default as TonderError } from './shared/utils/errors';
|
|
11
|
+
export * from './types';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { IApiConfig } from '@types';
|
|
2
|
+
import TonderError from '@shared/utils/errors';
|
|
3
|
+
import { TONDER_URL_BY_MODE } from '@shared/constants';
|
|
4
|
+
import { ErrorKeyEnum } from '@shared/enum';
|
|
5
|
+
|
|
6
|
+
export class HttpClient {
|
|
7
|
+
private readonly baseUrl: string;
|
|
8
|
+
protected readonly apiKey: string;
|
|
9
|
+
private abortController: AbortController;
|
|
10
|
+
|
|
11
|
+
constructor(config: IApiConfig) {
|
|
12
|
+
this.validateConfig(config);
|
|
13
|
+
this.apiKey = config.apiKey;
|
|
14
|
+
this.baseUrl = TONDER_URL_BY_MODE[config.mode];
|
|
15
|
+
this.abortController = new AbortController();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public getApiKey(): string {
|
|
19
|
+
return this.apiKey;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private validateConfig(config: IApiConfig): void {
|
|
23
|
+
if (!config.apiKey) {
|
|
24
|
+
throw new TonderError({
|
|
25
|
+
code: ErrorKeyEnum.MERCHANT_CREDENTIAL_REQUIRED,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected async request<T>(
|
|
31
|
+
endpoint: string,
|
|
32
|
+
options: RequestInit = {}
|
|
33
|
+
): Promise<T> {
|
|
34
|
+
try {
|
|
35
|
+
const headers = new Headers({
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
'Authorization': `Token ${this.apiKey}`,
|
|
38
|
+
...options.headers,
|
|
39
|
+
} as HeadersInit);
|
|
40
|
+
|
|
41
|
+
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
42
|
+
...options,
|
|
43
|
+
headers: headers,
|
|
44
|
+
signal: options.signal || this.abortController.signal,
|
|
45
|
+
} as RequestInit);
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
throw await this.handleRequestError(response);
|
|
48
|
+
}
|
|
49
|
+
if (response.status === 204) {
|
|
50
|
+
return {} as T;
|
|
51
|
+
}
|
|
52
|
+
return response.json();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
throw this.handleError(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
|
|
59
|
+
return this.request<T>(endpoint, {
|
|
60
|
+
...options,
|
|
61
|
+
method: 'GET',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
post<T>(
|
|
66
|
+
endpoint: string,
|
|
67
|
+
data: unknown,
|
|
68
|
+
options: RequestInit = {}
|
|
69
|
+
): Promise<T> {
|
|
70
|
+
return this.request<T>(endpoint, {
|
|
71
|
+
...options,
|
|
72
|
+
method: 'POST',
|
|
73
|
+
body: JSON.stringify(data),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
delete<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
|
|
78
|
+
return this.request<T>(endpoint, {
|
|
79
|
+
...options,
|
|
80
|
+
method: 'DELETE',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
private async handleRequestError(response: Response): Promise<never> {
|
|
84
|
+
const errorData = await response.json().catch(() => ({}));
|
|
85
|
+
|
|
86
|
+
throw new TonderError({
|
|
87
|
+
code: `HTTP_${response.status}`,
|
|
88
|
+
details: errorData,
|
|
89
|
+
message: errorData.detail || 'Request failed',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private handleError(error: unknown): never {
|
|
94
|
+
if (error instanceof TonderError) {
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
if (error.name === 'AbortError') {
|
|
100
|
+
throw new TonderError({
|
|
101
|
+
code: ErrorKeyEnum.REQUEST_ABORTED,
|
|
102
|
+
details: error,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
throw new TonderError({
|
|
107
|
+
code: ErrorKeyEnum.REQUEST_FAILED,
|
|
108
|
+
details: error,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
throw new TonderError({ code: ErrorKeyEnum.UNKNOWN_ERROR, details: error });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Cleanup method to abort any pending requests
|
|
117
|
+
*/
|
|
118
|
+
public cleanup(): void {
|
|
119
|
+
this.abortController.abort();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { HttpClient } from '@infrastructure/HttpClient';
|
|
2
|
+
import type { ISDKBaseConfig } from '@types';
|
|
3
|
+
import {
|
|
4
|
+
CardService,
|
|
5
|
+
CheckoutService,
|
|
6
|
+
CustomerService,
|
|
7
|
+
OpenPayService,
|
|
8
|
+
PaymentMethodService,
|
|
9
|
+
SkyflowService,
|
|
10
|
+
TokenService,
|
|
11
|
+
BusinessService,
|
|
12
|
+
MercadoPagoService,
|
|
13
|
+
TransactionService,
|
|
14
|
+
StorageService,
|
|
15
|
+
} from '@services';
|
|
16
|
+
|
|
17
|
+
export class ServiceManager {
|
|
18
|
+
private readonly http: HttpClient;
|
|
19
|
+
|
|
20
|
+
readonly business: BusinessService;
|
|
21
|
+
readonly card: CardService;
|
|
22
|
+
readonly checkout: CheckoutService;
|
|
23
|
+
readonly customer: CustomerService;
|
|
24
|
+
readonly paymentMethod: PaymentMethodService;
|
|
25
|
+
readonly skyflow: SkyflowService;
|
|
26
|
+
readonly token: TokenService;
|
|
27
|
+
readonly openPay: OpenPayService;
|
|
28
|
+
readonly mercadoPago: MercadoPagoService;
|
|
29
|
+
readonly storage: StorageService;
|
|
30
|
+
readonly transaction: TransactionService;
|
|
31
|
+
|
|
32
|
+
constructor(config: ISDKBaseConfig) {
|
|
33
|
+
this.http = new HttpClient({
|
|
34
|
+
apiKey: config.apiKey,
|
|
35
|
+
mode: config.mode,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
this.business = new BusinessService(this.http);
|
|
39
|
+
this.card = new CardService(this.http);
|
|
40
|
+
this.checkout = new CheckoutService(this.http);
|
|
41
|
+
this.customer = new CustomerService(this.http);
|
|
42
|
+
this.paymentMethod = new PaymentMethodService(this.http);
|
|
43
|
+
this.skyflow = new SkyflowService(this.http);
|
|
44
|
+
this.token = new TokenService(this.http);
|
|
45
|
+
this.openPay = new OpenPayService();
|
|
46
|
+
this.mercadoPago = new MercadoPagoService();
|
|
47
|
+
this.storage = new StorageService();
|
|
48
|
+
this.transaction = new TransactionService(this.http);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public cleanup(): void {
|
|
52
|
+
this.http.cleanup();
|
|
53
|
+
}
|
|
54
|
+
}
|