@paykka/card-checkout-ui 0.13.17 → 0.15.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/README.md +1 -1
- package/dist/card-checkout-ui.js +53 -25
- package/dist/card-checkout-ui.umd.cjs +53 -25
- package/dist/es/api/http.js +1 -1
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/modules/checkout/index.js +1 -3
- package/dist/es/api/modules/checkout/map.js +12 -4
- package/dist/es/api/modules/encrypted-card/index.js +3 -2
- package/dist/es/api/modules/get-browser-params.js +4 -8
- package/dist/es/api/modules/index.js +1 -1
- package/dist/es/api/modules/map.js +4 -1
- package/dist/es/api/modules/threeDS/index.js +16 -2
- package/dist/es/components/AccordionItem/AccordionItem.js +1 -3
- package/dist/es/components/AccountNameField/index.js +1 -1
- package/dist/es/components/AddressField/index.js +14 -4
- package/dist/es/components/ApplePay/index.js +74 -58
- package/dist/es/components/CPFField/index.js +3 -2
- package/dist/es/components/Card/index.js +192 -157
- package/dist/es/components/CardBrands/index.js +1 -1
- package/dist/es/components/CardExpireDateField/index.js +3 -2
- package/dist/es/components/CardHolderNameField/index.js +1 -1
- package/dist/es/components/CardIBANField/index.js +1 -1
- package/dist/es/components/CardNo/index.js +3 -3
- package/dist/es/components/CardNumberField/index.js +3 -2
- package/dist/es/components/CardSecurityCodeField/index.js +3 -2
- package/dist/es/components/CardSelector/index.js +5 -4
- package/dist/es/components/CombinedCardInfo/index.js +1 -1
- package/dist/es/components/DropIn/index.js +141 -144
- package/dist/es/components/EmailField/EmailField.js +1 -1
- package/dist/es/components/EncryptedCard/index.js +5 -5
- package/dist/es/components/GooglePay/index.js +126 -114
- package/dist/es/components/GuideCard/index.js +2 -2
- package/dist/es/components/PaymentButton/index.js +23 -8
- package/dist/es/components/RecurringTip/index.js +1 -1
- package/dist/es/components/SecuredFieldsProvider/index.js +31 -9
- package/dist/es/components/SecuredIframe/index.js +43 -27
- package/dist/es/components/Sepa/index.js +15 -7
- package/dist/es/components/SubmitButton/index.js +3 -3
- package/dist/es/components/ThreeDS/index.js +59 -30
- package/dist/es/components/Tip/index.js +1 -1
- package/dist/es/components/business/BlikCodeField/BlikCodeField.js +1 -1
- package/dist/es/components/business/BlikCodeField/index.js +1 -1
- package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +3 -3
- package/dist/es/components/business/BlikConfirmModal/index.js +2 -2
- package/dist/es/components/business/NameField/NameField.js +1 -1
- package/dist/es/components/business/NameField/index.js +1 -1
- package/dist/es/components/business/PhoneField/PhoneField.js +2 -1
- package/dist/es/components/business/PhoneField/index.js +1 -1
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +2 -2
- package/dist/es/components/business/QRCodeModal/index.js +1 -1
- package/dist/es/components/business/Tooltip/Tooltip.js +1 -1
- package/dist/es/components/business/Tooltip/index.js +1 -1
- package/dist/es/components/business/index.js +2 -2
- package/dist/es/components/index.js +11 -11
- package/dist/es/components/internal/Accordion/index.js +1 -1
- package/dist/es/components/internal/Button/{Button.js → Button2.js} +2 -2
- package/dist/es/components/internal/Button/index.js +2 -2
- package/dist/es/components/internal/CheckBox/CheckBox.js +3 -3
- package/dist/es/components/internal/CheckBox/index.js +1 -1
- package/dist/es/components/internal/Form/type.js +1 -1
- package/dist/es/components/internal/Info/Info.js +1 -1
- package/dist/es/components/internal/Info/index.js +1 -1
- package/dist/es/components/internal/Input/Input.js +1 -1
- package/dist/es/components/internal/Input/type.js +1 -1
- package/dist/es/components/internal/Loading/Loading2.js +20 -0
- package/dist/es/{api/modules/vietqr → components/internal/Loading}/index.js +3 -2
- package/dist/es/components/internal/Loading/loading.js +1 -0
- package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -1
- package/dist/es/components/internal/LoadingCheck/index.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/QRCode/QRCode.js +1 -1
- package/dist/es/components/internal/QRCode/index.js +1 -1
- package/dist/es/components/internal/Select/Select.js +5 -2
- package/dist/es/components/internal/Select/SelectMenu.js +1 -1
- package/dist/es/components/internal/Select/SelectMenuItem.js +1 -1
- package/dist/es/components/internal/icons/IconAlipayPlus.js +116 -0
- package/dist/es/components/internal/icons/IconArrowDown.js +4 -4
- package/dist/es/components/internal/icons/IconBancontact.js +69 -14
- package/dist/es/components/internal/icons/IconBlik.js +541 -21
- package/dist/es/components/internal/icons/IconError.js +2 -2
- package/dist/es/components/internal/icons/IconIdeal.js +61 -29
- package/dist/es/components/internal/icons/IconSkrill.js +14 -7
- package/dist/es/components/internal/icons/IconSuccess.js +2 -2
- package/dist/es/components/internal/icons/IconTrustly.js +11 -44
- package/dist/es/components/internal/icons/IconWechatPayGlobal.js +45 -0
- package/dist/es/components/internal/icons/IconWechatPayGlobalComplete.js +107 -0
- package/dist/es/components/wallets/AliPay/AliPay.js +186 -0
- package/dist/es/components/wallets/AliPay/ali-pay.js +1 -0
- package/dist/es/components/wallets/AliPay/index.js +1 -0
- package/dist/es/components/wallets/AliPay/type.js +1 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +18 -18
- package/dist/es/components/wallets/Blik/Blik.js +26 -20
- package/dist/es/components/wallets/Boost/Boost.js +180 -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 +68 -261
- package/dist/es/components/wallets/GrabPay/GrabPay.js +176 -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 +18 -18
- package/dist/es/components/wallets/LinePay/LinePay.js +180 -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 +184 -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 +182 -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 +14 -15
- package/dist/es/components/wallets/OpayWallet/OpayWallet.js +61 -226
- package/dist/es/components/wallets/P24/P24.js +18 -18
- package/dist/es/components/wallets/PagaWallet/PagaWallet.js +61 -226
- package/dist/es/components/wallets/Paymaya/Paymaya.js +61 -229
- package/dist/es/components/wallets/PicPay/PicPay.js +83 -243
- package/dist/es/components/wallets/Pix/Pix.js +77 -244
- package/dist/es/components/wallets/ShopeePay/ShopeePay.js +182 -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 +34 -35
- package/dist/es/components/wallets/TNGWallet/TNGWallet.js +182 -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 +22 -25
- package/dist/es/components/wallets/Vietqr/Vietqr.js +69 -258
- package/dist/es/components/wallets/WechatPay/WechatPay.js +250 -0
- package/dist/es/components/wallets/WechatPay/index.js +1 -0
- package/dist/es/components/wallets/WechatPay/type.js +1 -0
- package/dist/es/components/wallets/WechatPay/util.js +47 -0
- package/dist/es/components/wallets/WechatPay/wechat-pay.js +1 -0
- package/dist/es/components/wallets/Zalopay/Zalopay.js +67 -258
- package/dist/es/components/wallets/index.js +9 -0
- package/dist/es/constant.js +7 -0
- package/dist/es/core/checkout.js +50 -49
- package/dist/es/core/create-child.js +5 -4
- package/dist/es/core/index.js +1 -1
- package/dist/es/core/logger.js +1 -1
- package/dist/es/core/payment.js +78 -0
- package/dist/es/core/preview.js +29 -0
- package/dist/es/core/query.js +12 -3
- package/dist/es/core/session.js +36 -6
- package/dist/es/core/theme.js +1 -1
- package/dist/es/hooks/index.js +1 -1
- package/dist/es/hooks/useBaseWallet.js +136 -65
- package/dist/es/hooks/useI18n.js +3 -3
- package/dist/es/hooks/usePayState.js +37 -25
- package/dist/es/hooks/useRetry.js +50 -26
- package/dist/es/i18n/locales/de-DE.js +7 -0
- package/dist/es/i18n/locales/en-GB.js +7 -0
- package/dist/es/i18n/locales/es-ES.js +7 -0
- package/dist/es/i18n/locales/fr-FR.js +7 -0
- package/dist/es/i18n/locales/ja-JP.js +7 -0
- package/dist/es/i18n/locales/ko-KR.js +7 -0
- package/dist/es/i18n/locales/nl-NL.js +7 -0
- package/dist/es/i18n/locales/pt-PT.js +7 -0
- package/dist/es/i18n/locales/ru-RU.js +7 -0
- package/dist/es/i18n/locales/zh-CN.js +7 -0
- package/dist/es/i18n/locales/zh-HK.js +7 -0
- package/dist/es/i18n/locales/zh-TW.js +7 -0
- package/dist/es/i18n/util.js +10 -10
- package/dist/es/index.js +14 -12
- package/dist/es/out/base-fraud-detection.js +5 -2
- package/dist/es/out/fraud-detection.js +68 -54
- package/dist/es/out/paykka-detection.js +5 -7
- package/dist/es/out/stripe-radar.js +1 -1
- package/dist/es/out/worldpay-ddc-manager.js +9 -13
- package/dist/es/out/worldpay-ddc.js +8 -6
- package/dist/es/style.css +1 -1
- package/dist/es/types/event.js +11 -1
- package/dist/es/types/index.js +7 -0
- package/dist/es/types/message.js +2 -0
- package/dist/es/utils/array.js +19 -5
- package/dist/es/utils/business/amount.js +15 -0
- package/dist/es/utils/business/index.js +1 -0
- package/dist/es/utils/detect.js +8 -0
- package/dist/es/utils/index.js +7 -9
- package/dist/es/utils/location.js +8 -0
- package/dist/es/utils/number.js +19 -0
- package/dist/es/utils/payment.js +12 -12
- package/dist/es/utils/redirect.js +2 -0
- package/dist/es/utils/system-info/is-ua-webview.js +1 -20
- package/dist/style.css +1 -1
- package/dist/types/api/modules/checkout/type.d.ts +1 -1
- package/dist/types/api/modules/index.d.ts +0 -17
- package/dist/types/api/modules/threeDS/index.d.ts +19 -4
- package/dist/types/components/AddressField/type.d.ts +2 -2
- package/dist/types/components/ApplePay/type.d.ts +6 -2
- package/dist/types/components/CPFField/type.d.ts +1 -1
- package/dist/types/components/Card/type.d.ts +2 -18
- 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/layout.d.ts +33 -0
- package/dist/types/components/DropIn/type.d.ts +6 -6
- package/dist/types/components/GooglePay/createGooglePay.d.ts +1 -1
- package/dist/types/components/GooglePay/type.d.ts +12 -2
- package/dist/types/components/PaymentButton/type.d.ts +2 -0
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +2 -0
- package/dist/types/components/Sepa/type.d.ts +3 -4
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +0 -6
- package/dist/types/components/business/QRCodeModal/type.d.ts +12 -3
- package/dist/types/components/index.d.ts +0 -9
- package/dist/types/components/internal/CheckBox/type.d.ts +2 -1
- package/dist/types/components/internal/Loading/Loading.d.ts +2 -1
- package/dist/types/components/internal/Loading/type.d.ts +8 -0
- package/dist/types/components/internal/ResultMessage/ResultMessage.d.ts +3 -0
- package/dist/types/components/internal/ResultMessage/index.d.ts +2 -0
- package/dist/types/components/internal/ResultMessage/type.d.ts +13 -0
- package/dist/types/components/internal/Select/type.d.ts +1 -1
- package/dist/types/components/internal/icons/IconAlipayPlus.d.ts +2 -0
- package/dist/types/components/internal/icons/IconArrowDown.d.ts +1 -1
- package/dist/types/components/internal/icons/IconError.d.ts +1 -1
- package/dist/types/components/internal/icons/IconSuccess.d.ts +1 -1
- package/dist/types/components/internal/icons/IconWechatPayGlobal.d.ts +2 -0
- package/dist/types/components/internal/icons/IconWechatPayGlobalComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/components/{AliPay → wallets/AliPay}/AliPay.d.ts +9 -4
- package/dist/types/components/wallets/AliPay/type.d.ts +7 -0
- package/dist/types/components/wallets/Bancontact/type.d.ts +2 -24
- package/dist/types/components/wallets/Blik/type.d.ts +2 -24
- package/dist/types/components/{Boost → wallets/Boost}/Boost.d.ts +9 -4
- package/dist/types/components/wallets/Boost/type.d.ts +6 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +5 -0
- package/dist/types/components/wallets/GCash/type.d.ts +2 -24
- package/dist/types/components/{GrabPay → wallets/GrabPay}/GrabPay.d.ts +4 -4
- package/dist/types/components/wallets/GrabPay/type.d.ts +7 -0
- package/dist/types/components/wallets/IDeal/type.d.ts +2 -24
- package/dist/types/components/{LinePay → wallets/LinePay}/LinePay.d.ts +9 -4
- package/dist/types/components/wallets/LinePay/type.d.ts +6 -0
- package/dist/types/components/wallets/MayBankQRPay/MayBankQRPay.d.ts +15 -0
- package/dist/types/components/wallets/MayBankQRPay/type.d.ts +6 -0
- package/dist/types/components/wallets/NinePay/NinePay.d.ts +15 -0
- package/dist/types/components/wallets/NinePay/type.d.ts +6 -0
- package/dist/types/components/wallets/OVO/type.d.ts +2 -24
- package/dist/types/components/wallets/OpayWallet/OpayWallet.d.ts +5 -0
- package/dist/types/components/wallets/OpayWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/P24/type.d.ts +2 -24
- package/dist/types/components/wallets/PagaWallet/PagaWallet.d.ts +5 -0
- package/dist/types/components/wallets/PagaWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +5 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +2 -24
- package/dist/types/components/wallets/PicPay/type.d.ts +2 -24
- package/dist/types/components/wallets/Pix/type.d.ts +2 -24
- package/dist/types/components/{ShopeePay → wallets/ShopeePay}/ShopeePay.d.ts +9 -4
- package/dist/types/components/wallets/ShopeePay/type.d.ts +6 -0
- package/dist/types/components/wallets/Skrill/type.d.ts +2 -24
- package/dist/types/components/{TNGWallet → wallets/TNGWallet}/TNGWallet.d.ts +9 -4
- package/dist/types/components/wallets/TNGWallet/type.d.ts +6 -0
- package/dist/types/components/wallets/Trustly/type.d.ts +2 -16
- package/dist/types/components/wallets/Vietqr/Vietqr.d.ts +5 -0
- package/dist/types/components/wallets/Vietqr/type.d.ts +2 -24
- package/dist/types/components/wallets/WechatPay/WechatPay.d.ts +16 -0
- package/dist/types/components/wallets/WechatPay/type.d.ts +12 -0
- package/dist/types/components/wallets/WechatPay/util.d.ts +13 -0
- package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +5 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +2 -24
- package/dist/types/components/wallets/index.d.ts +9 -0
- package/dist/types/components/wallets/type.d.ts +0 -14
- package/dist/types/constant.d.ts +8 -0
- package/dist/types/core/checkout.d.ts +2 -9
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/payment.d.ts +21 -0
- package/dist/types/core/preview.d.ts +1 -0
- package/dist/types/core/session.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useBaseWallet.d.ts +27 -5
- package/dist/types/hooks/useI18n.d.ts +1 -1
- package/dist/types/hooks/usePayState.d.ts +3 -4
- package/dist/types/hooks/useRetry.d.ts +22 -3
- package/dist/types/i18n/I18n.d.ts +1 -0
- package/dist/types/i18n/locales/de-DE.d.ts +7 -0
- package/dist/types/i18n/locales/en-GB.d.ts +7 -0
- package/dist/types/i18n/locales/es-ES.d.ts +7 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +7 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +7 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +7 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +7 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +7 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +7 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +7 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +7 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +7 -0
- package/dist/types/i18n/util.d.ts +8 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/out/base-fraud-detection.d.ts +1 -0
- package/dist/types/out/config.d.ts +1 -1
- package/dist/types/out/fraud-detection.d.ts +3 -12
- package/dist/types/out/types.d.ts +7 -6
- package/dist/types/out/worldpay-ddc-manager.d.ts +7 -7
- package/dist/types/types/event.d.ts +30 -3
- package/dist/types/types/index.d.ts +14 -0
- package/dist/types/types/message.d.ts +27 -4
- package/dist/types/types/payment.d.ts +30 -3
- package/dist/types/utils/app-payment.d.ts +1 -0
- package/dist/types/utils/array.d.ts +17 -0
- package/dist/types/utils/business/amount.d.ts +7 -0
- package/dist/types/utils/business/index.d.ts +1 -0
- package/dist/types/utils/detect.d.ts +3 -0
- package/dist/types/utils/iframe.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -6
- package/dist/types/utils/number.d.ts +4 -0
- package/dist/types/utils/payment.d.ts +10 -10
- package/dist/types/utils/redirect.d.ts +10 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +4 -0
- package/package.json +11 -5
- package/dist/es/api/modules/ali-pay/index.js +0 -16
- package/dist/es/api/modules/boost/index.js +0 -16
- package/dist/es/api/modules/gcash/index.js +0 -16
- package/dist/es/api/modules/grab-pay/index.js +0 -16
- package/dist/es/api/modules/line-pay/index.js +0 -16
- package/dist/es/api/modules/may-bank-qr-pay/index.js +0 -16
- package/dist/es/api/modules/nine-pay/index.js +0 -16
- package/dist/es/api/modules/opay-wallet/index.js +0 -16
- package/dist/es/api/modules/paga-wallet/index.js +0 -16
- package/dist/es/api/modules/paymaya/index.js +0 -16
- package/dist/es/api/modules/pic-pay/index.js +0 -16
- package/dist/es/api/modules/pix/index.js +0 -16
- package/dist/es/api/modules/shopee-pay/index.js +0 -16
- package/dist/es/api/modules/tng-wallet/index.js +0 -16
- package/dist/es/api/modules/wechat-pay/index.js +0 -16
- package/dist/es/api/modules/zalopay/index.js +0 -16
- package/dist/es/components/AliPay/index.js +0 -330
- package/dist/es/components/Boost/index.js +0 -349
- package/dist/es/components/GrabPay/index.js +0 -349
- package/dist/es/components/LinePay/index.js +0 -349
- package/dist/es/components/MayBankQRPay/index.js +0 -355
- package/dist/es/components/NinePay/index.js +0 -349
- package/dist/es/components/ShopeePay/index.js +0 -349
- package/dist/es/components/TNGWallet/index.js +0 -349
- package/dist/es/components/WechatPay/index.js +0 -339
- package/dist/es/hooks/usePayment.js +0 -14
- package/dist/types/api/modules/ali-pay/index.d.ts +0 -4
- package/dist/types/api/modules/boost/index.d.ts +0 -4
- package/dist/types/api/modules/gcash/index.d.ts +0 -4
- package/dist/types/api/modules/grab-pay/index.d.ts +0 -4
- package/dist/types/api/modules/line-pay/index.d.ts +0 -4
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +0 -4
- package/dist/types/api/modules/nine-pay/index.d.ts +0 -4
- package/dist/types/api/modules/opay-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paga-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paymaya/index.d.ts +0 -4
- package/dist/types/api/modules/pic-pay/index.d.ts +0 -4
- package/dist/types/api/modules/pix/index.d.ts +0 -4
- package/dist/types/api/modules/shopee-pay/index.d.ts +0 -4
- package/dist/types/api/modules/tng-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/vietqr/index.d.ts +0 -4
- package/dist/types/api/modules/wechat-pay/index.d.ts +0 -4
- package/dist/types/api/modules/zalopay/index.d.ts +0 -4
- package/dist/types/components/AliPay/type.d.ts +0 -26
- package/dist/types/components/Boost/type.d.ts +0 -28
- package/dist/types/components/GrabPay/type.d.ts +0 -28
- package/dist/types/components/LinePay/type.d.ts +0 -28
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +0 -10
- package/dist/types/components/MayBankQRPay/type.d.ts +0 -28
- package/dist/types/components/NinePay/NinePay.d.ts +0 -10
- package/dist/types/components/NinePay/type.d.ts +0 -28
- package/dist/types/components/ShopeePay/type.d.ts +0 -28
- package/dist/types/components/TNGWallet/type.d.ts +0 -28
- package/dist/types/components/WechatPay/WechatPay.d.ts +0 -10
- package/dist/types/components/WechatPay/type.d.ts +0 -28
- package/dist/types/hooks/usePayment.d.ts +0 -8
- package/dist/types/utils/behavior-tracker.d.ts +0 -36
- /package/dist/es/components/internal/Button/{button2.js → button.js} +0 -0
- /package/dist/types/components/{AliPay → wallets/AliPay}/index.d.ts +0 -0
- /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
- /package/dist/types/components/{WechatPay → wallets/WechatPay}/index.d.ts +0 -0
|
@@ -3,7 +3,7 @@ import { COMMON_CLASS_NAME } from "../../constant.js";
|
|
|
3
3
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
4
4
|
import "../../core/context.js";
|
|
5
5
|
import { clamp } from "../../utils/index.js";
|
|
6
|
-
import "../../out/
|
|
6
|
+
import "../../out/fraud-detection.js";
|
|
7
7
|
import { getSupportedCardBrands, getCardBrandInfo } from "../../utils/card-brand/index.js";
|
|
8
8
|
import { normalizedClass } from "../../utils/format.js";
|
|
9
9
|
const { bem } = useBEM("card-brands");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { w, A, F, h, u } from "../../core.js";
|
|
2
2
|
import { isExpired } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -14,7 +14,7 @@ import { formatExpireDateOnInsert, formatExpireDateOnPaste } from "../../utils/e
|
|
|
14
14
|
import { limitedToNumber } from "../../utils/format.js";
|
|
15
15
|
import { isUndefined } from "../../utils/is.js";
|
|
16
16
|
const CardExpireDateField = w((props, ref) => {
|
|
17
|
-
const { className, style, security, showLabel } = props;
|
|
17
|
+
const { className, style, security, showLabel, disabled } = props;
|
|
18
18
|
const inputRef = A(null);
|
|
19
19
|
const formItemRef = A(null);
|
|
20
20
|
F(ref, () => ({
|
|
@@ -120,6 +120,7 @@ const CardExpireDateField = w((props, ref) => {
|
|
|
120
120
|
ref: inputRef,
|
|
121
121
|
maxLength: 5,
|
|
122
122
|
value,
|
|
123
|
+
disabled,
|
|
123
124
|
onInput,
|
|
124
125
|
placeholder: i18n.get("card.cardExpireDate.placeholder"),
|
|
125
126
|
children: security && /* @__PURE__ */ u("div", { style: "width:100%;height:100%", "data-sf": EFieldType.EXPIRE_DATE })
|
|
@@ -2,8 +2,8 @@ import { u } from "../../core.js";
|
|
|
2
2
|
import "../../utils/card-brand/brands.js";
|
|
3
3
|
import "../../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
5
|
+
import "../../out/fraud-detection.js";
|
|
5
6
|
import "../../core/context.js";
|
|
6
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
7
7
|
import "../internal/Form/type.js";
|
|
8
8
|
import "../internal/Form/context.js";
|
|
9
9
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A, h, u } from "../../core.js";
|
|
2
2
|
import { clamp } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -5,10 +5,10 @@ import "../../core/context.js";
|
|
|
5
5
|
import "../../utils/card-brand/brands.js";
|
|
6
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import { normalizedClass } from "../../utils/format.js";
|
|
8
|
-
import "../../out/
|
|
8
|
+
import "../../out/fraud-detection.js";
|
|
9
9
|
const { bem } = useBEM("card-no");
|
|
10
10
|
const CardNo = (props) => {
|
|
11
|
-
const { value, className, style } = props;
|
|
11
|
+
const { value, className, style, disabled } = props;
|
|
12
12
|
return /* @__PURE__ */ u(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
@@ -18,7 +18,7 @@ const CardNo = (props) => {
|
|
|
18
18
|
Array.from({ length: 4 }, (_, i) => i).map(() => {
|
|
19
19
|
return /* @__PURE__ */ u("span", { className: bem("dot") });
|
|
20
20
|
}),
|
|
21
|
-
/* @__PURE__ */ u("span", { className: bem("card-no"), children: value })
|
|
21
|
+
/* @__PURE__ */ u("span", { className: bem("card-no"), disabled, children: value })
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
24
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { w, A, F, h, y, u } from "../../core.js";
|
|
2
2
|
import { clamp } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -15,7 +15,7 @@ import { getSupportedCardBrands, getSupportedCardBrandsLengths, finCardBrandInfo
|
|
|
15
15
|
import { trimAll, limitedToNumber } from "../../utils/format.js";
|
|
16
16
|
const CardNumberField = w(
|
|
17
17
|
(props, ref) => {
|
|
18
|
-
const { supportedCardBrands = [], className, security, showLabel, onBinValue } = props;
|
|
18
|
+
const { supportedCardBrands = [], className, security, showLabel, onBinValue, disabled } = props;
|
|
19
19
|
const inputRef = A(null);
|
|
20
20
|
const formItemRef = A(null);
|
|
21
21
|
F(ref, () => ({
|
|
@@ -132,6 +132,7 @@ const CardNumberField = w(
|
|
|
132
132
|
ref: inputRef,
|
|
133
133
|
maxLength: 23,
|
|
134
134
|
value,
|
|
135
|
+
disabled,
|
|
135
136
|
onInput,
|
|
136
137
|
rightIcon: RightIcon(),
|
|
137
138
|
placeholder: i18n.get("card.cardNumber.placeholder"),
|
|
@@ -5,8 +5,8 @@ import "../../utils/system-info/get-browser-info.js";
|
|
|
5
5
|
import { limitedToNumber } from "../../utils/format.js";
|
|
6
6
|
import { EFieldType } from "../SecuredFieldsProvider/index.js";
|
|
7
7
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
8
|
+
import "../../out/fraud-detection.js";
|
|
8
9
|
import "../../core/context.js";
|
|
9
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
10
10
|
import "../internal/Form/type.js";
|
|
11
11
|
import "../internal/Form/context.js";
|
|
12
12
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -14,7 +14,7 @@ import "../internal/Form/Form.js";
|
|
|
14
14
|
import { Input } from "../internal/Input/Input.js";
|
|
15
15
|
import "../internal/Input/type.js";
|
|
16
16
|
const CardSecurityCodeField = w((props, ref) => {
|
|
17
|
-
const { className, style, security, showLabel } = props;
|
|
17
|
+
const { className, style, security, showLabel, disabled } = props;
|
|
18
18
|
const inputRef = A(null);
|
|
19
19
|
const formItemRef = A(null);
|
|
20
20
|
F(ref, () => ({
|
|
@@ -75,6 +75,7 @@ const CardSecurityCodeField = w((props, ref) => {
|
|
|
75
75
|
ref: inputRef,
|
|
76
76
|
maxLength: 4,
|
|
77
77
|
value,
|
|
78
|
+
disabled,
|
|
78
79
|
onInput,
|
|
79
80
|
placeholder: i18n.get("card.cardSecurityCode.placeholder"),
|
|
80
81
|
children: security && /* @__PURE__ */ u("div", { style: "width:100%;height:100%", "data-sf": EFieldType.CVV })
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { A, h, y, u } from "../../core.js";
|
|
2
2
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import { finCardBrandInfoByCode } from "../../utils/card-brand/index.js";
|
|
5
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
6
7
|
import "../../core/context.js";
|
|
7
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
8
8
|
import "../internal/Form/type.js";
|
|
9
9
|
import "../internal/Form/context.js";
|
|
10
10
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
11
11
|
import "../internal/Form/Form.js";
|
|
12
12
|
import { Select } from "../internal/Select/Select.js";
|
|
13
|
-
import { Button } from "../internal/Button/
|
|
13
|
+
import { Button } from "../internal/Button/Button2.js";
|
|
14
14
|
import { CardNo } from "../CardNo/index.js";
|
|
15
15
|
import { IconCardNo } from "../internal/icons/IconCardNo.js";
|
|
16
16
|
import { IconSwitch } from "../internal/icons/IconSwitch.js";
|
|
17
17
|
import { IconAdd } from "../internal/icons/IconAdd.js";
|
|
18
18
|
const CardSelector = (props) => {
|
|
19
|
-
const { cardList = [], onCardChange, onClickEdit, className, style, onClickChange, value } = props;
|
|
19
|
+
const { cardList = [], onCardChange, onClickEdit, className, style, onClickChange, value, disabled } = props;
|
|
20
20
|
const { i18n } = useI18n();
|
|
21
21
|
const { bem } = useBEM("card-selector");
|
|
22
22
|
const selectRef = A(null);
|
|
@@ -55,7 +55,7 @@ const CardSelector = (props) => {
|
|
|
55
55
|
] });
|
|
56
56
|
};
|
|
57
57
|
const getChangeIcon = () => {
|
|
58
|
-
return /* @__PURE__ */ u("div", { className: bem("change"), onClick: onClickChange, children: [
|
|
58
|
+
return /* @__PURE__ */ u("div", { className: bem("change", { disabled }), onClick: onClickChange, children: [
|
|
59
59
|
/* @__PURE__ */ u(IconSwitch, {}),
|
|
60
60
|
/* @__PURE__ */ u("span", { style: { marginLeft: "4px" }, children: i18n.get("card.cardSelector.change") })
|
|
61
61
|
] });
|
|
@@ -91,6 +91,7 @@ const CardSelector = (props) => {
|
|
|
91
91
|
{
|
|
92
92
|
value: currToken,
|
|
93
93
|
ref: selectRef,
|
|
94
|
+
disabled,
|
|
94
95
|
options: formatCardOptions(),
|
|
95
96
|
renderLabel,
|
|
96
97
|
onSelect: onSelectCard,
|
|
@@ -12,8 +12,8 @@ import { trimAll } from "../../utils/format.js";
|
|
|
12
12
|
import { IconCardNo } from "../internal/icons/IconCardNo.js";
|
|
13
13
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
14
14
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
15
|
+
import "../../out/fraud-detection.js";
|
|
15
16
|
import "../../core/context.js";
|
|
16
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
17
17
|
const { bem } = useBEM("combined-card-info");
|
|
18
18
|
const CombinedCardInfo = w(
|
|
19
19
|
(props, ref) => {
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { CoreContext } from "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
|
-
import { CardPaymentMethods, PaymentMethod, PaymentCategory, SessionMode, PaymentMethod2CategoryMap } from "../../constant.js";
|
|
1
|
+
import { w, h, A, F, y, u, b } from "../../core.js";
|
|
2
|
+
import { CardPaymentMethods, PaymentMethod, PaymentCategory, PaymentMethod2CategoryMap, SessionMode } from "../../constant.js";
|
|
7
3
|
import { Card } from "../Card/index.js";
|
|
8
4
|
import { ApplePay } from "../ApplePay/index.js";
|
|
9
5
|
import { GooglePay } from "../GooglePay/index.js";
|
|
10
|
-
import { Boost } from "../Boost/
|
|
11
|
-
import { NinePay } from "../NinePay/
|
|
12
|
-
import { LinePay } from "../LinePay/
|
|
13
|
-
import { TNGWallet } from "../TNGWallet/
|
|
14
|
-
import { MayBankQRPay } from "../MayBankQRPay/
|
|
15
|
-
import { ShopeePay } from "../ShopeePay/
|
|
16
|
-
import { GrabPay } from "../GrabPay/
|
|
6
|
+
import { Boost } from "../wallets/Boost/Boost.js";
|
|
7
|
+
import { NinePay } from "../wallets/NinePay/NinePay.js";
|
|
8
|
+
import { LinePay } from "../wallets/LinePay/LinePay.js";
|
|
9
|
+
import { TNGWallet } from "../wallets/TNGWallet/TNGWallet.js";
|
|
10
|
+
import { MayBankQRPay } from "../wallets/MayBankQRPay/MayBankQRPay.js";
|
|
11
|
+
import { ShopeePay } from "../wallets/ShopeePay/ShopeePay.js";
|
|
12
|
+
import { GrabPay } from "../wallets/GrabPay/GrabPay.js";
|
|
17
13
|
import { GCash } from "../wallets/GCash/GCash.js";
|
|
18
14
|
import { Paymaya } from "../wallets/Paymaya/Paymaya.js";
|
|
19
15
|
import { Zalopay } from "../wallets/Zalopay/Zalopay.js";
|
|
@@ -29,9 +25,14 @@ import { IDeal } from "../wallets/IDeal/IDeal.js";
|
|
|
29
25
|
import { Skrill } from "../wallets/Skrill/Skrill.js";
|
|
30
26
|
import { P24 } from "../wallets/P24/P24.js";
|
|
31
27
|
import { Trustly } from "../wallets/Trustly/Trustly.js";
|
|
28
|
+
import { AliPay } from "../wallets/AliPay/AliPay.js";
|
|
29
|
+
import { WechatPay } from "../wallets/WechatPay/WechatPay.js";
|
|
32
30
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
33
|
-
import {
|
|
31
|
+
import { CoreContext } from "../../core/context.js";
|
|
32
|
+
import "../../utils/card-brand/brands.js";
|
|
33
|
+
import "../../utils/system-info/get-browser-info.js";
|
|
34
34
|
import { PayKKaError } from "../../core/error.js";
|
|
35
|
+
import "../../out/fraud-detection.js";
|
|
35
36
|
import { createCheckoutChild } from "../../core/create-child.js";
|
|
36
37
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
37
38
|
import { Accordion } from "../internal/Accordion/Accordion.js";
|
|
@@ -59,11 +60,15 @@ import { IconOvo } from "../internal/icons/IconOvo.js";
|
|
|
59
60
|
import { IconSkrill } from "../internal/icons/IconSkrill.js";
|
|
60
61
|
import { IconBancontact } from "../internal/icons/IconBancontact.js";
|
|
61
62
|
import { IconIdeal } from "../internal/icons/IconIdeal.js";
|
|
62
|
-
import {
|
|
63
|
+
import { IconWechatPayGlobal } from "../internal/icons/IconWechatPayGlobal.js";
|
|
64
|
+
import { IconAlipayPlus } from "../internal/icons/IconAlipayPlus.js";
|
|
65
|
+
import { intersection } from "../../utils/array.js";
|
|
63
66
|
const dropInSupportedPaymentMethods = [
|
|
64
67
|
...CardPaymentMethods,
|
|
65
68
|
PaymentMethod.GOOGLE_PAY,
|
|
66
69
|
PaymentMethod.APPLE_PAY,
|
|
70
|
+
PaymentMethod.ALI_PAY,
|
|
71
|
+
PaymentMethod.WECHAT_PAY,
|
|
67
72
|
PaymentMethod.BOOST,
|
|
68
73
|
PaymentMethod.GRAB_PAY,
|
|
69
74
|
PaymentMethod.LINE_PAY,
|
|
@@ -112,41 +117,11 @@ const PaymentComponentMap = {
|
|
|
112
117
|
[PaymentCategory.OVO]: OVO,
|
|
113
118
|
[PaymentCategory.SKRILL]: Skrill,
|
|
114
119
|
[PaymentCategory.TRUSTLY]: Trustly,
|
|
115
|
-
[PaymentCategory.P24]: P24
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
[PaymentCategory.P24]: P24,
|
|
121
|
+
[PaymentCategory.WECHAT_PAY]: WechatPay,
|
|
122
|
+
[PaymentCategory.ALI_PAY]: AliPay
|
|
118
123
|
// [PaymentCategory.SEPA_DEBIT]: Sepa
|
|
119
124
|
};
|
|
120
|
-
const { bem: bem$1 } = useBEM("payment-tabs");
|
|
121
|
-
const PaymentTabs = (props) => {
|
|
122
|
-
const { value, tabs, themeColor = "#4F43DF" } = props;
|
|
123
|
-
const handleClickTab = (tab) => {
|
|
124
|
-
var _a;
|
|
125
|
-
if (tab.type === value) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
(_a = props.onChange) == null ? void 0 : _a.call(props, tab.type);
|
|
129
|
-
};
|
|
130
|
-
return /* @__PURE__ */ u("div", { className: bem$1(), children: tabs.map((tab) => /* @__PURE__ */ u(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
className: bem$1("tab"),
|
|
134
|
-
style: tab.type === value ? { borderColor: themeColor } : "",
|
|
135
|
-
onClick: () => handleClickTab(tab),
|
|
136
|
-
children: [
|
|
137
|
-
tab.icon,
|
|
138
|
-
/* @__PURE__ */ u(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
className: bem$1("name"),
|
|
142
|
-
style: tab.type === value ? { color: themeColor } : "",
|
|
143
|
-
children: tab.name
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
)) });
|
|
149
|
-
};
|
|
150
125
|
const paymentCategoryOptionMap = {
|
|
151
126
|
[PaymentCategory.CARD]: {
|
|
152
127
|
icon: IconCard2,
|
|
@@ -239,45 +214,114 @@ const paymentCategoryOptionMap = {
|
|
|
239
214
|
[PaymentCategory.P24]: {
|
|
240
215
|
icon: IconP24,
|
|
241
216
|
nameKey: "dropIn.p24.label"
|
|
217
|
+
},
|
|
218
|
+
[PaymentCategory.ALI_PAY]: {
|
|
219
|
+
icon: IconAlipayPlus,
|
|
220
|
+
nameKey: "dropIn.aliPay.label"
|
|
221
|
+
},
|
|
222
|
+
[PaymentCategory.WECHAT_PAY]: {
|
|
223
|
+
icon: IconWechatPayGlobal,
|
|
224
|
+
nameKey: "dropIn.wechatPay.label"
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const HEADER_CATEGORIES = [
|
|
228
|
+
PaymentCategory.APPLE_PAY,
|
|
229
|
+
PaymentCategory.GOOGLE_PAY
|
|
230
|
+
];
|
|
231
|
+
const toDropInCategories = (methods) => {
|
|
232
|
+
const categories = [];
|
|
233
|
+
const added = /* @__PURE__ */ new Set();
|
|
234
|
+
const add = (category) => {
|
|
235
|
+
if (added.has(category))
|
|
236
|
+
return;
|
|
237
|
+
added.add(category);
|
|
238
|
+
categories.push(category);
|
|
239
|
+
};
|
|
240
|
+
const cpy = [...methods];
|
|
241
|
+
if (intersection(cpy, CardPaymentMethods).length) {
|
|
242
|
+
add(PaymentCategory.CARD);
|
|
243
|
+
CardPaymentMethods.forEach((m) => {
|
|
244
|
+
const i = cpy.indexOf(m);
|
|
245
|
+
if (i > -1)
|
|
246
|
+
cpy.splice(i, 1);
|
|
247
|
+
});
|
|
242
248
|
}
|
|
249
|
+
cpy.forEach((method) => {
|
|
250
|
+
const category = PaymentMethod2CategoryMap[method];
|
|
251
|
+
category && add(category);
|
|
252
|
+
});
|
|
253
|
+
return categories;
|
|
254
|
+
};
|
|
255
|
+
const sortByOrder = (items, order = []) => {
|
|
256
|
+
const orderIndex = new Map(order.map((item, index) => [item, index]));
|
|
257
|
+
return [...items].sort((a, b2) => {
|
|
258
|
+
const ai = orderIndex.get(a);
|
|
259
|
+
const bi = orderIndex.get(b2);
|
|
260
|
+
if (ai !== void 0 && bi !== void 0)
|
|
261
|
+
return ai - bi;
|
|
262
|
+
if (ai !== void 0)
|
|
263
|
+
return -1;
|
|
264
|
+
if (bi !== void 0)
|
|
265
|
+
return 1;
|
|
266
|
+
return items.indexOf(a) - items.indexOf(b2);
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
const resolveDropInDisplayCategories = (options) => {
|
|
270
|
+
const { supportMethods, layout } = options;
|
|
271
|
+
const enabledMethods = intersection(supportMethods, dropInSupportedPaymentMethods);
|
|
272
|
+
const defaultCategories = toDropInCategories(enabledMethods);
|
|
273
|
+
const hidden = new Set((layout == null ? void 0 : layout.hidden) ?? []);
|
|
274
|
+
const visible = defaultCategories.filter((c) => !hidden.has(c));
|
|
275
|
+
return sortByOrder(visible, layout == null ? void 0 : layout.order);
|
|
276
|
+
};
|
|
277
|
+
const splitHeaderAndMain = (categories) => {
|
|
278
|
+
const header = [];
|
|
279
|
+
const main = [];
|
|
280
|
+
categories.forEach((category) => {
|
|
281
|
+
if (HEADER_CATEGORIES.includes(category)) {
|
|
282
|
+
header.push(category);
|
|
283
|
+
} else {
|
|
284
|
+
main.push(category);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
return { header, main };
|
|
243
288
|
};
|
|
244
289
|
const { bem } = useBEM("drop-in");
|
|
245
290
|
const DropIn = w((props, ref) => {
|
|
291
|
+
var _a;
|
|
246
292
|
const {
|
|
247
293
|
paymentMethods: paymentMethodsConfig,
|
|
248
|
-
layout =
|
|
294
|
+
// layout = 'accordion',
|
|
249
295
|
session,
|
|
250
296
|
core,
|
|
251
|
-
enableAccordionTransition = true
|
|
297
|
+
enableAccordionTransition = true,
|
|
298
|
+
paymentMethodLayout
|
|
252
299
|
} = props;
|
|
253
300
|
const { i18n, sessionReady } = usePayState(session, props.core);
|
|
254
301
|
const [paymentCategoryOptions, setPaymentCategoryOptions] = h([]);
|
|
255
302
|
const [activePaymentCategory, setActivePaymentCategory] = h();
|
|
256
303
|
const [enablePaymentMethod, setEnablePaymentMethod] = h();
|
|
257
|
-
const [headerPaymentCategories, setHeaderPaymentCategories] = h(
|
|
258
|
-
[]
|
|
259
|
-
);
|
|
304
|
+
const [headerPaymentCategories, setHeaderPaymentCategories] = h([]);
|
|
260
305
|
const [paymentCategories, setPaymentCategories] = h([]);
|
|
261
306
|
const componentMountRefMap = A({});
|
|
262
307
|
const componentInstMap = A({});
|
|
263
308
|
F(ref, () => ({
|
|
264
309
|
payment: () => {
|
|
265
|
-
var
|
|
310
|
+
var _a2, _b;
|
|
266
311
|
if (activePaymentCategory) {
|
|
267
|
-
const instRef = (
|
|
312
|
+
const instRef = (_a2 = componentInstMap.current[activePaymentCategory]) == null ? void 0 : _a2.ref;
|
|
268
313
|
(_b = instRef == null ? void 0 : instRef.payment) == null ? void 0 : _b.call(instRef);
|
|
269
314
|
}
|
|
270
315
|
}
|
|
271
316
|
}));
|
|
272
317
|
y(() => {
|
|
273
|
-
var
|
|
274
|
-
if (!activePaymentCategory)
|
|
318
|
+
var _a2, _b;
|
|
319
|
+
if (!activePaymentCategory)
|
|
275
320
|
return;
|
|
276
|
-
}
|
|
277
321
|
const currCompInst = componentInstMap.current[activePaymentCategory];
|
|
278
322
|
if (currCompInst) {
|
|
279
323
|
const ref2 = currCompInst.ref;
|
|
280
|
-
(
|
|
324
|
+
(_a2 = ref2.updateAddress) == null ? void 0 : _a2.call(ref2);
|
|
281
325
|
(_b = ref2.updateEmail) == null ? void 0 : _b.call(ref2);
|
|
282
326
|
}
|
|
283
327
|
}, [activePaymentCategory]);
|
|
@@ -289,13 +333,12 @@ const DropIn = w((props, ref) => {
|
|
|
289
333
|
}
|
|
290
334
|
}, [paymentCategories]);
|
|
291
335
|
y(() => {
|
|
292
|
-
|
|
293
|
-
renderComponent(
|
|
294
|
-
|
|
295
|
-
}
|
|
336
|
+
headerPaymentCategories == null ? void 0 : headerPaymentCategories.forEach((category) => {
|
|
337
|
+
renderComponent(category);
|
|
338
|
+
});
|
|
296
339
|
}, [headerPaymentCategories]);
|
|
297
340
|
const createComponent = (category) => {
|
|
298
|
-
const { onError, onSuccess, onTimeout, onExpired, onSubmit, onAuthorized } = props;
|
|
341
|
+
const { onError, onSuccess, onTimeout, onExpired, onSubmit, onAuthorized, onSubmitResponse } = props;
|
|
299
342
|
return createCheckoutChild(
|
|
300
343
|
props.core,
|
|
301
344
|
PaymentComponentMap[category],
|
|
@@ -305,7 +348,8 @@ const DropIn = w((props, ref) => {
|
|
|
305
348
|
onTimeout,
|
|
306
349
|
onExpired,
|
|
307
350
|
onSubmit,
|
|
308
|
-
onAuthorized
|
|
351
|
+
onAuthorized,
|
|
352
|
+
onSubmitResponse
|
|
309
353
|
},
|
|
310
354
|
{
|
|
311
355
|
...paymentMethodsConfig == null ? void 0 : paymentMethodsConfig[category],
|
|
@@ -321,63 +365,32 @@ const DropIn = w((props, ref) => {
|
|
|
321
365
|
componentInstMap.current[category] = inst;
|
|
322
366
|
}
|
|
323
367
|
};
|
|
324
|
-
const initPaymentCategories = (
|
|
325
|
-
const
|
|
326
|
-
const paymentCategoryOptions2 =
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
const isCardEnable = !!intersection(cpyEnablePaymentMethods, CardPaymentMethods).length;
|
|
338
|
-
if (isCardEnable) {
|
|
339
|
-
paymentCategories2.push(PaymentCategory.CARD);
|
|
340
|
-
paymentCategoryOptions2.push({
|
|
341
|
-
type: PaymentCategory.CARD,
|
|
342
|
-
icon: () => {
|
|
343
|
-
const Icon = paymentCategoryOptionMap[PaymentCategory.CARD].icon;
|
|
344
|
-
return Icon ? /* @__PURE__ */ u(Icon, { size: 24 }) : null;
|
|
345
|
-
},
|
|
346
|
-
name: i18n.get(paymentCategoryOptionMap[PaymentCategory.CARD].nameKey)
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
cpyEnablePaymentMethods.forEach((method) => {
|
|
350
|
-
if (cpyEnablePaymentMethods.includes(method)) {
|
|
351
|
-
const type = PaymentMethod2CategoryMap[method];
|
|
352
|
-
if (type) {
|
|
353
|
-
paymentCategories2.push(type);
|
|
354
|
-
paymentCategoryOptions2.push({
|
|
355
|
-
type,
|
|
356
|
-
icon: () => {
|
|
357
|
-
const Icon = paymentCategoryOptionMap[type].icon;
|
|
358
|
-
return Icon ? /* @__PURE__ */ u(Icon, { size: 24 }) : null;
|
|
359
|
-
},
|
|
360
|
-
name: i18n.get(paymentCategoryOptionMap[type].nameKey)
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
if (paymentCategoryOptions2.length) {
|
|
366
|
-
setPaymentCategoryOptions(paymentCategoryOptions2);
|
|
368
|
+
const initPaymentCategories = (displayCategories) => {
|
|
369
|
+
const { header, main } = splitHeaderAndMain(displayCategories);
|
|
370
|
+
const paymentCategoryOptions2 = main.map((category) => ({
|
|
371
|
+
type: category,
|
|
372
|
+
icon: () => {
|
|
373
|
+
const Icon = paymentCategoryOptionMap[category].icon;
|
|
374
|
+
const iconHeight = 24;
|
|
375
|
+
return Icon ? /* @__PURE__ */ u(Icon, { size: category === PaymentCategory.ALI_PAY ? 20 : iconHeight }) : null;
|
|
376
|
+
},
|
|
377
|
+
name: i18n.get(paymentCategoryOptionMap[category].nameKey)
|
|
378
|
+
}));
|
|
379
|
+
if (paymentCategoryOptions2.length === 1) {
|
|
367
380
|
setActivePaymentCategory(paymentCategoryOptions2[0].type);
|
|
368
381
|
}
|
|
369
|
-
|
|
370
|
-
|
|
382
|
+
setPaymentCategoryOptions(paymentCategoryOptions2);
|
|
383
|
+
setHeaderPaymentCategories(header);
|
|
384
|
+
setPaymentCategories(main);
|
|
371
385
|
};
|
|
372
386
|
const handlePaymentCategoryChange = (newPaymentCategory) => {
|
|
373
387
|
setActivePaymentCategory(newPaymentCategory);
|
|
374
388
|
};
|
|
375
389
|
y(() => {
|
|
376
|
-
var
|
|
377
|
-
if (!sessionReady || !i18n.ready.value)
|
|
390
|
+
var _a2, _b, _c, _d;
|
|
391
|
+
if (!sessionReady || !i18n.ready.value)
|
|
378
392
|
return;
|
|
379
|
-
|
|
380
|
-
if (((_a = session.checkout) == null ? void 0 : _a.sessionMode) === SessionMode.COMPONENT) {
|
|
393
|
+
if (((_a2 = session.checkout) == null ? void 0 : _a2.sessionMode) === SessionMode.COMPONENT) {
|
|
381
394
|
(_c = (_b = props.core.config).onInitError) == null ? void 0 : _c.call(
|
|
382
395
|
_b,
|
|
383
396
|
new PayKKaError("ERROR", "Please send the correct session when creating the checkout")
|
|
@@ -385,29 +398,29 @@ const DropIn = w((props, ref) => {
|
|
|
385
398
|
return;
|
|
386
399
|
}
|
|
387
400
|
const { supportMethods = [] } = (session == null ? void 0 : session.checkout) || {};
|
|
388
|
-
const
|
|
401
|
+
const displayCategories = resolveDropInDisplayCategories({
|
|
389
402
|
supportMethods,
|
|
390
|
-
|
|
391
|
-
);
|
|
392
|
-
if (!
|
|
403
|
+
layout: paymentMethodLayout
|
|
404
|
+
});
|
|
405
|
+
if (!displayCategories.length)
|
|
393
406
|
return;
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
if (
|
|
397
|
-
const category = PaymentMethod2CategoryMap[
|
|
407
|
+
initPaymentCategories(displayCategories);
|
|
408
|
+
const currPaymentMethod = (_d = core.payment) == null ? void 0 : _d.currPaymentMethod.value;
|
|
409
|
+
if (currPaymentMethod) {
|
|
410
|
+
const category = PaymentMethod2CategoryMap[currPaymentMethod];
|
|
398
411
|
category && setActivePaymentCategory(category);
|
|
399
|
-
core.enablePaymentMethod.value = core.processingPaymentMethod;
|
|
400
412
|
}
|
|
401
413
|
}, [sessionReady, i18n.ready.value]);
|
|
402
414
|
y(() => {
|
|
403
|
-
|
|
415
|
+
var _a2, _b;
|
|
416
|
+
if ((_a2 = core.payment) == null ? void 0 : _a2.currPaymentMethod.value) {
|
|
404
417
|
setEnablePaymentMethod(
|
|
405
|
-
PaymentMethod2CategoryMap[core.
|
|
418
|
+
PaymentMethod2CategoryMap[(_b = core.payment) == null ? void 0 : _b.currPaymentMethod.value]
|
|
406
419
|
);
|
|
407
420
|
} else {
|
|
408
421
|
setEnablePaymentMethod(void 0);
|
|
409
422
|
}
|
|
410
|
-
}, [core.
|
|
423
|
+
}, [(_a = core.payment) == null ? void 0 : _a.currPaymentMethod.value]);
|
|
411
424
|
const HeaderField = () => {
|
|
412
425
|
return /* @__PURE__ */ u(b, { children: headerPaymentCategories == null ? void 0 : headerPaymentCategories.map((category) => /* @__PURE__ */ u(
|
|
413
426
|
"div",
|
|
@@ -428,7 +441,7 @@ const DropIn = w((props, ref) => {
|
|
|
428
441
|
HeaderField(),
|
|
429
442
|
!!paymentCategoryOptions.length && /* @__PURE__ */ u(b, { children: [
|
|
430
443
|
OtherLine(),
|
|
431
|
-
|
|
444
|
+
/* @__PURE__ */ u("div", { className: bem("accordion-wrapper"), children: /* @__PURE__ */ u(
|
|
432
445
|
Accordion,
|
|
433
446
|
{
|
|
434
447
|
value: activePaymentCategory,
|
|
@@ -451,23 +464,7 @@ const DropIn = w((props, ref) => {
|
|
|
451
464
|
}
|
|
452
465
|
))
|
|
453
466
|
}
|
|
454
|
-
) })
|
|
455
|
-
/* @__PURE__ */ u("div", { className: bem("tabs-wrapper"), children: /* @__PURE__ */ u(
|
|
456
|
-
PaymentTabs,
|
|
457
|
-
{
|
|
458
|
-
value: activePaymentCategory,
|
|
459
|
-
tabs: paymentCategoryOptions,
|
|
460
|
-
onChange: (item) => handlePaymentCategoryChange(item)
|
|
461
|
-
}
|
|
462
|
-
) }),
|
|
463
|
-
paymentCategories == null ? void 0 : paymentCategories.map((category) => /* @__PURE__ */ u(
|
|
464
|
-
"div",
|
|
465
|
-
{
|
|
466
|
-
style: { display: category === activePaymentCategory ? "block" : "none" },
|
|
467
|
-
ref: (el) => componentMountRefMap.current[category] = el
|
|
468
|
-
}
|
|
469
|
-
))
|
|
470
|
-
] })
|
|
467
|
+
) })
|
|
471
468
|
] })
|
|
472
469
|
] }) });
|
|
473
470
|
});
|
|
@@ -10,8 +10,8 @@ import "../../utils/card-brand/brands.js";
|
|
|
10
10
|
import "../../utils/system-info/get-browser-info.js";
|
|
11
11
|
import { EMAIL_REG } from "../../utils/reg-exp.js";
|
|
12
12
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
13
|
+
import "../../out/fraud-detection.js";
|
|
13
14
|
import "../../core/context.js";
|
|
14
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
15
15
|
import "../internal/Form/type.js";
|
|
16
16
|
import "../internal/Form/context.js";
|
|
17
17
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -4,13 +4,15 @@ import { create } from "../../core/create.js";
|
|
|
4
4
|
import { w, F, h, A, y, u } from "../../core.js";
|
|
5
5
|
import "../../utils/card-brand/brands.js";
|
|
6
6
|
import { getBrowserInfo } from "../../utils/system-info/get-browser-info.js";
|
|
7
|
-
import "../../out/
|
|
7
|
+
import "../../out/fraud-detection.js";
|
|
8
8
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
9
9
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
10
|
-
import { intersection } from "../../utils/index.js";
|
|
11
|
-
import { defaultInputStyleConfig } from "../../types/index.js";
|
|
12
10
|
import { createPromise } from "../../utils/create-promise.js";
|
|
11
|
+
import { separateInputStyle, genComponentStyle, loadStyle } from "../../utils/style.js";
|
|
13
12
|
import { EFieldType, SecuredFieldsProvider } from "../SecuredFieldsProvider/index.js";
|
|
13
|
+
import { intersection } from "../../utils/array.js";
|
|
14
|
+
import { genShortId } from "../../utils/string.js";
|
|
15
|
+
import { defaultInputStyleConfig } from "../../types/index.js";
|
|
14
16
|
import { CardNumberField } from "../CardNumberField/index.js";
|
|
15
17
|
import { CardExpireDateField } from "../CardExpireDateField/index.js";
|
|
16
18
|
import { CardSecurityCodeField } from "../CardSecurityCodeField/index.js";
|
|
@@ -22,8 +24,6 @@ import "../internal/Form/Form.js";
|
|
|
22
24
|
import { CombinedCardInfo } from "../CombinedCardInfo/index.js";
|
|
23
25
|
import "../internal/Input/Input.js";
|
|
24
26
|
import { inputWrapperClassName } from "../internal/Input/type.js";
|
|
25
|
-
import { separateInputStyle, genComponentStyle, loadStyle } from "../../utils/style.js";
|
|
26
|
-
import { genShortId } from "../../utils/string.js";
|
|
27
27
|
const ENCRYPTED_CARD_WRAPPER_ID = "encryptedCardWrapper";
|
|
28
28
|
const ENCRYPTED_CARD_ITEM_ATTR = "data-eci";
|
|
29
29
|
var EEncryptedCardType = /* @__PURE__ */ ((EEncryptedCardType2) => {
|