@paykka/card-checkout-ui 0.8.0 → 0.11.2
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 +21 -14
- package/dist/card-checkout-ui.umd.cjs +21 -14
- package/dist/es/_commonjsHelpers.js +1 -0
- package/dist/es/api/http.js +19 -21
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/modules/ali-pay/index.js +19 -11
- package/dist/es/api/modules/apple-pay/index.js +10 -26
- package/dist/es/api/modules/boost/index.js +56 -0
- package/dist/es/api/modules/card/index.js +17 -11
- package/dist/es/api/modules/checkout/index.js +6 -6
- package/dist/es/api/modules/checkout/map.js +23 -6
- package/dist/es/api/modules/gcash/index.js +56 -0
- package/dist/es/api/modules/get-browser-params.js +2 -2
- package/dist/es/api/modules/google-pay/index.js +10 -26
- package/dist/es/api/modules/grab-pay/index.js +56 -0
- package/dist/es/api/modules/index.js +1 -1
- package/dist/es/api/modules/line-pay/index.js +56 -0
- package/dist/es/api/modules/may-bank-qr-pay/index.js +56 -0
- package/dist/es/api/modules/nine-pay/index.js +56 -0
- package/dist/es/api/modules/paymaya/index.js +56 -0
- package/dist/es/api/modules/risk/index.js +13 -0
- package/dist/es/api/modules/sepa/index.js +19 -11
- package/dist/es/api/modules/shopee-pay/index.js +56 -0
- package/dist/es/api/modules/threeDS/index.js +1 -0
- package/dist/es/api/modules/tng-wallet/index.js +56 -0
- package/dist/es/api/modules/wechat-pay/index.js +18 -31
- package/dist/es/components/AccordionItem/AccordionItem.js +37 -0
- package/dist/es/components/AccountNameField/index.js +1 -0
- package/dist/es/components/AddressField/index.js +1 -0
- package/dist/es/components/AliPay/index.js +28 -40
- package/dist/es/components/ApplePay/index.js +18 -39
- package/dist/es/components/Boost/index.js +324 -0
- package/dist/es/components/Card/index.js +80 -48
- package/dist/es/components/CardBrands/index.js +3 -2
- package/dist/es/components/CardExpireDateField/index.js +1 -0
- package/dist/es/components/CardHolderNameField/index.js +1 -0
- package/dist/es/components/CardIBANField/index.js +1 -0
- package/dist/es/components/CardNo/index.js +1 -0
- package/dist/es/components/CardNumberField/index.js +124 -106
- package/dist/es/components/CardSecurityCodeField/index.js +1 -0
- package/dist/es/components/CardSelector/index.js +1 -0
- package/dist/es/components/CombinedCardInfo/index.js +4 -0
- package/dist/es/components/DropIn/index.js +206 -50
- package/dist/es/components/EmailField/EmailField.js +14 -15
- package/dist/es/components/EncryptedCard/index.js +1 -0
- package/dist/es/components/GooglePay/index.js +7 -6
- package/dist/es/components/GrabPay/index.js +324 -0
- package/dist/es/components/GuideCard/index.js +44 -0
- package/dist/es/components/LinePay/index.js +324 -0
- package/dist/es/components/MayBankQRPay/index.js +324 -0
- package/dist/es/components/NinePay/index.js +324 -0
- package/dist/es/components/RecurringTip/index.js +1 -0
- package/dist/es/components/SecuredFieldsProvider/index.js +2 -1
- package/dist/es/components/SecuredIframe/index.js +57 -4
- package/dist/es/components/Sepa/index.js +7 -10
- package/dist/es/components/ShopeePay/index.js +324 -0
- package/dist/es/components/SubmitButton/index.js +7 -20
- package/dist/es/components/TNGWallet/index.js +324 -0
- package/dist/es/components/ThreeDS/index.js +1 -0
- package/dist/es/components/WechatPay/index.js +30 -49
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +42 -0
- package/dist/es/components/business/QRCodeModal/index.js +7 -0
- package/dist/es/components/business/QRCodeModal/qr-code-modal.js +1 -0
- package/dist/es/components/business/QRCodeModal/type.js +1 -0
- package/dist/es/components/business/index.js +7 -0
- package/dist/es/components/index.js +10 -0
- package/dist/es/components/internal/Accordion/Accordion.js +14 -0
- package/dist/es/components/internal/Accordion/accordion2.js +1 -0
- package/dist/es/components/internal/Accordion/accordionTransition.js +26 -0
- package/dist/es/components/internal/Accordion/index.js +8 -0
- package/dist/es/components/internal/Accordion/type.js +10 -0
- package/dist/es/components/internal/Button/Button.js +1 -0
- package/dist/es/components/internal/Button/index.js +1 -0
- package/dist/es/components/internal/CheckBox/CheckBox.js +1 -0
- package/dist/es/components/internal/CheckBox/index.js +1 -0
- package/dist/es/components/internal/Form/type.js +1 -0
- package/dist/es/components/internal/Info/Info.js +1 -0
- package/dist/es/components/internal/Info/index.js +1 -0
- package/dist/es/components/internal/Input/type.js +1 -0
- package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -0
- package/dist/es/components/internal/LoadingCheck/index.js +1 -0
- package/dist/es/components/internal/Modal/Modal.js +18 -3
- package/dist/es/components/internal/Modal/index.js +1 -0
- package/dist/es/components/internal/Modal/type.js +1 -0
- package/dist/es/components/internal/QRCode/QRCode.js +32 -0
- package/dist/es/components/internal/QRCode/index.js +5 -0
- package/dist/es/components/internal/QRCode/type.js +1 -0
- package/dist/es/components/internal/Select/Select.js +11 -9
- package/dist/es/components/internal/Select/SelectMenu.js +1 -0
- package/dist/es/components/internal/Select/SelectMenuItem.js +1 -0
- package/dist/es/components/internal/icons/IconBoost.js +63 -0
- package/dist/es/components/internal/icons/IconCard.js +1 -40
- package/dist/es/components/internal/icons/IconCard2.js +60 -0
- package/dist/es/components/internal/icons/IconGCash.js +196 -0
- package/dist/es/components/internal/icons/IconGcashComplete.js +184 -0
- package/dist/es/components/internal/icons/IconGrabPay.js +59 -0
- package/dist/es/components/internal/icons/IconLinePay.js +99 -0
- package/dist/es/components/internal/icons/IconMayBankQRPay.js +69 -0
- package/dist/es/components/internal/icons/IconNinePay.js +255 -0
- package/dist/es/components/internal/icons/IconPaymaya.js +114 -0
- package/dist/es/components/internal/icons/IconRedirect.js +58 -0
- package/dist/es/components/internal/icons/IconScan.js +102 -0
- package/dist/es/components/internal/icons/IconShopeePay.js +108 -0
- package/dist/es/components/internal/icons/IconTNGWallet.js +119 -0
- package/dist/es/components/internal/icons/IconUnionPay.js +65 -0
- package/dist/es/components/wallets/GCash/GCash.js +368 -0
- package/dist/es/components/wallets/GCash/g-cash.js +1 -0
- package/dist/es/components/wallets/GCash/index.js +1 -0
- package/dist/es/components/wallets/GCash/type.js +1 -0
- package/dist/es/components/wallets/Paymaya/Paymaya.js +325 -0
- package/dist/es/components/wallets/Paymaya/index.js +1 -0
- package/dist/es/components/wallets/Paymaya/paymaya2.js +1 -0
- package/dist/es/components/wallets/Paymaya/type.js +1 -0
- package/dist/es/config.js +12 -12
- package/dist/es/constant.js +84 -4
- package/dist/es/core/PayKKaCheckout.js +35 -5
- package/dist/es/core/Session.js +24 -23
- package/dist/es/core/error.js +7 -0
- package/dist/es/core/index.js +1 -0
- package/dist/es/core/query.js +3 -3
- package/dist/es/core.js +2082 -70
- package/dist/es/hooks/index.js +1 -0
- package/dist/es/hooks/useI18n.js +1 -0
- package/dist/es/hooks/usePayState.js +7 -5
- package/dist/es/i18n/I18n.js +8 -2
- package/dist/es/i18n/locales/de-DE.js +16 -1
- package/dist/es/i18n/locales/en-GB.js +16 -1
- package/dist/es/i18n/locales/es-ES.js +16 -1
- package/dist/es/i18n/locales/fr-FR.js +16 -1
- package/dist/es/i18n/locales/index.js +2 -1
- package/dist/es/i18n/locales/ja-JP.js +16 -1
- package/dist/es/i18n/locales/ko-KR.js +16 -1
- package/dist/es/i18n/locales/nl-NL.js +88 -0
- package/dist/es/i18n/locales/pt-PT.js +16 -1
- package/dist/es/i18n/locales/ru-RU.js +16 -1
- package/dist/es/i18n/locales/zh-CN.js +16 -1
- package/dist/es/i18n/locales/zh-HK.js +16 -1
- package/dist/es/i18n/locales/zh-TW.js +16 -1
- package/dist/es/i18n/util.js +12 -3
- package/dist/es/index.js +22 -0
- package/dist/es/out/fraud-detection.js +39 -13
- package/dist/es/out/worldpay-ddc.js +143 -0
- package/dist/es/style.css +1 -1192
- package/dist/es/types/event.js +15 -0
- package/dist/es/types/fraud-detection.js +1 -0
- package/dist/es/types/index.js +1 -0
- package/dist/es/types/message.js +3 -0
- package/dist/es/utils/array.js +9 -0
- package/dist/es/utils/card-brand/brands.js +11 -1
- package/dist/es/utils/card-brand/index.js +4 -3
- package/dist/es/utils/card-brand/luhn.js +25 -0
- package/dist/es/utils/date.js +25 -0
- package/dist/es/utils/detect.js +6 -0
- package/dist/es/utils/format.js +28 -12
- package/dist/es/utils/iframe.js +1 -1
- package/dist/es/utils/index.js +9 -1
- package/dist/es/utils/location.js +37 -0
- package/dist/es/utils/object.js +14 -0
- package/dist/es/utils/redirect.js +32 -0
- package/dist/es/utils/reg-exp.js +4 -0
- package/dist/es/utils/system-info/get-browser-info.js +4 -4
- package/dist/es/utils/system-info/get-system-info.js +11 -7
- package/dist/es/utils/system-info/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/api/http.d.ts +4 -10
- package/dist/types/api/modules/ali-pay/index.d.ts +2 -1
- package/dist/types/api/modules/apple-pay/index.d.ts +2 -1
- package/dist/types/api/modules/boost/index.d.ts +24 -0
- package/dist/types/api/modules/card/index.d.ts +1 -1
- package/dist/types/api/modules/checkout/index.d.ts +2 -2
- package/dist/types/api/modules/checkout/type.d.ts +9 -0
- package/dist/types/api/modules/gcash/index.d.ts +24 -0
- package/dist/types/api/modules/get-browser-params.d.ts +2 -2
- package/dist/types/api/modules/google-pay/index.d.ts +2 -1
- package/dist/types/api/modules/grab-pay/index.d.ts +24 -0
- package/dist/types/api/modules/index.d.ts +11 -0
- package/dist/types/api/modules/line-pay/index.d.ts +24 -0
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +24 -0
- package/dist/types/api/modules/nine-pay/index.d.ts +24 -0
- package/dist/types/api/modules/paymaya/index.d.ts +24 -0
- package/dist/types/api/modules/risk/index.d.ts +8 -0
- package/dist/types/api/modules/sepa/index.d.ts +2 -1
- package/dist/types/api/modules/shopee-pay/index.d.ts +24 -0
- package/dist/types/api/modules/threeDS/index.d.ts +3 -0
- package/dist/types/api/modules/tng-wallet/index.d.ts +24 -0
- package/dist/types/api/modules/wechat-pay/index.d.ts +2 -1
- package/dist/types/components/Boost/Boost.d.ts +7 -0
- package/dist/types/components/Boost/index.d.ts +2 -0
- package/dist/types/components/Boost/type.d.ts +61 -0
- package/dist/types/components/CardNumberField/type.d.ts +7 -1
- package/dist/types/components/CombinedCardInfo/type.d.ts +1 -0
- package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +1 -1
- package/dist/types/components/DropIn/config.d.ts +7 -0
- package/dist/types/components/DropIn/type.d.ts +11 -3
- package/dist/types/components/GrabPay/GrabPay.d.ts +7 -0
- package/dist/types/components/GrabPay/index.d.ts +2 -0
- package/dist/types/components/GrabPay/type.d.ts +61 -0
- package/dist/types/components/GuideCard/GuideCard.d.ts +3 -0
- package/dist/types/components/GuideCard/index.d.ts +2 -0
- package/dist/types/components/GuideCard/type.d.ts +4 -0
- package/dist/types/components/LinePay/LinePay.d.ts +7 -0
- package/dist/types/components/LinePay/index.d.ts +2 -0
- package/dist/types/components/LinePay/type.d.ts +61 -0
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -0
- package/dist/types/components/MayBankQRPay/index.d.ts +2 -0
- package/dist/types/components/MayBankQRPay/type.d.ts +61 -0
- package/dist/types/components/NinePay/NinePay.d.ts +6 -0
- package/dist/types/components/NinePay/index.d.ts +2 -0
- package/dist/types/components/NinePay/type.d.ts +61 -0
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +1 -1
- package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +1 -1
- package/dist/types/components/ShopeePay/ShopeePay.d.ts +7 -0
- package/dist/types/components/ShopeePay/index.d.ts +2 -0
- package/dist/types/components/ShopeePay/type.d.ts +61 -0
- package/dist/types/components/SubmitButton/SubmitButton.d.ts +1 -1
- package/dist/types/components/TNGWallet/TNGWallet.d.ts +7 -0
- package/dist/types/components/TNGWallet/index.d.ts +2 -0
- package/dist/types/components/TNGWallet/type.d.ts +61 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +1 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/output.d.ts +1 -1
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/type.d.ts +13 -3
- package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +3 -0
- package/dist/types/components/business/QRCodeModal/index.d.ts +2 -0
- package/dist/types/components/business/QRCodeModal/type.d.ts +18 -0
- package/dist/types/components/business/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +9 -0
- package/dist/types/components/internal/Accordion/Accordion.d.ts +3 -0
- package/dist/types/components/internal/Accordion/accordionTransition.d.ts +8 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/AccordionItem.d.ts +3 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/index.d.ts +2 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/type.d.ts +18 -0
- package/dist/types/components/internal/Accordion/index.d.ts +3 -0
- package/dist/types/components/internal/Accordion/type.d.ts +18 -0
- package/dist/types/components/internal/Modal/type.d.ts +2 -0
- package/dist/types/components/internal/QRCode/QRCode.d.ts +2 -0
- package/dist/types/components/internal/QRCode/index.d.ts +2 -0
- package/dist/types/components/internal/QRCode/type.d.ts +9 -0
- package/dist/types/components/internal/Select/Select.d.ts +1 -17
- package/dist/types/components/internal/Select/type.d.ts +26 -1
- package/dist/types/components/internal/icons/IconBoost.d.ts +2 -0
- package/dist/types/components/internal/icons/IconCard2.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGCash.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGcashComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGrabPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconLinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconMayBankQRPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconNinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconPaymaya.d.ts +2 -0
- package/dist/types/components/internal/icons/IconRedirect.d.ts +2 -0
- package/dist/types/components/internal/icons/IconScan.d.ts +2 -0
- package/dist/types/components/internal/icons/IconShopeePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconTNGWallet.d.ts +2 -0
- package/dist/types/components/internal/icons/IconUnionPay.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +13 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +6 -0
- package/dist/types/components/wallets/GCash/index.d.ts +2 -0
- package/dist/types/components/wallets/GCash/type.d.ts +71 -0
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -0
- package/dist/types/components/wallets/Paymaya/index.d.ts +2 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +61 -0
- package/dist/types/config.d.ts +9 -9
- package/dist/types/constant.d.ts +28 -3
- package/dist/types/core/PayKKaCheckout.d.ts +10 -0
- package/dist/types/core/Session.d.ts +2 -0
- package/dist/types/core/error.d.ts +15 -2
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/hooks/usePayState.d.ts +5 -5
- package/dist/types/i18n/I18n.d.ts +1 -1
- package/dist/types/i18n/locales/de-DE.d.ts +13 -0
- package/dist/types/i18n/locales/en-GB.d.ts +13 -0
- package/dist/types/i18n/locales/es-ES.d.ts +13 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +13 -0
- package/dist/types/i18n/locales/index.d.ts +2 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +13 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +13 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +71 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +13 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +13 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +13 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +13 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +13 -0
- package/dist/types/i18n/util.d.ts +5 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/out/fraud-detection.d.ts +5 -1
- package/dist/types/out/types.d.ts +4 -0
- package/dist/types/out/worldpay-ddc-iframe.d.ts +1 -0
- package/dist/types/out/worldpay-ddc.d.ts +37 -0
- package/dist/types/types/event.d.ts +26 -0
- package/dist/types/types/fraud-detection.d.ts +3 -1
- package/dist/types/types/index.d.ts +23 -4
- package/dist/types/types/message.d.ts +22 -2
- package/dist/types/utils/array.d.ts +1 -0
- package/dist/types/utils/card-brand/brands.d.ts +4 -3
- package/dist/types/utils/card-brand/index.d.ts +9 -6
- package/dist/types/utils/card-brand/luhn.d.ts +9 -0
- package/dist/types/utils/date.d.ts +9 -0
- package/dist/types/utils/detect.d.ts +1 -0
- package/dist/types/utils/format.d.ts +7 -1
- package/dist/types/utils/iframe.d.ts +1 -1
- package/dist/types/utils/index.d.ts +8 -0
- package/dist/types/utils/location.d.ts +7 -0
- package/dist/types/utils/object.d.ts +1 -0
- package/dist/types/utils/redirect.d.ts +5 -0
- package/dist/types/utils/reg-exp.d.ts +1 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +1 -1
- package/dist/types/utils/system-info/get-system-info.d.ts +3 -2
- package/dist/types/utils/system-info/index.d.ts +3 -3
- package/package.json +6 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PayKKaError } from '../../core';
|
|
2
|
+
import type { PayRes } from '../../api';
|
|
3
|
+
import type { FormValidateError } from '../internal/Form';
|
|
4
|
+
export interface MayBankQRPayProps {
|
|
5
|
+
/**
|
|
6
|
+
* 是否展示邮箱
|
|
7
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
+
*/
|
|
10
|
+
showEmail?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 是否展示邮箱
|
|
13
|
+
* 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
14
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
|
+
*/
|
|
16
|
+
showAddress?: boolean;
|
|
17
|
+
/** 提交表单时触发 */
|
|
18
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
+
/** 支付成功后触发 */
|
|
20
|
+
onSuccess?: (...args: any[]) => void;
|
|
21
|
+
/** 支付失败时触发 */
|
|
22
|
+
onError?: (error: PayKKaError) => void;
|
|
23
|
+
/** 支付超时时触发 */
|
|
24
|
+
onTimeout?: () => void;
|
|
25
|
+
/** 收银台已过期时触发 */
|
|
26
|
+
onExpired?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* 请求支付接口成功后返回跳转链接
|
|
30
|
+
*/
|
|
31
|
+
onSubmitResponse?: (payRes: PayRes) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* 跳转模式,钱包支付时需要跳转到第三方页面进行支付,流程结束在返回收银台
|
|
35
|
+
* auto: 自动跳转
|
|
36
|
+
* manual: 需要在 onSubmitResponse 中接收跳转链接并手动跳转
|
|
37
|
+
*/
|
|
38
|
+
redirectMode?: 'auto' | 'manual';
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* 从第三方支付页面跳转回来时,是否自动查询支付结果
|
|
42
|
+
*/
|
|
43
|
+
autoQuery?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* 是否展示引导卡片
|
|
47
|
+
*/
|
|
48
|
+
showGuideCard?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface MayBankQRPayRef {
|
|
51
|
+
/** 停止轮询支付结果 */
|
|
52
|
+
stopRetry: () => void;
|
|
53
|
+
/** 开始轮询支付结果 */
|
|
54
|
+
startRetry: (timeout?: number) => void;
|
|
55
|
+
/** 更新表单地址 */
|
|
56
|
+
updateAddress: () => void;
|
|
57
|
+
/** 更新表单邮箱 */
|
|
58
|
+
updateEmail: () => void;
|
|
59
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
60
|
+
payment: () => void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NinePayProps, NinePayRef } from './type';
|
|
2
|
+
import type { CoreProps } from '../../types';
|
|
3
|
+
import './nine-pay.scss';
|
|
4
|
+
export declare const NinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<NinePayProps & CoreProps> & {
|
|
5
|
+
ref?: import("preact").Ref<NinePayRef> | undefined;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PayKKaError } from '../../core';
|
|
2
|
+
import type { PayRes } from '../../api';
|
|
3
|
+
import type { FormValidateError } from '../internal/Form';
|
|
4
|
+
export interface NinePayProps {
|
|
5
|
+
/**
|
|
6
|
+
* 是否展示邮箱
|
|
7
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
+
*/
|
|
10
|
+
showEmail?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 是否展示邮箱
|
|
13
|
+
* 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
14
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
|
+
*/
|
|
16
|
+
showAddress?: boolean;
|
|
17
|
+
/** 提交表单时触发 */
|
|
18
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
+
/** 支付成功后触发 */
|
|
20
|
+
onSuccess?: (...args: any[]) => void;
|
|
21
|
+
/** 支付失败时触发 */
|
|
22
|
+
onError?: (error: PayKKaError) => void;
|
|
23
|
+
/** 支付超时时触发 */
|
|
24
|
+
onTimeout?: () => void;
|
|
25
|
+
/** 收银台已过期时触发 */
|
|
26
|
+
onExpired?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* 请求支付接口成功后返回跳转链接
|
|
30
|
+
*/
|
|
31
|
+
onSubmitResponse?: (payRes: PayRes) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* 跳转模式,钱包支付时需要跳转到第三方页面进行支付,流程结束在返回收银台
|
|
35
|
+
* auto: 自动跳转
|
|
36
|
+
* manual: 需要在 onSubmitResponse 中接收跳转链接并手动跳转
|
|
37
|
+
*/
|
|
38
|
+
redirectMode?: 'auto' | 'manual';
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* 从第三方支付页面跳转回来时,是否自动查询支付结果
|
|
42
|
+
*/
|
|
43
|
+
autoQuery?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* 是否展示引导卡片
|
|
47
|
+
*/
|
|
48
|
+
showGuideCard?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface NinePayRef {
|
|
51
|
+
/** 停止轮询支付结果 */
|
|
52
|
+
stopRetry: () => void;
|
|
53
|
+
/** 开始轮询支付结果 */
|
|
54
|
+
startRetry: (timeout?: number) => void;
|
|
55
|
+
/** 更新表单地址 */
|
|
56
|
+
updateAddress: () => void;
|
|
57
|
+
/** 更新表单邮箱 */
|
|
58
|
+
updateEmail: () => void;
|
|
59
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
60
|
+
payment: () => void;
|
|
61
|
+
}
|
|
@@ -12,7 +12,7 @@ export interface SecuredFieldsProviderProps extends SecuredFieldsCallback {
|
|
|
12
12
|
style?: InputStylesConfig;
|
|
13
13
|
}
|
|
14
14
|
export interface SecuredFieldsProviderRef {
|
|
15
|
-
payment: (formData:
|
|
15
|
+
payment: (formData: Recordable, extraParams?: Recordable) => void;
|
|
16
16
|
encryptCard: (encryptInfo: EncryptCardMessage) => void;
|
|
17
17
|
reload: () => void;
|
|
18
18
|
validate: () => void;
|
|
@@ -15,6 +15,6 @@ export declare const useSecuredInput: () => {
|
|
|
15
15
|
validator: () => boolean;
|
|
16
16
|
};
|
|
17
17
|
getCurrCardBrand: (realValue: string) => import("../../utils/card-brand/brands").CardBrandConfig | undefined;
|
|
18
|
-
brand: "VISA" | "MASTER_CARD" | "JCB" | "AMEX" | "DINERS_CLUB" | "DISCOVER" | undefined;
|
|
18
|
+
brand: "VISA" | "MASTER_CARD" | "JCB" | "AMEX" | "DINERS_CLUB" | "DISCOVER" | "CHINA_UNION_PAY" | undefined;
|
|
19
19
|
validate: () => boolean | void;
|
|
20
20
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ShopeePayProps } from './type';
|
|
2
|
+
import type { ShopeePayRef } from './type';
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
import './shopee-pay.scss';
|
|
5
|
+
export declare const ShopeePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ShopeePayProps & CoreProps> & {
|
|
6
|
+
ref?: import("preact").Ref<ShopeePayRef> | undefined;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PayKKaError } from '../../core';
|
|
2
|
+
import type { PayRes } from '../../api';
|
|
3
|
+
import type { FormValidateError } from '../internal/Form';
|
|
4
|
+
export interface ShopeePayProps {
|
|
5
|
+
/**
|
|
6
|
+
* 是否展示邮箱
|
|
7
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
+
*/
|
|
10
|
+
showEmail?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 是否展示邮箱
|
|
13
|
+
* 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
14
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
|
+
*/
|
|
16
|
+
showAddress?: boolean;
|
|
17
|
+
/** 提交表单时触发 */
|
|
18
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
+
/** 支付成功后触发 */
|
|
20
|
+
onSuccess?: (...args: any[]) => void;
|
|
21
|
+
/** 支付失败时触发 */
|
|
22
|
+
onError?: (error: PayKKaError) => void;
|
|
23
|
+
/** 支付超时时触发 */
|
|
24
|
+
onTimeout?: () => void;
|
|
25
|
+
/** 收银台已过期时触发 */
|
|
26
|
+
onExpired?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* 请求支付接口成功后返回跳转链接
|
|
30
|
+
*/
|
|
31
|
+
onSubmitResponse?: (payRes: PayRes) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* 跳转模式,钱包支付时需要跳转到第三方页面进行支付,流程结束在返回收银台
|
|
35
|
+
* auto: 自动跳转
|
|
36
|
+
* manual: 需要在 onSubmitResponse 中接收跳转链接并手动跳转
|
|
37
|
+
*/
|
|
38
|
+
redirectMode?: 'auto' | 'manual';
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* 从第三方支付页面跳转回来时,是否自动查询支付结果
|
|
42
|
+
*/
|
|
43
|
+
autoQuery?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* 是否展示引导卡片
|
|
47
|
+
*/
|
|
48
|
+
showGuideCard?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface ShopeePayRef {
|
|
51
|
+
/** 停止轮询支付结果 */
|
|
52
|
+
stopRetry: () => void;
|
|
53
|
+
/** 开始轮询支付结果 */
|
|
54
|
+
startRetry: (timeout?: number) => void;
|
|
55
|
+
/** 更新表单地址 */
|
|
56
|
+
updateAddress: () => void;
|
|
57
|
+
/** 更新表单邮箱 */
|
|
58
|
+
updateEmail: () => void;
|
|
59
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
60
|
+
payment: () => void;
|
|
61
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './submit-button.scss';
|
|
2
2
|
import type { SubmitButtonProps } from './type';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const SubmitButton: (props: SubmitButtonProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TNGWalletProps } from './type';
|
|
2
|
+
import type { TNGWalletRef } from './type';
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
import './tng-wallet.scss';
|
|
5
|
+
export declare const TNGWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<TNGWalletProps & CoreProps> & {
|
|
6
|
+
ref?: import("preact").Ref<TNGWalletRef> | undefined;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PayKKaError } from '../../core';
|
|
2
|
+
import type { PayRes } from '../../api';
|
|
3
|
+
import type { FormValidateError } from '../internal/Form';
|
|
4
|
+
export interface TNGWalletProps {
|
|
5
|
+
/**
|
|
6
|
+
* 是否展示邮箱
|
|
7
|
+
* 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
+
*/
|
|
10
|
+
showEmail?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 是否展示邮箱
|
|
13
|
+
* 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
14
|
+
* 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
15
|
+
*/
|
|
16
|
+
showAddress?: boolean;
|
|
17
|
+
/** 提交表单时触发 */
|
|
18
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
19
|
+
/** 支付成功后触发 */
|
|
20
|
+
onSuccess?: (...args: any[]) => void;
|
|
21
|
+
/** 支付失败时触发 */
|
|
22
|
+
onError?: (error: PayKKaError) => void;
|
|
23
|
+
/** 支付超时时触发 */
|
|
24
|
+
onTimeout?: () => void;
|
|
25
|
+
/** 收银台已过期时触发 */
|
|
26
|
+
onExpired?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* 请求支付接口成功后返回跳转链接
|
|
30
|
+
*/
|
|
31
|
+
onSubmitResponse?: (payRes: PayRes) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* 跳转模式,钱包支付时需要跳转到第三方页面进行支付,流程结束在返回收银台
|
|
35
|
+
* auto: 自动跳转
|
|
36
|
+
* manual: 需要在 onSubmitResponse 中接收跳转链接并手动跳转
|
|
37
|
+
*/
|
|
38
|
+
redirectMode?: 'auto' | 'manual';
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* 从第三方支付页面跳转回来时,是否自动查询支付结果
|
|
42
|
+
*/
|
|
43
|
+
autoQuery?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* 是否展示引导卡片
|
|
47
|
+
*/
|
|
48
|
+
showGuideCard?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface TNGWalletRef {
|
|
51
|
+
/** 停止轮询支付结果 */
|
|
52
|
+
stopRetry: () => void;
|
|
53
|
+
/** 开始轮询支付结果 */
|
|
54
|
+
startRetry: (timeout?: number) => void;
|
|
55
|
+
/** 更新表单地址 */
|
|
56
|
+
updateAddress: () => void;
|
|
57
|
+
/** 更新表单邮箱 */
|
|
58
|
+
updateEmail: () => void;
|
|
59
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
60
|
+
payment: () => void;
|
|
61
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import './three-ds-iframe.scss';
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
export interface ThreeDSFormConfig {
|
|
2
|
+
action: string | null;
|
|
3
|
+
dataList: Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | null;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
1
8
|
export interface ThreeDSIframeProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
9
|
+
config: ThreeDSFormConfig;
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare enum ThreeDSChannel {
|
|
13
|
+
ECP = "ECP",
|
|
14
|
+
WORLDPAY = "WORLD_PAY"
|
|
5
15
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'preact/compat';
|
|
2
|
+
import type { Amount } from '../../../api';
|
|
3
|
+
export interface QRCodeModalProps {
|
|
4
|
+
/** 标题 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 过期时间 */
|
|
7
|
+
expiredTime: string;
|
|
8
|
+
/** 图标 */
|
|
9
|
+
icon: ReactNode;
|
|
10
|
+
/** 二维码 */
|
|
11
|
+
qrCode: string;
|
|
12
|
+
/** 支付金额 */
|
|
13
|
+
amount?: Amount;
|
|
14
|
+
/** 背景色 */
|
|
15
|
+
bgColor?: string;
|
|
16
|
+
/** 弹窗关闭时触发 */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QRCodeModal';
|
|
@@ -18,3 +18,12 @@ export * from './CardIBANField';
|
|
|
18
18
|
export * from './EncryptedCard';
|
|
19
19
|
export * from './CombinedCardInfo';
|
|
20
20
|
export * from './DropIn';
|
|
21
|
+
export * from './Boost';
|
|
22
|
+
export * from './LinePay';
|
|
23
|
+
export * from './MayBankQRPay';
|
|
24
|
+
export * from './NinePay';
|
|
25
|
+
export * from './GrabPay';
|
|
26
|
+
export * from './TNGWallet';
|
|
27
|
+
export * from './ShopeePay';
|
|
28
|
+
export * from './wallets/GCash';
|
|
29
|
+
export * from './wallets/Paymaya';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'preact/compat';
|
|
2
|
+
import type { PaymentCategory } from '../../../../../constant';
|
|
3
|
+
export type AccordionItemProps = {
|
|
4
|
+
/** 头部内容 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 当前 item 唯一标识 */
|
|
7
|
+
value: PaymentCategory;
|
|
8
|
+
/** 是否禁用 */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** 头部内容 */
|
|
11
|
+
header?: ReactNode;
|
|
12
|
+
/** 内容 */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** 是否展开 */
|
|
15
|
+
active?: boolean;
|
|
16
|
+
/** 选中时回调 */
|
|
17
|
+
onSelect?: (value: PaymentCategory) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'preact/compat';
|
|
2
|
+
export type AccordionProps = {
|
|
3
|
+
/** 默认选中的值 */
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
/** 当前选中的值(受控模式) */
|
|
6
|
+
value?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** 是否启用过渡动画 */
|
|
9
|
+
enableTransition?: boolean;
|
|
10
|
+
/** 选中值改变时的回调 */
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export type AccordionContextType = {
|
|
14
|
+
activeName?: string;
|
|
15
|
+
enableTransition?: boolean;
|
|
16
|
+
onSelect: (value: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const AccordionContext: import("preact").Context<AccordionContextType>;
|
|
@@ -15,6 +15,8 @@ export interface ModalProps extends CustomAttributes<HTMLDivElement> {
|
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
/** 弹窗状态改变时调用 */
|
|
17
17
|
onChange?: (status: boolean) => void;
|
|
18
|
+
/** 是否挂载到 body 下,避免 fixed 受父元素影响 */
|
|
19
|
+
appendToBody?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export interface ModalRef {
|
|
20
22
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CustomAttributes } from '../../../types';
|
|
2
|
+
export interface QRCodeProps extends CustomAttributes<HTMLButtonElement, 'style' | 'className'> {
|
|
3
|
+
/** 二维码内容 */
|
|
4
|
+
value: string;
|
|
5
|
+
/** 尺寸(像素),不传直接 100% 宽高 */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** 自定义class */
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { CustomAttributes } from '../../../types';
|
|
3
|
-
import type { SelectOption, SelectRef } from './type';
|
|
4
|
-
interface SelectProps extends CustomAttributes<HTMLInputElement, 'onBlur' | 'onFocus' | 'placeholder'> {
|
|
5
|
-
value?: string | number;
|
|
6
|
-
status?: 'error' | 'success';
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
rightIcon?: ReactNode;
|
|
9
|
-
options: SelectOption[];
|
|
10
|
-
onSelect: (value: string | number, option: SelectOption) => void;
|
|
11
|
-
inputClassName?: string;
|
|
12
|
-
noDataTip: string;
|
|
13
|
-
renderLabel?: (option: SelectOption) => ReactNode;
|
|
14
|
-
action?: ReactNode;
|
|
15
|
-
filterable?: boolean;
|
|
16
|
-
}
|
|
1
|
+
import type { SelectProps, SelectRef } from './type';
|
|
17
2
|
export declare const Select: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<SelectProps> & {
|
|
18
3
|
ref?: import("preact").Ref<SelectRef> | undefined;
|
|
19
4
|
}>;
|
|
20
|
-
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
1
|
+
import type { ReactNode } from 'preact/compat';
|
|
2
|
+
import type { CustomAttributes } from '../../../types';
|
|
2
3
|
export interface BaseSelectOption<V = string | number, L = string | ((option: BaseSelectOption<V>, selected: boolean) => ReactNode)> {
|
|
3
4
|
label: L;
|
|
4
5
|
value: V;
|
|
@@ -8,3 +9,27 @@ export type SelectOption = BaseSelectOption<string | number>;
|
|
|
8
9
|
export interface SelectRef {
|
|
9
10
|
blur: () => void;
|
|
10
11
|
}
|
|
12
|
+
export interface SelectProps extends CustomAttributes<HTMLInputElement, 'onBlur' | 'onFocus' | 'placeholder'> {
|
|
13
|
+
/** 选中值 */
|
|
14
|
+
value?: string | number;
|
|
15
|
+
/** 校验状态 */
|
|
16
|
+
status?: 'error' | 'success';
|
|
17
|
+
/** 占位符 */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** 右侧图标 */
|
|
20
|
+
rightIcon?: ReactNode;
|
|
21
|
+
/** 选项列表 */
|
|
22
|
+
options: SelectOption[];
|
|
23
|
+
/** 选中回调 */
|
|
24
|
+
onSelect: (value: string | number, option: SelectOption) => void;
|
|
25
|
+
/** 输入框样式 */
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
/** 没有数据时的提示 */
|
|
28
|
+
noDataTip?: string;
|
|
29
|
+
/** 渲染选项 */
|
|
30
|
+
renderLabel?: (option: SelectOption) => ReactNode;
|
|
31
|
+
/** 操作按钮 */
|
|
32
|
+
action?: ReactNode;
|
|
33
|
+
/** 是否可过滤 */
|
|
34
|
+
filterable?: boolean;
|
|
35
|
+
}
|
|
@@ -18,3 +18,16 @@ export * from './Icon3DSFail';
|
|
|
18
18
|
export * from './Icon3DSSuccess';
|
|
19
19
|
export * from './Icon3DSInfo';
|
|
20
20
|
export * from './IconCard';
|
|
21
|
+
export * from './IconLinePay';
|
|
22
|
+
export * from './IconBoost';
|
|
23
|
+
export * from './IconGrabPay';
|
|
24
|
+
export * from './IconNinePay';
|
|
25
|
+
export * from './IconMayBankQRPay';
|
|
26
|
+
export * from './IconShopeePay';
|
|
27
|
+
export * from './IconTNGWallet';
|
|
28
|
+
export * from './IconCard2';
|
|
29
|
+
export * from './IconUnionPay';
|
|
30
|
+
export * from './IconRedirect';
|
|
31
|
+
export * from './IconScan';
|
|
32
|
+
export * from './IconGCash';
|
|
33
|
+
export * from './IconPaymaya';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GCashProps, GCashRef } from './type';
|
|
2
|
+
import type { CoreProps } from '../../../types';
|
|
3
|
+
import './g-cash.scss';
|
|
4
|
+
export declare const GCash: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GCashProps & CoreProps> & {
|
|
5
|
+
ref?: import("preact").Ref<GCashRef> | undefined;
|
|
6
|
+
}>;
|