@paykka/card-checkout-ui 0.11.6 → 0.13.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.
Files changed (187) hide show
  1. package/dist/card-checkout-ui.js +17 -17
  2. package/dist/card-checkout-ui.umd.cjs +17 -17
  3. package/dist/es/api/index.js +1 -0
  4. package/dist/es/api/modules/address/index.js +9 -9
  5. package/dist/es/api/modules/ali-pay/index.js +10 -49
  6. package/dist/es/api/modules/apple-pay/index.js +13 -59
  7. package/dist/es/api/modules/boost/index.js +8 -48
  8. package/dist/es/api/modules/card/index.js +10 -54
  9. package/dist/es/api/modules/checkout/index.js +11 -9
  10. package/dist/es/api/modules/checkout/map.js +25 -18
  11. package/dist/es/api/modules/encrypted-card/index.js +3 -2
  12. package/dist/es/api/modules/gcash/index.js +8 -48
  13. package/dist/es/api/modules/google-pay/index.js +10 -56
  14. package/dist/es/api/modules/grab-pay/index.js +8 -48
  15. package/dist/es/api/modules/index.js +1 -0
  16. package/dist/es/api/modules/line-pay/index.js +8 -48
  17. package/dist/es/api/modules/map.js +17 -11
  18. package/dist/es/api/modules/may-bank-qr-pay/index.js +8 -48
  19. package/dist/es/api/modules/nine-pay/index.js +8 -48
  20. package/dist/es/api/modules/paymaya/index.js +8 -48
  21. package/dist/es/api/modules/risk/index.js +2 -1
  22. package/dist/es/api/modules/sepa/index.js +10 -51
  23. package/dist/es/api/modules/shopee-pay/index.js +8 -48
  24. package/dist/es/api/modules/threeDS/index.js +3 -0
  25. package/dist/es/api/modules/tng-wallet/index.js +8 -48
  26. package/dist/es/api/modules/wechat-pay/index.js +10 -51
  27. package/dist/es/api/modules/zalopay/index.js +16 -0
  28. package/dist/es/api/utils/index.js +59 -0
  29. package/dist/es/components/AddressField/index.js +37 -37
  30. package/dist/es/components/AliPay/index.js +143 -90
  31. package/dist/es/components/ApplePay/index.js +99 -67
  32. package/dist/es/components/Boost/index.js +66 -39
  33. package/dist/es/components/Card/index.js +90 -79
  34. package/dist/es/components/CardSelector/index.js +1 -1
  35. package/dist/es/components/DropIn/index.js +12 -4
  36. package/dist/es/components/EncryptedCard/index.js +1 -1
  37. package/dist/es/components/GooglePay/index.js +93 -60
  38. package/dist/es/components/GrabPay/index.js +66 -39
  39. package/dist/es/components/GuideCard/index.js +10 -7
  40. package/dist/es/components/LinePay/index.js +66 -39
  41. package/dist/es/components/MayBankQRPay/index.js +306 -273
  42. package/dist/es/components/NinePay/index.js +66 -39
  43. package/dist/es/components/SecuredFieldsProvider/index.js +3 -2
  44. package/dist/es/components/SecuredIframe/index.js +4 -2
  45. package/dist/es/components/Sepa/index.js +62 -39
  46. package/dist/es/components/ShopeePay/index.js +66 -39
  47. package/dist/es/components/SubmitButton/index.js +8 -7
  48. package/dist/es/components/TNGWallet/index.js +66 -39
  49. package/dist/es/components/WechatPay/index.js +146 -92
  50. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +26 -6
  51. package/dist/es/components/index.js +1 -0
  52. package/dist/es/components/internal/Modal/Modal.js +1 -1
  53. package/dist/es/components/internal/Select/Select.js +19 -8
  54. package/dist/es/components/internal/Select/SelectMenuItem.js +12 -4
  55. package/dist/es/components/internal/icons/IconZalopay.js +47 -0
  56. package/dist/es/components/internal/icons/IconZalopayComplete.js +48 -0
  57. package/dist/es/components/wallets/GCash/GCash.js +68 -39
  58. package/dist/es/components/wallets/Paymaya/Paymaya.js +66 -39
  59. package/dist/es/components/wallets/Zalopay/Zalopay.js +386 -0
  60. package/dist/es/components/wallets/Zalopay/index.js +1 -0
  61. package/dist/es/components/wallets/Zalopay/type.js +1 -0
  62. package/dist/es/components/wallets/Zalopay/zalopay2.js +1 -0
  63. package/dist/es/config.js +5 -5
  64. package/dist/es/constant.js +8 -2
  65. package/dist/es/core/{Address.js → address.js} +8 -16
  66. package/dist/es/core/{PayKKaCheckout.js → checkout.js} +78 -27
  67. package/dist/es/core/query.js +3 -2
  68. package/dist/es/core/{Session.js → session.js} +37 -20
  69. package/dist/es/core.js +0 -4
  70. package/dist/es/hooks/usePayment.js +14 -0
  71. package/dist/es/i18n/locales/de-DE.js +3 -1
  72. package/dist/es/i18n/locales/en-GB.js +3 -1
  73. package/dist/es/i18n/locales/es-ES.js +3 -1
  74. package/dist/es/i18n/locales/fr-FR.js +3 -1
  75. package/dist/es/i18n/locales/ja-JP.js +3 -1
  76. package/dist/es/i18n/locales/ko-KR.js +3 -1
  77. package/dist/es/i18n/locales/nl-NL.js +3 -1
  78. package/dist/es/i18n/locales/pt-PT.js +3 -1
  79. package/dist/es/i18n/locales/ru-RU.js +3 -1
  80. package/dist/es/i18n/locales/zh-CN.js +3 -1
  81. package/dist/es/i18n/locales/zh-HK.js +3 -1
  82. package/dist/es/i18n/locales/zh-TW.js +3 -1
  83. package/dist/es/index.js +16 -4
  84. package/dist/es/style.css +1 -1
  85. package/dist/es/types/index.js +7 -0
  86. package/dist/es/utils/colors.js +5 -1
  87. package/dist/es/utils/payment.js +82 -0
  88. package/dist/es/utils/redirect.js +4 -4
  89. package/dist/style.css +1 -1
  90. package/dist/types/api/modules/address/index.d.ts +15 -6
  91. package/dist/types/api/modules/ali-pay/index.d.ts +3 -19
  92. package/dist/types/api/modules/apple-pay/index.d.ts +4 -14
  93. package/dist/types/api/modules/boost/index.d.ts +3 -23
  94. package/dist/types/api/modules/card/index.d.ts +3 -30
  95. package/dist/types/api/modules/checkout/index.d.ts +3 -3
  96. package/dist/types/api/modules/checkout/map.d.ts +3 -3
  97. package/dist/types/api/modules/checkout/type.d.ts +33 -4
  98. package/dist/types/api/modules/gcash/index.d.ts +3 -23
  99. package/dist/types/api/modules/google-pay/index.d.ts +3 -13
  100. package/dist/types/api/modules/grab-pay/index.d.ts +3 -23
  101. package/dist/types/api/modules/index.d.ts +1 -0
  102. package/dist/types/api/modules/line-pay/index.d.ts +3 -23
  103. package/dist/types/api/modules/map.d.ts +2 -2
  104. package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +3 -23
  105. package/dist/types/api/modules/nine-pay/index.d.ts +3 -23
  106. package/dist/types/api/modules/paymaya/index.d.ts +3 -23
  107. package/dist/types/api/modules/sepa/index.d.ts +3 -24
  108. package/dist/types/api/modules/shopee-pay/index.d.ts +3 -23
  109. package/dist/types/api/modules/tng-wallet/index.d.ts +3 -23
  110. package/dist/types/api/modules/type.d.ts +74 -21
  111. package/dist/types/api/modules/wechat-pay/index.d.ts +3 -20
  112. package/dist/types/api/modules/zalopay/index.d.ts +4 -0
  113. package/dist/types/api/utils/index.d.ts +48 -0
  114. package/dist/types/components/AddressField/type.d.ts +3 -9
  115. package/dist/types/components/AliPay/AliPay.d.ts +6 -2
  116. package/dist/types/components/AliPay/type.d.ts +15 -2
  117. package/dist/types/components/ApplePay/ApplePay.d.ts +6 -2
  118. package/dist/types/components/ApplePay/type.d.ts +10 -14
  119. package/dist/types/components/ApplePay/utils.d.ts +1 -1
  120. package/dist/types/components/Boost/Boost.d.ts +6 -2
  121. package/dist/types/components/Boost/type.d.ts +2 -24
  122. package/dist/types/components/Card/Card.d.ts +6 -2
  123. package/dist/types/components/Card/type.d.ts +3 -43
  124. package/dist/types/components/DropIn/DropIn.d.ts +6 -2
  125. package/dist/types/components/DropIn/type.d.ts +4 -10
  126. package/dist/types/components/GooglePay/GooglePay.d.ts +6 -2
  127. package/dist/types/components/GooglePay/createGooglePay.d.ts +2 -1
  128. package/dist/types/components/GooglePay/type.d.ts +10 -26
  129. package/dist/types/components/GrabPay/GrabPay.d.ts +6 -2
  130. package/dist/types/components/GrabPay/type.d.ts +3 -25
  131. package/dist/types/components/LinePay/LinePay.d.ts +6 -2
  132. package/dist/types/components/LinePay/type.d.ts +3 -25
  133. package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -2
  134. package/dist/types/components/MayBankQRPay/type.d.ts +3 -25
  135. package/dist/types/components/NinePay/NinePay.d.ts +6 -2
  136. package/dist/types/components/NinePay/type.d.ts +3 -25
  137. package/dist/types/components/Sepa/Sepa.d.ts +6 -2
  138. package/dist/types/components/Sepa/type.d.ts +3 -2
  139. package/dist/types/components/ShopeePay/ShopeePay.d.ts +6 -2
  140. package/dist/types/components/ShopeePay/type.d.ts +3 -25
  141. package/dist/types/components/TNGWallet/TNGWallet.d.ts +6 -2
  142. package/dist/types/components/TNGWallet/type.d.ts +3 -25
  143. package/dist/types/components/WechatPay/WechatPay.d.ts +6 -2
  144. package/dist/types/components/WechatPay/type.d.ts +15 -2
  145. package/dist/types/components/business/QRCodeModal/type.d.ts +2 -0
  146. package/dist/types/components/index.d.ts +1 -0
  147. package/dist/types/components/internal/icons/IconZalopay.d.ts +2 -0
  148. package/dist/types/components/internal/icons/IconZalopayComplete.d.ts +2 -0
  149. package/dist/types/components/internal/icons/index.d.ts +3 -0
  150. package/dist/types/components/wallets/GCash/GCash.d.ts +6 -2
  151. package/dist/types/components/wallets/GCash/type.d.ts +3 -35
  152. package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -2
  153. package/dist/types/components/wallets/Paymaya/type.d.ts +3 -25
  154. package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +10 -0
  155. package/dist/types/components/wallets/Zalopay/index.d.ts +2 -0
  156. package/dist/types/components/wallets/Zalopay/type.d.ts +39 -0
  157. package/dist/types/config.d.ts +2 -4
  158. package/dist/types/constant.d.ts +3 -1
  159. package/dist/types/core/{Address.d.ts → address.d.ts} +23 -24
  160. package/dist/types/core/{PayKKaCheckout.d.ts → checkout.d.ts} +5 -3
  161. package/dist/types/core/context.d.ts +3 -2
  162. package/dist/types/core/index.d.ts +2 -2
  163. package/dist/types/core/query.d.ts +2 -2
  164. package/dist/types/core/session.d.ts +33 -0
  165. package/dist/types/hooks/index.d.ts +1 -0
  166. package/dist/types/hooks/usePayment.d.ts +8 -0
  167. package/dist/types/i18n/locales/de-DE.d.ts +2 -0
  168. package/dist/types/i18n/locales/en-GB.d.ts +2 -0
  169. package/dist/types/i18n/locales/es-ES.d.ts +2 -0
  170. package/dist/types/i18n/locales/fr-FR.d.ts +2 -0
  171. package/dist/types/i18n/locales/ja-JP.d.ts +2 -0
  172. package/dist/types/i18n/locales/ko-KR.d.ts +2 -0
  173. package/dist/types/i18n/locales/nl-NL.d.ts +2 -0
  174. package/dist/types/i18n/locales/pt-PT.d.ts +2 -0
  175. package/dist/types/i18n/locales/ru-RU.d.ts +2 -0
  176. package/dist/types/i18n/locales/zh-CN.d.ts +2 -0
  177. package/dist/types/i18n/locales/zh-HK.d.ts +2 -0
  178. package/dist/types/i18n/locales/zh-TW.d.ts +2 -0
  179. package/dist/types/index.d.ts +2 -1
  180. package/dist/types/types/index.d.ts +70 -32
  181. package/dist/types/types/message.d.ts +1 -0
  182. package/dist/types/utils/card-brand/index.d.ts +3 -3
  183. package/dist/types/utils/colors.d.ts +1 -0
  184. package/dist/types/utils/index.d.ts +1 -0
  185. package/dist/types/utils/payment.d.ts +37 -0
  186. package/package.json +3 -3
  187. package/dist/types/core/Session.d.ts +0 -16
@@ -1,5 +1,6 @@
1
1
  import type { CheckoutRes } from '../../api';
2
- export declare function createGooglePay(checkout: CheckoutRes, pay: (token?: string, billAddress?: {
2
+ import type { GooglePayProps } from './type';
3
+ export declare function createGooglePay(checkout: CheckoutRes, googlePayConfig: GooglePayProps['config'], pay: (token?: string, billAddress?: {
3
4
  email?: string;
4
5
  } & google.payments.api.Address, search?: boolean, timeout?: number) => Promise<{
5
6
  res?: google.payments.api.PaymentAuthorizationResult;
@@ -1,11 +1,14 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PaymentSuccessData } from '../../types';
3
- export interface GooglePayProps {
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
+ export interface GooglePayProps extends PayKKaCommonConfig {
4
4
  /** 支付授权成功后触发 */
5
5
  onSubmit?: () => void;
6
6
  /** 支付成功后触发 */
7
- onSuccess?: (data: PaymentSuccessData) => void;
8
- /** SDK 加载回调,status 为 true 表示加载成功,false 表示加载失败 */
7
+ onSuccess?: (data: PaymentInfo) => void;
8
+ /**
9
+ * SDK 加载回调,status 为 true 表示加载成功,false 表示加载失败
10
+ * 注意:该回调在 SDK 加载成功后触发,但不一定表示 Google Pay 可用
11
+ */
9
12
  onLoad?: (status: boolean) => void;
10
13
  /** 支付失败时触发 */
11
14
  onError?: (error: PayKKaError) => void;
@@ -13,30 +16,11 @@ export interface GooglePayProps {
13
16
  onTimeout?: (source: 'retry' | 'channel') => void;
14
17
  /** 收银台已过期时触发 */
15
18
  onExpired?: () => void;
16
- /** 当前设备环境是否可用于 Google Pay 支付 */
17
- onCanUse?: (canUse: boolean) => void;
18
- /**
19
- * @internal
20
- * 交易被风控拦截时触发
21
- */
22
- onAuthorized?: () => void;
23
19
  /**
24
- * @internal
25
- * 交易需要 3DS 验证时触发
26
- * url 为 3DS 验证链接
27
- * incomplete 为 false 表示目前要开始进行 3DS 验证,为 true 表示上一次 3DS 验证还未完成
20
+ * 当前设备环境是否可用于 Google Pay 支付
21
+ * 注意:在 onLoad 返回 false 的情况下不会触发该回调
28
22
  */
29
- onThreeDS?: (url: string, incomplete: boolean) => void;
30
- /**
31
- * @internal
32
- * 点击 GooglePay 按钮
33
- */
34
- onBtnClick?: () => void;
23
+ onCanUse?: (canUse: boolean) => void;
35
24
  }
36
25
  export interface GooglePayRef {
37
- /**
38
- * @internal
39
- * 3DS 验证流程结束后可调用该方法轮询收银台支付状态
40
- */
41
- checkThreeDS: () => void;
42
26
  }
@@ -1,7 +1,11 @@
1
1
  import type { GrabPayProps } from './type';
2
2
  import type { GrabPayRef } from './type';
3
- import type { CoreProps } from '../../types';
4
3
  import './grab-pay.scss';
5
- export declare const GrabPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GrabPayProps & CoreProps> & {
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
+ isDropIn?: boolean | undefined;
9
+ }> & {
6
10
  ref?: import("preact").Ref<GrabPayRef> | undefined;
7
11
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface GrabPayProps {
4
+ export interface GrabPayProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface GrabPayProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface GrabPayRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,7 +1,11 @@
1
1
  import type { LinePayProps } from './type';
2
2
  import type { LinePayRef } from './type';
3
- import type { CoreProps } from '../../types';
4
3
  import './line-pay.scss';
5
- export declare const LinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<LinePayProps & CoreProps> & {
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;
8
+ isDropIn?: boolean | undefined;
9
+ }> & {
6
10
  ref?: import("preact").Ref<LinePayRef> | undefined;
7
11
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface LinePayProps {
4
+ export interface LinePayProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface LinePayProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface LinePayRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,6 +1,10 @@
1
1
  import type { MayBankQRPayProps, MayBankQRPayRef } from './type';
2
- import type { CoreProps } from '../../types';
3
2
  import './may-bank-qr-pay.scss';
4
- export declare const MayBankQRPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<MayBankQRPayProps & CoreProps> & {
3
+ export declare const MayBankQRPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<MayBankQRPayProps & import("../../types").PayKKaCommonConfig & {
4
+ session: import("../../core").Session;
5
+ core: import("../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<MayBankQRPayRef> | undefined;
6
10
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface MayBankQRPayProps {
4
+ export interface MayBankQRPayProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface MayBankQRPayProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface MayBankQRPayRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,6 +1,10 @@
1
1
  import type { NinePayProps, NinePayRef } from './type';
2
- import type { CoreProps } from '../../types';
3
2
  import './nine-pay.scss';
4
- export declare const NinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<NinePayProps & CoreProps> & {
3
+ export declare const NinePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<NinePayProps & import("../../types").PayKKaCommonConfig & {
4
+ session: import("../../core").Session;
5
+ core: import("../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<NinePayRef> | undefined;
6
10
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface NinePayProps {
4
+ export interface NinePayProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface NinePayProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface NinePayRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,6 +1,10 @@
1
1
  import './sepa.scss';
2
2
  import type { SepaProps, SepaRef } from './type';
3
- import type { CoreProps } from '../../types';
4
- export declare const Sepa: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<SepaProps & CoreProps> & {
3
+ export declare const Sepa: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<SepaProps & import("../../types").PayKKaCommonConfig & {
4
+ session: import("../../core").Session;
5
+ core: import("../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<SepaRef> | undefined;
6
10
  }>;
@@ -1,8 +1,9 @@
1
1
  import type { PayKKaError } from '../../core';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
2
3
  import type { FormValidateError } from '../internal/Form';
3
- export interface SepaProps {
4
+ export interface SepaProps extends PayKKaCommonConfig {
4
5
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
5
- onSuccess?: (returnUrl?: string) => void;
6
+ onSuccess?: (data: PaymentInfo) => void;
6
7
  onError?: (error: PayKKaError) => void;
7
8
  onTimeout?: () => void;
8
9
  onAuthorized?: () => void;
@@ -1,7 +1,11 @@
1
1
  import type { ShopeePayProps } from './type';
2
2
  import type { ShopeePayRef } from './type';
3
- import type { CoreProps } from '../../types';
4
3
  import './shopee-pay.scss';
5
- export declare const ShopeePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ShopeePayProps & CoreProps> & {
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;
8
+ isDropIn?: boolean | undefined;
9
+ }> & {
6
10
  ref?: import("preact").Ref<ShopeePayRef> | undefined;
7
11
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface ShopeePayProps {
4
+ export interface ShopeePayProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface ShopeePayProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface ShopeePayRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,7 +1,11 @@
1
1
  import type { TNGWalletProps } from './type';
2
2
  import type { TNGWalletRef } from './type';
3
- import type { CoreProps } from '../../types';
4
3
  import './tng-wallet.scss';
5
- export declare const TNGWallet: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<TNGWalletProps & CoreProps> & {
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;
8
+ isDropIn?: boolean | undefined;
9
+ }> & {
6
10
  ref?: import("preact").Ref<TNGWalletRef> | undefined;
7
11
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { PayRes } from '../../api';
3
2
  import type { FormValidateError } from '../internal/Form';
4
- export interface TNGWalletProps {
3
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
4
+ export interface TNGWalletProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,35 +17,13 @@ export interface TNGWalletProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
27
  }
50
28
  export interface TNGWalletRef {
51
29
  /** 停止轮询支付结果 */
@@ -1,6 +1,10 @@
1
1
  import './wechat-pay.scss';
2
2
  import type { WechatPayProps, WechatPayRef } from './type';
3
- import type { CoreProps } from '../../types';
4
- export declare const WechatPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<WechatPayProps & CoreProps> & {
3
+ export declare const WechatPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<WechatPayProps & import("../../types").PayKKaCommonConfig & {
4
+ session: import("../../core").Session;
5
+ core: import("../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<WechatPayRef> | undefined;
6
10
  }>;
@@ -1,9 +1,22 @@
1
1
  import type { PayRes } from '../../api';
2
2
  import type { PayKKaError } from '../../core';
3
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../types';
3
4
  import type { FormValidateError } from '../internal/Form';
4
- export interface WechatPayProps {
5
+ export interface WechatPayProps extends PayKKaCommonConfig {
6
+ /**
7
+ * 是否展示邮箱
8
+ * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
9
+ * 若配置 false 但创建收银台时未传,依旧会展示该输入框。
10
+ */
11
+ showEmail?: boolean;
12
+ /**
13
+ * 是否展示邮箱
14
+ * 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
15
+ * 若配置 false 但创建收银台时未传,依旧会展示该输入框。
16
+ */
17
+ showAddress?: boolean;
5
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
6
- onSuccess?: (...args: any[]) => void;
19
+ onSuccess?: (data: PaymentInfo) => void;
7
20
  onError?: (error: PayKKaError) => void;
8
21
  onTimeout?: (source: 'retry' | 'channel') => void;
9
22
  onExpired?: () => void;
@@ -13,6 +13,8 @@ export interface QRCodeModalProps {
13
13
  amount?: Amount;
14
14
  /** 背景色 */
15
15
  bgColor?: string;
16
+ /** 弹窗字体颜色 */
17
+ textColor?: string;
16
18
  /** 弹窗关闭时触发 */
17
19
  onClose?: () => void;
18
20
  }
@@ -27,3 +27,4 @@ export * from './TNGWallet';
27
27
  export * from './ShopeePay';
28
28
  export * from './wallets/GCash';
29
29
  export * from './wallets/Paymaya';
30
+ export * from './wallets/Zalopay';
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconZalopay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconZalopayComplete: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -31,3 +31,6 @@ export * from './IconRedirect';
31
31
  export * from './IconScan';
32
32
  export * from './IconGCash';
33
33
  export * from './IconPaymaya';
34
+ export * from './IconGcashComplete';
35
+ export * from './IconZalopay';
36
+ export * from './IconZalopayComplete';
@@ -1,6 +1,10 @@
1
1
  import type { GCashProps, GCashRef } from './type';
2
- import type { CoreProps } from '../../../types';
3
2
  import './g-cash.scss';
4
- export declare const GCash: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GCashProps & CoreProps> & {
3
+ export declare const GCash: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GCashProps & import("../../../types").PayKKaCommonConfig & {
4
+ session: import("../../../core").Session;
5
+ core: import("../../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<GCashRef> | undefined;
6
10
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../..';
2
- import type { PayRes } from '../../../api';
2
+ import type { PayKKaCommonConfig, PaymentInfo } from '../../../types';
3
3
  import type { FormValidateError } from '../../internal/Form';
4
- export interface GCashProps {
4
+ export interface GCashProps extends PayKKaCommonConfig {
5
5
  /**
6
6
  * 是否展示邮箱
7
7
  * 若配置 true 但创建收银台时已经传了,就展示禁用状态。
@@ -17,45 +17,13 @@ export interface GCashProps {
17
17
  /** 提交表单时触发 */
18
18
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
19
19
  /** 支付成功后触发 */
20
- onSuccess?: (...args: any[]) => void;
20
+ onSuccess?: (data: PaymentInfo) => void;
21
21
  /** 支付失败时触发 */
22
22
  onError?: (error: PayKKaError) => void;
23
23
  /** 支付超时时触发 */
24
24
  onTimeout?: () => void;
25
25
  /** 收银台已过期时触发 */
26
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
- * @internal
51
- * 是否展示二维码弹窗
52
- */
53
- enableQRCodeModal?: boolean;
54
- /**
55
- * @internal
56
- * 用户关闭支付弹窗时触发
57
- */
58
- onCloseModal?: () => void;
59
27
  }
60
28
  export interface GCashRef {
61
29
  /** 停止轮询支付结果 */
@@ -1,6 +1,10 @@
1
1
  import type { PaymayaProps, PaymayaRef } from './type';
2
- import type { CoreProps } from '../../../types';
3
2
  import './paymaya.scss';
4
- export declare const Paymaya: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<PaymayaProps & CoreProps> & {
3
+ export declare const Paymaya: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<PaymayaProps & import("../../../types").PayKKaCommonConfig & {
4
+ session: import("../../../core").Session;
5
+ core: import("../../../core").PayKKaCheckout;
6
+ threeDSFrame?: import("../../../types").ThreeDSFrameConfig | undefined;
7
+ isDropIn?: boolean | undefined;
8
+ }> & {
5
9
  ref?: import("preact").Ref<PaymayaRef> | undefined;
6
10
  }>;