@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ThreeDSStatus } from '../api';
|
|
1
2
|
import type { AllFieldType } from '../components/SecuredFieldsProvider';
|
|
2
3
|
import type { ChannelCode } from '../constant';
|
|
3
4
|
import type { PaymentMethod } from '../constant';
|
|
@@ -5,7 +6,7 @@ import type { PaymentMethod } from '../constant';
|
|
|
5
6
|
* 事件类型
|
|
6
7
|
* 适用于埋点上报
|
|
7
8
|
*/
|
|
8
|
-
export type EventType = FraudDetectionEventType | ApplePayEventType | GooglePayEventType | PaymentEventType | ThreeDSEventType | LoggerEventType | SecurityIframeEventType;
|
|
9
|
+
export type EventType = FraudDetectionEventType | ApplePayEventType | GooglePayEventType | PaymentEventType | ThreeDSEventType | LoggerEventType | SecurityIframeEventType | WechatPayEventType;
|
|
9
10
|
export type EventData<T extends EventType> = EventDataMapping[T];
|
|
10
11
|
/** fraud detection 事件类型 */
|
|
11
12
|
export declare enum FraudDetectionEventType {
|
|
@@ -27,6 +28,8 @@ export declare enum FraudDetectionEventType {
|
|
|
27
28
|
FRAUD_DETECTION_WARNING = "fraudDetection:warning"
|
|
28
29
|
}
|
|
29
30
|
export declare enum ApplePayEventType {
|
|
31
|
+
/** Apple Pay 环境检测失败 */
|
|
32
|
+
APPLE_PAY_ENV_CHECK_ERROR = "applePay:envCheckError",
|
|
30
33
|
/** Apple Pay SDK 加载失败 */
|
|
31
34
|
APPLE_PAY_LOAD_ERROR = "applePay:loadError",
|
|
32
35
|
/** 当前环境不支持 Apple Pay */
|
|
@@ -52,6 +55,16 @@ export declare enum GooglePayEventType {
|
|
|
52
55
|
/** Google Pay 取消支付 */
|
|
53
56
|
GOOGLE_PAY_CANCELLED = "googlePay:cancelled"
|
|
54
57
|
}
|
|
58
|
+
export declare enum WechatPayEventType {
|
|
59
|
+
/** 微信支付开始 */
|
|
60
|
+
WECHAT_PAY_START = "wechatPay:start",
|
|
61
|
+
/** 微信支付成功 */
|
|
62
|
+
WECHAT_PAY_SUCCESS = "wechatPay:success",
|
|
63
|
+
/** 微信支付失败 */
|
|
64
|
+
WECHAT_PAY_FAILURE = "wechatPay:failure",
|
|
65
|
+
/** 微信支付取消 */
|
|
66
|
+
WECHAT_PAY_CANCELLED = "wechatPay:cancelled"
|
|
67
|
+
}
|
|
55
68
|
export declare enum PaymentEventType {
|
|
56
69
|
/** 支付开始 */
|
|
57
70
|
PAYMENT_START = "payment:start",
|
|
@@ -78,7 +91,9 @@ export declare enum ThreeDSEventType {
|
|
|
78
91
|
/** 3DS 结束(并不代表成功) */
|
|
79
92
|
THREE_DS_END = "threeDS:end",
|
|
80
93
|
/** 3DS 认证(认证页面加载,可能是渠道的,也可能是我们自己的,依赖设计) */
|
|
81
|
-
THREE_DS_AUTH = "threeDS:auth"
|
|
94
|
+
THREE_DS_AUTH = "threeDS:auth",
|
|
95
|
+
/** 3DS 内嵌渠道页面加载 */
|
|
96
|
+
THREE_DS_INNER_CHANNEL = "threeDS:innerChannel"
|
|
82
97
|
}
|
|
83
98
|
export declare enum SecurityIframeEventType {
|
|
84
99
|
/** 安全 iframe 加载成功 */
|
|
@@ -107,6 +122,7 @@ export interface EventDataMapping {
|
|
|
107
122
|
[ApplePayEventType.APPLE_PAY_VALIDATE_MERCHANT]: undefined;
|
|
108
123
|
[ApplePayEventType.APPLE_PAY_AUTHORIZED]: undefined;
|
|
109
124
|
[ApplePayEventType.APPLE_PAY_CANCELLED]: undefined;
|
|
125
|
+
[ApplePayEventType.APPLE_PAY_ENV_CHECK_ERROR]: CommonEventData;
|
|
110
126
|
[GooglePayEventType.GOOGLE_PAY_LOAD_ERROR]: undefined;
|
|
111
127
|
[GooglePayEventType.GOOGLE_PAY_CAN_NOT_USE]: undefined;
|
|
112
128
|
[GooglePayEventType.GOOGLE_PAY_BUTTON_CLICKED]: undefined;
|
|
@@ -123,11 +139,16 @@ export interface EventDataMapping {
|
|
|
123
139
|
[ThreeDSEventType.THREE_DS_CANCELLED]: undefined;
|
|
124
140
|
[ThreeDSEventType.THREE_DS_CONTINUE]: undefined;
|
|
125
141
|
[ThreeDSEventType.THREE_DS_END]: undefined;
|
|
126
|
-
[ThreeDSEventType.THREE_DS_AUTH]:
|
|
142
|
+
[ThreeDSEventType.THREE_DS_AUTH]: ThreeDSAuthData;
|
|
143
|
+
[ThreeDSEventType.THREE_DS_INNER_CHANNEL]: undefined;
|
|
127
144
|
[SecurityIframeEventType.SECURITY_IFRAME_LOADED]: SecurityIframeBaseData;
|
|
128
145
|
[SecurityIframeEventType.SECURITY_IFRAME_LOAD_ERROR]: SecurityIframeBaseData;
|
|
129
146
|
[LoggerEventType.ENV]: Recordable;
|
|
130
147
|
[LoggerEventType.BEHAVIOR]: Recordable;
|
|
148
|
+
[WechatPayEventType.WECHAT_PAY_START]: undefined;
|
|
149
|
+
[WechatPayEventType.WECHAT_PAY_SUCCESS]: undefined;
|
|
150
|
+
[WechatPayEventType.WECHAT_PAY_FAILURE]: CommonEventData;
|
|
151
|
+
[WechatPayEventType.WECHAT_PAY_CANCELLED]: undefined;
|
|
131
152
|
}
|
|
132
153
|
export interface CommonEventData {
|
|
133
154
|
message?: string;
|
|
@@ -138,6 +159,8 @@ export interface FraudDetectionBaseData {
|
|
|
138
159
|
/** ddc专用 */
|
|
139
160
|
bin?: string;
|
|
140
161
|
id?: string;
|
|
162
|
+
/** 耗时,单位:毫秒 */
|
|
163
|
+
time?: number;
|
|
141
164
|
}
|
|
142
165
|
export interface FraudDetectionErrorData extends FraudDetectionBaseData {
|
|
143
166
|
/** 错误信息 */
|
|
@@ -163,3 +186,7 @@ export interface SecurityIframeBaseData {
|
|
|
163
186
|
/** iframe 的 url */
|
|
164
187
|
url?: string;
|
|
165
188
|
}
|
|
189
|
+
export interface ThreeDSAuthData {
|
|
190
|
+
/** 3DS 状态 */
|
|
191
|
+
status?: ThreeDSStatus;
|
|
192
|
+
}
|
|
@@ -80,6 +80,14 @@ export declare enum PaymentStatus {
|
|
|
80
80
|
/** 上一次 3DS 认证未完成 */
|
|
81
81
|
IN_PREVIOUS_THREEDS = "IN_PREVIOUS_THREEDS"
|
|
82
82
|
}
|
|
83
|
+
export declare enum PaymentAction {
|
|
84
|
+
/** 扫码支付 */
|
|
85
|
+
SCAN_CODE = "SCAN_CODE",
|
|
86
|
+
/** 跳转支付 */
|
|
87
|
+
REDIRECT = "REDIRECT",
|
|
88
|
+
/** 跳转支付(POST 方式) */
|
|
89
|
+
REDIRECT_POST = "REDIRECT_POST"
|
|
90
|
+
}
|
|
83
91
|
export interface BasePaymentInfo {
|
|
84
92
|
/** 会话 ID */
|
|
85
93
|
sessionId?: string;
|
|
@@ -115,6 +123,12 @@ export interface BasePaymentInfo {
|
|
|
115
123
|
requestMethod?: string;
|
|
116
124
|
/** 支付过期时间 */
|
|
117
125
|
paymentExpiredAt?: string;
|
|
126
|
+
/** 支付动作 */
|
|
127
|
+
action?: PaymentAction;
|
|
128
|
+
/** 二维码 */
|
|
129
|
+
qrCode?: string;
|
|
130
|
+
/** 请求数据,POST 方式跳转时需要传递 */
|
|
131
|
+
requestData?: Recordable;
|
|
118
132
|
/** 其他支付信息 */
|
|
119
133
|
[key: string]: any;
|
|
120
134
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CardBrand, InputStylesConfig } from '.';
|
|
2
|
-
import type { CheckoutPaymentParams, PayRes } from '../api';
|
|
2
|
+
import type { CheckoutPaymentParams, PayRes, ThreeDSStatus } from '../api';
|
|
3
3
|
import type { EncryptCardRes } from '../api/modules/encrypted-card/type';
|
|
4
4
|
import type { AllFieldType, FieldIframeConfig } from '../components/SecuredFieldsProvider';
|
|
5
5
|
import type { FormValidationStatus } from '../components/internal/Form';
|
|
@@ -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
|
/**
|
|
@@ -66,6 +68,8 @@ export declare const enum MessageAction {
|
|
|
66
68
|
DDC_RESULT = "ddcResult",
|
|
67
69
|
/** 通知 DDC iframe jwt 和 bin 信息 */
|
|
68
70
|
DDC_JWT_BIN = "ddcJwtBin",
|
|
71
|
+
/** 通知隐藏 iframe 发送卡号前 9 位信息 */
|
|
72
|
+
DDC_CARD_BIN = "ddcCardBin",
|
|
69
73
|
/** iframe 内错误 */
|
|
70
74
|
IFRAME_ERROR = "iframeError"
|
|
71
75
|
}
|
|
@@ -88,17 +92,19 @@ type MessageMapping = {
|
|
|
88
92
|
[MessageAction.AUTHORIZED]: AuthorizedMessage;
|
|
89
93
|
[MessageAction.BRAND]: BrandMessage;
|
|
90
94
|
[MessageAction.ACTIVATED]: ActivatedMessage;
|
|
91
|
-
[MessageAction.HIDDEN_IFRAME_READY]:
|
|
95
|
+
[MessageAction.HIDDEN_IFRAME_READY]: HiddenIframeReadyMessage;
|
|
92
96
|
[MessageAction.VALIDATE]: {} extends BaseMessage ? {} : BaseMessage;
|
|
93
97
|
[MessageAction.VALIDATED]: ValidatedMessage;
|
|
94
98
|
[MessageAction.SET_CONFIG]: SetConfigMessage;
|
|
95
99
|
[MessageAction.CHECK_THREE_DS]: CheckThreeDSMessage;
|
|
96
100
|
[MessageAction.THREE_DS_STATUS_INIT]: {};
|
|
97
101
|
[MessageAction.THREE_DS_STATUS_CONFIG]: ThreeDSStatusConfigMessage;
|
|
98
|
-
[MessageAction.THREE_DS_AUTH_LOADED]:
|
|
102
|
+
[MessageAction.THREE_DS_AUTH_LOADED]: ThreeDSAuthLoadedMessage;
|
|
103
|
+
[MessageAction.THREE_DS_INNER_CHANNEL_LOADED]: BaseMessage;
|
|
99
104
|
[MessageAction.DEBUG_MODE]: {};
|
|
100
105
|
[MessageAction.DDC_RESULT]: DDCResultMessage;
|
|
101
106
|
[MessageAction.DDC_JWT_BIN]: DDCJwtBinMessage;
|
|
107
|
+
[MessageAction.DDC_CARD_BIN]: DDCCardBinMessage;
|
|
102
108
|
[MessageAction.IFRAME_ERROR]: IframeErrorMessage;
|
|
103
109
|
};
|
|
104
110
|
export interface BaseMessage {
|
|
@@ -190,6 +196,8 @@ export interface ValidatedMessage extends BaseMessage {
|
|
|
190
196
|
}
|
|
191
197
|
export interface SetConfigMessage extends BaseMessage {
|
|
192
198
|
style?: InputStylesConfig;
|
|
199
|
+
/** 是否禁用 */
|
|
200
|
+
disabled?: boolean;
|
|
193
201
|
}
|
|
194
202
|
export interface CheckThreeDSMessage extends BaseMessage {
|
|
195
203
|
status: string;
|
|
@@ -200,10 +208,15 @@ export interface ThreeDSStatusConfigMessage extends BaseMessage {
|
|
|
200
208
|
export interface DDCResultMessage extends BaseMessage {
|
|
201
209
|
sessionId: string;
|
|
202
210
|
}
|
|
203
|
-
export interface DDCJwtBinMessage {
|
|
211
|
+
export interface DDCJwtBinMessage extends Partial<BaseMessage> {
|
|
204
212
|
jwt: string;
|
|
205
213
|
bin: string;
|
|
206
214
|
url: string;
|
|
215
|
+
/** 隐藏 iframe 名称 */
|
|
216
|
+
hiddenIframeName?: string;
|
|
217
|
+
}
|
|
218
|
+
export interface HiddenIframeReadyMessage extends BaseMessage {
|
|
219
|
+
name: string;
|
|
207
220
|
}
|
|
208
221
|
export interface IframeRequestMessage extends BaseMessage {
|
|
209
222
|
request: Recordable;
|
|
@@ -216,4 +229,14 @@ export interface IframeErrorMessage extends BaseMessage {
|
|
|
216
229
|
stack?: string;
|
|
217
230
|
};
|
|
218
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;
|
|
239
|
+
/** 3DS 状态 */
|
|
240
|
+
status?: ThreeDSStatus;
|
|
241
|
+
}
|
|
219
242
|
export {};
|
|
@@ -6,17 +6,40 @@ import type { FormValidateError } from '../components/internal/Form';
|
|
|
6
6
|
export interface PaymentMethodContext {
|
|
7
7
|
/** 当前支付方式 */
|
|
8
8
|
paymentMethod?: PaymentMethod;
|
|
9
|
+
/** 订单 ID */
|
|
10
|
+
orderId?: string;
|
|
11
|
+
/** 会话 ID */
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 自定义表单字段展示配置 */
|
|
15
|
+
export interface PaymentCustomFieldsProps {
|
|
16
|
+
/**
|
|
17
|
+
* 是否展示邮箱
|
|
18
|
+
* @remarks
|
|
19
|
+
* - 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
20
|
+
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
showEmail?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 是否展示邮箱
|
|
26
|
+
* @remarks
|
|
27
|
+
* - 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
28
|
+
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
showAddress?: boolean;
|
|
9
32
|
}
|
|
10
33
|
/** 支付方式公共 props */
|
|
11
|
-
export interface PaymentCommonProps {
|
|
34
|
+
export interface PaymentCommonProps extends PaymentCustomFieldsProps {
|
|
12
35
|
/**
|
|
13
|
-
*
|
|
36
|
+
* 提交表单时触发,返回 false 则不继续支付,支持异步
|
|
14
37
|
* @param error 表单校验错误信息,为空则说明校验通过
|
|
15
38
|
* @param context 支付方式上下文数据
|
|
16
39
|
* @remarks
|
|
17
40
|
* 创建 PayKKaCheckout 时定义的 onSubmit 回调会被组件的同名回调覆盖
|
|
18
41
|
*/
|
|
19
|
-
onSubmit?: (error: Recordable<FormValidateError[]> | undefined, context: PaymentMethodContext) => void
|
|
42
|
+
onSubmit?: (error: Recordable<FormValidateError[]> | undefined, context: PaymentMethodContext) => void | boolean | Promise<void | boolean>;
|
|
20
43
|
/**
|
|
21
44
|
* 支付成功后触发
|
|
22
45
|
* @param data 支付成功数据
|
|
@@ -57,3 +80,7 @@ export interface PaymentCommonRef {
|
|
|
57
80
|
}
|
|
58
81
|
export interface PaymentThreeDSRef {
|
|
59
82
|
}
|
|
83
|
+
export interface PaymentRetryRef {
|
|
84
|
+
}
|
|
85
|
+
export interface PaymentFormFieldsRef {
|
|
86
|
+
}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 删除数组中特定元素,改变原数组
|
|
3
|
+
* @param array 要删除元素的数组
|
|
4
|
+
* @param element 要删除的元素
|
|
5
|
+
*/
|
|
1
6
|
export declare const removeElementFromArray: (array: any[], element: any) => void;
|
|
7
|
+
/**
|
|
8
|
+
* 获取多个数组的交集 A∩B∩C
|
|
9
|
+
* @param arrays 要获取交集的数组
|
|
10
|
+
* @returns 交集数组
|
|
11
|
+
*/
|
|
12
|
+
export declare const intersection: <T>(...arrays: T[][]) => T[];
|
|
13
|
+
/**
|
|
14
|
+
* 获取多个数组的差集 A∖(B∪C)
|
|
15
|
+
* @param arrays 要获取差集的数组
|
|
16
|
+
* @returns 差集数组
|
|
17
|
+
*/
|
|
18
|
+
export declare const difference: <T>(...arrays: T[][]) => T[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WalletChannelParams } from '../../api';
|
|
2
|
+
/**
|
|
3
|
+
* 计算交易金额加上渠道手续费后的总金额
|
|
4
|
+
* @param amount 交易金额
|
|
5
|
+
* @param channelParams 渠道参数
|
|
6
|
+
*/
|
|
7
|
+
export declare const calcAmountWithFee: (amount: number | undefined | null, channelParams: WalletChannelParams | undefined) => number | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './amount';
|
|
@@ -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;
|
|
@@ -53,9 +53,4 @@ export declare const safeStringify: (data: any, defaultValue?: string) => string
|
|
|
53
53
|
* @returns 是否过期
|
|
54
54
|
*/
|
|
55
55
|
export declare const isExpired: (expireDate: string) => boolean;
|
|
56
|
-
|
|
57
|
-
* 获取多个数组的交集
|
|
58
|
-
* @param arrays 要获取交集的数组
|
|
59
|
-
* @returns 交集数组
|
|
60
|
-
*/
|
|
61
|
-
export declare const intersection: <T>(...arrays: T[][]) => T[];
|
|
56
|
+
export declare const getReferrer: () => string;
|
|
@@ -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
|
|
@@ -3,3 +3,13 @@
|
|
|
3
3
|
* 根据支付方式选择使用 GET 或 POST 方式跳转
|
|
4
4
|
*/
|
|
5
5
|
export declare const redirectToPayment: (payInfo: Recordable) => void;
|
|
6
|
+
/**
|
|
7
|
+
* 使用 GET 方式跳转
|
|
8
|
+
* 直接在当前页面打开新的页面
|
|
9
|
+
*/
|
|
10
|
+
export declare const redirectByGet: (url: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* 使用 POST 方式跳转
|
|
13
|
+
* 创建表单并提交
|
|
14
|
+
*/
|
|
15
|
+
export declare const redirectByPost: (baseUrl: string, params: Recordable) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paykka/card-checkout-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/paykka-card-checkout-ui.umd.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -25,18 +25,24 @@
|
|
|
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",
|
|
44
|
+
"prepack": "node scripts/npm-readme.cjs enable",
|
|
45
|
+
"postpack": "node scripts/npm-readme.cjs disable"
|
|
40
46
|
},
|
|
41
47
|
"publishConfig": {
|
|
42
48
|
"registry": "https://packages.aliyun.com/640edee5a84870ae9d591e48/npm/npm-registry/"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { http } from "../../http.js";
|
|
3
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const aliPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getAliPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
aliPay,
|
|
15
|
-
getAliPayInfo
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { http } from "../../http.js";
|
|
2
|
-
import { payResMap } from "../map.js";
|
|
3
|
-
import { apiPrefix } from "../../../config.js";
|
|
4
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
-
const boostPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getBoostPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
boostPay,
|
|
15
|
-
getBoostPayInfo
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { http } from "../../http.js";
|
|
3
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const gcashPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getGcashPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
gcashPay,
|
|
15
|
-
getGcashPayInfo
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { http } from "../../http.js";
|
|
3
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const grabPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getGrabPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getGrabPayInfo,
|
|
15
|
-
grabPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { http } from "../../http.js";
|
|
2
|
-
import { payResMap } from "../map.js";
|
|
3
|
-
import { apiPrefix } from "../../../config.js";
|
|
4
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
-
const linePay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getLinePayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getLinePayInfo,
|
|
15
|
-
linePay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { http } from "../../http.js";
|
|
3
|
-
import { payResMap } from "../map.js";
|
|
4
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
-
const mayBankQRPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getMayBankQRPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getMayBankQRPayInfo,
|
|
15
|
-
mayBankQRPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { http } from "../../http.js";
|
|
3
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const ninePay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getNinePayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getNinePayInfo,
|
|
15
|
-
ninePay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
3
|
-
import { http } from "../../http.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const opayWalletPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getOpayWalletPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getOpayWalletPayInfo,
|
|
15
|
-
opayWalletPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
3
|
-
import { http } from "../../http.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const pagaWalletPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getPagaWalletPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getPagaWalletPayInfo,
|
|
15
|
-
pagaWalletPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
3
|
-
import { http } from "../../http.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const paymayaPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getPaymayaPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getPaymayaPayInfo,
|
|
15
|
-
paymayaPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
3
|
-
import { http } from "../../http.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const picPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getPicPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getPicPayInfo,
|
|
15
|
-
picPay
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { apiPrefix } from "../../../config.js";
|
|
2
|
-
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
3
|
-
import { http } from "../../http.js";
|
|
4
|
-
import { payResMap } from "../map.js";
|
|
5
|
-
const pixPay = async (params, extraParams, options) => {
|
|
6
|
-
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
-
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
-
};
|
|
9
|
-
const getPixPayInfo = async (params, extraParams, options) => {
|
|
10
|
-
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
-
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getPixPayInfo,
|
|
15
|
-
pixPay
|
|
16
|
-
};
|