@paykka/card-checkout-ui 0.13.17 → 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.
Files changed (180) hide show
  1. package/dist/card-checkout-ui.js +53 -25
  2. package/dist/card-checkout-ui.umd.cjs +53 -25
  3. package/dist/es/api/modules/boost/index.js +5 -16
  4. package/dist/es/api/modules/gcash/index.js +5 -16
  5. package/dist/es/api/modules/get-browser-params.js +1 -4
  6. package/dist/es/api/modules/grab-pay/index.js +5 -16
  7. package/dist/es/api/modules/line-pay/index.js +5 -16
  8. package/dist/es/api/modules/may-bank-qr-pay/index.js +5 -16
  9. package/dist/es/api/modules/nine-pay/index.js +5 -16
  10. package/dist/es/api/modules/opay-wallet/index.js +5 -16
  11. package/dist/es/api/modules/paga-wallet/index.js +5 -16
  12. package/dist/es/api/modules/paymaya/index.js +5 -16
  13. package/dist/es/api/modules/shopee-pay/index.js +5 -16
  14. package/dist/es/api/modules/threeDS/index.js +16 -2
  15. package/dist/es/api/modules/tng-wallet/index.js +5 -16
  16. package/dist/es/api/modules/zalopay/index.js +5 -16
  17. package/dist/es/components/AccordionItem/AccordionItem.js +0 -2
  18. package/dist/es/components/AddressField/index.js +13 -3
  19. package/dist/es/components/AliPay/index.js +64 -62
  20. package/dist/es/components/ApplePay/index.js +42 -39
  21. package/dist/es/components/CPFField/index.js +2 -1
  22. package/dist/es/components/Card/index.js +160 -133
  23. package/dist/es/components/CardExpireDateField/index.js +2 -1
  24. package/dist/es/components/CardNo/index.js +2 -2
  25. package/dist/es/components/CardNumberField/index.js +2 -1
  26. package/dist/es/components/CardSecurityCodeField/index.js +2 -1
  27. package/dist/es/components/CardSelector/index.js +3 -2
  28. package/dist/es/components/DropIn/index.js +24 -21
  29. package/dist/es/components/GooglePay/index.js +97 -88
  30. package/dist/es/components/PaymentButton/index.js +1 -1
  31. package/dist/es/components/SecuredFieldsProvider/index.js +31 -9
  32. package/dist/es/components/SecuredIframe/index.js +40 -23
  33. package/dist/es/components/SubmitButton/index.js +1 -1
  34. package/dist/es/components/ThreeDS/index.js +29 -12
  35. package/dist/es/components/WechatPay/index.js +70 -69
  36. package/dist/es/components/business/PhoneField/PhoneField.js +1 -0
  37. package/dist/es/components/index.js +7 -7
  38. package/dist/es/components/internal/CheckBox/CheckBox.js +2 -2
  39. package/dist/es/components/internal/Input/Input.js +1 -1
  40. package/dist/es/components/internal/Select/Select.js +4 -1
  41. package/dist/es/components/internal/icons/IconArrowDown.js +4 -4
  42. package/dist/es/components/internal/icons/IconBancontact.js +69 -14
  43. package/dist/es/components/internal/icons/IconBlik.js +541 -21
  44. package/dist/es/components/internal/icons/IconIdeal.js +61 -29
  45. package/dist/es/components/internal/icons/IconSkrill.js +14 -7
  46. package/dist/es/components/internal/icons/IconTrustly.js +11 -44
  47. package/dist/es/components/wallets/Bancontact/Bancontact.js +11 -8
  48. package/dist/es/components/wallets/Blik/Blik.js +12 -9
  49. package/dist/es/components/wallets/Boost/Boost.js +183 -0
  50. package/dist/es/components/wallets/Boost/boost2.js +1 -0
  51. package/dist/es/components/wallets/Boost/index.js +1 -0
  52. package/dist/es/components/wallets/Boost/type.js +1 -0
  53. package/dist/es/components/wallets/GCash/GCash.js +62 -252
  54. package/dist/es/components/wallets/GrabPay/GrabPay.js +183 -0
  55. package/dist/es/components/wallets/GrabPay/grab-pay.js +1 -0
  56. package/dist/es/components/wallets/GrabPay/index.js +1 -0
  57. package/dist/es/components/wallets/GrabPay/type.js +1 -0
  58. package/dist/es/components/wallets/IDeal/IDeal.js +11 -8
  59. package/dist/es/components/wallets/LinePay/LinePay.js +183 -0
  60. package/dist/es/components/wallets/LinePay/index.js +1 -0
  61. package/dist/es/components/wallets/LinePay/line-pay.js +1 -0
  62. package/dist/es/components/wallets/LinePay/type.js +1 -0
  63. package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +187 -0
  64. package/dist/es/components/wallets/MayBankQRPay/index.js +1 -0
  65. package/dist/es/components/wallets/MayBankQRPay/may-bank-qr-pay.js +1 -0
  66. package/dist/es/components/wallets/MayBankQRPay/type.js +1 -0
  67. package/dist/es/components/wallets/NinePay/NinePay.js +185 -0
  68. package/dist/es/components/wallets/NinePay/index.js +1 -0
  69. package/dist/es/components/wallets/NinePay/nine-pay.js +1 -0
  70. package/dist/es/components/wallets/NinePay/type.js +1 -0
  71. package/dist/es/components/wallets/OVO/OVO.js +7 -5
  72. package/dist/es/components/wallets/OpayWallet/OpayWallet.js +56 -218
  73. package/dist/es/components/wallets/P24/P24.js +11 -8
  74. package/dist/es/components/wallets/PagaWallet/PagaWallet.js +56 -218
  75. package/dist/es/components/wallets/Paymaya/Paymaya.js +56 -221
  76. package/dist/es/components/wallets/PicPay/PicPay.js +50 -47
  77. package/dist/es/components/wallets/Pix/Pix.js +44 -48
  78. package/dist/es/components/wallets/ShopeePay/ShopeePay.js +185 -0
  79. package/dist/es/components/wallets/ShopeePay/index.js +1 -0
  80. package/dist/es/components/wallets/ShopeePay/shopee-pay.js +1 -0
  81. package/dist/es/components/wallets/ShopeePay/type.js +1 -0
  82. package/dist/es/components/wallets/Skrill/Skrill.js +28 -26
  83. package/dist/es/components/wallets/TNGWallet/TNGWallet.js +185 -0
  84. package/dist/es/components/wallets/TNGWallet/index.js +1 -0
  85. package/dist/es/components/wallets/TNGWallet/tng-wallet.js +1 -0
  86. package/dist/es/components/wallets/TNGWallet/type.js +1 -0
  87. package/dist/es/components/wallets/Trustly/Trustly.js +15 -15
  88. package/dist/es/components/wallets/Vietqr/Vietqr.js +60 -248
  89. package/dist/es/components/wallets/Zalopay/Zalopay.js +61 -249
  90. package/dist/es/components/wallets/index.js +7 -0
  91. package/dist/es/core/checkout.js +19 -45
  92. package/dist/es/core/logger.js +1 -1
  93. package/dist/es/core/payment.js +65 -0
  94. package/dist/es/hooks/useBaseWallet.js +20 -18
  95. package/dist/es/hooks/usePayState.js +37 -25
  96. package/dist/es/hooks/usePayment.js +1 -14
  97. package/dist/es/hooks/useRetry.js +50 -26
  98. package/dist/es/index.js +7 -7
  99. package/dist/es/out/base-fraud-detection.js +4 -1
  100. package/dist/es/out/fraud-detection.js +12 -13
  101. package/dist/es/out/worldpay-ddc-manager.js +7 -14
  102. package/dist/es/out/worldpay-ddc.js +7 -5
  103. package/dist/es/style.css +1 -1
  104. package/dist/es/types/event.js +1 -0
  105. package/dist/es/types/message.js +2 -0
  106. package/dist/es/utils/payment.js +12 -12
  107. package/dist/es/utils/system-info/is-ua-webview.js +1 -20
  108. package/dist/style.css +1 -1
  109. package/dist/types/api/modules/threeDS/index.d.ts +7 -0
  110. package/dist/types/components/AddressField/type.d.ts +2 -2
  111. package/dist/types/components/CPFField/type.d.ts +1 -1
  112. package/dist/types/components/CardExpireDateField/type.d.ts +1 -1
  113. package/dist/types/components/CardNo/type.d.ts +3 -2
  114. package/dist/types/components/CardNumberField/type.d.ts +1 -1
  115. package/dist/types/components/CardSecurityCodeField/type.d.ts +1 -1
  116. package/dist/types/components/CardSelector/type.d.ts +4 -4
  117. package/dist/types/components/GooglePay/createGooglePay.d.ts +1 -1
  118. package/dist/types/components/GooglePay/type.d.ts +6 -0
  119. package/dist/types/components/SecuredFieldsProvider/type.d.ts +2 -0
  120. package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +0 -6
  121. package/dist/types/components/index.d.ts +0 -7
  122. package/dist/types/components/internal/CheckBox/type.d.ts +2 -1
  123. package/dist/types/components/internal/Select/type.d.ts +1 -1
  124. package/dist/types/components/internal/icons/IconArrowDown.d.ts +1 -1
  125. package/dist/types/components/{Boost → wallets/Boost}/Boost.d.ts +9 -4
  126. package/dist/types/components/{Boost → wallets/Boost}/type.d.ts +2 -2
  127. package/dist/types/components/wallets/GCash/GCash.d.ts +5 -0
  128. package/dist/types/components/{GrabPay → wallets/GrabPay}/GrabPay.d.ts +4 -4
  129. package/dist/types/components/wallets/GrabPay/type.d.ts +17 -0
  130. package/dist/types/components/{LinePay → wallets/LinePay}/LinePay.d.ts +9 -4
  131. package/dist/types/components/{LinePay → wallets/LinePay}/type.d.ts +2 -2
  132. package/dist/types/components/wallets/MayBankQRPay/MayBankQRPay.d.ts +15 -0
  133. package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/type.d.ts +2 -2
  134. package/dist/types/components/wallets/NinePay/NinePay.d.ts +15 -0
  135. package/dist/types/components/{NinePay → wallets/NinePay}/type.d.ts +2 -2
  136. package/dist/types/components/wallets/OpayWallet/OpayWallet.d.ts +5 -0
  137. package/dist/types/components/wallets/PagaWallet/PagaWallet.d.ts +5 -0
  138. package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +5 -0
  139. package/dist/types/components/{ShopeePay → wallets/ShopeePay}/ShopeePay.d.ts +9 -4
  140. package/dist/types/components/{ShopeePay → wallets/ShopeePay}/type.d.ts +2 -2
  141. package/dist/types/components/wallets/Skrill/type.d.ts +0 -12
  142. package/dist/types/components/{TNGWallet → wallets/TNGWallet}/TNGWallet.d.ts +9 -4
  143. package/dist/types/components/{TNGWallet → wallets/TNGWallet}/type.d.ts +2 -2
  144. package/dist/types/components/wallets/Vietqr/Vietqr.d.ts +5 -0
  145. package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +5 -0
  146. package/dist/types/components/wallets/index.d.ts +7 -0
  147. package/dist/types/core/checkout.d.ts +2 -9
  148. package/dist/types/core/payment.d.ts +21 -0
  149. package/dist/types/hooks/useBaseWallet.d.ts +2 -2
  150. package/dist/types/hooks/usePayState.d.ts +3 -1
  151. package/dist/types/hooks/useRetry.console-tests.d.ts +41 -0
  152. package/dist/types/hooks/useRetry.d.ts +22 -3
  153. package/dist/types/out/base-fraud-detection.d.ts +1 -0
  154. package/dist/types/out/config.d.ts +1 -1
  155. package/dist/types/out/fraud-detection.d.ts +2 -8
  156. package/dist/types/out/types.d.ts +3 -1
  157. package/dist/types/out/worldpay-ddc-manager.d.ts +6 -7
  158. package/dist/types/types/event.d.ts +6 -1
  159. package/dist/types/types/message.d.ts +24 -3
  160. package/dist/types/types/payment.d.ts +4 -0
  161. package/dist/types/utils/iframe.d.ts +1 -1
  162. package/dist/types/utils/payment.d.ts +10 -10
  163. package/package.json +9 -5
  164. package/dist/es/components/Boost/index.js +0 -349
  165. package/dist/es/components/GrabPay/index.js +0 -349
  166. package/dist/es/components/LinePay/index.js +0 -349
  167. package/dist/es/components/MayBankQRPay/index.js +0 -355
  168. package/dist/es/components/NinePay/index.js +0 -349
  169. package/dist/es/components/ShopeePay/index.js +0 -349
  170. package/dist/es/components/TNGWallet/index.js +0 -349
  171. package/dist/types/components/GrabPay/type.d.ts +0 -28
  172. package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +0 -10
  173. package/dist/types/components/NinePay/NinePay.d.ts +0 -10
  174. /package/dist/types/components/{Boost → wallets/Boost}/index.d.ts +0 -0
  175. /package/dist/types/components/{GrabPay → wallets/GrabPay}/index.d.ts +0 -0
  176. /package/dist/types/components/{LinePay → wallets/LinePay}/index.d.ts +0 -0
  177. /package/dist/types/components/{MayBankQRPay → wallets/MayBankQRPay}/index.d.ts +0 -0
  178. /package/dist/types/components/{NinePay → wallets/NinePay}/index.d.ts +0 -0
  179. /package/dist/types/components/{ShopeePay → wallets/ShopeePay}/index.d.ts +0 -0
  180. /package/dist/types/components/{TNGWallet → wallets/TNGWallet}/index.d.ts +0 -0
@@ -18,11 +18,4 @@ 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
21
  export * from './wallets';
@@ -1,6 +1,7 @@
1
- import type { CustomAttributes } from "../../../types";
1
+ import type { CustomAttributes } from '../../../types';
2
2
  export interface CheckBoxProps extends CustomAttributes<HTMLDivElement> {
3
3
  checked?: boolean;
4
4
  label?: string;
5
+ disabled?: boolean;
5
6
  onChange?: (checked: boolean) => void;
6
7
  }
@@ -9,7 +9,7 @@ export type SelectOption = BaseSelectOption<string | number>;
9
9
  export interface SelectRef {
10
10
  blur: () => void;
11
11
  }
12
- export interface SelectProps extends CustomAttributes<HTMLInputElement, 'onBlur' | 'onFocus' | 'placeholder'> {
12
+ export interface SelectProps extends CustomAttributes<HTMLInputElement, 'onBlur' | 'onFocus' | 'placeholder' | 'disabled'> {
13
13
  /** 选中值 */
14
14
  value?: string | number;
15
15
  /** 校验状态 */
@@ -1,2 +1,2 @@
1
1
  import type { IconProps } from './type';
2
- export declare function IconArrowDown({ size, style, className }: IconProps): import("preact").JSX.Element;
2
+ export declare const IconArrowDown: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -1,10 +1,15 @@
1
1
  import type { BoostProps } from './type';
2
2
  import type { BoostRef } from './type';
3
3
  import './boost.scss';
4
- export declare const Boost: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<BoostProps & import("../../types").PayKKaCommonConfig & {
5
- session: import("../../core").Session;
6
- core: import("../../core").PayKKaCheckout;
7
- threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
4
+ /**
5
+ * Boost 支付方式
6
+ * - 表单:邮箱,地址
7
+ * - 支付:跳转至 Boost 页面完成支付
8
+ */
9
+ export declare const Boost: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<BoostProps & 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<BoostRef> | undefined;
@@ -1,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface BoostProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -1,5 +1,10 @@
1
1
  import type { GCashProps, GCashRef } from './type';
2
2
  import './g-cash.scss';
3
+ /**
4
+ * GCash 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:移动端跳转,PC 端展示二维码弹窗
7
+ */
3
8
  export declare const GCash: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GCashProps & import("../../../types").PayKKaCommonConfig & {
4
9
  session: import("../../../core").Session;
5
10
  core: import("../../../core").PayKKaCheckout;
@@ -1,10 +1,10 @@
1
1
  import type { GrabPayProps } from './type';
2
2
  import type { GrabPayRef } from './type';
3
3
  import './grab-pay.scss';
4
- export declare const GrabPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GrabPayProps & import("../../types").PayKKaCommonConfig & {
5
- session: import("../../core").Session;
6
- core: import("../../core").PayKKaCheckout;
7
- threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
4
+ export declare const GrabPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GrabPayProps & import("../../../types").PayKKaCommonConfig & {
5
+ session: import("../../../core").Session;
6
+ core: import("../../../core").PayKKaCheckout;
7
+ threeDSFrame?: import("../../../types").ThreeDSFrameConfig | undefined;
8
8
  isDropIn?: boolean | undefined;
9
9
  }> & {
10
10
  ref?: import("preact").Ref<GrabPayRef> | undefined;
@@ -0,0 +1,17 @@
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
+ import type { WalletRedirectProps, WalletCustomProps } from '../type';
4
+ export interface GrabPayProps extends PayKKaCommonConfig, WalletRedirectProps, WalletCustomProps, PaymentCommonProps {
5
+ }
6
+ export interface GrabPayRef {
7
+ /** 停止轮询支付结果 */
8
+ stopRetry: () => void;
9
+ /** 开始轮询支付结果 */
10
+ startRetry: (timeout?: number) => void;
11
+ /** 更新表单地址 */
12
+ updateAddress: () => void;
13
+ /** 更新表单邮箱 */
14
+ updateEmail: () => void;
15
+ /** 不展示支付按钮时,可调用该方法进行支付 */
16
+ payment: () => void;
17
+ }
@@ -1,10 +1,15 @@
1
1
  import type { LinePayProps } from './type';
2
2
  import type { LinePayRef } from './type';
3
3
  import './line-pay.scss';
4
- export declare const LinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<LinePayProps & import("../../types").PayKKaCommonConfig & {
5
- session: import("../../core").Session;
6
- core: import("../../core").PayKKaCheckout;
7
- threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
4
+ /**
5
+ * LinePay 支付方式
6
+ * - 表单:邮箱,地址
7
+ * - 支付:跳转至 LinePay 页面完成支付
8
+ */
9
+ export declare const LinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<LinePayProps & 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<LinePayRef> | undefined;
@@ -1,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface LinePayProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -0,0 +1,15 @@
1
+ import type { MayBankQRPayProps, MayBankQRPayRef } from './type';
2
+ import './may-bank-qr-pay.scss';
3
+ /**
4
+ * MayBankQRPay 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:跳转至 MayBankQRPay 页面完成支付
7
+ */
8
+ export declare const MayBankQRPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<MayBankQRPayProps & 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<MayBankQRPayRef> | undefined;
15
+ }>;
@@ -1,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface MayBankQRPayProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -0,0 +1,15 @@
1
+ import type { NinePayProps, NinePayRef } from './type';
2
+ import './nine-pay.scss';
3
+ /**
4
+ * NinePay 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:跳转至 NinePay 页面完成支付
7
+ */
8
+ export declare const NinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<NinePayProps & 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<NinePayRef> | undefined;
15
+ }>;
@@ -1,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface NinePayProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -1,5 +1,10 @@
1
1
  import type { OpayWalletProps, OpayWalletRef } from './type';
2
2
  import './opay-wallet.scss';
3
+ /**
4
+ * OpayWallet 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:跳转至 OpayWallet 页面完成支付
7
+ */
3
8
  export declare const OpayWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<OpayWalletProps & import("../../../types").PayKKaCommonConfig & {
4
9
  session: import("../../../core").Session;
5
10
  core: import("../../../core").PayKKaCheckout;
@@ -1,5 +1,10 @@
1
1
  import type { PagaWalletProps, PagaWalletRef } from './type';
2
2
  import './paga-wallet.scss';
3
+ /**
4
+ * PagaWallet 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:跳转至 PagaWallet 页面完成支付
7
+ */
3
8
  export declare const PagaWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<PagaWalletProps & import("../../../types").PayKKaCommonConfig & {
4
9
  session: import("../../../core").Session;
5
10
  core: import("../../../core").PayKKaCheckout;
@@ -1,5 +1,10 @@
1
1
  import type { PaymayaProps, PaymayaRef } from './type';
2
2
  import './paymaya.scss';
3
+ /**
4
+ * Paymaya 支付方式
5
+ * - 表单:邮箱,地址
6
+ * - 支付:跳转至 Paymaya 页面完成支付
7
+ */
3
8
  export declare const Paymaya: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<PaymayaProps & import("../../../types").PayKKaCommonConfig & {
4
9
  session: import("../../../core").Session;
5
10
  core: import("../../../core").PayKKaCheckout;
@@ -1,10 +1,15 @@
1
1
  import type { ShopeePayProps } from './type';
2
2
  import type { ShopeePayRef } from './type';
3
3
  import './shopee-pay.scss';
4
- export declare const ShopeePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ShopeePayProps & import("../../types").PayKKaCommonConfig & {
5
- session: import("../../core").Session;
6
- core: import("../../core").PayKKaCheckout;
7
- threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
4
+ /**
5
+ * ShopeePay 支付方式
6
+ * - 表单:邮箱,地址
7
+ * - 支付:跳转至 ShopeePay 页面完成支付
8
+ */
9
+ export declare const ShopeePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ShopeePayProps & 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<ShopeePayRef> | undefined;
@@ -1,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface ShopeePayProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -2,18 +2,6 @@ import type { PayKKaCommonConfig } from '../../../types';
2
2
  import type { WalletCustomProps, WalletRedirectProps } from '../type';
3
3
  import type { PaymentCommonProps } from '../../../types/payment';
4
4
  export interface SkrillProps extends PayKKaCommonConfig, WalletRedirectProps, WalletCustomProps, PaymentCommonProps {
5
- /**
6
- * 是否展示邮箱
7
- * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
8
- * 若配置 false 但创建收银台时未传,依旧会展示该输入框。
9
- */
10
- showEmail?: boolean;
11
- /**
12
- * 是否展示地址
13
- * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
14
- * 若配置 false 但创建收银台时未传,依旧会展示该输入框。
15
- */
16
- showAddress?: boolean;
17
5
  }
18
6
  export interface SkrillRef {
19
7
  /** 停止轮询支付结果 */
@@ -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
- export declare const TNGWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<TNGWalletProps & import("../../types").PayKKaCommonConfig & {
5
- session: import("../../core").Session;
6
- core: import("../../core").PayKKaCheckout;
7
- threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
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,5 +1,5 @@
1
- import type { PayKKaCommonConfig } from '../../types';
2
- import type { PaymentCommonProps } from '../../types/payment';
1
+ import type { PayKKaCommonConfig } from '../../../types';
2
+ import type { PaymentCommonProps } from '../../../types/payment';
3
3
  export interface TNGWalletProps extends PayKKaCommonConfig, PaymentCommonProps {
4
4
  /**
5
5
  * 是否展示邮箱
@@ -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,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,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';
@@ -3,10 +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';
9
8
  import { PayKKaLogger } from './logger';
9
+ import { PayKKaPayment } from './payment';
10
10
  export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
11
11
  /**
12
12
  * 收银台实例
@@ -14,13 +14,6 @@ export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
14
14
  */
15
15
  export declare class PayKKaCheckout {
16
16
  #private;
17
- /** 当前正在处理的支付方式,在第三方支付页面跳回收银台时,会通过 url 参数传递过来 */
18
- processingPaymentMethod: PaymentMethod | null;
19
- /**
20
- * 当前启用的支付方式(禁用则展示禁用样式)
21
- * 在 DropIn 且有正在处理的支付方式时,会设置为当前支付方式,并把其他支付方式设为禁用
22
- */
23
- enablePaymentMethod: import("@preact/signals").Signal<PaymentMethod | null>;
24
17
  constructor(config: PayKKaInitConfiguration);
25
18
  init(): Promise<void>;
26
19
  private initCheckoutConfig;
@@ -46,7 +39,7 @@ export declare class PayKKaCheckout {
46
39
  */
47
40
  create<P extends Recordable>(component: ComponentType<P> | ((props: P) => JSX.Element), props?: Partial<P> | null): ComponentInst<P>;
48
41
  getCoreProps(): CoreProps;
49
- resetEnablePaymentMethod(): void;
50
42
  getAddressCore(): AddressCore;
51
43
  get logger(): PayKKaLogger | undefined;
44
+ get payment(): PayKKaPayment | undefined;
52
45
  }
@@ -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
+ }
@@ -1,6 +1,6 @@
1
1
  import { PaymentMethod } from '../constant';
2
2
  import type { WalletCustomProps, WalletRedirectProps, WalletQRCodeModalProps } from '../components/wallets/type';
3
- import type { CoreProps } from '../types';
3
+ import type { BasePaymentInfo, CoreProps } from '../types';
4
4
  import { type FieldStatusConfig } from '../api';
5
5
  import type { PaymentButtonStatus } from '../components/PaymentButton';
6
6
  import type { PaymentCommonProps, PaymentMethodContext } from '../types/payment';
@@ -13,7 +13,7 @@ export type BaseWalletOptions = {
13
13
  /** 获取最终处理过的表单数据 */
14
14
  getFormData: () => Recordable;
15
15
  /** 处理支付中状态 */
16
- onProcessing?: () => void;
16
+ onProcessing?: (paymentInfo: BasePaymentInfo) => void | Promise<void>;
17
17
  };
18
18
  /**
19
19
  * 基础钱包通用逻辑
@@ -1,5 +1,5 @@
1
1
  import type { PayKKaCheckout, Session } from '../core';
2
- export declare function usePayState(session: Session, core?: PayKKaCheckout): {
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 function useRetry(fn: (timeout: number) => Promise<{
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
  };
@@ -18,6 +18,7 @@ export declare abstract class BaseFraudDetection {
18
18
  protected timeout: number;
19
19
  private timer;
20
20
  private initPromise;
21
+ private fraudDetectionStartTime?;
21
22
  constructor(params: {
22
23
  channel: ChannelCode;
23
24
  channelConfig?: ChannelSDKConfig;
@@ -14,7 +14,7 @@ export declare const STRIPE_RADAR_SCRIPT_ORIGIN = "https://js.stripe.com";
14
14
  export declare const STRIPE_RADAR_SCRIPT_URL = "https://js.stripe.com/v3/";
15
15
  /** ddc 超时时间, 15s */
16
16
  export declare const DDC_TIMEOUT = 15000;
17
- /** stripe 超时时间, 10s */
17
+ /** stripe 超时时间, 12s */
18
18
  export declare const STRIPE_RADAR_TIMEOUT = 12000;
19
19
  /** 默认超时时间, 10s */
20
20
  export declare const DEFAULT_TIMEOUT = 10000;
@@ -1,8 +1,8 @@
1
- import { type CollModeType } from '../types';
2
1
  import type { FraudDetectionConfig, FraudDetectionOptions } from './types';
3
2
  type FraudDetectionType = {
4
3
  getFraudDetectionId: (options?: {
5
4
  bin?: string;
5
+ hiddenIframeName?: string;
6
6
  }) => Promise<string>;
7
7
  createFraudDetection: () => Promise<void>;
8
8
  };
@@ -11,11 +11,5 @@ export default function getFraudDetectionInstance(config: FraudDetectionConfig,
11
11
  * 内部配置
12
12
  * @internal
13
13
  */
14
- options?: FraudDetectionOptions,
15
- /**
16
- * 可用渠道列表
17
- * 仅供Hosted等页面收银台使用,不能让用户知道我们有哪些渠道
18
- * @internal
19
- */
20
- mode?: CollModeType[]): FraudDetectionType;
14
+ options?: FraudDetectionOptions): FraudDetectionType;
21
15
  export {};
@@ -3,9 +3,11 @@ export type FraudDetectionOptions = {
3
3
  sessionMode?: string;
4
4
  } & Pick<PayKKaInitConfiguration, 'onEvent'>;
5
5
  export type FraudDetectionConfig = {
6
- env?: FraudDetectionEnv;
7
6
  clientKey: string;
7
+ /** 环境,默认 eu */
8
+ env?: FraudDetectionEnv;
8
9
  };
9
10
  export interface FraudDetectionInitOption {
10
11
  bin?: string;
12
+ hiddenIframeName?: string;
11
13
  }
@@ -1,18 +1,17 @@
1
1
  import type { ChannelSDKConfig } from '../api/modules/risk';
2
2
  import type { FraudDetectionInitOption, FraudDetectionOptions } from './types';
3
3
  /**
4
- * 管理多个 WorldpayDDC 实例:按 key('' 或 bin)分配实例,并串行执行 init,避免回包错配。
5
- * fraud-detection 只依赖本类,不写 map / lock 等 Worldpay 专属逻辑。
4
+ * 每次支付都要最新 ddc id:
5
+ * - 不按 bin 缓存、不用兜底 id
6
+ * - 每次 init 都 new 一个 WorldpayDDC 并采集
6
7
  */
7
8
  export declare class WorldpayDDCManager {
8
9
  private static instance;
9
10
  private options?;
10
11
  private channelConfig?;
11
- /** bin WorldpayDDC 实例的映射 */
12
- private worldpayDDCMap;
12
+ /** 本次(最近一次)init 对应的 DDC 实例 */
13
+ private currentDDC;
13
14
  constructor(options?: FraudDetectionOptions, channelConfig?: ChannelSDKConfig);
14
- /** 创建 WorldpayDDC,如果缓存中有就用缓存的 */
15
- private createWorldpayDDC;
16
15
  init(options?: FraudDetectionInitOption): Promise<void>;
17
- getFraudDetectionId(bin: string): string | undefined | null;
16
+ getFraudDetectionId(): string | undefined | null;
18
17
  }