@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,15 @@
|
|
|
1
1
|
import type { TNGWalletProps } from './type';
|
|
2
2
|
import type { TNGWalletRef } from './type';
|
|
3
3
|
import './tng-wallet.scss';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* TNGWallet 支付方式
|
|
6
|
+
* - 表单:邮箱,地址
|
|
7
|
+
* - 支付:跳转至 TNGWallet 页面完成支付
|
|
8
|
+
*/
|
|
9
|
+
export declare const TNGWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<TNGWalletProps & import("../../../types").PayKKaCommonConfig & {
|
|
10
|
+
session: import("../../../core").Session;
|
|
11
|
+
core: import("../../../core").PayKKaCheckout;
|
|
12
|
+
threeDSFrame?: import("../../../types").ThreeDSFrameConfig | undefined;
|
|
8
13
|
isDropIn?: boolean | undefined;
|
|
9
14
|
}> & {
|
|
10
15
|
ref?: import("preact").Ref<TNGWalletRef> | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export interface TNGWalletProps extends PayKKaCommonConfig {
|
|
1
|
+
import type { PayKKaCommonConfig } from '../../../types';
|
|
2
|
+
import type { PaymentCommonProps } from '../../../types/payment';
|
|
3
|
+
export interface TNGWalletProps extends PayKKaCommonConfig, PaymentCommonProps {
|
|
5
4
|
/**
|
|
6
5
|
* 是否展示邮箱
|
|
7
6
|
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
@@ -14,16 +13,6 @@ export interface TNGWalletProps extends PayKKaCommonConfig {
|
|
|
14
13
|
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
14
|
*/
|
|
16
15
|
showAddress?: boolean;
|
|
17
|
-
/** 提交表单时触发 */
|
|
18
|
-
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
-
/** 支付成功后触发 */
|
|
20
|
-
onSuccess?: (data: PaymentInfo) => void;
|
|
21
|
-
/** 支付失败时触发 */
|
|
22
|
-
onError?: (error: PayKKaError) => void;
|
|
23
|
-
/** 支付超时时触发 */
|
|
24
|
-
onTimeout?: () => void;
|
|
25
|
-
/** 收银台已过期时触发 */
|
|
26
|
-
onExpired?: () => void;
|
|
27
16
|
}
|
|
28
17
|
export interface TNGWalletRef {
|
|
29
18
|
/** 停止轮询支付结果 */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './trustly.scss';
|
|
2
|
+
import type { TrustlyProps, TrustlyRef } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* Trustly 支付方式
|
|
5
|
+
* - 表单:指定国家,姓名,邮箱
|
|
6
|
+
* - 支付:跳转至 Trustly 页面完成支付
|
|
7
|
+
*/
|
|
8
|
+
export declare const Trustly: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<TrustlyProps & import("../../../types").PayKKaCommonConfig & {
|
|
9
|
+
session: import("../../../core").Session;
|
|
10
|
+
core: import("../../../core").PayKKaCheckout;
|
|
11
|
+
threeDSFrame?: import("../../../types").ThreeDSFrameConfig | undefined;
|
|
12
|
+
isDropIn?: boolean | undefined;
|
|
13
|
+
}> & {
|
|
14
|
+
ref?: import("preact").Ref<TrustlyRef> | undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PayKKaCommonConfig } from '../../../types';
|
|
2
|
+
import type { PaymentCommonProps } from '../../../types/payment';
|
|
3
|
+
import type { WalletCustomProps, WalletRedirectProps } from '../type';
|
|
4
|
+
export interface TrustlyProps extends PayKKaCommonConfig, WalletRedirectProps, WalletCustomProps, PaymentCommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* 是否展示地址
|
|
7
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
+
*/
|
|
10
|
+
showAddress?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TrustlyRef {
|
|
13
|
+
/** 停止轮询支付结果 */
|
|
14
|
+
stopRetry: () => void;
|
|
15
|
+
/** 开始轮询支付结果 */
|
|
16
|
+
startRetry: (timeout?: number) => void;
|
|
17
|
+
/** 更新表单地址 */
|
|
18
|
+
updateAddress: () => void;
|
|
19
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
20
|
+
payment: () => void;
|
|
21
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { VietqrProps, VietqrRef } from './type';
|
|
2
2
|
import './vietqr.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Vietqr 支付方式
|
|
5
|
+
* - 表单:邮箱,地址
|
|
6
|
+
* - 支付:移动端跳转,PC 端展示二维码弹窗
|
|
7
|
+
*/
|
|
3
8
|
export declare const Vietqr: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<VietqrProps & import("../../../types").PayKKaCommonConfig & {
|
|
4
9
|
session: import("../../../core").Session;
|
|
5
10
|
core: import("../../../core").PayKKaCheckout;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export interface VietqrProps extends PayKKaCommonConfig {
|
|
1
|
+
import type { PayKKaCommonConfig } from '../../../types';
|
|
2
|
+
import type { PaymentCommonProps } from '../../../types/payment';
|
|
3
|
+
export interface VietqrProps extends PayKKaCommonConfig, PaymentCommonProps {
|
|
5
4
|
/**
|
|
6
5
|
* 是否展示邮箱
|
|
7
6
|
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
@@ -14,16 +13,6 @@ export interface VietqrProps extends PayKKaCommonConfig {
|
|
|
14
13
|
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
14
|
*/
|
|
16
15
|
showAddress?: boolean;
|
|
17
|
-
/** 提交表单时触发 */
|
|
18
|
-
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
-
/** 支付成功后触发 */
|
|
20
|
-
onSuccess?: (data: PaymentInfo) => void;
|
|
21
|
-
/** 支付失败时触发 */
|
|
22
|
-
onError?: (error: PayKKaError) => void;
|
|
23
|
-
/** 支付超时时触发 */
|
|
24
|
-
onTimeout?: (type: 'retry' | 'channel') => void;
|
|
25
|
-
/** 收银台已过期时触发 */
|
|
26
|
-
onExpired?: () => void;
|
|
27
16
|
}
|
|
28
17
|
export interface VietqrRef {
|
|
29
18
|
/** 停止轮询支付结果 */
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ZalopayProps, ZalopayRef } from './type';
|
|
2
2
|
import './zalopay.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Zalopay 支付方式
|
|
5
|
+
* - 表单:邮箱,地址
|
|
6
|
+
* - 支付:移动端跳转,PC 端展示二维码弹窗
|
|
7
|
+
*/
|
|
3
8
|
export declare const Zalopay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ZalopayProps & import("../../../types").PayKKaCommonConfig & {
|
|
4
9
|
session: import("../../../core").Session;
|
|
5
10
|
core: import("../../../core").PayKKaCheckout;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export interface ZalopayProps extends PayKKaCommonConfig {
|
|
1
|
+
import type { PayKKaCommonConfig } from '../../../types';
|
|
2
|
+
import type { PaymentCommonProps } from '../../../types/payment';
|
|
3
|
+
export interface ZalopayProps extends PayKKaCommonConfig, PaymentCommonProps {
|
|
5
4
|
/**
|
|
6
5
|
* 是否展示邮箱
|
|
7
6
|
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
@@ -14,16 +13,6 @@ export interface ZalopayProps extends PayKKaCommonConfig {
|
|
|
14
13
|
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
14
|
*/
|
|
16
15
|
showAddress?: boolean;
|
|
17
|
-
/** 提交表单时触发 */
|
|
18
|
-
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
-
/** 支付成功后触发 */
|
|
20
|
-
onSuccess?: (data: PaymentInfo) => void;
|
|
21
|
-
/** 支付失败时触发 */
|
|
22
|
-
onError?: (error: PayKKaError) => void;
|
|
23
|
-
/** 支付超时时触发 */
|
|
24
|
-
onTimeout?: (type: 'retry' | 'channel') => void;
|
|
25
|
-
/** 收银台已过期时触发 */
|
|
26
|
-
onExpired?: () => void;
|
|
27
16
|
}
|
|
28
17
|
export interface ZalopayRef {
|
|
29
18
|
/** 停止轮询支付结果 */
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export * from './Boost';
|
|
2
|
+
export * from './GrabPay';
|
|
3
|
+
export * from './LinePay';
|
|
4
|
+
export * from './NinePay';
|
|
5
|
+
export * from './MayBankQRPay';
|
|
6
|
+
export * from './ShopeePay';
|
|
7
|
+
export * from './TNGWallet';
|
|
1
8
|
export * from './GCash';
|
|
2
9
|
export * from './Paymaya';
|
|
3
10
|
export * from './Zalopay';
|
|
@@ -6,3 +13,10 @@ export * from './Pix';
|
|
|
6
13
|
export * from './PicPay';
|
|
7
14
|
export * from './PagaWallet';
|
|
8
15
|
export * from './OpayWallet';
|
|
16
|
+
export * from './OVO';
|
|
17
|
+
export * from './Bancontact';
|
|
18
|
+
export * from './Blik';
|
|
19
|
+
export * from './IDeal';
|
|
20
|
+
export * from './Skrill';
|
|
21
|
+
export * from './P24';
|
|
22
|
+
export * from './Trustly';
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export interface
|
|
1
|
+
/** 钱包自定义配置,主要作用于展示 */
|
|
2
|
+
export interface WalletCustomProps {
|
|
3
|
+
/**
|
|
4
|
+
* 是否展示邮箱
|
|
5
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
6
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
7
|
+
* @defaultValue false
|
|
8
|
+
*/
|
|
9
|
+
showEmail?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 是否展示邮箱
|
|
12
|
+
* 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
13
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
14
|
+
* @defaultValue false
|
|
15
|
+
*/
|
|
16
|
+
showAddress?: boolean;
|
|
3
17
|
}
|
|
4
18
|
/** 通过跳转支付的钱包配置 */
|
|
5
|
-
export interface WalletRedirectProps
|
|
19
|
+
export interface WalletRedirectProps {
|
|
6
20
|
}
|
|
7
21
|
/** 通过弹窗支付的钱包配置 */
|
|
8
|
-
export interface WalletQRCodeModalProps
|
|
22
|
+
export interface WalletQRCodeModalProps {
|
|
9
23
|
}
|
package/dist/types/constant.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export declare enum PaymentMethod {
|
|
|
33
33
|
PIC_PAY = "PIC_PAY",
|
|
34
34
|
OPAY_WALLET = "OPAY_WALLET",
|
|
35
35
|
PAGA_WALLET = "PAGA_WALLET",
|
|
36
|
+
BANCONTACT = "BANCONTACT",
|
|
37
|
+
IDEAL = "IDEAL",
|
|
38
|
+
BLIK = "BLIK",
|
|
39
|
+
OVO = "OVO",
|
|
40
|
+
SKRILL = "SKRILL",
|
|
41
|
+
TRUSTLY = "TRUSTLY",
|
|
42
|
+
P24 = "P24",
|
|
36
43
|
/** 目前没用 */
|
|
37
44
|
SEPA_DEBIT = "SEPA_DEBIT"
|
|
38
45
|
}
|
|
@@ -60,7 +67,14 @@ export declare enum PaymentCategory {
|
|
|
60
67
|
PIX = "pix",
|
|
61
68
|
PIC_PAY = "picPay",
|
|
62
69
|
OPAY_WALLET = "opayWallet",
|
|
63
|
-
PAGA_WALLET = "pagaWallet"
|
|
70
|
+
PAGA_WALLET = "pagaWallet",
|
|
71
|
+
BANCONTACT = "bancontact",
|
|
72
|
+
IDEAL = "ideal",
|
|
73
|
+
BLIK = "blik",
|
|
74
|
+
OVO = "ovo",
|
|
75
|
+
SKRILL = "skrill",
|
|
76
|
+
TRUSTLY = "trustly",
|
|
77
|
+
P24 = "p24"
|
|
64
78
|
}
|
|
65
79
|
export declare const PaymentMethod2CategoryMap: Partial<Record<PaymentMethod, PaymentCategory>>;
|
|
66
80
|
export declare const PaymentCategory2MethodMap: Partial<Record<PaymentCategory, PaymentMethod[]>>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EAddressType } from '../constant';
|
|
2
|
-
import type { I18n } from '../i18n';
|
|
3
2
|
interface Option {
|
|
4
3
|
label: string;
|
|
5
4
|
value: string;
|
|
@@ -24,13 +23,11 @@ export declare class AddressCore {
|
|
|
24
23
|
private provinceOptions;
|
|
25
24
|
private cityOptions;
|
|
26
25
|
private addressState;
|
|
27
|
-
private
|
|
26
|
+
private locale;
|
|
28
27
|
private addressFormat;
|
|
29
28
|
private validateAllFields;
|
|
30
29
|
constructor();
|
|
31
|
-
|
|
32
|
-
i18n: I18n;
|
|
33
|
-
}): void;
|
|
30
|
+
setLocale(locale: string): void;
|
|
34
31
|
requestCountryOption(): Promise<void>;
|
|
35
32
|
countryOptionReady(): Promise<boolean | null>;
|
|
36
33
|
getCountryOption(): Option[];
|
|
@@ -3,9 +3,10 @@ import { type CoreProps, type PayKKaEnvConfig, type PayKKaInitConfiguration } fr
|
|
|
3
3
|
import { type ComponentInst } from './create';
|
|
4
4
|
import { Session } from './session';
|
|
5
5
|
import getFraudDetectionInstance from '../out/fraud-detection';
|
|
6
|
-
import type { PaymentMethod } from '../constant';
|
|
7
6
|
import { AddressCore } from './address';
|
|
8
7
|
import { PayKKaTheme } from './theme';
|
|
8
|
+
import { PayKKaLogger } from './logger';
|
|
9
|
+
import { PayKKaPayment } from './payment';
|
|
9
10
|
export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
|
|
10
11
|
/**
|
|
11
12
|
* 收银台实例
|
|
@@ -13,13 +14,6 @@ export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
|
|
|
13
14
|
*/
|
|
14
15
|
export declare class PayKKaCheckout {
|
|
15
16
|
#private;
|
|
16
|
-
/** 当前正在处理的支付方式,在第三方支付页面跳回收银台时,会通过 url 参数传递过来 */
|
|
17
|
-
processingPaymentMethod: PaymentMethod | null;
|
|
18
|
-
/**
|
|
19
|
-
* 当前启用的支付方式(禁用则展示禁用样式)
|
|
20
|
-
* 在 DropIn 且有正在处理的支付方式时,会设置为当前支付方式,并把其他支付方式设为禁用
|
|
21
|
-
*/
|
|
22
|
-
enablePaymentMethod: import("@preact/signals").Signal<PaymentMethod | null>;
|
|
23
17
|
constructor(config: PayKKaInitConfiguration);
|
|
24
18
|
init(): Promise<void>;
|
|
25
19
|
private initCheckoutConfig;
|
|
@@ -32,14 +26,20 @@ export declare class PayKKaCheckout {
|
|
|
32
26
|
private initLocale;
|
|
33
27
|
private initTheme;
|
|
34
28
|
private initOtherData;
|
|
29
|
+
private initLogger;
|
|
35
30
|
get session(): Session;
|
|
36
31
|
get theme(): PayKKaTheme;
|
|
37
32
|
get envConfig(): PayKKaEnvConfig;
|
|
38
33
|
get config(): PayKKaInitConfiguration;
|
|
39
34
|
get id(): string;
|
|
40
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* 创建组件
|
|
37
|
+
* @param component 组件
|
|
38
|
+
* @param props 组件 props
|
|
39
|
+
*/
|
|
41
40
|
create<P extends Recordable>(component: ComponentType<P> | ((props: P) => JSX.Element), props?: Partial<P> | null): ComponentInst<P>;
|
|
42
41
|
getCoreProps(): CoreProps;
|
|
43
|
-
resetEnablePaymentMethod(): void;
|
|
44
42
|
getAddressCore(): AddressCore;
|
|
43
|
+
get logger(): PayKKaLogger | undefined;
|
|
44
|
+
get payment(): PayKKaPayment | undefined;
|
|
45
45
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* 为什么不用环境变量?因为需要打包成 NPM 包,环境由用户传入
|
|
5
5
|
*/
|
|
6
6
|
import type { PayKKaEnvType } from '../types';
|
|
7
|
+
export declare const DEV_ORIGIN = "https://checkout-dev.eu.paykka.com";
|
|
8
|
+
export declare const FAT_ORIGIN = "https://checkout-fat.eu.paykka.com";
|
|
9
|
+
export declare const SANDBOX_ORIGIN = "https://checkout-sandbox.aq.paykka.com";
|
|
10
|
+
export declare const HK_ORIGIN = "https://checkout.aq.paykka.com";
|
|
11
|
+
export declare const EU_ORIGIN = "https://checkout.eu.paykka.com";
|
|
7
12
|
export declare const origin2Env: Record<string, PayKKaEnvType>;
|
|
8
13
|
export declare const apiEnv: Record<PayKKaEnvType, string>;
|
|
9
14
|
export declare const cdnEnv: Record<PayKKaEnvType, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 前端错误信息枚举,为了防止与后端 code 冲突做的区分 */
|
|
2
|
-
export declare enum
|
|
2
|
+
export declare enum EPayKKaErrorReason {
|
|
3
3
|
/** worldpay ddc 错误 */
|
|
4
4
|
DDC_ERROR = "DDC_ERROR",
|
|
5
5
|
/** worldpay ddc 超时 */
|
|
@@ -20,11 +20,17 @@ export declare enum EPayKKaError {
|
|
|
20
20
|
TIMEOUT = "TIMEOUT"
|
|
21
21
|
}
|
|
22
22
|
export declare class PayKKaError extends Error {
|
|
23
|
+
/** 错误名称,用来在上报时进行区分 */
|
|
24
|
+
name: string;
|
|
23
25
|
/** 错误类型 */
|
|
24
26
|
type: keyof typeof EPayKKaError;
|
|
25
|
-
/**
|
|
27
|
+
/** 错误信息 */
|
|
28
|
+
msg?: string;
|
|
29
|
+
/** 错误码 */
|
|
26
30
|
code?: string;
|
|
27
|
-
|
|
31
|
+
/** 错误原因 */
|
|
32
|
+
cause?: any;
|
|
33
|
+
constructor(type: keyof typeof EPayKKaError, msg?: string | EPayKKaErrorReason, info?: {
|
|
28
34
|
code?: string;
|
|
29
35
|
cause?: any;
|
|
30
36
|
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 监控上报相关工具函数
|
|
3
|
+
*
|
|
4
|
+
* @see {@link https://jlpay.yuque.com/fsx9z5/zxl6gq/gllvvfa22s7mat85#bDnRM}
|
|
5
|
+
*/
|
|
6
|
+
import type { PayKKaError } from '../core';
|
|
7
|
+
import { type EventData, type EventType, type PayKKaEnvType } from '../types';
|
|
8
|
+
type LoggerCollect = 'ENV' | 'BEHAVIOR';
|
|
9
|
+
interface LoggerOptions {
|
|
10
|
+
/** 监控项目 id */
|
|
11
|
+
pid?: string;
|
|
12
|
+
/** 监控会话 id */
|
|
13
|
+
sid?: string;
|
|
14
|
+
/** 监控环境 */
|
|
15
|
+
env?: PayKKaEnvType;
|
|
16
|
+
/** 收集监控数据,默认收集所有数据 */
|
|
17
|
+
collect?: LoggerCollect[];
|
|
18
|
+
}
|
|
19
|
+
export interface RequestLogInfo {
|
|
20
|
+
/** 请求接口 */
|
|
21
|
+
api: string;
|
|
22
|
+
/** 是否调用成功 */
|
|
23
|
+
success: boolean;
|
|
24
|
+
/** 接口耗时 */
|
|
25
|
+
time: number;
|
|
26
|
+
/** 返回码 */
|
|
27
|
+
code?: string;
|
|
28
|
+
/** 返回信息 */
|
|
29
|
+
msg?: string;
|
|
30
|
+
/** API请求开始时间戳 */
|
|
31
|
+
timestamp?: number;
|
|
32
|
+
/** 业务状态码 */
|
|
33
|
+
retCode?: string;
|
|
34
|
+
}
|
|
35
|
+
/** 监控上报,只上报收银台相关日志 */
|
|
36
|
+
export declare class PayKKaLogger {
|
|
37
|
+
constructor();
|
|
38
|
+
init(options?: LoggerOptions): Promise<void>;
|
|
39
|
+
/** 上报自定义事件 */
|
|
40
|
+
reportCustomEvent(event: EventType, data?: EventData<EventType>): void;
|
|
41
|
+
/** 上报错误 */
|
|
42
|
+
reportErrorEvent(error: PayKKaError): void;
|
|
43
|
+
/** 上报请求 */
|
|
44
|
+
reportRequestEvent(request: RequestLogInfo): void;
|
|
45
|
+
setLoggerOptions(options: Recordable): void;
|
|
46
|
+
/**
|
|
47
|
+
* 在日志上报前执行,拦截部分日志上报
|
|
48
|
+
* 1. 过滤接口日志,只上报收银台相关接口,用接口域名判断
|
|
49
|
+
* 2. 过滤错误日志,只上报包含特定属性的错误
|
|
50
|
+
* 3. 过滤资源加载日志,只上报收银台相关资源
|
|
51
|
+
*/
|
|
52
|
+
private beforeSendEvent;
|
|
53
|
+
private load;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PaymentMethod } from '../constant';
|
|
2
|
+
import type { Session } from './session';
|
|
3
|
+
/** 储存全局支付相关状态和方法 */
|
|
4
|
+
export declare class PayKKaPayment {
|
|
5
|
+
#private;
|
|
6
|
+
/**
|
|
7
|
+
* 当前正在处理(支付或查询)的支付方式
|
|
8
|
+
* @remarks
|
|
9
|
+
* 当 currPaymentMethod 不为 null,就表示当前处于支付或查询状态,所有支付方式表单、按钮禁用,也无法切换支付方式
|
|
10
|
+
*/
|
|
11
|
+
currPaymentMethod: import("@preact/signals").Signal<PaymentMethod | null>;
|
|
12
|
+
constructor(session: Session);
|
|
13
|
+
init(): void;
|
|
14
|
+
/**
|
|
15
|
+
* 根据 url 参数获取当前正在处理(支付或查询)的支付方式
|
|
16
|
+
* @remarks
|
|
17
|
+
* 如果 url 参数中的支付方式不在支持的支付方式列表中,则不做处理
|
|
18
|
+
*/
|
|
19
|
+
getCurrPaymentMethodByUrlParam(): void;
|
|
20
|
+
resetCurrPaymentMethod(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PaymentMethod } from '../constant';
|
|
2
|
+
import type { WalletCustomProps, WalletRedirectProps, WalletQRCodeModalProps } from '../components/wallets/type';
|
|
3
|
+
import type { BasePaymentInfo, CoreProps } from '../types';
|
|
4
|
+
import { type FieldStatusConfig } from '../api';
|
|
5
|
+
import type { PaymentButtonStatus } from '../components/PaymentButton';
|
|
6
|
+
import type { PaymentCommonProps, PaymentMethodContext } from '../types/payment';
|
|
7
|
+
export type BaseWalletProps = WalletCustomProps & WalletRedirectProps & WalletQRCodeModalProps & CoreProps & PaymentCommonProps;
|
|
8
|
+
export type BaseWalletOptions = {
|
|
9
|
+
/** 轮询超时时间 */
|
|
10
|
+
retryTimeout?: number;
|
|
11
|
+
/** 是否支持二维码支付弹窗,若不支持,则直接采用跳转方式 */
|
|
12
|
+
supportQRCodeModal?: boolean;
|
|
13
|
+
/** 获取最终处理过的表单数据 */
|
|
14
|
+
getFormData: () => Recordable;
|
|
15
|
+
/** 处理支付中状态 */
|
|
16
|
+
onProcessing?: (paymentInfo: BasePaymentInfo) => void | Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 基础钱包通用逻辑
|
|
20
|
+
* @param paymentMethod - 支付方式
|
|
21
|
+
* @param baseProps - 钱包组件 props
|
|
22
|
+
*/
|
|
23
|
+
export declare const useBaseWallet: (paymentMethod: PaymentMethod, baseProps: BaseWalletProps, options: BaseWalletOptions) => {
|
|
24
|
+
payment: (timeout?: number) => Promise<{
|
|
25
|
+
end: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
search: (timeout?: number) => Promise<{
|
|
28
|
+
end: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
startRetry: (timeout?: number) => void;
|
|
31
|
+
stopRetry: () => void;
|
|
32
|
+
setPaymentButtonStatus: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<PaymentButtonStatus>>;
|
|
33
|
+
paymentButtonStatus: PaymentButtonStatus;
|
|
34
|
+
errorMessage: string;
|
|
35
|
+
setErrorMessage: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>;
|
|
36
|
+
showQRCodeModal: boolean;
|
|
37
|
+
setShowQRCodeModal: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
|
|
38
|
+
qrCodeInfo: {
|
|
39
|
+
/** 二维码地址 */
|
|
40
|
+
qrCode: string;
|
|
41
|
+
/** 二维码过期时间 */
|
|
42
|
+
expiredTime?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
setQrCodeInfo: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<{
|
|
45
|
+
/** 二维码地址 */
|
|
46
|
+
qrCode: string;
|
|
47
|
+
/** 二维码过期时间 */
|
|
48
|
+
expiredTime?: string | undefined;
|
|
49
|
+
} | undefined>>;
|
|
50
|
+
processCloseQRCodeModal: () => void;
|
|
51
|
+
isEnabled: boolean;
|
|
52
|
+
fieldStatus: FieldStatusConfig | undefined;
|
|
53
|
+
getPaymentMethodContext: () => PaymentMethodContext;
|
|
54
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PayKKaCheckout, Session } from '../core';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const usePayState: (session: Session, core?: PayKKaCheckout) => {
|
|
3
3
|
validated: boolean;
|
|
4
4
|
setValidated: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
|
|
5
5
|
errorMsg: string;
|
|
@@ -8,8 +8,10 @@ export declare function usePayState(session: Session, core?: PayKKaCheckout): {
|
|
|
8
8
|
fraudDetection: {
|
|
9
9
|
getFraudDetectionId: (options?: {
|
|
10
10
|
bin?: string | undefined;
|
|
11
|
+
hiddenIframeName?: string | undefined;
|
|
11
12
|
} | undefined) => Promise<string>;
|
|
12
13
|
createFraudDetection: () => Promise<void>;
|
|
13
14
|
} | null;
|
|
14
15
|
sessionReady: boolean;
|
|
16
|
+
disabled: boolean;
|
|
15
17
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** 纯函数:阶梯解析 + 抖动公式(固定 Math.random,便于对照) */
|
|
2
|
+
export declare function runPureConsoleTests(): {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
passed: number;
|
|
5
|
+
failed: number;
|
|
6
|
+
failures: string[];
|
|
7
|
+
};
|
|
8
|
+
/** Hook:固定 interval,cb 第 3 次 end;校验首段延迟、次数、resolve 结果 */
|
|
9
|
+
export declare function runHookFixedIntervalDemo(): Promise<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
detail: string[];
|
|
12
|
+
}>;
|
|
13
|
+
/** Hook:短阶梯 + pollTiers;校验 cb 次数与 resolve */
|
|
14
|
+
export declare function runHookPollTiersDemo(): Promise<{
|
|
15
|
+
ok: boolean;
|
|
16
|
+
detail: string[];
|
|
17
|
+
}>;
|
|
18
|
+
export type UseRetryConsoleRunSummary = {
|
|
19
|
+
pure: {
|
|
20
|
+
ok: boolean;
|
|
21
|
+
passed: number;
|
|
22
|
+
failed: number;
|
|
23
|
+
failures: string[];
|
|
24
|
+
};
|
|
25
|
+
hookFixed: {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
detail: string[];
|
|
28
|
+
};
|
|
29
|
+
hookTiers: {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
detail: string[];
|
|
32
|
+
};
|
|
33
|
+
allOk: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function runAll(): Promise<UseRetryConsoleRunSummary>;
|
|
36
|
+
export declare const __paykkaUseRetryTests: {
|
|
37
|
+
readonly runPureConsoleTests: typeof runPureConsoleTests;
|
|
38
|
+
readonly runHookFixedIntervalDemo: typeof runHookFixedIntervalDemo;
|
|
39
|
+
readonly runHookPollTiersDemo: typeof runHookPollTiersDemo;
|
|
40
|
+
readonly runAll: typeof runAll;
|
|
41
|
+
};
|
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const withRetryIntervalJitter: (interval: number) => number;
|
|
2
|
+
export type RetryPollTier = {
|
|
3
|
+
/**
|
|
4
|
+
* 已流逝时间(毫秒)严格小于本值时用本档 `interval`。
|
|
5
|
+
* 最后一档常用 {@link Number.POSITIVE_INFINITY},表示之后不再换档;总轮询时长仍由 `useRetry` 的 `timeout` 决定。
|
|
6
|
+
*/
|
|
7
|
+
until: number;
|
|
8
|
+
/** 该档内每轮间隔;值为毫秒 */
|
|
9
|
+
interval: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 前 15s 每 3s 一次
|
|
13
|
+
* 15s~60s 每 6s 一次
|
|
14
|
+
* 之后每 12s 一次,直至达到外层设置的轮询时间
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_RETRY_POLL_TIERS: RetryPollTier[];
|
|
17
|
+
export declare const getRetryIntervalForElapsed: (elapsedMs: number, tiers?: RetryPollTier[]) => number;
|
|
18
|
+
export declare const useRetry: (cb: (timeout: number) => Promise<{
|
|
2
19
|
end: boolean;
|
|
3
20
|
res?: any;
|
|
4
|
-
}>, { timeout, interval, onTimeout, onEnd }
|
|
21
|
+
}>, { timeout, interval, pollTiers, onTimeout, onEnd }?: {
|
|
5
22
|
timeout?: number;
|
|
6
23
|
interval?: number;
|
|
24
|
+
pollTiers?: RetryPollTier[];
|
|
7
25
|
onTimeout?: () => void;
|
|
8
26
|
onEnd?: (res: any) => void;
|
|
9
|
-
})
|
|
27
|
+
}) => {
|
|
10
28
|
start: (opts?: {
|
|
11
29
|
timeout?: number;
|
|
12
30
|
interval?: number;
|
|
31
|
+
pollTiers?: RetryPollTier[];
|
|
13
32
|
}) => Promise<unknown>;
|
|
14
33
|
stop: () => void;
|
|
15
34
|
};
|