@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
package/dist/es/api/http.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../core.js";
|
|
|
4
4
|
import { safeStringify } from "../utils/index.js";
|
|
5
5
|
import { getFetch } from "./fetch.js";
|
|
6
6
|
import { PayKKaError, EPayKKaError } from "../core/error.js";
|
|
7
|
-
import "../out/
|
|
7
|
+
import "../out/fraud-detection.js";
|
|
8
8
|
import { getBrowserInfo } from "../utils/system-info/get-browser-info.js";
|
|
9
9
|
const request = async (method, url, params, { timeout = 2e4, headers, locale } = {}) => {
|
|
10
10
|
const abortController = new AbortController();
|
package/dist/es/api/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RequestCacheManager } from "../../../utils/request-cache-manager.js";
|
|
2
2
|
import { apiPrefix } from "../../../config.js";
|
|
3
3
|
import { http } from "../../http.js";
|
|
4
|
-
import { getBrowserParams } from "../get-browser-params.js";
|
|
5
4
|
import { checkoutMap } from "./map.js";
|
|
6
5
|
const queryCheckout = async (params, extraParams = {}, options) => {
|
|
7
6
|
return http.post(
|
|
@@ -9,8 +8,7 @@ const queryCheckout = async (params, extraParams = {}, options) => {
|
|
|
9
8
|
{
|
|
10
9
|
session_id: params.sessionId,
|
|
11
10
|
client_key: params.clientKey,
|
|
12
|
-
...extraParams
|
|
13
|
-
browser: await getBrowserParams()
|
|
11
|
+
...extraParams
|
|
14
12
|
},
|
|
15
13
|
options
|
|
16
14
|
);
|
|
@@ -63,18 +63,25 @@ const checkoutMap = (res = {}) => {
|
|
|
63
63
|
const { payment_methods, bill, tokens } = support_methods;
|
|
64
64
|
const paymentMethodsInfo = formatPaymentMethodInfo(payment_methods);
|
|
65
65
|
const sessionMode = res.session_mode === "HOST" ? "HOSTED" : res.session_mode;
|
|
66
|
+
const transAmount = {
|
|
67
|
+
currency: res.currency,
|
|
68
|
+
symbol: res.symbol,
|
|
69
|
+
default_fraction_digits: res.default_fraction_digits,
|
|
70
|
+
...res.trans_amount
|
|
71
|
+
};
|
|
66
72
|
return {
|
|
67
73
|
country: res.country,
|
|
68
74
|
merchantId: res.merchant_id,
|
|
69
75
|
sessionId: res.session_id,
|
|
70
76
|
clientKey: res.client_key,
|
|
71
77
|
status: res.status,
|
|
72
|
-
transAmount: amountMap(
|
|
78
|
+
transAmount: amountMap(transAmount),
|
|
73
79
|
expireTime: res.expire_time,
|
|
74
80
|
paymentMethod: res.payment_method,
|
|
75
81
|
// 兼容其他收银台,没有 session_mode 字段就默认 HOSTED
|
|
76
82
|
sessionMode: sessionMode || "HOSTED",
|
|
77
|
-
|
|
83
|
+
// 兼容其他收银台,没有 merchant_name 字段就默认主题中的 merchant_name
|
|
84
|
+
merchantName: res.merchant_name || ((_a = res.theme) == null ? void 0 : _a.merchant_name),
|
|
78
85
|
returnUrl: res.return_url,
|
|
79
86
|
cancelUrl: res.cancel_url,
|
|
80
87
|
locale: res.locale,
|
|
@@ -104,6 +111,7 @@ const checkoutMap = (res = {}) => {
|
|
|
104
111
|
billingAddressFilled: card.billing_address_filled
|
|
105
112
|
})),
|
|
106
113
|
storePaymentMethod: (_b = res.payment) == null ? void 0 : _b.store_payment_method,
|
|
114
|
+
// 对于 field 需要兜底,如果后端没有传字段,则默认需要展示
|
|
107
115
|
field: {
|
|
108
116
|
holderName: {
|
|
109
117
|
show: !!(field == null ? void 0 : field.holder_name_display),
|
|
@@ -121,8 +129,8 @@ const checkoutMap = (res = {}) => {
|
|
|
121
129
|
},
|
|
122
130
|
amountBreakdown: formatAmountBreakdown(res.amount_breakdown),
|
|
123
131
|
finishTime: res.utc_finish_time,
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
rawResponse: res,
|
|
133
|
+
...paymentMethodsInfo
|
|
126
134
|
};
|
|
127
135
|
};
|
|
128
136
|
export {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cardBrandCodes } from "../../../utils/card-brand/brands.js";
|
|
2
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
3
|
+
import { intersection } from "../../../utils/array.js";
|
|
2
4
|
import { http } from "../../http.js";
|
|
3
5
|
import "../../../core.js";
|
|
4
6
|
import { formatPaymentMethodInfo } from "../checkout/map.js";
|
|
5
|
-
import { cardBrandCodes } from "../../../utils/card-brand/brands.js";
|
|
6
7
|
const verifyClientKey = async (clientKey, merchantId, options) => {
|
|
7
8
|
return http.post(
|
|
8
9
|
"/frames/info",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import "../../utils/
|
|
2
|
-
import { getBrowser } from "../../utils/system-info/index.js";
|
|
1
|
+
import { getReferrer } from "../../utils/index.js";
|
|
3
2
|
import { getFingerprint } from "../../utils/system-info/finger-print.js";
|
|
4
|
-
import {
|
|
3
|
+
import { getBrowser } from "../../utils/system-info/index.js";
|
|
5
4
|
const getTerminalType = (deviceType) => {
|
|
6
5
|
let terminalType = "WEB";
|
|
7
6
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
@@ -10,8 +9,6 @@ const getTerminalType = (deviceType) => {
|
|
|
10
9
|
terminalType = "MINI_APP";
|
|
11
10
|
} else if (userAgent.includes("micromessenger") || userAgent.includes("alipay")) {
|
|
12
11
|
terminalType = "IN_APP_WAP";
|
|
13
|
-
} else if (isUaWebview(userAgent)) {
|
|
14
|
-
terminalType = "APP";
|
|
15
12
|
} else {
|
|
16
13
|
terminalType = "WAP";
|
|
17
14
|
}
|
|
@@ -19,13 +16,12 @@ const getTerminalType = (deviceType) => {
|
|
|
19
16
|
return terminalType;
|
|
20
17
|
};
|
|
21
18
|
const getBaseBrowserParams = async (params = {}) => {
|
|
22
|
-
var _a, _b;
|
|
23
19
|
const { fraudDetectionId, origin } = params;
|
|
24
20
|
const browser = await getBrowser();
|
|
25
21
|
const terminalType = getTerminalType(browser.deviceType);
|
|
26
22
|
return {
|
|
27
23
|
origin: btoa(origin || window.location.origin),
|
|
28
|
-
referer: btoa(
|
|
24
|
+
referer: btoa(getReferrer()),
|
|
29
25
|
user_agent: browser.userAgent,
|
|
30
26
|
color_depth: browser.colorDepth,
|
|
31
27
|
language: browser.language,
|
|
@@ -39,7 +35,7 @@ const getBaseBrowserParams = async (params = {}) => {
|
|
|
39
35
|
terminal_type: terminalType,
|
|
40
36
|
fraud_detection_id: fraudDetectionId,
|
|
41
37
|
// 当前组件库版本(构建时由 define 注入)
|
|
42
|
-
app_version: "0.
|
|
38
|
+
app_version: "0.15.1"
|
|
43
39
|
};
|
|
44
40
|
};
|
|
45
41
|
const getBrowserParams = async (params = {}) => {
|
|
@@ -22,9 +22,12 @@ const payResMap = (res) => {
|
|
|
22
22
|
finishTime: res.utc_finish_time,
|
|
23
23
|
payInfo: {
|
|
24
24
|
threeDSUrl: (_a = res.authentication_result) == null ? void 0 : _a.authentication_url,
|
|
25
|
-
targetUrl: payInfo.
|
|
25
|
+
targetUrl: payInfo.request_url || payInfo.payment_url,
|
|
26
26
|
requestMethod: payInfo.request_method,
|
|
27
27
|
paymentExpiredAt: res == null ? void 0 : res.payment_expire_time,
|
|
28
|
+
action: payInfo.next_action,
|
|
29
|
+
qrCode: payInfo.qr_code || payInfo.payment_url,
|
|
30
|
+
requestData: payInfo.request_data,
|
|
28
31
|
...payInfo
|
|
29
32
|
},
|
|
30
33
|
rawResponse: res
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import "../../../utils/card-brand/brands.js";
|
|
2
2
|
import "../../../utils/system-info/get-browser-info.js";
|
|
3
3
|
import "../../../core.js";
|
|
4
|
-
import "
|
|
5
|
-
|
|
4
|
+
import { http } from "../../http.js";
|
|
5
|
+
var ThreeDSAuthOperate = /* @__PURE__ */ ((ThreeDSAuthOperate2) => {
|
|
6
|
+
ThreeDSAuthOperate2["OPEN"] = "OPEN";
|
|
7
|
+
ThreeDSAuthOperate2["CANCEL"] = "CANCEL";
|
|
8
|
+
return ThreeDSAuthOperate2;
|
|
9
|
+
})(ThreeDSAuthOperate || {});
|
|
10
|
+
const noticeThreeDSOperate = (id, operate) => {
|
|
11
|
+
return http.post("/3ds/stand-alone/notify", {
|
|
12
|
+
authentication_record_id: id,
|
|
13
|
+
operate
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
ThreeDSAuthOperate,
|
|
18
|
+
noticeThreeDSOperate
|
|
19
|
+
};
|
|
@@ -5,7 +5,7 @@ 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
|
import { AccordionContext } from "../internal/Accordion/type.js";
|
|
10
10
|
import { accordionTransition } from "../internal/Accordion/accordionTransition.js";
|
|
11
11
|
const { bem } = useBEM("accordion-item");
|
|
@@ -15,8 +15,6 @@ const AccordionItem = (props) => {
|
|
|
15
15
|
const [contentRef, setContentRef] = h(null);
|
|
16
16
|
const active = activeName === value;
|
|
17
17
|
const handleClickItem = () => {
|
|
18
|
-
if (disabled)
|
|
19
|
-
return;
|
|
20
18
|
onSelect(value);
|
|
21
19
|
};
|
|
22
20
|
y(() => {
|
|
@@ -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";
|
|
@@ -6,8 +6,8 @@ import "../../utils/card-brand/brands.js";
|
|
|
6
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
8
8
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
9
|
+
import "../../out/fraud-detection.js";
|
|
9
10
|
import { CoreContext } from "../../core/context.js";
|
|
10
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
11
11
|
import "../internal/Form/type.js";
|
|
12
12
|
import "../internal/Form/context.js";
|
|
13
13
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -47,10 +47,11 @@ const AddressField = w((props, ref) => {
|
|
|
47
47
|
if (!(context == null ? void 0 : context.core)) {
|
|
48
48
|
throw new Error("CoreContext is not found");
|
|
49
49
|
}
|
|
50
|
-
const { onChange,
|
|
50
|
+
const { onChange, allowedCountries, mode, disabled = false } = props;
|
|
51
51
|
const { i18n } = useI18n();
|
|
52
52
|
const addressCore = context.core.getAddressCore();
|
|
53
|
-
const addressMode = mode
|
|
53
|
+
const addressMode = mode || ((_a = context.core.config._checkoutConfig) == null ? void 0 : _a.addressMode) || "address";
|
|
54
|
+
const addressLabelKey = addressMode === "address" ? "address.label" : "address.country";
|
|
54
55
|
const [addressState, setAddressState] = h({ ...addressCore.getAddressState() });
|
|
55
56
|
const [countryOptions, setCountryOptions] = h(addressCore.getCountryOption() ?? []);
|
|
56
57
|
const [provinceOptions, setProvinceOptions] = h(addressCore.getProvinceOption() ?? []);
|
|
@@ -211,7 +212,7 @@ const AddressField = w((props, ref) => {
|
|
|
211
212
|
FormItem,
|
|
212
213
|
{
|
|
213
214
|
ref: countryFormItemRef,
|
|
214
|
-
label:
|
|
215
|
+
label: i18n.get(addressLabelKey),
|
|
215
216
|
path: "address.country",
|
|
216
217
|
rule: createRule(),
|
|
217
218
|
showErrorMessage: false,
|
|
@@ -219,6 +220,7 @@ const AddressField = w((props, ref) => {
|
|
|
219
220
|
Select,
|
|
220
221
|
{
|
|
221
222
|
value: addressState.country,
|
|
223
|
+
disabled,
|
|
222
224
|
filterable: true,
|
|
223
225
|
options: visibleCountryOptions,
|
|
224
226
|
onSelect: (value) => onSelectCountry(value),
|
|
@@ -242,6 +244,7 @@ const AddressField = w((props, ref) => {
|
|
|
242
244
|
Input,
|
|
243
245
|
{
|
|
244
246
|
value: addressState.address1,
|
|
247
|
+
disabled,
|
|
245
248
|
onInput: (event) => handleStateChange(EAddressType.ADDRESS_1, event.currentTarget.value),
|
|
246
249
|
placeholder: description,
|
|
247
250
|
inputClassName: className
|
|
@@ -262,6 +265,7 @@ const AddressField = w((props, ref) => {
|
|
|
262
265
|
Input,
|
|
263
266
|
{
|
|
264
267
|
value: addressState.address2,
|
|
268
|
+
disabled,
|
|
265
269
|
onInput: (event) => handleStateChange(EAddressType.ADDRESS_2, event.currentTarget.value),
|
|
266
270
|
placeholder: description,
|
|
267
271
|
inputClassName: className
|
|
@@ -283,6 +287,7 @@ const AddressField = w((props, ref) => {
|
|
|
283
287
|
Input,
|
|
284
288
|
{
|
|
285
289
|
value: addressState.postCode,
|
|
290
|
+
disabled,
|
|
286
291
|
onInput: (event) => handleStateChange(EAddressType.POST_CODE, event.currentTarget.value),
|
|
287
292
|
placeholder: description,
|
|
288
293
|
inputClassName: className
|
|
@@ -304,6 +309,7 @@ const AddressField = w((props, ref) => {
|
|
|
304
309
|
Input,
|
|
305
310
|
{
|
|
306
311
|
value: addressState.area,
|
|
312
|
+
disabled,
|
|
307
313
|
onInput: (event) => handleStateChange(EAddressType.AREA, event.currentTarget.value),
|
|
308
314
|
placeholder: description,
|
|
309
315
|
inputClassName: className
|
|
@@ -325,6 +331,7 @@ const AddressField = w((props, ref) => {
|
|
|
325
331
|
Select,
|
|
326
332
|
{
|
|
327
333
|
value: addressState.city,
|
|
334
|
+
disabled,
|
|
328
335
|
filterable: true,
|
|
329
336
|
options: cityOptions,
|
|
330
337
|
onSelect: (value) => onSelectCity(value),
|
|
@@ -336,6 +343,7 @@ const AddressField = w((props, ref) => {
|
|
|
336
343
|
Input,
|
|
337
344
|
{
|
|
338
345
|
value: addressState.city,
|
|
346
|
+
disabled,
|
|
339
347
|
onInput: (event) => handleStateChange(EAddressType.CITY, event.currentTarget.value),
|
|
340
348
|
placeholder: description,
|
|
341
349
|
inputClassName: className
|
|
@@ -357,6 +365,7 @@ const AddressField = w((props, ref) => {
|
|
|
357
365
|
Select,
|
|
358
366
|
{
|
|
359
367
|
value: addressState.province,
|
|
368
|
+
disabled,
|
|
360
369
|
filterable: true,
|
|
361
370
|
options: provinceOptions,
|
|
362
371
|
onSelect: (value) => onSelectProvince(value),
|
|
@@ -368,6 +377,7 @@ const AddressField = w((props, ref) => {
|
|
|
368
377
|
Input,
|
|
369
378
|
{
|
|
370
379
|
value: addressState.province,
|
|
380
|
+
disabled,
|
|
371
381
|
onInput: (event) => handleStateChange(EAddressType.PROVINCE, event.currentTarget.value),
|
|
372
382
|
placeholder: description,
|
|
373
383
|
inputClassName: className
|
|
@@ -3,17 +3,17 @@ import { isTimeoutError } from "../../api/http.js";
|
|
|
3
3
|
import "../../utils/card-brand/brands.js";
|
|
4
4
|
import "../../utils/system-info/get-browser-info.js";
|
|
5
5
|
import { parseE164, underscoreToUpperCamelCase } from "../../utils/format.js";
|
|
6
|
-
import {
|
|
7
|
-
import { deepMerge } from "../../utils/object.js";
|
|
8
|
-
import { formatPaymentResult } from "../../utils/payment.js";
|
|
9
|
-
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
6
|
+
import { ApplePayEventType } from "../../types/event.js";
|
|
10
7
|
import { PaymentMethod, SessionMode } from "../../constant.js";
|
|
8
|
+
import { deepMerge } from "../../utils/object.js";
|
|
9
|
+
import { processPaymentStatus, formatPaymentResult } from "../../utils/payment.js";
|
|
10
|
+
import { buildPaymentParams } from "../../api/utils/index.js";
|
|
11
11
|
import { getApplePayInfo, applePay, getMerchantSession } from "../../api/modules/apple-pay/index.js";
|
|
12
|
+
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
12
13
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
13
14
|
import "../../core/context.js";
|
|
14
15
|
import { PayKKaError } from "../../core/error.js";
|
|
15
|
-
import
|
|
16
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
16
|
+
import "../../out/fraud-detection.js";
|
|
17
17
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
18
18
|
import { useRetry } from "../../hooks/useRetry.js";
|
|
19
19
|
import { Info } from "../internal/Info/Info.js";
|
|
@@ -118,7 +118,7 @@ const { bem } = useBEM("apple-pay");
|
|
|
118
118
|
const ApplePay = w((props) => {
|
|
119
119
|
const { session, isDropIn, core, config } = props;
|
|
120
120
|
const { applePaySession, initApplePaySession, reportSuccess2ApplePay, reportFailure2ApplePay } = useApplePaySession();
|
|
121
|
-
const { i18n, sessionReady, fraudDetection } = usePayState(session, props.core);
|
|
121
|
+
const { i18n, sessionReady, fraudDetection, disabled } = usePayState(session, props.core);
|
|
122
122
|
const [errorMsg, setErrorMsg] = h("");
|
|
123
123
|
const [showApplePay, setShowApplePay] = h(false);
|
|
124
124
|
const applePayConfig = deepMerge(DEFAULT_APPLE_PAY_CONFIG, config || {});
|
|
@@ -148,16 +148,23 @@ const ApplePay = w((props) => {
|
|
|
148
148
|
);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
if (!supportMethods.includes(
|
|
151
|
+
if (!supportMethods.includes(CURR_PAYMENT_METHOD)) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
loadApplePayJS(
|
|
155
155
|
async () => {
|
|
156
156
|
var _a, _b, _c, _d, _e;
|
|
157
157
|
(_a = props.onLoad) == null ? void 0 : _a.call(props, true);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
let envSupported = false;
|
|
159
|
+
try {
|
|
160
|
+
envSupported = await getApplePayEnvSupported(
|
|
161
|
+
(_d = (_c = (_b = session == null ? void 0 : session.checkout) == null ? void 0 : _b.channelParams) == null ? void 0 : _c.applePay) == null ? void 0 : _d.merchantIdentifier
|
|
162
|
+
);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_ENV_CHECK_ERROR, {
|
|
165
|
+
message: error instanceof Error ? error.message : String(error)
|
|
166
|
+
});
|
|
167
|
+
}
|
|
161
168
|
if (!envSupported) {
|
|
162
169
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_CAN_NOT_USE);
|
|
163
170
|
}
|
|
@@ -175,6 +182,7 @@ const ApplePay = w((props) => {
|
|
|
175
182
|
const onTimeout = q(
|
|
176
183
|
(message) => {
|
|
177
184
|
var _a;
|
|
185
|
+
core.payment.resetCurrPaymentMethod();
|
|
178
186
|
const timeoutMessage = message || i18n.get("common.payTimeout");
|
|
179
187
|
reportFailure2ApplePay(timeoutMessage);
|
|
180
188
|
setErrorMsg(timeoutMessage);
|
|
@@ -205,7 +213,7 @@ const ApplePay = w((props) => {
|
|
|
205
213
|
country: billingContact == null ? void 0 : billingContact.countryCode
|
|
206
214
|
},
|
|
207
215
|
payment: {
|
|
208
|
-
paymentMethod:
|
|
216
|
+
paymentMethod: CURR_PAYMENT_METHOD,
|
|
209
217
|
tokenData: JSON.stringify({ token })
|
|
210
218
|
},
|
|
211
219
|
browser: await getBrowserParams({
|
|
@@ -214,70 +222,72 @@ const ApplePay = w((props) => {
|
|
|
214
222
|
};
|
|
215
223
|
};
|
|
216
224
|
async function pay(search = false, timeout, token, billingContact, shippingContact) {
|
|
217
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
225
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
218
226
|
setErrorMsg("");
|
|
219
227
|
try {
|
|
228
|
+
core.payment.currPaymentMethod.value = CURR_PAYMENT_METHOD;
|
|
220
229
|
const requestOptions = { locale: i18n.locale, timeout };
|
|
221
230
|
let res = null;
|
|
222
231
|
if (search) {
|
|
223
|
-
const extraParams = (_b = (_a = core.config)._getExtraParams) == null ? void 0 : _b.call(_a, "query",
|
|
232
|
+
const extraParams = (_b = (_a = core.config)._getExtraParams) == null ? void 0 : _b.call(_a, "query", CURR_PAYMENT_METHOD);
|
|
224
233
|
res = await getApplePayInfo(
|
|
225
234
|
{
|
|
226
235
|
sessionId: session.sessionId,
|
|
227
236
|
clientKey: session.clientKey,
|
|
228
|
-
paymentMethod:
|
|
237
|
+
paymentMethod: CURR_PAYMENT_METHOD
|
|
229
238
|
},
|
|
230
239
|
extraParams,
|
|
231
240
|
requestOptions
|
|
232
241
|
);
|
|
233
242
|
} else {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
extraParams
|
|
238
|
-
|
|
239
|
-
|
|
243
|
+
const paymentParams = await getPaymentParams(token, billingContact, shippingContact);
|
|
244
|
+
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", CURR_PAYMENT_METHOD);
|
|
245
|
+
if ((_e = core.config._checkoutConfig) == null ? void 0 : _e.dynamicSessionId) {
|
|
246
|
+
await core.updateSessionId(buildPaymentParams(paymentParams, extraParams));
|
|
247
|
+
session.sessionId && (paymentParams.sessionId = session.sessionId);
|
|
248
|
+
}
|
|
249
|
+
res = await applePay(paymentParams, extraParams, requestOptions);
|
|
240
250
|
}
|
|
241
|
-
const {
|
|
251
|
+
const { errorMessage, errorCode, sessionId } = res;
|
|
242
252
|
sessionId && (session.sessionId = sessionId);
|
|
243
|
-
!search && ((
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
!search && ((_f = props.onSubmitResponse) == null ? void 0 : _f.call(props, res, getPaymentMethodContext()));
|
|
254
|
+
let end = true;
|
|
255
|
+
await processPaymentStatus(res, {
|
|
256
|
+
onProcessing: async () => {
|
|
257
|
+
!search && await startReFetchPayInfo();
|
|
258
|
+
end = false;
|
|
259
|
+
},
|
|
260
|
+
onSuccess: () => {
|
|
246
261
|
reportSuccess2ApplePay();
|
|
247
262
|
processOnSuccess(res);
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return { end: !search };
|
|
252
|
-
} else if (orderStatus === PaymentStatus.FAILURE) {
|
|
263
|
+
},
|
|
264
|
+
onFailure: () => {
|
|
265
|
+
var _a2;
|
|
253
266
|
errorMessage && setErrorMsg(errorMessage);
|
|
254
|
-
(
|
|
267
|
+
(_a2 = props.onError) == null ? void 0 : _a2.call(
|
|
255
268
|
props,
|
|
256
269
|
new PayKKaError("API_ERROR", errorMessage, { code: errorCode }),
|
|
257
270
|
getPaymentMethodContext()
|
|
258
271
|
);
|
|
272
|
+
core.payment.resetCurrPaymentMethod();
|
|
259
273
|
reportFailure2ApplePay(errorMessage);
|
|
260
|
-
|
|
261
|
-
|
|
274
|
+
},
|
|
275
|
+
onAuthorized: () => {
|
|
276
|
+
var _a2;
|
|
262
277
|
reportSuccess2ApplePay();
|
|
263
|
-
(
|
|
264
|
-
|
|
265
|
-
|
|
278
|
+
(_a2 = props.onAuthorized) == null ? void 0 : _a2.call(props, getPaymentMethodContext());
|
|
279
|
+
},
|
|
280
|
+
onExpired: () => {
|
|
281
|
+
var _a2, _b2;
|
|
282
|
+
(_a2 = props.onExpired) == null ? void 0 : _a2.call(props, getPaymentMethodContext());
|
|
283
|
+
(_b2 = applePaySession.current) == null ? void 0 : _b2.abort();
|
|
284
|
+
},
|
|
285
|
+
onDefault: () => {
|
|
266
286
|
reportFailure2ApplePay();
|
|
267
|
-
|
|
287
|
+
core.payment.resetCurrPaymentMethod();
|
|
268
288
|
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
processOnSuccess(res);
|
|
272
|
-
return { end: true };
|
|
273
|
-
} else if (status === PaymentStatus.EXPIRED) {
|
|
274
|
-
(_h = props.onExpired) == null ? void 0 : _h.call(props, getPaymentMethodContext());
|
|
275
|
-
(_i = applePaySession.current) == null ? void 0 : _i.abort();
|
|
276
|
-
return { end: true };
|
|
277
|
-
} else {
|
|
278
|
-
reportFailure2ApplePay();
|
|
279
|
-
return { end: true };
|
|
280
|
-
}
|
|
289
|
+
});
|
|
290
|
+
return { end };
|
|
281
291
|
} catch (error) {
|
|
282
292
|
if (isTimeoutError(error)) {
|
|
283
293
|
if (search) {
|
|
@@ -289,18 +299,19 @@ const ApplePay = w((props) => {
|
|
|
289
299
|
} else {
|
|
290
300
|
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
291
301
|
message && setErrorMsg(message);
|
|
292
|
-
(
|
|
302
|
+
(_g = props.onError) == null ? void 0 : _g.call(
|
|
293
303
|
props,
|
|
294
304
|
new PayKKaError("API_ERROR", message, { code: error.code, cause: error }),
|
|
295
305
|
getPaymentMethodContext()
|
|
296
306
|
);
|
|
297
307
|
reportFailure2ApplePay(message);
|
|
308
|
+
core.payment.resetCurrPaymentMethod();
|
|
298
309
|
return { end: true };
|
|
299
310
|
}
|
|
300
311
|
}
|
|
301
312
|
}
|
|
302
313
|
const genApplePayRequest = () => {
|
|
303
|
-
var _a, _b, _c, _d, _e;
|
|
314
|
+
var _a, _b, _c, _d, _e, _f;
|
|
304
315
|
const checkout = session == null ? void 0 : session.checkout;
|
|
305
316
|
const { applePay: applePay2 } = (checkout == null ? void 0 : checkout.channelParams) ?? {};
|
|
306
317
|
const requiredBillingContactFields = [
|
|
@@ -309,25 +320,29 @@ const ApplePay = w((props) => {
|
|
|
309
320
|
if (((_b = checkout == null ? void 0 : checkout.bill) == null ? void 0 : _b.billingAddressCollection) === "REQUIRED") {
|
|
310
321
|
requiredBillingContactFields.push("postalAddress");
|
|
311
322
|
}
|
|
323
|
+
const amount = (_c = core.payment) == null ? void 0 : _c.amount.value;
|
|
312
324
|
return {
|
|
313
325
|
merchantCapabilities: ["supports3DS"],
|
|
314
326
|
countryCode: (applePay2 == null ? void 0 : applePay2.countryCode) ?? "",
|
|
315
327
|
requiredBillingContactFields,
|
|
316
|
-
requiredShippingContactFields: (
|
|
317
|
-
currencyCode: (
|
|
318
|
-
supportedNetworks: ((
|
|
328
|
+
requiredShippingContactFields: (_d = applePayConfig.request) == null ? void 0 : _d.requiredShippingContactFields,
|
|
329
|
+
currencyCode: (amount == null ? void 0 : amount.currency) ?? "",
|
|
330
|
+
supportedNetworks: ((_f = (_e = applePay2 == null ? void 0 : applePay2.supportedNetworks) == null ? void 0 : _e.map) == null ? void 0 : _f.call(_e, (item) => underscoreToUpperCamelCase(item))) ?? [],
|
|
319
331
|
total: {
|
|
320
332
|
label: (checkout == null ? void 0 : checkout.theme.merchantName) ?? "",
|
|
321
333
|
type: "final",
|
|
322
|
-
amount: String(
|
|
334
|
+
amount: String((amount == null ? void 0 : amount.amount) || 0)
|
|
323
335
|
}
|
|
324
336
|
};
|
|
325
337
|
};
|
|
326
|
-
const onApplePayButtonClicked = () => {
|
|
338
|
+
const onApplePayButtonClicked = async () => {
|
|
327
339
|
var _a, _b;
|
|
328
340
|
const { onEvent } = props.core.config;
|
|
329
341
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_BUTTON_CLICKED);
|
|
330
|
-
(_a = props.onBtnClick) == null ? void 0 : _a.call(props);
|
|
342
|
+
const btnResult = await ((_a = props.onBtnClick) == null ? void 0 : _a.call(props));
|
|
343
|
+
if (btnResult === false) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
331
346
|
if (!ApplePaySession) {
|
|
332
347
|
return;
|
|
333
348
|
}
|
|
@@ -352,6 +367,7 @@ const ApplePay = w((props) => {
|
|
|
352
367
|
onCancel: () => {
|
|
353
368
|
var _a2;
|
|
354
369
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_CANCELLED);
|
|
370
|
+
core.payment.resetCurrPaymentMethod();
|
|
355
371
|
(_a2 = props.onCancel) == null ? void 0 : _a2.call(props);
|
|
356
372
|
}
|
|
357
373
|
});
|
|
@@ -361,7 +377,7 @@ const ApplePay = w((props) => {
|
|
|
361
377
|
var _a, _b;
|
|
362
378
|
const buttonStyle = (_a = applePayConfig.button) == null ? void 0 : _a.buttonStyle;
|
|
363
379
|
const buttonType = (_b = applePayConfig.button) == null ? void 0 : _b.buttonType;
|
|
364
|
-
return /* @__PURE__ */ u("div", { className: bem("button"), children: canUseApplePaySDK ? /* @__PURE__ */ u(b, { children: /* @__PURE__ */ u(
|
|
380
|
+
return /* @__PURE__ */ u("div", { className: bem("button", { disabled }), children: canUseApplePaySDK ? /* @__PURE__ */ u(b, { children: /* @__PURE__ */ u(
|
|
365
381
|
"apple-pay-button",
|
|
366
382
|
{
|
|
367
383
|
buttonstyle: buttonStyle,
|
|
@@ -4,8 +4,8 @@ import "../../utils/card-brand/brands.js";
|
|
|
4
4
|
import "../../utils/system-info/get-browser-info.js";
|
|
5
5
|
import { EInternalFieldType } from "../SecuredFieldsProvider/index.js";
|
|
6
6
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
7
|
+
import "../../out/fraud-detection.js";
|
|
7
8
|
import "../../core/context.js";
|
|
8
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
9
9
|
import "../internal/Form/type.js";
|
|
10
10
|
import "../internal/Form/context.js";
|
|
11
11
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -14,7 +14,7 @@ import { Input } from "../internal/Input/Input.js";
|
|
|
14
14
|
import "../internal/Input/type.js";
|
|
15
15
|
import { CNPJ_FULL_LENGTH, CPF_FULL_LENGTH, formatCPFOnInsert } from "../../utils/cpf.js";
|
|
16
16
|
const CPFField = w((props, ref) => {
|
|
17
|
-
const { className, style, security } = props;
|
|
17
|
+
const { className, style, security, disabled } = props;
|
|
18
18
|
const { i18n } = useI18n();
|
|
19
19
|
const inputRef = A(null);
|
|
20
20
|
const formItemRef = A(null);
|
|
@@ -71,6 +71,7 @@ const CPFField = w((props, ref) => {
|
|
|
71
71
|
Input,
|
|
72
72
|
{
|
|
73
73
|
type: "text",
|
|
74
|
+
disabled,
|
|
74
75
|
inputmode: "numeric",
|
|
75
76
|
ref: inputRef,
|
|
76
77
|
maxLength: CNPJ_FULL_LENGTH,
|