@paykka/card-checkout-ui 0.13.16 → 0.14.0
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/dist/card-checkout-ui.js +54 -26
- package/dist/card-checkout-ui.umd.cjs +54 -26
- package/dist/es/api/modules/boost/index.js +5 -16
- package/dist/es/api/modules/gcash/index.js +5 -16
- package/dist/es/api/modules/get-browser-params.js +1 -4
- package/dist/es/api/modules/grab-pay/index.js +5 -16
- package/dist/es/api/modules/line-pay/index.js +5 -16
- package/dist/es/api/modules/may-bank-qr-pay/index.js +5 -16
- package/dist/es/api/modules/nine-pay/index.js +5 -16
- package/dist/es/api/modules/opay-wallet/index.js +5 -16
- package/dist/es/api/modules/paga-wallet/index.js +5 -16
- package/dist/es/api/modules/paymaya/index.js +5 -16
- package/dist/es/api/modules/shopee-pay/index.js +5 -16
- package/dist/es/api/modules/threeDS/index.js +16 -2
- package/dist/es/api/modules/tng-wallet/index.js +5 -16
- package/dist/es/api/modules/wallet/index.js +16 -0
- package/dist/es/api/modules/zalopay/index.js +5 -16
- package/dist/es/api/utils/index.js +2 -1
- package/dist/es/components/AccordionItem/AccordionItem.js +0 -2
- package/dist/es/components/AddressField/index.js +95 -85
- package/dist/es/components/AliPay/index.js +88 -76
- package/dist/es/components/ApplePay/index.js +61 -43
- package/dist/es/components/CPFField/index.js +2 -1
- package/dist/es/components/Card/index.js +182 -143
- package/dist/es/components/CardExpireDateField/index.js +2 -1
- package/dist/es/components/CardNo/index.js +2 -2
- package/dist/es/components/CardNumberField/index.js +2 -1
- package/dist/es/components/CardSecurityCodeField/index.js +2 -1
- package/dist/es/components/CardSelector/index.js +3 -2
- package/dist/es/components/DropIn/index.js +98 -31
- package/dist/es/components/GooglePay/index.js +190 -151
- package/dist/es/components/GuideCard/index.js +8 -1
- package/dist/es/components/PaymentButton/index.js +58 -0
- package/dist/es/components/RecurringTip/index.js +3 -3
- package/dist/es/components/SecuredFieldsProvider/index.js +81 -17
- package/dist/es/components/SecuredIframe/index.js +120 -52
- package/dist/es/components/Sepa/index.js +23 -25
- package/dist/es/components/SubmitButton/index.js +1 -1
- package/dist/es/components/ThreeDS/index.js +34 -15
- package/dist/es/components/WechatPay/index.js +94 -83
- package/dist/es/components/business/BlikCodeField/BlikCodeField.js +92 -0
- package/dist/es/components/business/BlikCodeField/blik-code-field.js +1 -0
- package/dist/es/components/business/BlikCodeField/index.js +13 -0
- package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +45 -0
- package/dist/es/components/business/BlikConfirmModal/blik-confirm-modal.js +1 -0
- package/dist/es/components/business/BlikConfirmModal/index.js +9 -0
- package/dist/es/components/business/BlikConfirmModal/type.js +1 -0
- package/dist/es/components/business/NameField/NameField.js +51 -0
- package/dist/es/components/business/NameField/index.js +11 -0
- package/dist/es/components/business/NameField/type.js +1 -0
- package/dist/es/components/business/PhoneField/PhoneField.js +125 -0
- package/dist/es/components/business/PhoneField/config.js +33 -0
- package/dist/es/components/business/PhoneField/index.js +14 -0
- package/dist/es/components/business/PhoneField/phone-field.js +1 -0
- package/dist/es/components/business/PhoneField/type.js +1 -0
- package/dist/es/components/business/SegmentedDigitInput/SegmentedDigitInput.js +80 -0
- package/dist/es/components/business/SegmentedDigitInput/format.js +26 -0
- package/dist/es/components/business/SegmentedDigitInput/index.js +5 -0
- package/dist/es/components/business/Tooltip/Tooltip.js +18 -0
- package/dist/es/components/business/Tooltip/index.js +6 -0
- package/dist/es/components/business/Tooltip/tooltip2.js +1 -0
- package/dist/es/components/business/index.js +14 -0
- package/dist/es/components/index.js +14 -7
- package/dist/es/components/internal/CheckBox/CheckBox.js +2 -2
- package/dist/es/components/internal/Input/Input.js +1 -1
- package/dist/es/components/internal/Select/Select.js +7 -1
- package/dist/es/components/internal/icons/IconArrowDown.js +4 -4
- package/dist/es/components/internal/icons/IconBancontact.js +95 -0
- package/dist/es/components/internal/icons/IconBlik.js +567 -0
- package/dist/es/components/internal/icons/IconIdeal.js +86 -0
- package/dist/es/components/internal/icons/IconOvo.js +47 -0
- package/dist/es/components/internal/icons/IconP24.js +40 -0
- package/dist/es/components/internal/icons/IconPhone.js +56 -0
- package/dist/es/components/internal/icons/IconSkrill.js +38 -0
- package/dist/es/components/internal/icons/IconTrustly.js +37 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +201 -0
- package/dist/es/components/wallets/Bancontact/bancontact2.js +1 -0
- package/dist/es/components/wallets/Bancontact/index.js +1 -0
- package/dist/es/components/wallets/Bancontact/type.js +1 -0
- package/dist/es/components/wallets/Blik/Blik.js +232 -0
- package/dist/es/components/wallets/Blik/blik2.js +1 -0
- package/dist/es/components/wallets/Blik/index.js +1 -0
- package/dist/es/components/wallets/Blik/type.js +1 -0
- package/dist/es/components/wallets/Boost/Boost.js +183 -0
- package/dist/es/components/wallets/Boost/boost2.js +1 -0
- package/dist/es/components/wallets/Boost/index.js +1 -0
- package/dist/es/components/wallets/Boost/type.js +1 -0
- package/dist/es/components/wallets/GCash/GCash.js +74 -252
- package/dist/es/components/wallets/GrabPay/GrabPay.js +183 -0
- package/dist/es/components/wallets/GrabPay/grab-pay.js +1 -0
- package/dist/es/components/wallets/GrabPay/index.js +1 -0
- package/dist/es/components/wallets/GrabPay/type.js +1 -0
- package/dist/es/components/wallets/IDeal/IDeal.js +201 -0
- package/dist/es/components/wallets/IDeal/ideal2.js +1 -0
- package/dist/es/components/wallets/IDeal/index.js +1 -0
- package/dist/es/components/wallets/IDeal/type.js +1 -0
- package/dist/es/components/wallets/LinePay/LinePay.js +183 -0
- package/dist/es/components/wallets/LinePay/index.js +1 -0
- package/dist/es/components/wallets/LinePay/line-pay.js +1 -0
- package/dist/es/components/wallets/LinePay/type.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +187 -0
- package/dist/es/components/wallets/MayBankQRPay/index.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/may-bank-qr-pay.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/type.js +1 -0
- package/dist/es/components/wallets/NinePay/NinePay.js +185 -0
- package/dist/es/components/wallets/NinePay/index.js +1 -0
- package/dist/es/components/wallets/NinePay/nine-pay.js +1 -0
- package/dist/es/components/wallets/NinePay/type.js +1 -0
- package/dist/es/components/wallets/OVO/OVO.js +200 -0
- package/dist/es/components/wallets/OVO/index.js +1 -0
- package/dist/es/components/wallets/OVO/ovo2.js +1 -0
- package/dist/es/components/wallets/OVO/type.js +1 -0
- package/dist/es/components/wallets/OpayWallet/OpayWallet.js +57 -218
- package/dist/es/components/wallets/P24/P24.js +198 -0
- package/dist/es/components/wallets/P24/index.js +1 -0
- package/dist/es/components/wallets/P24/p242.js +1 -0
- package/dist/es/components/wallets/P24/type.js +1 -0
- package/dist/es/components/wallets/PagaWallet/PagaWallet.js +57 -218
- package/dist/es/components/wallets/Paymaya/Paymaya.js +57 -221
- package/dist/es/components/wallets/PicPay/PicPay.js +64 -55
- package/dist/es/components/wallets/Pix/Pix.js +58 -56
- package/dist/es/components/wallets/ShopeePay/ShopeePay.js +185 -0
- package/dist/es/components/wallets/ShopeePay/index.js +1 -0
- package/dist/es/components/wallets/ShopeePay/shopee-pay.js +1 -0
- package/dist/es/components/wallets/ShopeePay/type.js +1 -0
- package/dist/es/components/wallets/Skrill/Skrill.js +200 -0
- package/dist/es/components/wallets/Skrill/index.js +1 -0
- package/dist/es/components/wallets/Skrill/skrill2.js +1 -0
- package/dist/es/components/wallets/Skrill/type.js +1 -0
- package/dist/es/components/wallets/TNGWallet/TNGWallet.js +185 -0
- package/dist/es/components/wallets/TNGWallet/index.js +1 -0
- package/dist/es/components/wallets/TNGWallet/tng-wallet.js +1 -0
- package/dist/es/components/wallets/TNGWallet/type.js +1 -0
- package/dist/es/components/wallets/Trustly/Trustly.js +226 -0
- package/dist/es/components/wallets/Trustly/index.js +1 -0
- package/dist/es/components/wallets/Trustly/trustly2.js +1 -0
- package/dist/es/components/wallets/Trustly/type.js +1 -0
- package/dist/es/components/wallets/Vietqr/Vietqr.js +73 -242
- package/dist/es/components/wallets/Zalopay/Zalopay.js +73 -242
- package/dist/es/components/wallets/index.js +14 -0
- package/dist/es/constant.js +48 -2
- package/dist/es/core/address.js +7 -6
- package/dist/es/core/checkout.js +93 -41
- package/dist/es/core/create-child.js +68 -0
- package/dist/es/core/environment.js +23 -1
- package/dist/es/core/error.js +15 -2
- package/dist/es/core/logger.js +106 -0
- package/dist/es/core/payment.js +65 -0
- package/dist/es/fe-logger.min.js +1 -0
- package/dist/es/hooks/useBaseWallet.js +280 -0
- package/dist/es/hooks/usePayState.js +37 -25
- package/dist/es/hooks/usePayment.js +1 -14
- package/dist/es/hooks/useRetry.js +50 -26
- package/dist/es/i18n/locales/de-DE.js +24 -0
- package/dist/es/i18n/locales/en-GB.js +24 -0
- package/dist/es/i18n/locales/es-ES.js +24 -0
- package/dist/es/i18n/locales/fr-FR.js +24 -0
- package/dist/es/i18n/locales/ja-JP.js +24 -0
- package/dist/es/i18n/locales/ko-KR.js +24 -0
- package/dist/es/i18n/locales/nl-NL.js +24 -0
- package/dist/es/i18n/locales/pt-PT.js +24 -0
- package/dist/es/i18n/locales/ru-RU.js +24 -0
- package/dist/es/i18n/locales/zh-CN.js +24 -0
- package/dist/es/i18n/locales/zh-HK.js +24 -0
- package/dist/es/i18n/locales/zh-TW.js +24 -0
- package/dist/es/index.js +23 -8
- package/dist/es/out/base-fraud-detection.js +4 -1
- package/dist/es/out/config.js +10 -4
- package/dist/es/out/fraud-detection.js +12 -13
- package/dist/es/out/worldpay-ddc-manager.js +7 -14
- package/dist/es/out/worldpay-ddc.js +7 -5
- package/dist/es/polyfill.js +166 -0
- package/dist/es/style.css +1 -1
- package/dist/es/types/event.js +12 -3
- package/dist/es/types/message.js +3 -0
- package/dist/es/utils/iframe.js +1 -1
- package/dist/es/utils/location.js +0 -8
- package/dist/es/utils/payment.js +12 -12
- package/dist/es/utils/redirect.js +4 -5
- package/dist/es/utils/system-info/is-ua-webview.js +1 -20
- package/dist/fe-logger.min.js +1 -0
- package/dist/polyfill.js +166 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/index.d.ts +1 -0
- package/dist/types/api/modules/threeDS/index.d.ts +7 -0
- package/dist/types/api/modules/type.d.ts +2 -0
- package/dist/types/api/modules/wallet/index.d.ts +18 -0
- package/dist/types/api/utils/index.d.ts +1 -0
- package/dist/types/components/AddressField/index.d.ts +1 -0
- package/dist/types/components/AddressField/type.d.ts +17 -2
- package/dist/types/components/AddressField/utils.d.ts +22 -0
- package/dist/types/components/AliPay/type.d.ts +11 -15
- package/dist/types/components/ApplePay/type.d.ts +5 -28
- package/dist/types/components/CPFField/type.d.ts +1 -1
- package/dist/types/components/Card/type.d.ts +22 -23
- package/dist/types/components/CardExpireDateField/type.d.ts +1 -1
- package/dist/types/components/CardNo/type.d.ts +3 -2
- package/dist/types/components/CardNumberField/type.d.ts +1 -1
- package/dist/types/components/CardSecurityCodeField/type.d.ts +1 -1
- package/dist/types/components/CardSelector/type.d.ts +4 -4
- package/dist/types/components/DropIn/type.d.ts +10 -22
- package/dist/types/components/GooglePay/createGooglePay.d.ts +4 -4
- package/dist/types/components/GooglePay/type.d.ts +10 -14
- package/dist/types/components/PaymentButton/PaymentButton.d.ts +3 -0
- package/dist/types/components/PaymentButton/index.d.ts +2 -0
- package/dist/types/components/PaymentButton/type.d.ts +13 -0
- package/dist/types/components/RecurringTip/RecurringTip.d.ts +1 -1
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +7 -1
- package/dist/types/components/SecuredIframe/HiddenIframe.d.ts +5 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +0 -6
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/type.d.ts +2 -0
- package/dist/types/components/WechatPay/type.d.ts +11 -15
- package/dist/types/components/business/BlikCodeField/BlikCodeField.d.ts +6 -0
- package/dist/types/components/business/BlikCodeField/index.d.ts +2 -0
- package/dist/types/components/business/BlikCodeField/type.d.ts +9 -0
- package/dist/types/components/business/BlikConfirmModal/BlikConfirmModal.d.ts +6 -0
- package/dist/types/components/business/BlikConfirmModal/index.d.ts +2 -0
- package/dist/types/components/business/BlikConfirmModal/type.d.ts +8 -0
- package/dist/types/components/business/NameField/NameField.d.ts +5 -0
- package/dist/types/components/business/NameField/index.d.ts +2 -0
- package/dist/types/components/business/NameField/type.d.ts +7 -0
- package/dist/types/components/business/PhoneField/PhoneField.d.ts +6 -0
- package/dist/types/components/business/PhoneField/config.d.ts +22 -0
- package/dist/types/components/business/PhoneField/index.d.ts +2 -0
- package/dist/types/components/business/PhoneField/type.d.ts +9 -0
- package/dist/types/components/business/SegmentedDigitInput/SegmentedDigitInput.d.ts +5 -0
- package/dist/types/components/business/SegmentedDigitInput/format.d.ts +5 -0
- package/dist/types/components/business/SegmentedDigitInput/index.d.ts +3 -0
- package/dist/types/components/business/SegmentedDigitInput/type.d.ts +13 -0
- package/dist/types/components/business/Tooltip/Tooltip.d.ts +11 -0
- package/dist/types/components/business/Tooltip/index.d.ts +1 -0
- package/dist/types/components/business/index.d.ts +6 -0
- package/dist/types/components/index.d.ts +0 -7
- package/dist/types/components/internal/CheckBox/type.d.ts +2 -1
- package/dist/types/components/internal/Form/type.d.ts +2 -1
- package/dist/types/components/internal/Select/type.d.ts +1 -1
- package/dist/types/components/internal/icons/IconArrowDown.d.ts +1 -1
- package/dist/types/components/internal/icons/IconBancontact.d.ts +2 -0
- package/dist/types/components/internal/icons/IconBlik.d.ts +2 -0
- package/dist/types/components/internal/icons/IconIdeal.d.ts +2 -0
- package/dist/types/components/internal/icons/IconOvo.d.ts +2 -0
- package/dist/types/components/internal/icons/IconP24.d.ts +2 -0
- package/dist/types/components/internal/icons/IconPhone.d.ts +2 -0
- package/dist/types/components/internal/icons/IconSkrill.d.ts +2 -0
- package/dist/types/components/internal/icons/IconTrustly.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +8 -0
- package/dist/types/components/type.d.ts +0 -0
- package/dist/types/components/wallets/Bancontact/Bancontact.d.ts +15 -0
- package/dist/types/components/wallets/Bancontact/index.d.ts +2 -0
- package/dist/types/components/{GrabPay → wallets/Bancontact}/type.d.ts +8 -18
- package/dist/types/components/wallets/Blik/Blik.d.ts +15 -0
- package/dist/types/components/wallets/Blik/index.d.ts +2 -0
- package/dist/types/components/wallets/Blik/type.d.ts +29 -0
- package/dist/types/components/{Boost → wallets/Boost}/Boost.d.ts +9 -4
- package/dist/types/components/{Boost → wallets/Boost}/type.d.ts +3 -14
- package/dist/types/components/wallets/GCash/GCash.d.ts +5 -0
- package/dist/types/components/wallets/GCash/type.d.ts +3 -14
- package/dist/types/components/{GrabPay → wallets/GrabPay}/GrabPay.d.ts +4 -4
- package/dist/types/components/wallets/GrabPay/type.d.ts +17 -0
- package/dist/types/components/wallets/IDeal/IDeal.d.ts +15 -0
- package/dist/types/components/wallets/IDeal/index.d.ts +2 -0
- package/dist/types/components/wallets/IDeal/type.d.ts +29 -0
- package/dist/types/components/{LinePay → wallets/LinePay}/LinePay.d.ts +9 -4
- package/dist/types/components/{LinePay → wallets/LinePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/MayBankQRPay/MayBankQRPay.d.ts +15 -0
- package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/type.d.ts +3 -14
- package/dist/types/components/wallets/NinePay/NinePay.d.ts +15 -0
- package/dist/types/components/{NinePay → wallets/NinePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/OVO/OVO.d.ts +15 -0
- package/dist/types/components/wallets/OVO/index.d.ts +2 -0
- package/dist/types/components/wallets/OVO/type.d.ts +29 -0
- package/dist/types/components/wallets/OpayWallet/OpayWallet.d.ts +5 -0
- package/dist/types/components/wallets/OpayWallet/type.d.ts +4 -15
- package/dist/types/components/wallets/P24/P24.d.ts +15 -0
- package/dist/types/components/wallets/P24/index.d.ts +2 -0
- package/dist/types/components/wallets/P24/type.d.ts +29 -0
- package/dist/types/components/wallets/PagaWallet/PagaWallet.d.ts +5 -0
- package/dist/types/components/wallets/PagaWallet/type.d.ts +5 -16
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +5 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +3 -14
- package/dist/types/components/wallets/PicPay/type.d.ts +5 -16
- package/dist/types/components/wallets/Pix/type.d.ts +5 -16
- package/dist/types/components/{ShopeePay → wallets/ShopeePay}/ShopeePay.d.ts +9 -4
- package/dist/types/components/{ShopeePay → wallets/ShopeePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/Skrill/Skrill.d.ts +15 -0
- package/dist/types/components/wallets/Skrill/index.d.ts +2 -0
- package/dist/types/components/wallets/Skrill/type.d.ts +17 -0
- package/dist/types/components/{TNGWallet → wallets/TNGWallet}/TNGWallet.d.ts +9 -4
- package/dist/types/components/{TNGWallet → wallets/TNGWallet}/type.d.ts +3 -14
- package/dist/types/components/wallets/Trustly/Trustly.d.ts +15 -0
- package/dist/types/components/wallets/Trustly/index.d.ts +2 -0
- package/dist/types/components/wallets/Trustly/type.d.ts +21 -0
- package/dist/types/components/wallets/Vietqr/Vietqr.d.ts +5 -0
- package/dist/types/components/wallets/Vietqr/type.d.ts +3 -14
- package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +5 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +3 -14
- package/dist/types/components/wallets/index.d.ts +14 -0
- package/dist/types/components/wallets/type.d.ts +18 -4
- package/dist/types/constant.d.ts +15 -1
- package/dist/types/core/address.d.ts +2 -5
- package/dist/types/core/checkout.d.ts +10 -10
- package/dist/types/core/create-child.d.ts +1 -0
- package/dist/types/core/environment.d.ts +5 -0
- package/dist/types/core/error.d.ts +9 -3
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/logger.d.ts +55 -0
- package/dist/types/core/payment.d.ts +21 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useBaseWallet.d.ts +54 -0
- package/dist/types/hooks/usePayState.d.ts +3 -1
- package/dist/types/hooks/useRetry.console-tests.d.ts +41 -0
- package/dist/types/hooks/useRetry.d.ts +22 -3
- package/dist/types/i18n/locales/de-DE.d.ts +23 -0
- package/dist/types/i18n/locales/en-GB.d.ts +23 -0
- package/dist/types/i18n/locales/es-ES.d.ts +23 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +23 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +23 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +23 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +23 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +23 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +23 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +23 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +23 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +23 -0
- package/dist/types/out/base-fraud-detection.d.ts +1 -0
- package/dist/types/out/config.d.ts +6 -1
- package/dist/types/out/fraud-detection.d.ts +2 -8
- package/dist/types/out/types.d.ts +3 -1
- package/dist/types/out/worldpay-ddc-manager.d.ts +6 -7
- package/dist/types/types/event.d.ts +46 -13
- package/dist/types/types/index.d.ts +8 -37
- package/dist/types/types/message.d.ts +48 -7
- package/dist/types/types/payment.d.ts +63 -0
- package/dist/types/utils/app-payment.d.ts +7 -3
- package/dist/types/utils/behavior-tracker.d.ts +36 -0
- package/dist/types/utils/env.d.ts +37 -0
- package/dist/types/utils/iframe.d.ts +1 -1
- package/dist/types/utils/payment.d.ts +10 -10
- package/package.json +12 -5
- package/dist/es/components/Boost/index.js +0 -348
- package/dist/es/components/GrabPay/index.js +0 -348
- package/dist/es/components/LinePay/index.js +0 -348
- package/dist/es/components/MayBankQRPay/index.js +0 -354
- package/dist/es/components/NinePay/index.js +0 -348
- package/dist/es/components/ShopeePay/index.js +0 -348
- package/dist/es/components/TNGWallet/index.js +0 -348
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +0 -10
- package/dist/types/components/NinePay/NinePay.d.ts +0 -10
- package/dist/types/utils/logger.d.ts +0 -14
- /package/dist/types/components/{Boost → wallets/Boost}/index.d.ts +0 -0
- /package/dist/types/components/{GrabPay → wallets/GrabPay}/index.d.ts +0 -0
- /package/dist/types/components/{LinePay → wallets/LinePay}/index.d.ts +0 -0
- /package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/index.d.ts +0 -0
- /package/dist/types/components/{NinePay → wallets/NinePay}/index.d.ts +0 -0
- /package/dist/types/components/{ShopeePay → wallets/ShopeePay}/index.d.ts +0 -0
- /package/dist/types/components/{TNGWallet → wallets/TNGWallet}/index.d.ts +0 -0
|
@@ -1,323 +1,155 @@
|
|
|
1
|
-
import { w, F, A, h, y,
|
|
1
|
+
import { w, F, A, h, y, u, b } from "../../../core.js";
|
|
2
2
|
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
3
|
import { CoreContext } from "../../../core/context.js";
|
|
4
4
|
import "../../../utils/card-brand/brands.js";
|
|
5
5
|
import "../../../utils/system-info/get-browser-info.js";
|
|
6
|
-
import { isMobile } from "../../../utils/system-info/get-system-info.js";
|
|
7
6
|
import { normalizedClass, formatAmount } from "../../../utils/format.js";
|
|
8
|
-
import {
|
|
9
|
-
import { processPaymentStatus } from "../../../utils/payment.js";
|
|
10
|
-
import { isTimeoutError } from "../../../api/http.js";
|
|
11
|
-
import { getBrowserParams } from "../../../api/modules/get-browser-params.js";
|
|
12
|
-
import { PaymentCategory, COMMON_CLASS_NAME, PaymentMethod, SessionMode } from "../../../constant.js";
|
|
13
|
-
import { getZalopayPayInfo, zalopayPay } from "../../../api/modules/zalopay/index.js";
|
|
14
|
-
import { PayKKaError } from "../../../core/error.js";
|
|
7
|
+
import { PaymentMethod, PaymentCategory, COMMON_CLASS_NAME } from "../../../constant.js";
|
|
15
8
|
import "../../../out/worldpay-jsc-origin.js";
|
|
16
9
|
import { usePayState } from "../../../hooks/usePayState.js";
|
|
17
|
-
import {
|
|
18
|
-
import { usePaymentStatus } from "../../../hooks/usePayment.js";
|
|
10
|
+
import { useBaseWallet } from "../../../hooks/useBaseWallet.js";
|
|
19
11
|
import { createEmailCore, EmailField } from "../../EmailField/EmailField.js";
|
|
20
|
-
import { SubmitButton } from "../../SubmitButton/index.js";
|
|
21
12
|
import { GuideCard } from "../../GuideCard/index.js";
|
|
22
|
-
import { AddressField } from "../../AddressField/index.js";
|
|
13
|
+
import { DEFAULT_ADDRESS, AddressField } from "../../AddressField/index.js";
|
|
23
14
|
import { Info } from "../../internal/Info/Info.js";
|
|
24
15
|
import "../../internal/Form/type.js";
|
|
25
16
|
import "../../internal/Form/context.js";
|
|
26
17
|
import "../../internal/Form/FormItem.js";
|
|
27
18
|
import { Form } from "../../internal/Form/Form.js";
|
|
28
19
|
import { QRCodeModal } from "../../business/QRCodeModal/QRCodeModal.js";
|
|
20
|
+
import "../../internal/Input/Input.js";
|
|
21
|
+
import "../../internal/Input/type.js";
|
|
22
|
+
import "../../internal/Select/Select.js";
|
|
23
|
+
import "../../business/PhoneField/config.js";
|
|
24
|
+
import "../../business/PhoneField/phone-field.js";
|
|
29
25
|
import { IconZalopayComplete } from "../../internal/icons/IconZalopayComplete.js";
|
|
26
|
+
import "../../business/Tooltip/tooltip2.js";
|
|
27
|
+
import "../../business/BlikCodeField/blik-code-field.js";
|
|
28
|
+
import "../../internal/Button/button2.js";
|
|
29
|
+
import "../../internal/Modal/Modal.js";
|
|
30
|
+
import "../../business/BlikConfirmModal/blik-confirm-modal.js";
|
|
31
|
+
import "../../internal/LoadingCheck/loading-check.js";
|
|
30
32
|
import "./zalopay2.js";
|
|
33
|
+
import { PaymentButton } from "../../PaymentButton/index.js";
|
|
31
34
|
const { bem } = useBEM("zalopay");
|
|
32
35
|
const fieldClassNames = bem("field");
|
|
36
|
+
const CURR_PAYMENT_METHOD = PaymentMethod.ZALOPAY;
|
|
33
37
|
const Zalopay = w((props, ref) => {
|
|
34
38
|
var _a;
|
|
35
39
|
const {
|
|
36
40
|
session,
|
|
37
|
-
showEmail = false,
|
|
38
|
-
showAddress = false,
|
|
39
41
|
core,
|
|
40
|
-
redirectMode = "auto",
|
|
41
|
-
autoQuery = true,
|
|
42
42
|
showGuideCard = true,
|
|
43
|
-
enableQRCodeModal = true,
|
|
44
43
|
hidePaymentButton = false
|
|
45
44
|
} = props;
|
|
46
45
|
F(ref, () => ({
|
|
47
|
-
stopRetry: () =>
|
|
48
|
-
|
|
49
|
-
stopReFetchPayInfo();
|
|
50
|
-
},
|
|
51
|
-
startRetry: (timeout) => {
|
|
52
|
-
setPaymentButtonStatus("loading");
|
|
53
|
-
startReFetchPayInfo({ timeout });
|
|
54
|
-
},
|
|
46
|
+
stopRetry: () => stopRetry(),
|
|
47
|
+
startRetry: (timeout) => startRetry(timeout),
|
|
55
48
|
updateAddress: () => {
|
|
56
49
|
var _a2;
|
|
57
50
|
if (!(fieldStatus == null ? void 0 : fieldStatus.address.show))
|
|
58
51
|
return;
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
|
|
52
|
+
const address = addressCore.getAddressState();
|
|
53
|
+
form.address = address;
|
|
54
|
+
setForm(form);
|
|
55
|
+
(_a2 = addressFieldRef.current) == null ? void 0 : _a2.update(address);
|
|
56
|
+
validateFormSilently();
|
|
63
57
|
},
|
|
64
58
|
updateEmail: () => {
|
|
65
59
|
var _a2;
|
|
66
60
|
if (!(fieldStatus == null ? void 0 : fieldStatus.email.show))
|
|
67
61
|
return;
|
|
68
|
-
|
|
69
|
-
setForm(
|
|
62
|
+
form.email = emailState.email;
|
|
63
|
+
setForm(form);
|
|
70
64
|
(_a2 = emailFieldRef.current) == null ? void 0 : _a2.update(emailState.email);
|
|
71
|
-
|
|
65
|
+
validateFormSilently();
|
|
72
66
|
},
|
|
73
67
|
payment: () => {
|
|
74
68
|
hidePaymentButton && onSubmit();
|
|
75
69
|
}
|
|
76
70
|
}));
|
|
71
|
+
const {
|
|
72
|
+
isEnabled,
|
|
73
|
+
fieldStatus,
|
|
74
|
+
paymentButtonStatus,
|
|
75
|
+
setPaymentButtonStatus,
|
|
76
|
+
errorMessage,
|
|
77
|
+
setErrorMessage,
|
|
78
|
+
payment,
|
|
79
|
+
startRetry,
|
|
80
|
+
stopRetry,
|
|
81
|
+
showQRCodeModal,
|
|
82
|
+
qrCodeInfo,
|
|
83
|
+
processCloseQRCodeModal,
|
|
84
|
+
getPaymentMethodContext
|
|
85
|
+
} = useBaseWallet(CURR_PAYMENT_METHOD, props, {
|
|
86
|
+
retryTimeout: 10 * 60 * 1e3,
|
|
87
|
+
supportQRCodeModal: true,
|
|
88
|
+
getFormData: () => {
|
|
89
|
+
return {
|
|
90
|
+
...form
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
77
94
|
const addressCore = core.getAddressCore();
|
|
78
95
|
const emailState = createEmailCore();
|
|
79
96
|
const addressFieldRef = A(null);
|
|
80
97
|
const emailFieldRef = A(null);
|
|
81
|
-
const
|
|
82
|
-
const { i18n, fraudDetection, sessionReady } = usePayState(session);
|
|
83
|
-
const { errorMsg, setErrorMsg, paymentButtonStatus, setPaymentButtonStatus } = usePaymentStatus();
|
|
98
|
+
const { i18n, sessionReady, disabled } = usePayState(session, props.core);
|
|
84
99
|
const formRef = A(null);
|
|
85
100
|
const [form, setForm] = h({
|
|
86
101
|
email: "",
|
|
87
|
-
address: {
|
|
88
|
-
country: void 0,
|
|
89
|
-
province: void 0,
|
|
90
|
-
city: void 0,
|
|
91
|
-
area: void 0,
|
|
92
|
-
postCode: void 0,
|
|
93
|
-
address1: void 0,
|
|
94
|
-
address2: void 0
|
|
95
|
-
}
|
|
102
|
+
address: { ...DEFAULT_ADDRESS }
|
|
96
103
|
});
|
|
97
104
|
const [validated, setValidated] = h(false);
|
|
98
|
-
const [fieldStatus, setFieldStatus] = h();
|
|
99
|
-
const [showQRCodeModal, setShowQRCodeModal] = h(false);
|
|
100
|
-
const [qrCodeInfo, setQrCodeInfo] = h();
|
|
101
|
-
const initFieldStatus = () => {
|
|
102
|
-
const { field, sessionMode } = session.checkout;
|
|
103
|
-
const { email, address } = field;
|
|
104
|
-
if (sessionMode === SessionMode.COMPONENT) {
|
|
105
|
-
if (email.disabled) {
|
|
106
|
-
email.show = showEmail;
|
|
107
|
-
}
|
|
108
|
-
if (showAddress && !(address == null ? void 0 : address.show)) {
|
|
109
|
-
address.show = true;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
setFieldStatus({ ...field });
|
|
113
|
-
};
|
|
114
105
|
y(() => {
|
|
115
|
-
if (!sessionReady)
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const { bill = {}, supportMethods = [], country } = (session == null ? void 0 : session.checkout) || {};
|
|
119
|
-
if (!supportMethods.includes(PaymentMethod.ZALOPAY)) {
|
|
106
|
+
if (!sessionReady)
|
|
120
107
|
return;
|
|
121
|
-
}
|
|
122
|
-
initFieldStatus();
|
|
123
|
-
setIsCheckoutEnabled(true);
|
|
108
|
+
const { bill = {}, country } = (session == null ? void 0 : session.checkout) || {};
|
|
124
109
|
country && addressCore.setCountry(country);
|
|
125
110
|
form.email = bill.email ?? "";
|
|
126
111
|
form.address.country = country;
|
|
127
|
-
if (autoQuery && core.processingPaymentMethod === PaymentMethod.ZALOPAY) {
|
|
128
|
-
setPaymentButtonStatus("loading");
|
|
129
|
-
startReFetchPayInfo();
|
|
130
|
-
}
|
|
131
112
|
}, [sessionReady]);
|
|
132
|
-
const
|
|
113
|
+
const validateFormSilently = () => {
|
|
133
114
|
var _a2;
|
|
134
|
-
|
|
135
|
-
(_a2 = props.onError) == null ? void 0 : _a2.call(props, error);
|
|
136
|
-
core.resetEnablePaymentMethod();
|
|
137
|
-
};
|
|
138
|
-
const onTimeout = q(
|
|
139
|
-
(message) => {
|
|
140
|
-
var _a2;
|
|
141
|
-
setShowQRCodeModal(false);
|
|
142
|
-
setErrorMsg(message || i18n.get("common.payTimeout"));
|
|
143
|
-
setPaymentButtonStatus("unSubmit");
|
|
144
|
-
(_a2 = props.onTimeout) == null ? void 0 : _a2.call(props, "retry");
|
|
145
|
-
core.resetEnablePaymentMethod();
|
|
146
|
-
},
|
|
147
|
-
[i18n, props.onTimeout]
|
|
148
|
-
);
|
|
149
|
-
const { start: startReFetchPayInfo, stop: stopReFetchPayInfo } = useRetry(
|
|
150
|
-
(timeout) => pay(true, timeout),
|
|
151
|
-
{
|
|
152
|
-
timeout: 10 * 60 * 1e3,
|
|
153
|
-
onTimeout: () => onTimeout(i18n.get("common.queryTimeout"))
|
|
154
|
-
}
|
|
155
|
-
);
|
|
156
|
-
const getPaymentParams = async () => {
|
|
157
|
-
return {
|
|
158
|
-
sessionId: session.sessionId,
|
|
159
|
-
clientKey: session.clientKey,
|
|
160
|
-
payment: {
|
|
161
|
-
paymentMethod: PaymentMethod.ZALOPAY
|
|
162
|
-
},
|
|
163
|
-
bill: {
|
|
164
|
-
email: form.email,
|
|
165
|
-
addressLine1: form.address.address1,
|
|
166
|
-
addressLine2: form.address.address2,
|
|
167
|
-
postalCode: form.address.postCode,
|
|
168
|
-
country: form.address.country,
|
|
169
|
-
district: form.address.area,
|
|
170
|
-
state: form.address.province ? addressCore.getLabel(form.address.province, addressCore.getProvinceOption()) ?? form.address.province : void 0,
|
|
171
|
-
city: form.address.city ? addressCore.getLabel(form.address.city, addressCore.getCityOptions()) ?? form.address.city : void 0
|
|
172
|
-
},
|
|
173
|
-
browser: await getBrowserParams({
|
|
174
|
-
fraudDetectionId: await (fraudDetection == null ? void 0 : fraudDetection.getFraudDetectionId())
|
|
175
|
-
})
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
const pay = async (search = false, timeout) => {
|
|
179
|
-
var _a2, _b, _c, _d, _e;
|
|
180
|
-
try {
|
|
181
|
-
const requestOptions = { locale: i18n.locale, timeout };
|
|
182
|
-
let res = null;
|
|
183
|
-
if (search) {
|
|
184
|
-
const extraParams = (_b = (_a2 = core.config)._getExtraParams) == null ? void 0 : _b.call(_a2, "query", PaymentMethod.ZALOPAY);
|
|
185
|
-
res = await getZalopayPayInfo(
|
|
186
|
-
{
|
|
187
|
-
sessionId: session.sessionId,
|
|
188
|
-
clientKey: session.clientKey,
|
|
189
|
-
paymentMethod: PaymentMethod.ZALOPAY
|
|
190
|
-
},
|
|
191
|
-
extraParams,
|
|
192
|
-
requestOptions
|
|
193
|
-
);
|
|
194
|
-
} else {
|
|
195
|
-
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", PaymentMethod.ZALOPAY);
|
|
196
|
-
res = await zalopayPay(await getPaymentParams(), extraParams, requestOptions);
|
|
197
|
-
}
|
|
198
|
-
!search && ((_e = props.onSubmitResponse) == null ? void 0 : _e.call(props, res));
|
|
199
|
-
const { errorMessage, errorCode, payInfo = {}, sessionId } = res;
|
|
200
|
-
sessionId && (session.sessionId = sessionId);
|
|
201
|
-
const { paymentExpiredAt } = payInfo;
|
|
202
|
-
let end = true;
|
|
203
|
-
processPaymentStatus(res, {
|
|
204
|
-
onProcessing: () => {
|
|
205
|
-
if (!search && payInfo) {
|
|
206
|
-
if (isMobile()) {
|
|
207
|
-
if (redirectMode === "auto") {
|
|
208
|
-
redirectToPayment(payInfo);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
} else {
|
|
212
|
-
if (enableQRCodeModal) {
|
|
213
|
-
setShowQRCodeModal(true);
|
|
214
|
-
setQrCodeInfo({
|
|
215
|
-
qrCode: payInfo.qr_code || payInfo.request_url,
|
|
216
|
-
expiredTime: paymentExpiredAt
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
startReFetchPayInfo();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
end = false;
|
|
223
|
-
},
|
|
224
|
-
onSuccess: () => {
|
|
225
|
-
var _a3;
|
|
226
|
-
setShowQRCodeModal(false);
|
|
227
|
-
setPaymentButtonStatus("success");
|
|
228
|
-
(_a3 = props.onSuccess) == null ? void 0 : _a3.call(props, res);
|
|
229
|
-
},
|
|
230
|
-
onFailure: () => {
|
|
231
|
-
errorMessage && setErrorMsg(errorMessage);
|
|
232
|
-
setPaymentButtonStatus("unSubmit");
|
|
233
|
-
processOnError(new PayKKaError("API_ERROR", errorMessage, { code: errorCode }));
|
|
234
|
-
},
|
|
235
|
-
onCanceled: () => {
|
|
236
|
-
var _a3;
|
|
237
|
-
core.resetEnablePaymentMethod();
|
|
238
|
-
setPaymentButtonStatus("unSubmit");
|
|
239
|
-
(_a3 = props.onTimeout) == null ? void 0 : _a3.call(props, "channel");
|
|
240
|
-
},
|
|
241
|
-
onExpired: () => {
|
|
242
|
-
var _a3;
|
|
243
|
-
setShowQRCodeModal(false);
|
|
244
|
-
setPaymentButtonStatus("unSubmit");
|
|
245
|
-
(_a3 = props.onExpired) == null ? void 0 : _a3.call(props);
|
|
246
|
-
},
|
|
247
|
-
onDefault: () => {
|
|
248
|
-
setPaymentButtonStatus("unSubmit");
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
return { end };
|
|
252
|
-
} catch (error) {
|
|
253
|
-
if (isTimeoutError(error)) {
|
|
254
|
-
if (search) {
|
|
255
|
-
return { end: false };
|
|
256
|
-
} else {
|
|
257
|
-
onTimeout();
|
|
258
|
-
return { end: true };
|
|
259
|
-
}
|
|
260
|
-
} else {
|
|
261
|
-
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
262
|
-
message && setErrorMsg(message);
|
|
263
|
-
processOnError(new PayKKaError("API_ERROR", message, { code: error.code, cause: error }));
|
|
264
|
-
setPaymentButtonStatus("unSubmit");
|
|
265
|
-
return { end: true };
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
const validateForm = () => {
|
|
270
|
-
var _a2;
|
|
271
|
-
(_a2 = formRef.current) == null ? void 0 : _a2.validate(void 0, false).then(() => {
|
|
272
|
-
setValidated(true);
|
|
273
|
-
}).catch(() => {
|
|
274
|
-
setValidated(false);
|
|
275
|
-
});
|
|
115
|
+
(_a2 = formRef.current) == null ? void 0 : _a2.validate(void 0, false).then(() => setValidated(true)).catch(() => setValidated(false));
|
|
276
116
|
};
|
|
277
117
|
y(() => {
|
|
278
|
-
|
|
118
|
+
validateFormSilently();
|
|
279
119
|
}, [form]);
|
|
280
120
|
const onSubmit = async () => {
|
|
281
121
|
var _a2;
|
|
282
|
-
|
|
122
|
+
setErrorMessage("");
|
|
283
123
|
(_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
|
|
284
124
|
var _a3;
|
|
285
125
|
(fieldStatus == null ? void 0 : fieldStatus.address.show) && addressCore.setValidateAllFields(true);
|
|
286
|
-
(_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors);
|
|
126
|
+
(_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext());
|
|
287
127
|
if (errors) {
|
|
288
128
|
setPaymentButtonStatus("unSubmit");
|
|
289
129
|
return;
|
|
290
130
|
}
|
|
291
|
-
setErrorMsg("");
|
|
292
131
|
setPaymentButtonStatus("loading");
|
|
293
|
-
await
|
|
132
|
+
await payment();
|
|
294
133
|
});
|
|
295
134
|
};
|
|
296
|
-
const handleCloseQRCodeModal = () => {
|
|
297
|
-
var _a2;
|
|
298
|
-
setPaymentButtonStatus("unSubmit");
|
|
299
|
-
stopReFetchPayInfo();
|
|
300
|
-
setShowQRCodeModal(false);
|
|
301
|
-
setQrCodeInfo(void 0);
|
|
302
|
-
(_a2 = props.onCloseModal) == null ? void 0 : _a2.call(props);
|
|
303
|
-
};
|
|
304
135
|
const setFormRef = (dom) => {
|
|
305
136
|
formRef.current = dom;
|
|
306
|
-
dom &&
|
|
137
|
+
dom && validateFormSilently();
|
|
307
138
|
};
|
|
308
|
-
const
|
|
139
|
+
const WalletButton = () => {
|
|
309
140
|
var _a2;
|
|
310
141
|
const transAmount = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.transAmount;
|
|
311
142
|
const amountText = (transAmount == null ? void 0 : transAmount.amount) ? formatAmount(transAmount).jointSymbol() : "";
|
|
312
143
|
const text = i18n.get("common.pay") + (amountText ? ` ${amountText}` : "");
|
|
313
144
|
return /* @__PURE__ */ u(
|
|
314
|
-
|
|
145
|
+
PaymentButton,
|
|
315
146
|
{
|
|
316
147
|
className: bem("button"),
|
|
148
|
+
disabled,
|
|
317
149
|
status: paymentButtonStatus,
|
|
318
|
-
text,
|
|
319
150
|
onClick: onSubmit,
|
|
320
|
-
verified: validated
|
|
151
|
+
verified: validated,
|
|
152
|
+
children: text
|
|
321
153
|
}
|
|
322
154
|
);
|
|
323
155
|
};
|
|
@@ -327,22 +159,21 @@ const Zalopay = w((props, ref) => {
|
|
|
327
159
|
{
|
|
328
160
|
ref: emailFieldRef,
|
|
329
161
|
value: form.email,
|
|
330
|
-
disabled: fieldStatus == null ? void 0 : fieldStatus.email.disabled
|
|
162
|
+
disabled: (fieldStatus == null ? void 0 : fieldStatus.email.disabled) || disabled
|
|
331
163
|
}
|
|
332
164
|
) }) });
|
|
333
165
|
};
|
|
334
166
|
const ErrorMessage = () => {
|
|
335
|
-
return /* @__PURE__ */ u(b, { children: !!
|
|
167
|
+
return /* @__PURE__ */ u(b, { children: !!errorMessage && /* @__PURE__ */ u(Info, { content: errorMessage }) });
|
|
336
168
|
};
|
|
337
169
|
const Address = () => {
|
|
338
|
-
var _a2, _b;
|
|
339
170
|
return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.address.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
|
|
340
171
|
AddressField,
|
|
341
172
|
{
|
|
342
173
|
ref: addressFieldRef,
|
|
343
174
|
value: form.address,
|
|
344
|
-
|
|
345
|
-
|
|
175
|
+
onChange: (value) => setForm(Object.assign(form, { address: value })),
|
|
176
|
+
disabled
|
|
346
177
|
}
|
|
347
178
|
) }) });
|
|
348
179
|
};
|
|
@@ -354,14 +185,14 @@ const Zalopay = w((props, ref) => {
|
|
|
354
185
|
session,
|
|
355
186
|
core
|
|
356
187
|
},
|
|
357
|
-
children:
|
|
188
|
+
children: isEnabled && i18n.ready.value && /* @__PURE__ */ u("div", { className: core.theme.className, children: [
|
|
358
189
|
showGuideCard && /* @__PURE__ */ u(GuideCard, { type: PaymentCategory.ZALOPAY }),
|
|
359
190
|
/* @__PURE__ */ u(Form, { form, ref: setFormRef, onFormChange: (form2) => setForm(form2), children: /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, bem()), children: [
|
|
360
191
|
Email(),
|
|
361
192
|
Address(),
|
|
362
193
|
/* @__PURE__ */ u("div", { className: bem("footer-wrapper"), children: [
|
|
363
194
|
ErrorMessage(),
|
|
364
|
-
!hidePaymentButton &&
|
|
195
|
+
!hidePaymentButton && WalletButton()
|
|
365
196
|
] })
|
|
366
197
|
] }) }),
|
|
367
198
|
showQRCodeModal && /* @__PURE__ */ u(
|
|
@@ -373,7 +204,7 @@ const Zalopay = w((props, ref) => {
|
|
|
373
204
|
amount: (_a = session == null ? void 0 : session.checkout) == null ? void 0 : _a.transAmount,
|
|
374
205
|
expiredTime: qrCodeInfo.expiredTime,
|
|
375
206
|
borderColor: "#00CF6A",
|
|
376
|
-
onClose:
|
|
207
|
+
onClose: processCloseQRCodeModal
|
|
377
208
|
}
|
|
378
209
|
)
|
|
379
210
|
] })
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import "./Boost/Boost.js";
|
|
2
|
+
import "./GrabPay/GrabPay.js";
|
|
3
|
+
import "./LinePay/LinePay.js";
|
|
4
|
+
import "./NinePay/NinePay.js";
|
|
5
|
+
import "./MayBankQRPay/MayBankQRPay.js";
|
|
6
|
+
import "./ShopeePay/ShopeePay.js";
|
|
7
|
+
import "./TNGWallet/TNGWallet.js";
|
|
1
8
|
import "./GCash/GCash.js";
|
|
2
9
|
import "./Paymaya/Paymaya.js";
|
|
3
10
|
import "./Zalopay/Zalopay.js";
|
|
@@ -6,3 +13,10 @@ import "./Pix/Pix.js";
|
|
|
6
13
|
import "./PicPay/PicPay.js";
|
|
7
14
|
import "./PagaWallet/PagaWallet.js";
|
|
8
15
|
import "./OpayWallet/OpayWallet.js";
|
|
16
|
+
import "./OVO/OVO.js";
|
|
17
|
+
import "./Bancontact/Bancontact.js";
|
|
18
|
+
import "./Blik/Blik.js";
|
|
19
|
+
import "./IDeal/IDeal.js";
|
|
20
|
+
import "./Skrill/Skrill.js";
|
|
21
|
+
import "./P24/P24.js";
|
|
22
|
+
import "./Trustly/Trustly.js";
|
package/dist/es/constant.js
CHANGED
|
@@ -30,6 +30,13 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
30
30
|
PaymentMethod2["PIC_PAY"] = "PIC_PAY";
|
|
31
31
|
PaymentMethod2["OPAY_WALLET"] = "OPAY_WALLET";
|
|
32
32
|
PaymentMethod2["PAGA_WALLET"] = "PAGA_WALLET";
|
|
33
|
+
PaymentMethod2["BANCONTACT"] = "BANCONTACT";
|
|
34
|
+
PaymentMethod2["IDEAL"] = "IDEAL";
|
|
35
|
+
PaymentMethod2["BLIK"] = "BLIK";
|
|
36
|
+
PaymentMethod2["OVO"] = "OVO";
|
|
37
|
+
PaymentMethod2["SKRILL"] = "SKRILL";
|
|
38
|
+
PaymentMethod2["TRUSTLY"] = "TRUSTLY";
|
|
39
|
+
PaymentMethod2["P24"] = "P24";
|
|
33
40
|
PaymentMethod2["SEPA_DEBIT"] = "SEPA_DEBIT";
|
|
34
41
|
return PaymentMethod2;
|
|
35
42
|
})(PaymentMethod || {});
|
|
@@ -55,9 +62,20 @@ var PaymentCategory = /* @__PURE__ */ ((PaymentCategory2) => {
|
|
|
55
62
|
PaymentCategory2["PIC_PAY"] = "picPay";
|
|
56
63
|
PaymentCategory2["OPAY_WALLET"] = "opayWallet";
|
|
57
64
|
PaymentCategory2["PAGA_WALLET"] = "pagaWallet";
|
|
65
|
+
PaymentCategory2["BANCONTACT"] = "bancontact";
|
|
66
|
+
PaymentCategory2["IDEAL"] = "ideal";
|
|
67
|
+
PaymentCategory2["BLIK"] = "blik";
|
|
68
|
+
PaymentCategory2["OVO"] = "ovo";
|
|
69
|
+
PaymentCategory2["SKRILL"] = "skrill";
|
|
70
|
+
PaymentCategory2["TRUSTLY"] = "trustly";
|
|
71
|
+
PaymentCategory2["P24"] = "p24";
|
|
58
72
|
return PaymentCategory2;
|
|
59
73
|
})(PaymentCategory || {});
|
|
60
74
|
const PaymentMethod2CategoryMap = {
|
|
75
|
+
[
|
|
76
|
+
"BANKCARD"
|
|
77
|
+
/* BANKCARD */
|
|
78
|
+
]: "card",
|
|
61
79
|
[
|
|
62
80
|
"APPLE_PAY"
|
|
63
81
|
/* APPLE_PAY */
|
|
@@ -137,8 +155,36 @@ const PaymentMethod2CategoryMap = {
|
|
|
137
155
|
[
|
|
138
156
|
"PAGA_WALLET"
|
|
139
157
|
/* PAGA_WALLET */
|
|
140
|
-
]: "pagaWallet"
|
|
141
|
-
|
|
158
|
+
]: "pagaWallet",
|
|
159
|
+
[
|
|
160
|
+
"BANCONTACT"
|
|
161
|
+
/* BANCONTACT */
|
|
162
|
+
]: "bancontact",
|
|
163
|
+
[
|
|
164
|
+
"IDEAL"
|
|
165
|
+
/* IDEAL */
|
|
166
|
+
]: "ideal",
|
|
167
|
+
[
|
|
168
|
+
"BLIK"
|
|
169
|
+
/* BLIK */
|
|
170
|
+
]: "blik",
|
|
171
|
+
[
|
|
172
|
+
"OVO"
|
|
173
|
+
/* OVO */
|
|
174
|
+
]: "ovo",
|
|
175
|
+
[
|
|
176
|
+
"SKRILL"
|
|
177
|
+
/* SKRILL */
|
|
178
|
+
]: "skrill",
|
|
179
|
+
[
|
|
180
|
+
"TRUSTLY"
|
|
181
|
+
/* TRUSTLY */
|
|
182
|
+
]: "trustly",
|
|
183
|
+
[
|
|
184
|
+
"P24"
|
|
185
|
+
/* P24 */
|
|
186
|
+
]: "p24"
|
|
187
|
+
/* P24 */
|
|
142
188
|
};
|
|
143
189
|
const CardPaymentMethods = [
|
|
144
190
|
"VISA",
|
package/dist/es/core/address.js
CHANGED
|
@@ -36,7 +36,7 @@ class AddressCore {
|
|
|
36
36
|
__publicField(this, "provinceOptions");
|
|
37
37
|
__publicField(this, "cityOptions");
|
|
38
38
|
__publicField(this, "addressState");
|
|
39
|
-
__publicField(this, "
|
|
39
|
+
__publicField(this, "locale");
|
|
40
40
|
__publicField(this, "addressFormat");
|
|
41
41
|
__publicField(this, "validateAllFields", false);
|
|
42
42
|
this.addressState = {
|
|
@@ -50,16 +50,17 @@ class AddressCore {
|
|
|
50
50
|
};
|
|
51
51
|
this.countryOptions = [];
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
this.
|
|
53
|
+
setLocale(locale) {
|
|
54
|
+
this.locale = locale;
|
|
55
55
|
}
|
|
56
|
+
/* 请求国家列表,这里做了一个缓存,避免重复请求 */
|
|
56
57
|
async requestCountryOption() {
|
|
57
58
|
var _a, _b;
|
|
58
|
-
if (this.countryOptions.length
|
|
59
|
+
if (this.countryOptions.length || ((_a = __privateGet(this, _countryOptionsReadyPromise)) == null ? void 0 : _a.isPending))
|
|
59
60
|
return;
|
|
60
61
|
try {
|
|
61
62
|
__privateSet(this, _countryOptionsReadyPromise, createPromise());
|
|
62
|
-
this.countryOptions = await getCountry({ locale: this.
|
|
63
|
+
this.countryOptions = await getCountry({ locale: this.locale });
|
|
63
64
|
__privateGet(this, _countryOptionsReadyPromise).resolve(true);
|
|
64
65
|
} catch (error) {
|
|
65
66
|
(_b = __privateGet(this, _countryOptionsReadyPromise)) == null ? void 0 : _b.resolve(false);
|
|
@@ -72,7 +73,7 @@ class AddressCore {
|
|
|
72
73
|
return this.countryOptions;
|
|
73
74
|
}
|
|
74
75
|
async requestProvinceOption(value) {
|
|
75
|
-
this.provinceOptions = await mergedGetProvince(value, { locale: this.
|
|
76
|
+
this.provinceOptions = await mergedGetProvince(value, { locale: this.locale });
|
|
76
77
|
return this.provinceOptions;
|
|
77
78
|
}
|
|
78
79
|
getProvinceOption() {
|