@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,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class BaseSDK {
|
|
11
|
+
constructor(tonderClient, getState, setState, setSkyflowConfig) {
|
|
12
|
+
this.tonderClient = tonderClient;
|
|
13
|
+
this.setSkyflowConfig = setSkyflowConfig;
|
|
14
|
+
this.getState = getState;
|
|
15
|
+
this.setState = setState;
|
|
16
|
+
}
|
|
17
|
+
async getInitialData() {
|
|
18
|
+
const merchantData = await this.tonderClient.getService().business.fetchBusiness();
|
|
19
|
+
await this.setState({
|
|
20
|
+
merchantData
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Init customer, if it's exist in state
|
|
24
|
+
try {
|
|
25
|
+
await this.getOrRegisterCustomer(this.getState().paymentData?.customer || this.getState().customer);
|
|
26
|
+
} catch (e) {}
|
|
27
|
+
}
|
|
28
|
+
async getOrRegisterCustomer(customer) {
|
|
29
|
+
try {
|
|
30
|
+
const customerInput = customer;
|
|
31
|
+
if (customerInput && Object.keys(customerInput).length > 0) {
|
|
32
|
+
const customerData = await this.tonderClient.getService().customer.registerOrFetchCustomer(customerInput);
|
|
33
|
+
await this.setState({
|
|
34
|
+
customerData
|
|
35
|
+
});
|
|
36
|
+
return customerData;
|
|
37
|
+
}
|
|
38
|
+
console.log('Customer data was not provided, skipping get/register.');
|
|
39
|
+
return null;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if (error instanceof _errors.default) {
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
throw new _errors.default({
|
|
45
|
+
code: _enum.ErrorKeyEnum.STATE_ERROR,
|
|
46
|
+
details: error
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async initializeProviders(providers) {
|
|
51
|
+
if (providers?.mercadoPago) {
|
|
52
|
+
this.initMercadoPago();
|
|
53
|
+
}
|
|
54
|
+
await this.initSkyflow();
|
|
55
|
+
}
|
|
56
|
+
initMercadoPago() {
|
|
57
|
+
const merchantData = this.getState().merchantData;
|
|
58
|
+
// Init mercado pago, if it's active
|
|
59
|
+
if (!!merchantData?.mercado_pago && !!merchantData?.mercado_pago?.active) {
|
|
60
|
+
this.tonderClient.getService().mercadoPago.injectMercadoPagoSecurity();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async initSkyflow() {
|
|
64
|
+
const merchantData = this.getState().merchantData;
|
|
65
|
+
if (merchantData?.vault_id && merchantData?.vault_url) {
|
|
66
|
+
const skyflowConfig = await this.tonderClient.getService().skyflow.createSkyflowConfig(merchantData);
|
|
67
|
+
this.setSkyflowConfig(skyflowConfig);
|
|
68
|
+
await this.setState({
|
|
69
|
+
skyflowConfig
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
var _default = exports.default = BaseSDK;
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","e","__esModule","default","BaseSDK","constructor","tonderClient","getState","setState","setSkyflowConfig","getInitialData","merchantData","getService","business","fetchBusiness","getOrRegisterCustomer","paymentData","customer","customerInput","Object","keys","length","customerData","registerOrFetchCustomer","console","log","error","TonderError","code","ErrorKeyEnum","STATE_ERROR","details","initializeProviders","providers","mercadoPago","initMercadoPago","initSkyflow","mercado_pago","active","injectMercadoPagoSecurity","vault_id","vault_url","skyflowConfig","skyflow","createSkyflowConfig","_default","exports"],"sourceRoot":"../../../../src","sources":["core/BaseSDK/index.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG5C,MAAMG,OAAO,CAAC;EAMZC,WAAWA,CACTC,YAAoB,EACpBC,QAA6B,EAC7BC,QAA0C,EAC1CC,gBAA2D,EAC3D;IACA,IAAI,CAACH,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACG,gBAAgB,GAAGA,gBAAgB;IACxC,IAAI,CAACF,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;EAC1B;EAEA,MAAaE,cAAcA,CAAA,EAAkB;IAC3C,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACL,YAAY,CACzCM,UAAU,CAAC,CAAC,CACZC,QAAQ,CAACC,aAAa,CAAC,CAAC;IAE3B,MAAM,IAAI,CAACN,QAAQ,CAAC;MAAEG;IAAa,CAAC,CAAC;;IA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AAY,EAAE0B,YAAY,EAAEC,MAAM,EAAE;MACxE,IAAI,CAAChC,YAAY,CAACM,UAAU,CAAC,CAAC,CAACsB,WAAW,CAACK,yBAAyB,CAAC,CAAC;IACxE;EACF;EAEA,MAAcH,WAAWA,CAAA,EAAG;IAC1B,MAAMzB,YAAY,GAAG,IAAI,CAACJ,QAAQ,CAAC,CAAC,CAACI,YAAY;IACjD,IAAIA,YAAY,EAAE6B,QAAQ,IAAI7B,YAAY,EAAE8B,SAAS,EAAE;MACrD,MAAMC,aAAa,GAAG,MAAM,IAAI,CAACpC,YAAY,CAC1CM,UAAU,CAAC,CAAC,CACZ+B,OAAO,CAACC,mBAAmB,CAACjC,YAAY,CAAC;MAE5C,IAAI,CAACF,gBAAgB,CAACiC,aAAa,CAAC;MAEpC,MAAM,IAAI,CAAClC,QAAQ,CAAC;QAAEkC;MAAc,CAAC,CAAC;IACxC;EACF;AACF;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcC,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EnrollmentContainer = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
var _constants = require("@shared/constants");
|
|
10
|
+
var _common = require("@shared/utils/common");
|
|
11
|
+
var _BaseEnrollment = _interopRequireDefault(require("@core/BaseEnrollment"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
class EnrollmentContainer {
|
|
14
|
+
#tonderClient;
|
|
15
|
+
#baseSDK;
|
|
16
|
+
constructor(tonderClient, setSkyflowConfig) {
|
|
17
|
+
this.#tonderClient = tonderClient;
|
|
18
|
+
this.#baseSDK = new _BaseEnrollment.default(tonderClient, tonderClient.getState, tonderClient.setState, setSkyflowConfig);
|
|
19
|
+
}
|
|
20
|
+
create = async data => {
|
|
21
|
+
return await this.#baseSDK.create(data);
|
|
22
|
+
};
|
|
23
|
+
async saveCustomerCard() {
|
|
24
|
+
const currentCallbacks = this.#baseSDK.getState().callbacks;
|
|
25
|
+
try {
|
|
26
|
+
await this.#baseSDK.setState({
|
|
27
|
+
isProcessing: true
|
|
28
|
+
});
|
|
29
|
+
await (0, _common.executeCallback)({
|
|
30
|
+
callbacks: currentCallbacks,
|
|
31
|
+
callback: 'beforeSave',
|
|
32
|
+
throwError: true
|
|
33
|
+
});
|
|
34
|
+
const cardFields = await this.#baseSDK.getState().skyflowContainer.collect();
|
|
35
|
+
const card_data = cardFields?.records[0]?.fields;
|
|
36
|
+
const response = await this.#baseSDK.saveCard(card_data.skyflow_id);
|
|
37
|
+
await this.#baseSDK.setState({
|
|
38
|
+
isProcessing: false
|
|
39
|
+
});
|
|
40
|
+
await (0, _common.executeCallback)({
|
|
41
|
+
callbacks: currentCallbacks,
|
|
42
|
+
callback: 'onFinishSave',
|
|
43
|
+
data: {
|
|
44
|
+
response
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
response
|
|
49
|
+
};
|
|
50
|
+
} catch (error) {
|
|
51
|
+
let err;
|
|
52
|
+
let message = _constants.MESSAGES_ES.SAVE_CARD_PROCESS_ERROR;
|
|
53
|
+
if ((error && 'message' in error ? error?.message : '').includes('Incomplete inputs')) {
|
|
54
|
+
err = new _errors.default({
|
|
55
|
+
code: _enum.ErrorKeyEnum.INVALID_CARD_DATA,
|
|
56
|
+
details: error
|
|
57
|
+
});
|
|
58
|
+
message = _constants.MESSAGES_ES.INVALID_CARD_DATA;
|
|
59
|
+
} else {
|
|
60
|
+
err = error instanceof _errors.default ? error : new _errors.default({
|
|
61
|
+
code: _enum.ErrorKeyEnum.SAVE_CARD_PROCESS_ERROR,
|
|
62
|
+
details: error
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
await this.#baseSDK.setState({
|
|
66
|
+
error: error,
|
|
67
|
+
isProcessing: false,
|
|
68
|
+
message: message
|
|
69
|
+
});
|
|
70
|
+
await (0, _common.executeCallback)({
|
|
71
|
+
callbacks: currentCallbacks,
|
|
72
|
+
callback: 'onFinishSave',
|
|
73
|
+
data: {
|
|
74
|
+
error: err
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
error: err
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
reset = () => {
|
|
83
|
+
this.#tonderClient.reset();
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
exports.EnrollmentContainer = EnrollmentContainer;
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","_constants","_common","_BaseEnrollment","e","__esModule","default","EnrollmentContainer","tonderClient","baseSDK","constructor","setSkyflowConfig","BaseEnrollment","getState","setState","create","data","saveCustomerCard","currentCallbacks","callbacks","isProcessing","executeCallback","callback","throwError","cardFields","skyflowContainer","collect","card_data","records","fields","response","saveCard","skyflow_id","error","err","message","MESSAGES_ES","SAVE_CARD_PROCESS_ERROR","includes","TonderError","code","ErrorKeyEnum","INVALID_CARD_DATA","details","reset","exports"],"sourceRoot":"../../../../src","sources":["core/EnrollmentContainer/index.ts"],"mappings":";;;;;;AAMA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI3C,MAAMG,mBAAmB,CAAwB;E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Property(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
var _BaseCheckout = _interopRequireDefault(require("@core/BaseCheckout"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
class PaymentInlineContainer {
|
|
12
|
+
#tonderClient;
|
|
13
|
+
#baseSDK;
|
|
14
|
+
#defaultCustomization = {
|
|
15
|
+
saveCards: {
|
|
16
|
+
showSaveCardOption: true,
|
|
17
|
+
showSaved: true,
|
|
18
|
+
autoSave: false,
|
|
19
|
+
showDeleteOption: true
|
|
20
|
+
},
|
|
21
|
+
paymentButton: {
|
|
22
|
+
show: true,
|
|
23
|
+
text: 'Pagar',
|
|
24
|
+
showAmount: true
|
|
25
|
+
},
|
|
26
|
+
paymentMethods: {
|
|
27
|
+
show: true
|
|
28
|
+
},
|
|
29
|
+
cardForm: {
|
|
30
|
+
show: true
|
|
31
|
+
},
|
|
32
|
+
showMessages: true
|
|
33
|
+
};
|
|
34
|
+
constructor(tonderClient, setSkyflowConfig) {
|
|
35
|
+
this.#tonderClient = tonderClient;
|
|
36
|
+
this.#baseSDK = new _BaseCheckout.default(tonderClient, tonderClient.getState, tonderClient.setState, setSkyflowConfig);
|
|
37
|
+
}
|
|
38
|
+
create = async data => {
|
|
39
|
+
this.#baseSDK.setState({
|
|
40
|
+
...data,
|
|
41
|
+
customization: {
|
|
42
|
+
...this.#defaultCustomization,
|
|
43
|
+
...(data.customization || {}),
|
|
44
|
+
saveCards: {
|
|
45
|
+
...this.#defaultCustomization.saveCards,
|
|
46
|
+
...(data.customization?.saveCards || {})
|
|
47
|
+
},
|
|
48
|
+
paymentMethods: {
|
|
49
|
+
...this.#defaultCustomization.paymentMethods,
|
|
50
|
+
...(data.customization?.paymentMethods || {})
|
|
51
|
+
},
|
|
52
|
+
cardForm: {
|
|
53
|
+
...this.#defaultCustomization.cardForm,
|
|
54
|
+
...(data.customization?.cardForm || {})
|
|
55
|
+
},
|
|
56
|
+
paymentButton: {
|
|
57
|
+
...this.#defaultCustomization.paymentButton,
|
|
58
|
+
...(data.customization?.paymentButton || {})
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
uiData: {
|
|
62
|
+
card: '',
|
|
63
|
+
payment_method: '',
|
|
64
|
+
saveCard: false,
|
|
65
|
+
selectedMethod: 'new',
|
|
66
|
+
paymentMethods: [],
|
|
67
|
+
cards: []
|
|
68
|
+
},
|
|
69
|
+
isCreating: true,
|
|
70
|
+
isCreated: false
|
|
71
|
+
});
|
|
72
|
+
return await this.#baseSDK.create();
|
|
73
|
+
};
|
|
74
|
+
payment = async data => {
|
|
75
|
+
try {
|
|
76
|
+
if (data) {
|
|
77
|
+
await this.#tonderClient.setState({
|
|
78
|
+
paymentData: data
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const state = this.#tonderClient.getState();
|
|
82
|
+
const payment_data = {
|
|
83
|
+
...state.paymentData,
|
|
84
|
+
card: state.uiData.card,
|
|
85
|
+
payment_method: state.uiData.payment_method
|
|
86
|
+
};
|
|
87
|
+
await this.validateProcessPaymentData(payment_data);
|
|
88
|
+
const response = await this.#baseSDK.setupPaymentFlow(payment_data);
|
|
89
|
+
return {
|
|
90
|
+
response
|
|
91
|
+
};
|
|
92
|
+
} catch (error) {
|
|
93
|
+
const err = await this.#baseSDK.handlePaymentError(error);
|
|
94
|
+
return {
|
|
95
|
+
error: err
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
reset = () => {
|
|
100
|
+
this.#tonderClient.reset();
|
|
101
|
+
};
|
|
102
|
+
validateProcessPaymentData(data) {
|
|
103
|
+
if (!data || data && Object.keys(data).length === 0) {
|
|
104
|
+
throw new _errors.default({
|
|
105
|
+
code: _enum.ErrorKeyEnum.INVALID_PAYMENT_REQUEST
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
var _default = exports.default = PaymentInlineContainer;
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","_BaseCheckout","e","__esModule","default","PaymentInlineContainer","tonderClient","baseSDK","defaultCustomization","saveCards","showSaveCardOption","showSaved","autoSave","showDeleteOption","paymentButton","show","text","showAmount","paymentMethods","cardForm","showMessages","constructor","setSkyflowConfig","BaseCheckout","getState","setState","create","data","customization","uiData","card","payment_method","saveCard","selectedMethod","cards","isCreating","isCreated","payment","paymentData","state","payment_data","validateProcessPaymentData","response","setupPaymentFlow","error","err","handlePaymentError","reset","Object","keys","length","TonderError","code","ErrorKeyEnum","INVALID_PAYMENT_REQUEST","_default","exports"],"sourceRoot":"../../../../src","sources":["core/PaymentInlineContainer/index.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG9C,MAAMG,sBAAsB,CAAoC;EAC9D,CAACC,YAAY;EACb,CAACC,OAAO;EACR,CAACC,oBAAoB,GAAgC;IACnDC,SAAS,EAAE;MACTC,kBAAkB,EAAE,IAAI;MACxBC,SAAS,EAAE,IAAI;MACfC,QAAQ,EAAE,KAAK;MACfC,gBAAgB,EAAE;IACpB,CAAC;IACDC,aAAa,EAAE;MACbC,IAAI,EAAE,IAAI;MACVC,IAAI,EAAE,OAAO;MACbC,UAAU,EAAE;IACd,CAAC;IACDC,cAAc,EAAE;MACdH,IAAI,EAAE;IACR,CAAC;IACDI,QAAQ,EAAE;MACRJ,I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IC,eAAW,CAAC;QACpBC,IAAI,EAAEC,kBAAY,CAACC;MACrB,CAAC,CAAC;IACJ;EACF;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApD,OAAA,GAEcC,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
8
|
+
var _enum = require("@shared/enum");
|
|
9
|
+
var _BaseCheckout = _interopRequireDefault(require("@core/BaseCheckout"));
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _paymentMethodUtils = require("@shared/utils/paymentMethodUtils");
|
|
12
|
+
var _cardBrandCatalog = require("@shared/catalog/cardBrandCatalog");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
class PaymentLiteContainer {
|
|
15
|
+
#tonderClient;
|
|
16
|
+
#baseSDK;
|
|
17
|
+
#defaultCustomization = {
|
|
18
|
+
saveCards: {
|
|
19
|
+
autoSave: false
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
constructor(tonderClient, setSkyflowConfig) {
|
|
23
|
+
this.#tonderClient = tonderClient;
|
|
24
|
+
this.#baseSDK = new _BaseCheckout.default(tonderClient, tonderClient.getState, tonderClient.setState, setSkyflowConfig);
|
|
25
|
+
}
|
|
26
|
+
create = async data => {
|
|
27
|
+
this.#baseSDK.setState({
|
|
28
|
+
...data,
|
|
29
|
+
customization: {
|
|
30
|
+
...this.#defaultCustomization,
|
|
31
|
+
...(data.customization || {}),
|
|
32
|
+
saveCards: {
|
|
33
|
+
...this.#defaultCustomization.saveCards,
|
|
34
|
+
...(data.customization?.saveCards || {})
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
isCreating: true,
|
|
38
|
+
isCreated: false
|
|
39
|
+
});
|
|
40
|
+
return await this.#baseSDK.create();
|
|
41
|
+
};
|
|
42
|
+
payment = async data => {
|
|
43
|
+
try {
|
|
44
|
+
if (data) {
|
|
45
|
+
await this.#tonderClient.setState({
|
|
46
|
+
paymentData: data
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const state = this.#tonderClient.getState();
|
|
50
|
+
const payment_data = {
|
|
51
|
+
...state.paymentData
|
|
52
|
+
};
|
|
53
|
+
await this.validateProcessPaymentData(payment_data);
|
|
54
|
+
const response = await this.#baseSDK.setupPaymentFlow(payment_data);
|
|
55
|
+
return {
|
|
56
|
+
response
|
|
57
|
+
};
|
|
58
|
+
} catch (error) {
|
|
59
|
+
const err = await this.#baseSDK.handlePaymentError(error);
|
|
60
|
+
return {
|
|
61
|
+
error: err
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
saveCustomerCard = async () => {
|
|
66
|
+
try {
|
|
67
|
+
await this.#baseSDK.setState({
|
|
68
|
+
isProcessing: true
|
|
69
|
+
});
|
|
70
|
+
const cardFields = await this.#baseSDK.getState().skyflowContainer.collect();
|
|
71
|
+
const card_data = cardFields?.records[0]?.fields;
|
|
72
|
+
const response = await this.#baseSDK.validateAndSaveCard(card_data.skyflow_id, true);
|
|
73
|
+
return {
|
|
74
|
+
response: response
|
|
75
|
+
};
|
|
76
|
+
} catch (error) {
|
|
77
|
+
const err = error instanceof _errors.default ? error : new _errors.default({
|
|
78
|
+
code: _enum.ErrorKeyEnum.SAVE_CARD_PROCESS_ERROR,
|
|
79
|
+
details: error
|
|
80
|
+
});
|
|
81
|
+
await this.#baseSDK.setState({
|
|
82
|
+
error: error,
|
|
83
|
+
isProcessing: false
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
error: err
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
getCustomerCards = async () => {
|
|
91
|
+
try {
|
|
92
|
+
const merchantId = this.#tonderClient.getBusinessPK();
|
|
93
|
+
const secureToken = this.#tonderClient.getSecureToken();
|
|
94
|
+
const customer_auth_token = this.#tonderClient.getCustomerAuthToken();
|
|
95
|
+
const response = await this.#tonderClient.getService().card.fetchCustomerCards(customer_auth_token, secureToken, merchantId);
|
|
96
|
+
return {
|
|
97
|
+
response: {
|
|
98
|
+
...response,
|
|
99
|
+
cards: response.cards.map(ic => ({
|
|
100
|
+
...ic,
|
|
101
|
+
icon: (0, _cardBrandCatalog.getCardType)(ic.fields.card_scheme)
|
|
102
|
+
}))
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
} catch (error) {
|
|
106
|
+
return {
|
|
107
|
+
error: error
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
removeCustomerCard = async id => {
|
|
112
|
+
try {
|
|
113
|
+
const merchantId = this.#tonderClient.getBusinessPK();
|
|
114
|
+
const secureToken = this.#tonderClient.getSecureToken();
|
|
115
|
+
const customer_auth_token = this.#tonderClient.getCustomerAuthToken();
|
|
116
|
+
const response = await this.#tonderClient.getService().card.removeCustomerCard(customer_auth_token, secureToken, id, merchantId);
|
|
117
|
+
return {
|
|
118
|
+
response
|
|
119
|
+
};
|
|
120
|
+
} catch (error) {
|
|
121
|
+
return {
|
|
122
|
+
error: error
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
getPaymentMethods = async () => {
|
|
127
|
+
try {
|
|
128
|
+
const response = await this.#tonderClient.getService().paymentMethod.fetchPaymentMethods();
|
|
129
|
+
const pm_results = (0, _paymentMethodUtils.getPaymentMethodsWithDetails)(response);
|
|
130
|
+
return {
|
|
131
|
+
response: pm_results
|
|
132
|
+
};
|
|
133
|
+
} catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
error: error
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
reset = () => {
|
|
140
|
+
this.#tonderClient.reset();
|
|
141
|
+
};
|
|
142
|
+
validateProcessPaymentData(data) {
|
|
143
|
+
if (!data || data && Object.keys(data).length === 0) {
|
|
144
|
+
throw new _errors.default({
|
|
145
|
+
code: _enum.ErrorKeyEnum.INVALID_PAYMENT_REQUEST
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
let card_data = (0, _lodash.defaultTo)(data.card, '');
|
|
149
|
+
let payment_method_data = (0, _lodash.defaultTo)(data.payment_method, '');
|
|
150
|
+
if (card_data !== '' && payment_method_data !== '') {
|
|
151
|
+
throw new _errors.default({
|
|
152
|
+
code: _enum.ErrorKeyEnum.INVALID_PAYMENT_REQUEST_CARD_PM
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
var _default = exports.default = PaymentLiteContainer;
|
|
158
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","_interopRequireDefault","require","_enum","_BaseCheckout","_lodash","_paymentMethodUtils","_cardBrandCatalog","e","__esModule","default","PaymentLiteContainer","tonderClient","baseSDK","defaultCustomization","saveCards","autoSave","constructor","setSkyflowConfig","BaseCheckout","getState","setState","create","data","customization","isCreating","isCreated","payment","paymentData","state","payment_data","validateProcessPaymentData","response","setupPaymentFlow","error","err","handlePaymentError","saveCustomerCard","isProcessing","cardFields","skyflowContainer","collect","card_data","records","fields","validateAndSaveCard","skyflow_id","TonderError","code","ErrorKeyEnum","SAVE_CARD_PROCESS_ERROR","details","getCustomerCards","merchantId","getBusinessPK","secureToken","getSecureToken","customer_auth_token","getCustomerAuthToken","getService","card","fetchCustomerCards","cards","map","ic","icon","getCardType","card_scheme","removeCustomerCard","id","getPaymentMethods","paymentMethod","fetchPaymentMethods","pm_results","getPaymentMethodsWithDetails","reset","Object","keys","length","INVALID_PAYMENT_REQUEST","defaultTo","payment_method_data","payment_method","INVALID_PAYMENT_REQUEST_CARD_PM","_default","exports"],"sourceRoot":"../../../../src","sources":["core/PaymentLite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8B;MACrB,CAAC,CAAC;IACJ;IAEA,IAAIrC,SAAS,GAAG,IAAAsC,iBAAS,EAACzD,IAAI,CAACqC,IAAI,EAAE,EAAE,CAAC;IACxC,IAAIqB,mBAAmB,GAAG,IAAAD,iBAAS,EAACzD,IAAI,CAAC2D,cAAc,EAAE,EAAE,CAAC;IAE5D,IAAIxC,SAAS,KAAK,EAAE,IAAIuC,mBAAmB,KAAK,EAAE,EAAE;MAClD,MAAM,IAAIlC,eAAW,CAAC;QACpBC,IAAI,EAAEC,kBAAY,CAACkC;MACrB,CAAC,CAAC;IACJ;EACF;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3E,OAAA,GAEcC,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ServiceManager = require("@infrastructure/ServiceManager");
|
|
8
|
+
var _errors = _interopRequireDefault(require("@shared/utils/errors"));
|
|
9
|
+
var _enum = require("@shared/enum");
|
|
10
|
+
var _constants = require("@shared/constants");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
class Tonder {
|
|
13
|
+
subscribers = [];
|
|
14
|
+
eventListeners = new Map();
|
|
15
|
+
constructor(config) {
|
|
16
|
+
this.initData(config);
|
|
17
|
+
}
|
|
18
|
+
initData(config) {
|
|
19
|
+
this.service = new _ServiceManager.ServiceManager(config);
|
|
20
|
+
this.config = {
|
|
21
|
+
...config,
|
|
22
|
+
returnURL: config.returnURL && config.returnURL !== '' ? config.returnURL : _constants.TONDER_URL_BY_MODE[config.mode]
|
|
23
|
+
};
|
|
24
|
+
this.state = {};
|
|
25
|
+
this.eventListeners = new Map();
|
|
26
|
+
}
|
|
27
|
+
getConfig() {
|
|
28
|
+
return Object.freeze({
|
|
29
|
+
...this.config
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getService() {
|
|
33
|
+
return this.service;
|
|
34
|
+
}
|
|
35
|
+
getCustomerAuthToken() {
|
|
36
|
+
const customerData = this.state.customerData;
|
|
37
|
+
if (!customerData?.auth_token) {
|
|
38
|
+
throw new _errors.default({
|
|
39
|
+
code: _enum.ErrorKeyEnum.CUSTOMER_AUTH_TOKEN_NOT_VALID
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return customerData.auth_token;
|
|
43
|
+
}
|
|
44
|
+
getSecureToken() {
|
|
45
|
+
return this.state.secureToken;
|
|
46
|
+
}
|
|
47
|
+
getBusinessPK() {
|
|
48
|
+
return this.state.merchantData?.business?.pk;
|
|
49
|
+
}
|
|
50
|
+
getState = () => {
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
...this.state
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
setState = newState => {
|
|
56
|
+
this.state = {
|
|
57
|
+
...this.state,
|
|
58
|
+
...newState
|
|
59
|
+
};
|
|
60
|
+
this.notifySubscribers();
|
|
61
|
+
};
|
|
62
|
+
updateUIState({
|
|
63
|
+
card,
|
|
64
|
+
paymentMethod,
|
|
65
|
+
selectedMethod,
|
|
66
|
+
cards,
|
|
67
|
+
paymentMethods,
|
|
68
|
+
saveCard
|
|
69
|
+
}) {
|
|
70
|
+
const selected_data = {
|
|
71
|
+
...(selectedMethod && selectedMethod !== '' ? {
|
|
72
|
+
...(card && card !== '' ? {
|
|
73
|
+
card
|
|
74
|
+
} : paymentMethod && paymentMethod !== '' ? {
|
|
75
|
+
payment_method: paymentMethod
|
|
76
|
+
} : {
|
|
77
|
+
card: '',
|
|
78
|
+
payment_method: ''
|
|
79
|
+
})
|
|
80
|
+
} : {})
|
|
81
|
+
};
|
|
82
|
+
const new_state = {
|
|
83
|
+
uiData: {
|
|
84
|
+
...(this.state.uiData || {}),
|
|
85
|
+
...selected_data,
|
|
86
|
+
...(selectedMethod ? {
|
|
87
|
+
selectedMethod
|
|
88
|
+
} : {}),
|
|
89
|
+
...(saveCard !== undefined ? {
|
|
90
|
+
saveCard
|
|
91
|
+
} : {}),
|
|
92
|
+
...(cards ? {
|
|
93
|
+
cards
|
|
94
|
+
} : {}),
|
|
95
|
+
...(paymentMethods ? {
|
|
96
|
+
paymentMethods
|
|
97
|
+
} : {})
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
this.setState(new_state);
|
|
101
|
+
}
|
|
102
|
+
subscribe(callback) {
|
|
103
|
+
this.subscribers.push(callback);
|
|
104
|
+
return () => {
|
|
105
|
+
this.subscribers = this.subscribers.filter(sub => sub !== callback);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
emit = (eventName, data) => {
|
|
109
|
+
const listeners = this.eventListeners.get(eventName);
|
|
110
|
+
if (listeners) {
|
|
111
|
+
listeners.forEach(listener => listener(data));
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
on(eventName, listener) {
|
|
115
|
+
if (!this.eventListeners.has(eventName)) {
|
|
116
|
+
this.eventListeners.set(eventName, new Set());
|
|
117
|
+
}
|
|
118
|
+
this.eventListeners.get(eventName).add(listener);
|
|
119
|
+
return () => {
|
|
120
|
+
this.eventListeners.get(eventName)?.delete(listener);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
notifySubscribers() {
|
|
124
|
+
this.subscribers.forEach(callback => callback());
|
|
125
|
+
}
|
|
126
|
+
reset() {
|
|
127
|
+
// this.subscribers = [];
|
|
128
|
+
this.eventListeners.clear();
|
|
129
|
+
this.initData(this.config);
|
|
130
|
+
this.notifySubscribers();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
var _default = exports.default = Tonder;
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ServiceManager","require","_errors","_interopRequireDefault","_enum","_constants","e","__esModule","default","Tonder","subscribers","eventListeners","Map","constructor","config","initData","service","ServiceManager","returnURL","TONDER_URL_BY_MODE","mode","state","getConfig","Object","freeze","getService","getCustomerAuthToken","customerData","auth_token","TonderError","code","ErrorKeyEnum","CUSTOMER_AUTH_TOKEN_NOT_VALID","getSecureToken","secureToken","getBusinessPK","merchantData","business","pk","getState","setState","newState","notifySubscribers","updateUIState","card","paymentMethod","selectedMethod","cards","paymentMethods","saveCard","selected_data","payment_method","new_state","uiData","undefined","subscribe","callback","push","filter","sub","emit","eventName","data","listeners","get","forEach","listener","on","has","set","Set","add","delete","reset","clear","_default","exports"],"sourceRoot":"../../../../src","sources":["core/Tonder/index.ts"],"mappings":";;;;;;AAMA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAAuD,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvD,MAAMG,MAAM,CAAC;EAIHC,WAAW,GAAmB,EAAE;EAChCC,cAAc,GAA0C,IAAIC,GAAG,CAAC,CAAC;EAEzEC,WAAWA,CAACC,MAAsB,EAAE;IAClC,IAAI,CAACC,QAAQ,CAACD,MAAM,CAAC;EACvB;EAEQC,QAAQA,CAACD,MAAM,EAAE;IACvB,IAAI,CAACE,OAAO,GAAG,IAAIC,8BAAc,CAACH,MAAM,CAAC;IACzC,IAAI,CAACA,MAAM,GAAG;MACZ,GAAGA,MAAM;MACTI,SAAS,EACPJ,MAAM,CAACI,SAAS,IAAIJ,MAAM,CAACI,SAAS,KAAK,EAAE,GACvCJ,MAAM,CAACI,SAAS,GAChBC,6BAAkB,CAACL,MAAM,CAACM,IAAI;IACtC,CAAC;IACD,IAAI,CAACC,KAAK,GAAG,CAAC,CAAC;IACf,IAAI,CAACV,cAAc,GAAG,IAAIC,GAAG,CAAC,CAAC;EACjC;EAE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,CAAC0D,GAAG,CAACR,SAAS,EAAE,IAAIS,GAAG,CAAC,CAAC,CAAC;IAC/C;IACA,IAAI,CAAC3D,cAAc,CAACqD,GAAG,CAACH,SAAS,CAAC,CAAEU,GAAG,CAACL,QAAQ,CAAC;IAEjD,OAAO,MAAM;MACX,IAAI,CAACvD,cAAc,CAACqD,GAAG,CAACH,SAAS,CAAC,EAAEW,MAAM,CAACN,QAAQ,CAAC;IACtD,CAAC;EACH;EAEQxB,iBAAiBA,CAAA,EAAG;IAC1B,IAAI,CAAChC,WAAW,CAACuD,OAAO,CAAET,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;EACpD;EAEOiB,KAAKA,CAAA,EAAG;IACb;IACA,IAAI,CAAC9D,cAAc,CAAC+D,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC3D,QAAQ,CAAC,IAAI,CAACD,MAAM,CAAC;IAC1B,IAAI,CAAC4B,iBAAiB,CAAC,CAAC;EAC1B;AACF;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAApE,OAAA,GAEcC,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
// }
|
|
36
|
+
"use strict";
|
|
37
|
+
//# sourceMappingURL=index-old.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useTonder/index-old.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
|