@paykka/card-checkout-ui 0.13.16 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/card-checkout-ui.js +54 -26
- package/dist/card-checkout-ui.umd.cjs +54 -26
- package/dist/es/api/modules/boost/index.js +5 -16
- package/dist/es/api/modules/gcash/index.js +5 -16
- package/dist/es/api/modules/get-browser-params.js +1 -4
- package/dist/es/api/modules/grab-pay/index.js +5 -16
- package/dist/es/api/modules/line-pay/index.js +5 -16
- package/dist/es/api/modules/may-bank-qr-pay/index.js +5 -16
- package/dist/es/api/modules/nine-pay/index.js +5 -16
- package/dist/es/api/modules/opay-wallet/index.js +5 -16
- package/dist/es/api/modules/paga-wallet/index.js +5 -16
- package/dist/es/api/modules/paymaya/index.js +5 -16
- package/dist/es/api/modules/shopee-pay/index.js +5 -16
- package/dist/es/api/modules/threeDS/index.js +16 -2
- package/dist/es/api/modules/tng-wallet/index.js +5 -16
- package/dist/es/api/modules/wallet/index.js +16 -0
- package/dist/es/api/modules/zalopay/index.js +5 -16
- package/dist/es/api/utils/index.js +2 -1
- package/dist/es/components/AccordionItem/AccordionItem.js +0 -2
- package/dist/es/components/AddressField/index.js +95 -85
- package/dist/es/components/AliPay/index.js +88 -76
- package/dist/es/components/ApplePay/index.js +61 -43
- package/dist/es/components/CPFField/index.js +2 -1
- package/dist/es/components/Card/index.js +182 -143
- package/dist/es/components/CardExpireDateField/index.js +2 -1
- package/dist/es/components/CardNo/index.js +2 -2
- package/dist/es/components/CardNumberField/index.js +2 -1
- package/dist/es/components/CardSecurityCodeField/index.js +2 -1
- package/dist/es/components/CardSelector/index.js +3 -2
- package/dist/es/components/DropIn/index.js +98 -31
- package/dist/es/components/GooglePay/index.js +190 -151
- package/dist/es/components/GuideCard/index.js +8 -1
- package/dist/es/components/PaymentButton/index.js +58 -0
- package/dist/es/components/RecurringTip/index.js +3 -3
- package/dist/es/components/SecuredFieldsProvider/index.js +81 -17
- package/dist/es/components/SecuredIframe/index.js +120 -52
- package/dist/es/components/Sepa/index.js +23 -25
- package/dist/es/components/SubmitButton/index.js +1 -1
- package/dist/es/components/ThreeDS/index.js +34 -15
- package/dist/es/components/WechatPay/index.js +94 -83
- package/dist/es/components/business/BlikCodeField/BlikCodeField.js +92 -0
- package/dist/es/components/business/BlikCodeField/blik-code-field.js +1 -0
- package/dist/es/components/business/BlikCodeField/index.js +13 -0
- package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +45 -0
- package/dist/es/components/business/BlikConfirmModal/blik-confirm-modal.js +1 -0
- package/dist/es/components/business/BlikConfirmModal/index.js +9 -0
- package/dist/es/components/business/BlikConfirmModal/type.js +1 -0
- package/dist/es/components/business/NameField/NameField.js +51 -0
- package/dist/es/components/business/NameField/index.js +11 -0
- package/dist/es/components/business/NameField/type.js +1 -0
- package/dist/es/components/business/PhoneField/PhoneField.js +125 -0
- package/dist/es/components/business/PhoneField/config.js +33 -0
- package/dist/es/components/business/PhoneField/index.js +14 -0
- package/dist/es/components/business/PhoneField/phone-field.js +1 -0
- package/dist/es/components/business/PhoneField/type.js +1 -0
- package/dist/es/components/business/SegmentedDigitInput/SegmentedDigitInput.js +80 -0
- package/dist/es/components/business/SegmentedDigitInput/format.js +26 -0
- package/dist/es/components/business/SegmentedDigitInput/index.js +5 -0
- package/dist/es/components/business/Tooltip/Tooltip.js +18 -0
- package/dist/es/components/business/Tooltip/index.js +6 -0
- package/dist/es/components/business/Tooltip/tooltip2.js +1 -0
- package/dist/es/components/business/index.js +14 -0
- package/dist/es/components/index.js +14 -7
- package/dist/es/components/internal/CheckBox/CheckBox.js +2 -2
- package/dist/es/components/internal/Input/Input.js +1 -1
- package/dist/es/components/internal/Select/Select.js +7 -1
- package/dist/es/components/internal/icons/IconArrowDown.js +4 -4
- package/dist/es/components/internal/icons/IconBancontact.js +95 -0
- package/dist/es/components/internal/icons/IconBlik.js +567 -0
- package/dist/es/components/internal/icons/IconIdeal.js +86 -0
- package/dist/es/components/internal/icons/IconOvo.js +47 -0
- package/dist/es/components/internal/icons/IconP24.js +40 -0
- package/dist/es/components/internal/icons/IconPhone.js +56 -0
- package/dist/es/components/internal/icons/IconSkrill.js +38 -0
- package/dist/es/components/internal/icons/IconTrustly.js +37 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +201 -0
- package/dist/es/components/wallets/Bancontact/bancontact2.js +1 -0
- package/dist/es/components/wallets/Bancontact/index.js +1 -0
- package/dist/es/components/wallets/Bancontact/type.js +1 -0
- package/dist/es/components/wallets/Blik/Blik.js +232 -0
- package/dist/es/components/wallets/Blik/blik2.js +1 -0
- package/dist/es/components/wallets/Blik/index.js +1 -0
- package/dist/es/components/wallets/Blik/type.js +1 -0
- package/dist/es/components/wallets/Boost/Boost.js +183 -0
- package/dist/es/components/wallets/Boost/boost2.js +1 -0
- package/dist/es/components/wallets/Boost/index.js +1 -0
- package/dist/es/components/wallets/Boost/type.js +1 -0
- package/dist/es/components/wallets/GCash/GCash.js +74 -252
- package/dist/es/components/wallets/GrabPay/GrabPay.js +183 -0
- package/dist/es/components/wallets/GrabPay/grab-pay.js +1 -0
- package/dist/es/components/wallets/GrabPay/index.js +1 -0
- package/dist/es/components/wallets/GrabPay/type.js +1 -0
- package/dist/es/components/wallets/IDeal/IDeal.js +201 -0
- package/dist/es/components/wallets/IDeal/ideal2.js +1 -0
- package/dist/es/components/wallets/IDeal/index.js +1 -0
- package/dist/es/components/wallets/IDeal/type.js +1 -0
- package/dist/es/components/wallets/LinePay/LinePay.js +183 -0
- package/dist/es/components/wallets/LinePay/index.js +1 -0
- package/dist/es/components/wallets/LinePay/line-pay.js +1 -0
- package/dist/es/components/wallets/LinePay/type.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +187 -0
- package/dist/es/components/wallets/MayBankQRPay/index.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/may-bank-qr-pay.js +1 -0
- package/dist/es/components/wallets/MayBankQRPay/type.js +1 -0
- package/dist/es/components/wallets/NinePay/NinePay.js +185 -0
- package/dist/es/components/wallets/NinePay/index.js +1 -0
- package/dist/es/components/wallets/NinePay/nine-pay.js +1 -0
- package/dist/es/components/wallets/NinePay/type.js +1 -0
- package/dist/es/components/wallets/OVO/OVO.js +200 -0
- package/dist/es/components/wallets/OVO/index.js +1 -0
- package/dist/es/components/wallets/OVO/ovo2.js +1 -0
- package/dist/es/components/wallets/OVO/type.js +1 -0
- package/dist/es/components/wallets/OpayWallet/OpayWallet.js +57 -218
- package/dist/es/components/wallets/P24/P24.js +198 -0
- package/dist/es/components/wallets/P24/index.js +1 -0
- package/dist/es/components/wallets/P24/p242.js +1 -0
- package/dist/es/components/wallets/P24/type.js +1 -0
- package/dist/es/components/wallets/PagaWallet/PagaWallet.js +57 -218
- package/dist/es/components/wallets/Paymaya/Paymaya.js +57 -221
- package/dist/es/components/wallets/PicPay/PicPay.js +64 -55
- package/dist/es/components/wallets/Pix/Pix.js +58 -56
- package/dist/es/components/wallets/ShopeePay/ShopeePay.js +185 -0
- package/dist/es/components/wallets/ShopeePay/index.js +1 -0
- package/dist/es/components/wallets/ShopeePay/shopee-pay.js +1 -0
- package/dist/es/components/wallets/ShopeePay/type.js +1 -0
- package/dist/es/components/wallets/Skrill/Skrill.js +200 -0
- package/dist/es/components/wallets/Skrill/index.js +1 -0
- package/dist/es/components/wallets/Skrill/skrill2.js +1 -0
- package/dist/es/components/wallets/Skrill/type.js +1 -0
- package/dist/es/components/wallets/TNGWallet/TNGWallet.js +185 -0
- package/dist/es/components/wallets/TNGWallet/index.js +1 -0
- package/dist/es/components/wallets/TNGWallet/tng-wallet.js +1 -0
- package/dist/es/components/wallets/TNGWallet/type.js +1 -0
- package/dist/es/components/wallets/Trustly/Trustly.js +226 -0
- package/dist/es/components/wallets/Trustly/index.js +1 -0
- package/dist/es/components/wallets/Trustly/trustly2.js +1 -0
- package/dist/es/components/wallets/Trustly/type.js +1 -0
- package/dist/es/components/wallets/Vietqr/Vietqr.js +73 -242
- package/dist/es/components/wallets/Zalopay/Zalopay.js +73 -242
- package/dist/es/components/wallets/index.js +14 -0
- package/dist/es/constant.js +48 -2
- package/dist/es/core/address.js +7 -6
- package/dist/es/core/checkout.js +93 -41
- package/dist/es/core/create-child.js +68 -0
- package/dist/es/core/environment.js +23 -1
- package/dist/es/core/error.js +15 -2
- package/dist/es/core/logger.js +106 -0
- package/dist/es/core/payment.js +65 -0
- package/dist/es/fe-logger.min.js +1 -0
- package/dist/es/hooks/useBaseWallet.js +280 -0
- package/dist/es/hooks/usePayState.js +37 -25
- package/dist/es/hooks/usePayment.js +1 -14
- package/dist/es/hooks/useRetry.js +50 -26
- package/dist/es/i18n/locales/de-DE.js +24 -0
- package/dist/es/i18n/locales/en-GB.js +24 -0
- package/dist/es/i18n/locales/es-ES.js +24 -0
- package/dist/es/i18n/locales/fr-FR.js +24 -0
- package/dist/es/i18n/locales/ja-JP.js +24 -0
- package/dist/es/i18n/locales/ko-KR.js +24 -0
- package/dist/es/i18n/locales/nl-NL.js +24 -0
- package/dist/es/i18n/locales/pt-PT.js +24 -0
- package/dist/es/i18n/locales/ru-RU.js +24 -0
- package/dist/es/i18n/locales/zh-CN.js +24 -0
- package/dist/es/i18n/locales/zh-HK.js +24 -0
- package/dist/es/i18n/locales/zh-TW.js +24 -0
- package/dist/es/index.js +23 -8
- package/dist/es/out/base-fraud-detection.js +4 -1
- package/dist/es/out/config.js +10 -4
- package/dist/es/out/fraud-detection.js +12 -13
- package/dist/es/out/worldpay-ddc-manager.js +7 -14
- package/dist/es/out/worldpay-ddc.js +7 -5
- package/dist/es/polyfill.js +166 -0
- package/dist/es/style.css +1 -1
- package/dist/es/types/event.js +12 -3
- package/dist/es/types/message.js +3 -0
- package/dist/es/utils/iframe.js +1 -1
- package/dist/es/utils/location.js +0 -8
- package/dist/es/utils/payment.js +12 -12
- package/dist/es/utils/redirect.js +4 -5
- package/dist/es/utils/system-info/is-ua-webview.js +1 -20
- package/dist/fe-logger.min.js +1 -0
- package/dist/polyfill.js +166 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/index.d.ts +1 -0
- package/dist/types/api/modules/threeDS/index.d.ts +7 -0
- package/dist/types/api/modules/type.d.ts +2 -0
- package/dist/types/api/modules/wallet/index.d.ts +18 -0
- package/dist/types/api/utils/index.d.ts +1 -0
- package/dist/types/components/AddressField/index.d.ts +1 -0
- package/dist/types/components/AddressField/type.d.ts +17 -2
- package/dist/types/components/AddressField/utils.d.ts +22 -0
- package/dist/types/components/AliPay/type.d.ts +11 -15
- package/dist/types/components/ApplePay/type.d.ts +5 -28
- package/dist/types/components/CPFField/type.d.ts +1 -1
- package/dist/types/components/Card/type.d.ts +22 -23
- package/dist/types/components/CardExpireDateField/type.d.ts +1 -1
- package/dist/types/components/CardNo/type.d.ts +3 -2
- package/dist/types/components/CardNumberField/type.d.ts +1 -1
- package/dist/types/components/CardSecurityCodeField/type.d.ts +1 -1
- package/dist/types/components/CardSelector/type.d.ts +4 -4
- package/dist/types/components/DropIn/type.d.ts +10 -22
- package/dist/types/components/GooglePay/createGooglePay.d.ts +4 -4
- package/dist/types/components/GooglePay/type.d.ts +10 -14
- package/dist/types/components/PaymentButton/PaymentButton.d.ts +3 -0
- package/dist/types/components/PaymentButton/index.d.ts +2 -0
- package/dist/types/components/PaymentButton/type.d.ts +13 -0
- package/dist/types/components/RecurringTip/RecurringTip.d.ts +1 -1
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +7 -1
- package/dist/types/components/SecuredIframe/HiddenIframe.d.ts +5 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +0 -6
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/type.d.ts +2 -0
- package/dist/types/components/WechatPay/type.d.ts +11 -15
- package/dist/types/components/business/BlikCodeField/BlikCodeField.d.ts +6 -0
- package/dist/types/components/business/BlikCodeField/index.d.ts +2 -0
- package/dist/types/components/business/BlikCodeField/type.d.ts +9 -0
- package/dist/types/components/business/BlikConfirmModal/BlikConfirmModal.d.ts +6 -0
- package/dist/types/components/business/BlikConfirmModal/index.d.ts +2 -0
- package/dist/types/components/business/BlikConfirmModal/type.d.ts +8 -0
- package/dist/types/components/business/NameField/NameField.d.ts +5 -0
- package/dist/types/components/business/NameField/index.d.ts +2 -0
- package/dist/types/components/business/NameField/type.d.ts +7 -0
- package/dist/types/components/business/PhoneField/PhoneField.d.ts +6 -0
- package/dist/types/components/business/PhoneField/config.d.ts +22 -0
- package/dist/types/components/business/PhoneField/index.d.ts +2 -0
- package/dist/types/components/business/PhoneField/type.d.ts +9 -0
- package/dist/types/components/business/SegmentedDigitInput/SegmentedDigitInput.d.ts +5 -0
- package/dist/types/components/business/SegmentedDigitInput/format.d.ts +5 -0
- package/dist/types/components/business/SegmentedDigitInput/index.d.ts +3 -0
- package/dist/types/components/business/SegmentedDigitInput/type.d.ts +13 -0
- package/dist/types/components/business/Tooltip/Tooltip.d.ts +11 -0
- package/dist/types/components/business/Tooltip/index.d.ts +1 -0
- package/dist/types/components/business/index.d.ts +6 -0
- package/dist/types/components/index.d.ts +0 -7
- package/dist/types/components/internal/CheckBox/type.d.ts +2 -1
- package/dist/types/components/internal/Form/type.d.ts +2 -1
- package/dist/types/components/internal/Select/type.d.ts +1 -1
- package/dist/types/components/internal/icons/IconArrowDown.d.ts +1 -1
- package/dist/types/components/internal/icons/IconBancontact.d.ts +2 -0
- package/dist/types/components/internal/icons/IconBlik.d.ts +2 -0
- package/dist/types/components/internal/icons/IconIdeal.d.ts +2 -0
- package/dist/types/components/internal/icons/IconOvo.d.ts +2 -0
- package/dist/types/components/internal/icons/IconP24.d.ts +2 -0
- package/dist/types/components/internal/icons/IconPhone.d.ts +2 -0
- package/dist/types/components/internal/icons/IconSkrill.d.ts +2 -0
- package/dist/types/components/internal/icons/IconTrustly.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +8 -0
- package/dist/types/components/type.d.ts +0 -0
- package/dist/types/components/wallets/Bancontact/Bancontact.d.ts +15 -0
- package/dist/types/components/wallets/Bancontact/index.d.ts +2 -0
- package/dist/types/components/{GrabPay → wallets/Bancontact}/type.d.ts +8 -18
- package/dist/types/components/wallets/Blik/Blik.d.ts +15 -0
- package/dist/types/components/wallets/Blik/index.d.ts +2 -0
- package/dist/types/components/wallets/Blik/type.d.ts +29 -0
- package/dist/types/components/{Boost → wallets/Boost}/Boost.d.ts +9 -4
- package/dist/types/components/{Boost → wallets/Boost}/type.d.ts +3 -14
- package/dist/types/components/wallets/GCash/GCash.d.ts +5 -0
- package/dist/types/components/wallets/GCash/type.d.ts +3 -14
- package/dist/types/components/{GrabPay → wallets/GrabPay}/GrabPay.d.ts +4 -4
- package/dist/types/components/wallets/GrabPay/type.d.ts +17 -0
- package/dist/types/components/wallets/IDeal/IDeal.d.ts +15 -0
- package/dist/types/components/wallets/IDeal/index.d.ts +2 -0
- package/dist/types/components/wallets/IDeal/type.d.ts +29 -0
- package/dist/types/components/{LinePay → wallets/LinePay}/LinePay.d.ts +9 -4
- package/dist/types/components/{LinePay → wallets/LinePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/MayBankQRPay/MayBankQRPay.d.ts +15 -0
- package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/type.d.ts +3 -14
- package/dist/types/components/wallets/NinePay/NinePay.d.ts +15 -0
- package/dist/types/components/{NinePay → wallets/NinePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/OVO/OVO.d.ts +15 -0
- package/dist/types/components/wallets/OVO/index.d.ts +2 -0
- package/dist/types/components/wallets/OVO/type.d.ts +29 -0
- package/dist/types/components/wallets/OpayWallet/OpayWallet.d.ts +5 -0
- package/dist/types/components/wallets/OpayWallet/type.d.ts +4 -15
- package/dist/types/components/wallets/P24/P24.d.ts +15 -0
- package/dist/types/components/wallets/P24/index.d.ts +2 -0
- package/dist/types/components/wallets/P24/type.d.ts +29 -0
- package/dist/types/components/wallets/PagaWallet/PagaWallet.d.ts +5 -0
- package/dist/types/components/wallets/PagaWallet/type.d.ts +5 -16
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +5 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +3 -14
- package/dist/types/components/wallets/PicPay/type.d.ts +5 -16
- package/dist/types/components/wallets/Pix/type.d.ts +5 -16
- package/dist/types/components/{ShopeePay → wallets/ShopeePay}/ShopeePay.d.ts +9 -4
- package/dist/types/components/{ShopeePay → wallets/ShopeePay}/type.d.ts +3 -14
- package/dist/types/components/wallets/Skrill/Skrill.d.ts +15 -0
- package/dist/types/components/wallets/Skrill/index.d.ts +2 -0
- package/dist/types/components/wallets/Skrill/type.d.ts +17 -0
- package/dist/types/components/{TNGWallet → wallets/TNGWallet}/TNGWallet.d.ts +9 -4
- package/dist/types/components/{TNGWallet → wallets/TNGWallet}/type.d.ts +3 -14
- package/dist/types/components/wallets/Trustly/Trustly.d.ts +15 -0
- package/dist/types/components/wallets/Trustly/index.d.ts +2 -0
- package/dist/types/components/wallets/Trustly/type.d.ts +21 -0
- package/dist/types/components/wallets/Vietqr/Vietqr.d.ts +5 -0
- package/dist/types/components/wallets/Vietqr/type.d.ts +3 -14
- package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +5 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +3 -14
- package/dist/types/components/wallets/index.d.ts +14 -0
- package/dist/types/components/wallets/type.d.ts +18 -4
- package/dist/types/constant.d.ts +15 -1
- package/dist/types/core/address.d.ts +2 -5
- package/dist/types/core/checkout.d.ts +10 -10
- package/dist/types/core/create-child.d.ts +1 -0
- package/dist/types/core/environment.d.ts +5 -0
- package/dist/types/core/error.d.ts +9 -3
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/logger.d.ts +55 -0
- package/dist/types/core/payment.d.ts +21 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useBaseWallet.d.ts +54 -0
- package/dist/types/hooks/usePayState.d.ts +3 -1
- package/dist/types/hooks/useRetry.console-tests.d.ts +41 -0
- package/dist/types/hooks/useRetry.d.ts +22 -3
- package/dist/types/i18n/locales/de-DE.d.ts +23 -0
- package/dist/types/i18n/locales/en-GB.d.ts +23 -0
- package/dist/types/i18n/locales/es-ES.d.ts +23 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +23 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +23 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +23 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +23 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +23 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +23 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +23 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +23 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +23 -0
- package/dist/types/out/base-fraud-detection.d.ts +1 -0
- package/dist/types/out/config.d.ts +6 -1
- package/dist/types/out/fraud-detection.d.ts +2 -8
- package/dist/types/out/types.d.ts +3 -1
- package/dist/types/out/worldpay-ddc-manager.d.ts +6 -7
- package/dist/types/types/event.d.ts +46 -13
- package/dist/types/types/index.d.ts +8 -37
- package/dist/types/types/message.d.ts +48 -7
- package/dist/types/types/payment.d.ts +63 -0
- package/dist/types/utils/app-payment.d.ts +7 -3
- package/dist/types/utils/behavior-tracker.d.ts +36 -0
- package/dist/types/utils/env.d.ts +37 -0
- package/dist/types/utils/iframe.d.ts +1 -1
- package/dist/types/utils/payment.d.ts +10 -10
- package/package.json +12 -5
- package/dist/es/components/Boost/index.js +0 -348
- package/dist/es/components/GrabPay/index.js +0 -348
- package/dist/es/components/LinePay/index.js +0 -348
- package/dist/es/components/MayBankQRPay/index.js +0 -354
- package/dist/es/components/NinePay/index.js +0 -348
- package/dist/es/components/ShopeePay/index.js +0 -348
- package/dist/es/components/TNGWallet/index.js +0 -348
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +0 -10
- package/dist/types/components/NinePay/NinePay.d.ts +0 -10
- package/dist/types/utils/logger.d.ts +0 -14
- /package/dist/types/components/{Boost → wallets/Boost}/index.d.ts +0 -0
- /package/dist/types/components/{GrabPay → wallets/GrabPay}/index.d.ts +0 -0
- /package/dist/types/components/{LinePay → wallets/LinePay}/index.d.ts +0 -0
- /package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/index.d.ts +0 -0
- /package/dist/types/components/{NinePay → wallets/NinePay}/index.d.ts +0 -0
- /package/dist/types/components/{ShopeePay → wallets/ShopeePay}/index.d.ts +0 -0
- /package/dist/types/components/{TNGWallet → wallets/TNGWallet}/index.d.ts +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { AllFieldType } from '../components/SecuredFieldsProvider';
|
|
1
2
|
import type { ChannelCode } from '../constant';
|
|
2
3
|
import type { PaymentMethod } from '../constant';
|
|
3
4
|
/**
|
|
4
5
|
* 事件类型
|
|
5
6
|
* 适用于埋点上报
|
|
6
7
|
*/
|
|
7
|
-
export type EventType = FraudDetectionEventType | ApplePayEventType | GooglePayEventType | PaymentEventType | ThreeDSEventType;
|
|
8
|
+
export type EventType = FraudDetectionEventType | ApplePayEventType | GooglePayEventType | PaymentEventType | ThreeDSEventType | LoggerEventType | SecurityIframeEventType;
|
|
8
9
|
export type EventData<T extends EventType> = EventDataMapping[T];
|
|
9
10
|
/** fraud detection 事件类型 */
|
|
10
11
|
export declare enum FraudDetectionEventType {
|
|
@@ -52,8 +53,10 @@ export declare enum GooglePayEventType {
|
|
|
52
53
|
GOOGLE_PAY_CANCELLED = "googlePay:cancelled"
|
|
53
54
|
}
|
|
54
55
|
export declare enum PaymentEventType {
|
|
55
|
-
/**
|
|
56
|
+
/** 支付开始 */
|
|
56
57
|
PAYMENT_START = "payment:start",
|
|
58
|
+
/** 支付响应 */
|
|
59
|
+
PAYMENT_RESPONSE = "payment:response",
|
|
57
60
|
/** 支付成功 */
|
|
58
61
|
PAYMENT_SUCCESS = "payment:success",
|
|
59
62
|
/** 支付失败 */
|
|
@@ -61,9 +64,13 @@ export declare enum PaymentEventType {
|
|
|
61
64
|
/** 支付超时,超时并不代表支付失败,只是没有及时获取到结果 */
|
|
62
65
|
PAYMENT_TIMEOUT = "payment:timeout",
|
|
63
66
|
/** 支付过期 */
|
|
64
|
-
PAYMENT_EXPIRED = "payment:expired"
|
|
67
|
+
PAYMENT_EXPIRED = "payment:expired",
|
|
68
|
+
/** 支付被风控滞留 */
|
|
69
|
+
PAYMENT_AUTHORIZED = "payment:authorized"
|
|
65
70
|
}
|
|
66
71
|
export declare enum ThreeDSEventType {
|
|
72
|
+
/** 3DS 开始 */
|
|
73
|
+
THREE_DS_START = "threeDS:start",
|
|
67
74
|
/** 3DS 取消(一般由用户主动关闭弹窗触发,但并不代表 3DS 流程没走完) */
|
|
68
75
|
THREE_DS_CANCELLED = "threeDS:cancelled",
|
|
69
76
|
/** 3DS 继续认证(展示继续认证页面时触发) */
|
|
@@ -71,15 +78,21 @@ export declare enum ThreeDSEventType {
|
|
|
71
78
|
/** 3DS 结束(并不代表成功) */
|
|
72
79
|
THREE_DS_END = "threeDS:end",
|
|
73
80
|
/** 3DS 认证(认证页面加载,可能是渠道的,也可能是我们自己的,依赖设计) */
|
|
74
|
-
THREE_DS_AUTH = "threeDS:auth"
|
|
81
|
+
THREE_DS_AUTH = "threeDS:auth",
|
|
82
|
+
/** 3DS 内嵌渠道页面加载 */
|
|
83
|
+
THREE_DS_INNER_CHANNEL = "threeDS:innerChannel"
|
|
75
84
|
}
|
|
76
85
|
export declare enum SecurityIframeEventType {
|
|
77
|
-
/** 安全 iframe
|
|
78
|
-
|
|
79
|
-
/** 安全 iframe
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
/** 安全 iframe 加载成功 */
|
|
87
|
+
SECURITY_IFRAME_LOADED = "securityIframe:loaded",
|
|
88
|
+
/** 安全 iframe 加载失败 */
|
|
89
|
+
SECURITY_IFRAME_LOAD_ERROR = "securityIframe:loadError"
|
|
90
|
+
}
|
|
91
|
+
export declare enum LoggerEventType {
|
|
92
|
+
/** 设备 */
|
|
93
|
+
ENV = "logger:env",
|
|
94
|
+
/** 行为 */
|
|
95
|
+
BEHAVIOR = "logger:behavior"
|
|
83
96
|
}
|
|
84
97
|
export interface EventDataMapping {
|
|
85
98
|
[FraudDetectionEventType.FRAUD_DETECTION_TRANSFORM_ERROR]: undefined;
|
|
@@ -102,17 +115,22 @@ export interface EventDataMapping {
|
|
|
102
115
|
[GooglePayEventType.GOOGLE_PAY_AUTHORIZED]: undefined;
|
|
103
116
|
[GooglePayEventType.GOOGLE_PAY_CANCELLED]: undefined;
|
|
104
117
|
[PaymentEventType.PAYMENT_START]: PaymentBaseData;
|
|
118
|
+
[PaymentEventType.PAYMENT_RESPONSE]: PaymentBaseData;
|
|
105
119
|
[PaymentEventType.PAYMENT_SUCCESS]: PaymentBaseData;
|
|
106
120
|
[PaymentEventType.PAYMENT_FAILURE]: PaymentFailureEventData;
|
|
107
121
|
[PaymentEventType.PAYMENT_TIMEOUT]: PaymentBaseData;
|
|
108
122
|
[PaymentEventType.PAYMENT_EXPIRED]: PaymentBaseData;
|
|
123
|
+
[PaymentEventType.PAYMENT_AUTHORIZED]: PaymentBaseData;
|
|
124
|
+
[ThreeDSEventType.THREE_DS_START]: undefined;
|
|
109
125
|
[ThreeDSEventType.THREE_DS_CANCELLED]: undefined;
|
|
110
126
|
[ThreeDSEventType.THREE_DS_CONTINUE]: undefined;
|
|
111
127
|
[ThreeDSEventType.THREE_DS_END]: undefined;
|
|
112
128
|
[ThreeDSEventType.THREE_DS_AUTH]: undefined;
|
|
113
|
-
[
|
|
114
|
-
[SecurityIframeEventType.
|
|
115
|
-
[SecurityIframeEventType.
|
|
129
|
+
[ThreeDSEventType.THREE_DS_INNER_CHANNEL]: undefined;
|
|
130
|
+
[SecurityIframeEventType.SECURITY_IFRAME_LOADED]: SecurityIframeBaseData;
|
|
131
|
+
[SecurityIframeEventType.SECURITY_IFRAME_LOAD_ERROR]: SecurityIframeBaseData;
|
|
132
|
+
[LoggerEventType.ENV]: Recordable;
|
|
133
|
+
[LoggerEventType.BEHAVIOR]: Recordable;
|
|
116
134
|
}
|
|
117
135
|
export interface CommonEventData {
|
|
118
136
|
message?: string;
|
|
@@ -123,6 +141,8 @@ export interface FraudDetectionBaseData {
|
|
|
123
141
|
/** ddc专用 */
|
|
124
142
|
bin?: string;
|
|
125
143
|
id?: string;
|
|
144
|
+
/** 耗时,单位:毫秒 */
|
|
145
|
+
time?: number;
|
|
126
146
|
}
|
|
127
147
|
export interface FraudDetectionErrorData extends FraudDetectionBaseData {
|
|
128
148
|
/** 错误信息 */
|
|
@@ -133,5 +153,18 @@ export interface PaymentFailureEventData extends PaymentBaseData {
|
|
|
133
153
|
code?: string;
|
|
134
154
|
}
|
|
135
155
|
export interface PaymentBaseData {
|
|
156
|
+
/** 支付方式 */
|
|
136
157
|
paymentMethod?: PaymentMethod;
|
|
158
|
+
/** 会话 ID */
|
|
159
|
+
sessionId?: string;
|
|
160
|
+
/** 订单 ID */
|
|
161
|
+
orderId?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface SecurityIframeBaseData {
|
|
164
|
+
/** 表单类型 */
|
|
165
|
+
fieldType?: AllFieldType;
|
|
166
|
+
/** 是否是隐藏 iframe */
|
|
167
|
+
hidden?: boolean;
|
|
168
|
+
/** iframe 的 url */
|
|
169
|
+
url?: string;
|
|
137
170
|
}
|
|
@@ -2,15 +2,16 @@ import type { HTMLAttributes } from 'preact/compat';
|
|
|
2
2
|
import type { LocaleKeyType } from '../i18n';
|
|
3
3
|
import type { PayKKaError } from '../core';
|
|
4
4
|
import type { FraudDetectionEnv } from './fraud-detection';
|
|
5
|
-
import type { FormValidateError } from '../components/internal/Form';
|
|
6
5
|
import type { PaymentMethod } from '../constant';
|
|
7
6
|
import type { Amount, OrderStatus, SessionStatus } from '../api';
|
|
7
|
+
import type { PaymentCommonProps } from './payment';
|
|
8
8
|
export * from './fraud-detection';
|
|
9
9
|
export * from './message';
|
|
10
10
|
export * from './event';
|
|
11
11
|
export type CustomAttributes<T extends EventTarget, K extends keyof HTMLAttributes<T> = 'style' | 'className'> = Pick<HTMLAttributes<T>, K>;
|
|
12
12
|
/** 收银台初始化参数 */
|
|
13
|
-
export interface PayKKaInitConfiguration extends PayKKaCommonConfig {
|
|
13
|
+
export interface PayKKaInitConfiguration extends PayKKaCommonConfig, PaymentCommonProps {
|
|
14
|
+
/** 会话 ID */
|
|
14
15
|
sessionId?: string;
|
|
15
16
|
/** 环境配置,必传! */
|
|
16
17
|
env: PayKKaEnvType;
|
|
@@ -21,47 +22,17 @@ export interface PayKKaInitConfiguration extends PayKKaCommonConfig {
|
|
|
21
22
|
/** 定义 3DS 所需配置 */
|
|
22
23
|
threeDSFrame?: ThreeDSFrameConfig;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* 收银台已经获取到可用支付方式时调用
|
|
26
|
+
* @param methods 可用支付方式列表
|
|
26
27
|
*/
|
|
27
|
-
/** 收银台已经获取到可用支付方式时调用 */
|
|
28
28
|
onPaymentMethodsReady?: (methods: PaymentMethod[]) => void;
|
|
29
|
-
/** 收银台创建时报错触发 */
|
|
30
|
-
onInitError?: (error: PayKKaError) => void;
|
|
31
29
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* 收银台创建时报错触发
|
|
31
|
+
* @param error 错误信息
|
|
34
32
|
*/
|
|
35
|
-
|
|
36
|
-
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
37
|
-
/** 支付成功后触发 */
|
|
38
|
-
onSuccess?: (data: PaymentInfo) => void;
|
|
39
|
-
/** 支付失败时触发 */
|
|
40
|
-
onError?: (error: PayKKaError) => void;
|
|
41
|
-
/** 支付超时时触发 */
|
|
42
|
-
onTimeout?: () => void;
|
|
43
|
-
/** 收银台已过期时触发 */
|
|
44
|
-
onExpired?: () => void;
|
|
33
|
+
onInitError?: (error: PayKKaError) => void;
|
|
45
34
|
}
|
|
46
35
|
export interface PayKKaCheckoutConfig {
|
|
47
|
-
/**
|
|
48
|
-
* 是否启用初始化验证
|
|
49
|
-
* 收银台内置对 sessionId 等参数进行校验,但不同收银台校验规则不同,需要自行校验
|
|
50
|
-
* @defaultValue true
|
|
51
|
-
*/
|
|
52
|
-
enableInitValidation?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* API 地址前缀,不同收银台的 API 地址前缀不同
|
|
55
|
-
* @defaultValue /session
|
|
56
|
-
*/
|
|
57
|
-
apiPrefix?: string;
|
|
58
|
-
/**
|
|
59
|
-
* 地址模式,不同收银台的地址模式不同
|
|
60
|
-
* address: 地址模式,需要展示国家、省市区等所有地址输入框
|
|
61
|
-
* country: 国家模式,只需要展示国家选择框
|
|
62
|
-
* @defaultValue 'address'
|
|
63
|
-
*/
|
|
64
|
-
addressMode?: AddressMode;
|
|
65
36
|
}
|
|
66
37
|
export type AddressMode = 'address' | 'country';
|
|
67
38
|
/** 公共配置属性 */
|
|
@@ -57,6 +57,8 @@ export declare const enum MessageAction {
|
|
|
57
57
|
THREE_DS_STATUS_CONFIG = "threeDSStatusConfig",
|
|
58
58
|
/** 通知 3DS 认证页面加载 */
|
|
59
59
|
THREE_DS_AUTH_LOADED = "threeDSAuthLoaded",
|
|
60
|
+
/** 通知 3DS 渠道页面加载,一般指的是内嵌在 iframe 里面的渠道挑战页面 */
|
|
61
|
+
THREE_DS_INNER_CHANNEL_LOADED = "threeDSInnerChannelLoaded",
|
|
60
62
|
/** 开启测试模式 */
|
|
61
63
|
DEBUG_MODE = "debugMode",
|
|
62
64
|
/**
|
|
@@ -65,7 +67,11 @@ export declare const enum MessageAction {
|
|
|
65
67
|
/** 通知组件 DDC 结果 */
|
|
66
68
|
DDC_RESULT = "ddcResult",
|
|
67
69
|
/** 通知 DDC iframe jwt 和 bin 信息 */
|
|
68
|
-
DDC_JWT_BIN = "ddcJwtBin"
|
|
70
|
+
DDC_JWT_BIN = "ddcJwtBin",
|
|
71
|
+
/** 通知隐藏 iframe 发送卡号前 9 位信息 */
|
|
72
|
+
DDC_CARD_BIN = "ddcCardBin",
|
|
73
|
+
/** iframe 内错误 */
|
|
74
|
+
IFRAME_ERROR = "iframeError"
|
|
69
75
|
}
|
|
70
76
|
export type Message<T extends MessageAction> = {
|
|
71
77
|
action: T;
|
|
@@ -86,17 +92,20 @@ type MessageMapping = {
|
|
|
86
92
|
[MessageAction.AUTHORIZED]: AuthorizedMessage;
|
|
87
93
|
[MessageAction.BRAND]: BrandMessage;
|
|
88
94
|
[MessageAction.ACTIVATED]: ActivatedMessage;
|
|
89
|
-
[MessageAction.HIDDEN_IFRAME_READY]:
|
|
95
|
+
[MessageAction.HIDDEN_IFRAME_READY]: HiddenIframeReadyMessage;
|
|
90
96
|
[MessageAction.VALIDATE]: {} extends BaseMessage ? {} : BaseMessage;
|
|
91
97
|
[MessageAction.VALIDATED]: ValidatedMessage;
|
|
92
98
|
[MessageAction.SET_CONFIG]: SetConfigMessage;
|
|
93
99
|
[MessageAction.CHECK_THREE_DS]: CheckThreeDSMessage;
|
|
94
100
|
[MessageAction.THREE_DS_STATUS_INIT]: {};
|
|
95
101
|
[MessageAction.THREE_DS_STATUS_CONFIG]: ThreeDSStatusConfigMessage;
|
|
96
|
-
[MessageAction.THREE_DS_AUTH_LOADED]:
|
|
102
|
+
[MessageAction.THREE_DS_AUTH_LOADED]: ThreeDSAuthLoadedMessage;
|
|
103
|
+
[MessageAction.THREE_DS_INNER_CHANNEL_LOADED]: BaseMessage;
|
|
97
104
|
[MessageAction.DEBUG_MODE]: {};
|
|
98
105
|
[MessageAction.DDC_RESULT]: DDCResultMessage;
|
|
99
106
|
[MessageAction.DDC_JWT_BIN]: DDCJwtBinMessage;
|
|
107
|
+
[MessageAction.DDC_CARD_BIN]: DDCCardBinMessage;
|
|
108
|
+
[MessageAction.IFRAME_ERROR]: IframeErrorMessage;
|
|
100
109
|
};
|
|
101
110
|
export interface BaseMessage {
|
|
102
111
|
/** 收银台 id */
|
|
@@ -130,15 +139,21 @@ export interface ValidWithValueMessage extends BaseMessage {
|
|
|
130
139
|
value: string;
|
|
131
140
|
fieldType: AllFieldType;
|
|
132
141
|
}
|
|
142
|
+
export interface PaymentBaseMessage extends BaseMessage {
|
|
143
|
+
api: string;
|
|
144
|
+
success: boolean;
|
|
145
|
+
time: number;
|
|
146
|
+
code?: string;
|
|
147
|
+
}
|
|
133
148
|
export interface PaymentMessage extends BaseMessage {
|
|
134
149
|
formData: CheckoutPaymentParams;
|
|
135
150
|
locale: string;
|
|
136
151
|
extraParams?: Recordable;
|
|
137
152
|
}
|
|
138
|
-
export interface AfterPaymentMessage extends
|
|
153
|
+
export interface AfterPaymentMessage extends PaymentBaseMessage {
|
|
139
154
|
response: PayRes;
|
|
140
155
|
}
|
|
141
|
-
export interface PaymentErrorMessage extends
|
|
156
|
+
export interface PaymentErrorMessage extends PaymentBaseMessage {
|
|
142
157
|
error: {
|
|
143
158
|
message: string;
|
|
144
159
|
code: string;
|
|
@@ -149,7 +164,7 @@ export interface ValidStatusChangedMessage extends BaseMessage {
|
|
|
149
164
|
errorTip?: string;
|
|
150
165
|
fieldType: AllFieldType;
|
|
151
166
|
}
|
|
152
|
-
export interface PaymentTimeoutMessage extends
|
|
167
|
+
export interface PaymentTimeoutMessage extends PaymentBaseMessage {
|
|
153
168
|
message?: string;
|
|
154
169
|
}
|
|
155
170
|
export interface CardEncryptedMessage extends BaseMessage {
|
|
@@ -181,6 +196,8 @@ export interface ValidatedMessage extends BaseMessage {
|
|
|
181
196
|
}
|
|
182
197
|
export interface SetConfigMessage extends BaseMessage {
|
|
183
198
|
style?: InputStylesConfig;
|
|
199
|
+
/** 是否禁用 */
|
|
200
|
+
disabled?: boolean;
|
|
184
201
|
}
|
|
185
202
|
export interface CheckThreeDSMessage extends BaseMessage {
|
|
186
203
|
status: string;
|
|
@@ -191,9 +208,33 @@ export interface ThreeDSStatusConfigMessage extends BaseMessage {
|
|
|
191
208
|
export interface DDCResultMessage extends BaseMessage {
|
|
192
209
|
sessionId: string;
|
|
193
210
|
}
|
|
194
|
-
export interface DDCJwtBinMessage {
|
|
211
|
+
export interface DDCJwtBinMessage extends Partial<BaseMessage> {
|
|
195
212
|
jwt: string;
|
|
196
213
|
bin: string;
|
|
197
214
|
url: string;
|
|
215
|
+
/** 隐藏 iframe 名称 */
|
|
216
|
+
hiddenIframeName?: string;
|
|
217
|
+
}
|
|
218
|
+
export interface HiddenIframeReadyMessage extends BaseMessage {
|
|
219
|
+
name: string;
|
|
220
|
+
}
|
|
221
|
+
export interface IframeRequestMessage extends BaseMessage {
|
|
222
|
+
request: Recordable;
|
|
223
|
+
}
|
|
224
|
+
export interface IframeErrorMessage extends BaseMessage {
|
|
225
|
+
fieldType?: AllFieldType;
|
|
226
|
+
error: {
|
|
227
|
+
message?: string;
|
|
228
|
+
code?: string;
|
|
229
|
+
stack?: string;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export interface DDCCardBinMessage extends BaseMessage {
|
|
233
|
+
/** 卡号前 9 位 */
|
|
234
|
+
bin?: string;
|
|
235
|
+
}
|
|
236
|
+
export interface ThreeDSAuthLoadedMessage extends BaseMessage {
|
|
237
|
+
/** 认证记录 id,标识当前认证 */
|
|
238
|
+
authId: string | undefined;
|
|
198
239
|
}
|
|
199
240
|
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PaymentMethod } from '../constant';
|
|
2
|
+
import type { PayKKaError } from '../core/error';
|
|
3
|
+
import type { PaymentInfo } from '../types';
|
|
4
|
+
import type { FormValidateError } from '../components/internal/Form';
|
|
5
|
+
/** 支付方式上下文数据,在各种支付回调中传递,可扩展 */
|
|
6
|
+
export interface PaymentMethodContext {
|
|
7
|
+
/** 当前支付方式 */
|
|
8
|
+
paymentMethod?: PaymentMethod;
|
|
9
|
+
/** 订单 ID */
|
|
10
|
+
orderId?: string;
|
|
11
|
+
/** 会话 ID */
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 支付方式公共 props */
|
|
15
|
+
export interface PaymentCommonProps {
|
|
16
|
+
/**
|
|
17
|
+
* 提交表单时触发
|
|
18
|
+
* @param error 表单校验错误信息,为空则说明校验通过
|
|
19
|
+
* @param context 支付方式上下文数据
|
|
20
|
+
* @remarks
|
|
21
|
+
* 创建 PayKKaCheckout 时定义的 onSubmit 回调会被组件的同名回调覆盖
|
|
22
|
+
*/
|
|
23
|
+
onSubmit?: (error: Recordable<FormValidateError[]> | undefined, context: PaymentMethodContext) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 支付成功后触发
|
|
26
|
+
* @param data 支付成功数据
|
|
27
|
+
* @param context 支付方式上下文数据
|
|
28
|
+
* @remarks
|
|
29
|
+
* 创建 PayKKaCheckout 时定义的 onSuccess 回调会被组件的同名回调覆盖
|
|
30
|
+
*/
|
|
31
|
+
onSuccess?: (data: PaymentInfo, context: PaymentMethodContext) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 支付失败时触发,可再次支付
|
|
34
|
+
* @param error 支付失败信息
|
|
35
|
+
* @param context 支付方式上下文数据
|
|
36
|
+
* @remarks
|
|
37
|
+
* 创建 PayKKaCheckout 时定义的 onError 回调会被组件的同名回调覆盖
|
|
38
|
+
*/
|
|
39
|
+
onError?: (error: PayKKaError, context: PaymentMethodContext) => void;
|
|
40
|
+
/**
|
|
41
|
+
* 支付超时时触发,可再次支付
|
|
42
|
+
* @param type 超时类型,retry 表示重试,channel 表示渠道
|
|
43
|
+
* @param context 支付方式上下文数据
|
|
44
|
+
* @remarks
|
|
45
|
+
* 创建 PayKKaCheckout 时定义的 onTimeout 回调会被组件的同名回调覆盖
|
|
46
|
+
*/
|
|
47
|
+
onTimeout?: (type: 'retry' | 'channel', context: PaymentMethodContext) => void;
|
|
48
|
+
/**
|
|
49
|
+
* 收银台已过期时触发
|
|
50
|
+
* @param context 支付方式上下文数据
|
|
51
|
+
* @remarks
|
|
52
|
+
* 创建 PayKKaCheckout 时定义的 onExpired 回调会被组件的同名回调覆盖
|
|
53
|
+
*/
|
|
54
|
+
onExpired?: (context: PaymentMethodContext) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface PaymentThreeDSProps {
|
|
57
|
+
}
|
|
58
|
+
export interface PaymentCommonRef {
|
|
59
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
60
|
+
payment: () => void;
|
|
61
|
+
}
|
|
62
|
+
export interface PaymentThreeDSRef {
|
|
63
|
+
}
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
export declare const isApp3DSWebView: boolean;
|
|
6
6
|
/** 通知 app 3ds 完成 */
|
|
7
7
|
export declare const report3DSFinished2App: () => void;
|
|
8
|
-
|
|
8
|
+
export declare const getAppContextFromUA: () => any;
|
|
9
|
+
/**
|
|
10
|
+
* 获取 app 日志 id
|
|
11
|
+
* 由于 IOS 低版本兼容问题,无法直接植入 js 方法到 webview 中,只能通过 ua 获取
|
|
12
|
+
*/
|
|
9
13
|
export declare const getAppLoggerId: () => {
|
|
10
|
-
sid:
|
|
11
|
-
pid:
|
|
14
|
+
sid: any;
|
|
15
|
+
pid: any;
|
|
12
16
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface BehaviorTrackerData {
|
|
2
|
+
/** 初始化时间 */
|
|
3
|
+
startTime: number;
|
|
4
|
+
/** 点击次数 */
|
|
5
|
+
clickTimes: number;
|
|
6
|
+
/** 首次点击时间(相对初始化时间而言) */
|
|
7
|
+
firstClickTime: number;
|
|
8
|
+
/** 鼠标移动次数 */
|
|
9
|
+
mouseMoveTimes: number;
|
|
10
|
+
/** 触摸移动次数 */
|
|
11
|
+
touchMoveTimes: number;
|
|
12
|
+
/** 触摸开始次数 */
|
|
13
|
+
touchStartTimes: number;
|
|
14
|
+
/** 滚动次数 */
|
|
15
|
+
scrollTimes: number;
|
|
16
|
+
/** 键盘输入次数 */
|
|
17
|
+
keydownTimes: number;
|
|
18
|
+
/** 焦点变化次数 */
|
|
19
|
+
focusChangeTimes: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 用户行为追踪
|
|
23
|
+
* 用于收集用户行为数据,用于后续分析和优化
|
|
24
|
+
* 如果使用了模拟器/自动化工具,则能通过收集到的数据判断
|
|
25
|
+
*/
|
|
26
|
+
export declare class BehaviorTracker {
|
|
27
|
+
#private;
|
|
28
|
+
static instance: BehaviorTracker;
|
|
29
|
+
constructor();
|
|
30
|
+
get data(): BehaviorTrackerData;
|
|
31
|
+
/** 开始监听用户行为 */
|
|
32
|
+
init(): void;
|
|
33
|
+
/** 停止监听用户行为 */
|
|
34
|
+
destroy(): void;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const getWebGLInfo: () => {
|
|
2
|
+
vendor: any;
|
|
3
|
+
renderer: any;
|
|
4
|
+
};
|
|
5
|
+
export declare const isExceptionUA: () => boolean;
|
|
6
|
+
/** 获取环境特征信息 */
|
|
7
|
+
export declare const getEnvInfo: () => {
|
|
8
|
+
/** 是否为移动端 */
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
/** 是否为安全上下文 */
|
|
11
|
+
isSecureContext: boolean;
|
|
12
|
+
/** 是否为顶层窗口 */
|
|
13
|
+
isTopWindow: boolean;
|
|
14
|
+
/** 是否为 iframe */
|
|
15
|
+
isIframe: boolean;
|
|
16
|
+
/** 是否为自动化 */
|
|
17
|
+
webdriver: boolean;
|
|
18
|
+
/** 插件数量,该特性已经过时,所以如果没有值也很正常,如果是 0 则有可能是模拟器/自动化 */
|
|
19
|
+
pluginsNum: number;
|
|
20
|
+
/** 硬件并发数,如果是 0 则有可能是模拟器/自动化 */
|
|
21
|
+
hardwareConcurrency: number;
|
|
22
|
+
/** 屏幕宽度,模拟器/自动化的分辨率会比较小或奇怪 */
|
|
23
|
+
screenWidth: number;
|
|
24
|
+
/** 屏幕高度,模拟器/自动化的分辨率会比较小或奇怪 */
|
|
25
|
+
screenHeight: number;
|
|
26
|
+
/** 设备像素比,模拟器/自动化的设备像素比可能是 1,但对应 UA 却是高端设备 */
|
|
27
|
+
devicePixelRatio: number;
|
|
28
|
+
/** WebGL 信息,模拟器/自动化可能无法获取或者直接获取到模拟器的真实信息 */
|
|
29
|
+
webgl: {
|
|
30
|
+
vendor: any;
|
|
31
|
+
renderer: any;
|
|
32
|
+
};
|
|
33
|
+
/** UA 是否包含自动化特征 */
|
|
34
|
+
isExceptionUA: boolean;
|
|
35
|
+
/** 最大触摸点数,模拟器/自动化的最大触摸点数可能是 0 或 1 */
|
|
36
|
+
maxTouchPoints: number;
|
|
37
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const createIframe: (src: string) => HTMLIFrameElement;
|
|
2
|
-
export declare const postMessageToIframe: (data: Recordable | string, iframe: Window, targetOrigin?: string) => void;
|
|
2
|
+
export declare const postMessageToIframe: (data: Recordable | string, iframe: Window | null, targetOrigin?: string) => void;
|
|
@@ -5,23 +5,23 @@ import type { CheckoutRes, PayRes } from '../api';
|
|
|
5
5
|
import type { PaymentInfo } from '../types';
|
|
6
6
|
export interface PaymentCallbackConfig {
|
|
7
7
|
/** 订单处理中,定时查询订单 */
|
|
8
|
-
onProcessing?: () => void
|
|
8
|
+
onProcessing?: () => void | Promise<void>;
|
|
9
9
|
/** 订单已授权,提示用户,跳转商户页面 */
|
|
10
|
-
onAuthorized?: () => void
|
|
10
|
+
onAuthorized?: () => void | Promise<void>;
|
|
11
11
|
/** 订单需要3DS认证,跳转3DS认证页面 */
|
|
12
|
-
onInThreeDS?: () => void
|
|
12
|
+
onInThreeDS?: () => void | Promise<void>;
|
|
13
13
|
/** 上一次3DS认证未完成,跳转3DS认证页面 */
|
|
14
|
-
onInPreviousThreeDS?: () => void
|
|
14
|
+
onInPreviousThreeDS?: () => void | Promise<void>;
|
|
15
15
|
/** 订单取消,导致查询超时 */
|
|
16
|
-
onCanceled?: () => void
|
|
16
|
+
onCanceled?: () => void | Promise<void>;
|
|
17
17
|
/** 订单成功,支付成功 */
|
|
18
|
-
onSuccess?: () => void
|
|
18
|
+
onSuccess?: () => void | Promise<void>;
|
|
19
19
|
/** 订单失败,支付失败 */
|
|
20
|
-
onFailure?: () => void
|
|
20
|
+
onFailure?: () => void | Promise<void>;
|
|
21
21
|
/** 订单过期,支付过期 */
|
|
22
|
-
onExpired?: () => void
|
|
22
|
+
onExpired?: () => void | Promise<void>;
|
|
23
23
|
/** 不属于其他任何状态,兜底逻辑 */
|
|
24
|
-
onDefault?: () => void
|
|
24
|
+
onDefault?: () => void | Promise<void>;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* 处理支付状态的判断
|
|
@@ -29,7 +29,7 @@ export interface PaymentCallbackConfig {
|
|
|
29
29
|
* @param res 支付结果
|
|
30
30
|
* @param config 支付回调
|
|
31
31
|
*/
|
|
32
|
-
export declare const processPaymentStatus: (res: PayRes, config: PaymentCallbackConfig) => void
|
|
32
|
+
export declare const processPaymentStatus: (res: PayRes, config: PaymentCallbackConfig) => Promise<void>;
|
|
33
33
|
/**
|
|
34
34
|
* 格式化支付结果
|
|
35
35
|
* @param res
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paykka/card-checkout-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/paykka-card-checkout-ui.umd.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -25,18 +25,22 @@
|
|
|
25
25
|
"build:type": "tsc -p ./tsconfig.build.json",
|
|
26
26
|
"copy-dist-to-cdn": "tsx ./build/copyDist2CDN.ts",
|
|
27
27
|
"changeset": "changeset",
|
|
28
|
-
"changeset:
|
|
28
|
+
"changeset:fat-enter": "changeset pre enter beta",
|
|
29
|
+
"changeset:dev-enter": "changeset pre enter alpha",
|
|
30
|
+
"changeset:sandbox-enter": "changeset pre enter rc",
|
|
31
|
+
"changeset:fat": "changeset publish --tag beta",
|
|
32
|
+
"changeset:dev": "changeset publish --tag alpha",
|
|
33
|
+
"changeset:sandbox": "changeset publish --tag rc",
|
|
29
34
|
"changeset:pre-exit": "changeset pre exit",
|
|
30
35
|
"changeset:version": "changeset version",
|
|
31
36
|
"changeset:release": "changeset publish",
|
|
32
|
-
"changeset:prelease": "changeset publish --tag beta",
|
|
33
|
-
"type-check": "tsc --noEmit -p tsconfig.json --composite false",
|
|
34
37
|
"release:dev": "node scripts/release.cjs dev",
|
|
35
38
|
"release:fat": "node scripts/release.cjs fat",
|
|
36
39
|
"release:sandbox": "node scripts/release.cjs sandbox",
|
|
40
|
+
"release:noprod": "node scripts/release.cjs noprod",
|
|
37
41
|
"release:npm": "node scripts/release.cjs npm",
|
|
38
42
|
"release:prod": "node scripts/release.cjs prod",
|
|
39
|
-
"
|
|
43
|
+
"type-check": "tsc --noEmit -p tsconfig.json --composite false"
|
|
40
44
|
},
|
|
41
45
|
"publishConfig": {
|
|
42
46
|
"registry": "https://packages.aliyun.com/640edee5a84870ae9d591e48/npm/npm-registry/"
|
|
@@ -57,10 +61,13 @@
|
|
|
57
61
|
"vue-tsc": "^2.1.10"
|
|
58
62
|
},
|
|
59
63
|
"devDependencies": {
|
|
64
|
+
"@babel/core": "^7.29.0",
|
|
65
|
+
"@babel/preset-env": "^7.29.2",
|
|
60
66
|
"@changesets/cli": "^2.27.1",
|
|
61
67
|
"@preact/preset-vite": "^2.9.1",
|
|
62
68
|
"@types/node": "^20.12.7",
|
|
63
69
|
"autoprefixer": "^10.4.18",
|
|
70
|
+
"core-js": "^3.49.0",
|
|
64
71
|
"execa": "^8.0.1",
|
|
65
72
|
"fast-glob": "^3.3.2",
|
|
66
73
|
"sass": "^1.71.1",
|