@paykka/card-checkout-ui 0.8.0 → 0.9.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.
Files changed (247) hide show
  1. package/dist/card-checkout-ui.js +20 -13
  2. package/dist/card-checkout-ui.umd.cjs +20 -13
  3. package/dist/es/_commonjsHelpers.js +1 -0
  4. package/dist/es/api/http.js +19 -21
  5. package/dist/es/api/index.js +1 -0
  6. package/dist/es/api/modules/ali-pay/index.js +19 -11
  7. package/dist/es/api/modules/apple-pay/index.js +10 -26
  8. package/dist/es/api/modules/boost/index.js +56 -0
  9. package/dist/es/api/modules/card/index.js +17 -11
  10. package/dist/es/api/modules/checkout/index.js +6 -6
  11. package/dist/es/api/modules/checkout/map.js +23 -6
  12. package/dist/es/api/modules/gcash/index.js +56 -0
  13. package/dist/es/api/modules/get-browser-params.js +2 -2
  14. package/dist/es/api/modules/google-pay/index.js +10 -26
  15. package/dist/es/api/modules/grab-pay/index.js +56 -0
  16. package/dist/es/api/modules/index.js +1 -0
  17. package/dist/es/api/modules/line-pay/index.js +56 -0
  18. package/dist/es/api/modules/may-bank-qr-pay/index.js +56 -0
  19. package/dist/es/api/modules/nine-pay/index.js +56 -0
  20. package/dist/es/api/modules/paymaya/index.js +56 -0
  21. package/dist/es/api/modules/sepa/index.js +19 -11
  22. package/dist/es/api/modules/shopee-pay/index.js +56 -0
  23. package/dist/es/api/modules/tng-wallet/index.js +56 -0
  24. package/dist/es/api/modules/wechat-pay/index.js +18 -31
  25. package/dist/es/components/AccordionItem/AccordionItem.js +36 -0
  26. package/dist/es/components/AliPay/index.js +27 -39
  27. package/dist/es/components/ApplePay/index.js +16 -37
  28. package/dist/es/components/Boost/index.js +322 -0
  29. package/dist/es/components/Card/index.js +52 -41
  30. package/dist/es/components/CardBrands/index.js +2 -2
  31. package/dist/es/components/CardNumberField/index.js +113 -106
  32. package/dist/es/components/DropIn/index.js +204 -49
  33. package/dist/es/components/GooglePay/index.js +5 -4
  34. package/dist/es/components/GrabPay/index.js +322 -0
  35. package/dist/es/components/GuideCard/index.js +43 -0
  36. package/dist/es/components/LinePay/index.js +322 -0
  37. package/dist/es/components/MayBankQRPay/index.js +322 -0
  38. package/dist/es/components/NinePay/index.js +322 -0
  39. package/dist/es/components/SecuredIframe/index.js +3 -2
  40. package/dist/es/components/Sepa/index.js +6 -9
  41. package/dist/es/components/ShopeePay/index.js +322 -0
  42. package/dist/es/components/SubmitButton/index.js +6 -20
  43. package/dist/es/components/TNGWallet/index.js +322 -0
  44. package/dist/es/components/WechatPay/index.js +30 -49
  45. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +41 -0
  46. package/dist/es/components/business/QRCodeModal/index.js +6 -0
  47. package/dist/es/components/business/QRCodeModal/qr-code-modal.js +1 -0
  48. package/dist/es/components/business/QRCodeModal/type.js +1 -0
  49. package/dist/es/components/business/index.js +6 -0
  50. package/dist/es/components/index.js +9 -0
  51. package/dist/es/components/internal/Accordion/Accordion.js +14 -0
  52. package/dist/es/components/internal/Accordion/accordion2.js +1 -0
  53. package/dist/es/components/internal/Accordion/accordionTransition.js +26 -0
  54. package/dist/es/components/internal/Accordion/index.js +7 -0
  55. package/dist/es/components/internal/Accordion/type.js +10 -0
  56. package/dist/es/components/internal/Modal/Modal.js +17 -3
  57. package/dist/es/components/internal/Modal/index.js +1 -0
  58. package/dist/es/components/internal/Modal/type.js +1 -0
  59. package/dist/es/components/internal/QRCode/QRCode.js +31 -0
  60. package/dist/es/components/internal/QRCode/index.js +4 -0
  61. package/dist/es/components/internal/QRCode/type.js +1 -0
  62. package/dist/es/components/internal/icons/IconBoost.js +63 -0
  63. package/dist/es/components/internal/icons/IconCard.js +1 -40
  64. package/dist/es/components/internal/icons/IconCard2.js +60 -0
  65. package/dist/es/components/internal/icons/IconGCash.js +196 -0
  66. package/dist/es/components/internal/icons/IconGcashComplete.js +184 -0
  67. package/dist/es/components/internal/icons/IconGrabPay.js +59 -0
  68. package/dist/es/components/internal/icons/IconLinePay.js +99 -0
  69. package/dist/es/components/internal/icons/IconMayBankQRPay.js +69 -0
  70. package/dist/es/components/internal/icons/IconNinePay.js +255 -0
  71. package/dist/es/components/internal/icons/IconPaymaya.js +114 -0
  72. package/dist/es/components/internal/icons/IconRedirect.js +58 -0
  73. package/dist/es/components/internal/icons/IconScan.js +102 -0
  74. package/dist/es/components/internal/icons/IconShopeePay.js +108 -0
  75. package/dist/es/components/internal/icons/IconTNGWallet.js +119 -0
  76. package/dist/es/components/internal/icons/IconUnionPay.js +65 -0
  77. package/dist/es/components/wallets/GCash/GCash.js +356 -0
  78. package/dist/es/components/wallets/GCash/g-cash.js +1 -0
  79. package/dist/es/components/wallets/GCash/index.js +1 -0
  80. package/dist/es/components/wallets/GCash/type.js +1 -0
  81. package/dist/es/components/wallets/Paymaya/Paymaya.js +323 -0
  82. package/dist/es/components/wallets/Paymaya/index.js +1 -0
  83. package/dist/es/components/wallets/Paymaya/paymaya2.js +1 -0
  84. package/dist/es/components/wallets/Paymaya/type.js +1 -0
  85. package/dist/es/config.js +12 -12
  86. package/dist/es/constant.js +84 -4
  87. package/dist/es/core/PayKKaCheckout.js +28 -3
  88. package/dist/es/core/Session.js +24 -23
  89. package/dist/es/core/error.js +7 -0
  90. package/dist/es/core/query.js +3 -2
  91. package/dist/es/core.js +2082 -70
  92. package/dist/es/hooks/usePayState.js +0 -3
  93. package/dist/es/i18n/I18n.js +8 -2
  94. package/dist/es/i18n/locales/de-DE.js +16 -1
  95. package/dist/es/i18n/locales/en-GB.js +16 -1
  96. package/dist/es/i18n/locales/es-ES.js +16 -1
  97. package/dist/es/i18n/locales/fr-FR.js +16 -1
  98. package/dist/es/i18n/locales/ja-JP.js +16 -1
  99. package/dist/es/i18n/locales/ko-KR.js +16 -1
  100. package/dist/es/i18n/locales/pt-PT.js +16 -1
  101. package/dist/es/i18n/locales/ru-RU.js +16 -1
  102. package/dist/es/i18n/locales/zh-CN.js +16 -1
  103. package/dist/es/i18n/locales/zh-HK.js +16 -1
  104. package/dist/es/i18n/locales/zh-TW.js +16 -1
  105. package/dist/es/i18n/util.js +12 -3
  106. package/dist/es/index.js +20 -0
  107. package/dist/es/style.css +1 -1192
  108. package/dist/es/types/index.js +1 -0
  109. package/dist/es/utils/array.js +9 -0
  110. package/dist/es/utils/card-brand/brands.js +11 -1
  111. package/dist/es/utils/card-brand/index.js +4 -3
  112. package/dist/es/utils/card-brand/luhn.js +25 -0
  113. package/dist/es/utils/date.js +25 -0
  114. package/dist/es/utils/detect.js +6 -0
  115. package/dist/es/utils/format.js +28 -12
  116. package/dist/es/utils/index.js +9 -1
  117. package/dist/es/utils/location.js +37 -0
  118. package/dist/es/utils/object.js +14 -0
  119. package/dist/es/utils/redirect.js +32 -0
  120. package/dist/es/utils/system-info/get-browser-info.js +4 -4
  121. package/dist/es/utils/system-info/get-system-info.js +11 -7
  122. package/dist/es/utils/system-info/index.js +4 -4
  123. package/dist/style.css +1 -1
  124. package/dist/types/api/http.d.ts +4 -10
  125. package/dist/types/api/modules/ali-pay/index.d.ts +2 -1
  126. package/dist/types/api/modules/apple-pay/index.d.ts +2 -1
  127. package/dist/types/api/modules/boost/index.d.ts +24 -0
  128. package/dist/types/api/modules/card/index.d.ts +1 -1
  129. package/dist/types/api/modules/checkout/index.d.ts +2 -2
  130. package/dist/types/api/modules/checkout/type.d.ts +9 -0
  131. package/dist/types/api/modules/gcash/index.d.ts +24 -0
  132. package/dist/types/api/modules/get-browser-params.d.ts +2 -2
  133. package/dist/types/api/modules/google-pay/index.d.ts +2 -1
  134. package/dist/types/api/modules/grab-pay/index.d.ts +24 -0
  135. package/dist/types/api/modules/index.d.ts +9 -0
  136. package/dist/types/api/modules/line-pay/index.d.ts +24 -0
  137. package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +24 -0
  138. package/dist/types/api/modules/nine-pay/index.d.ts +24 -0
  139. package/dist/types/api/modules/paymaya/index.d.ts +24 -0
  140. package/dist/types/api/modules/sepa/index.d.ts +2 -1
  141. package/dist/types/api/modules/shopee-pay/index.d.ts +24 -0
  142. package/dist/types/api/modules/tng-wallet/index.d.ts +24 -0
  143. package/dist/types/api/modules/wechat-pay/index.d.ts +2 -1
  144. package/dist/types/components/Boost/Boost.d.ts +7 -0
  145. package/dist/types/components/Boost/index.d.ts +2 -0
  146. package/dist/types/components/Boost/type.d.ts +61 -0
  147. package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +1 -1
  148. package/dist/types/components/DropIn/config.d.ts +7 -0
  149. package/dist/types/components/DropIn/type.d.ts +11 -3
  150. package/dist/types/components/GrabPay/GrabPay.d.ts +7 -0
  151. package/dist/types/components/GrabPay/index.d.ts +2 -0
  152. package/dist/types/components/GrabPay/type.d.ts +61 -0
  153. package/dist/types/components/GuideCard/GuideCard.d.ts +3 -0
  154. package/dist/types/components/GuideCard/index.d.ts +2 -0
  155. package/dist/types/components/GuideCard/type.d.ts +4 -0
  156. package/dist/types/components/LinePay/LinePay.d.ts +7 -0
  157. package/dist/types/components/LinePay/index.d.ts +2 -0
  158. package/dist/types/components/LinePay/type.d.ts +61 -0
  159. package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -0
  160. package/dist/types/components/MayBankQRPay/index.d.ts +2 -0
  161. package/dist/types/components/MayBankQRPay/type.d.ts +61 -0
  162. package/dist/types/components/NinePay/NinePay.d.ts +6 -0
  163. package/dist/types/components/NinePay/index.d.ts +2 -0
  164. package/dist/types/components/NinePay/type.d.ts +61 -0
  165. package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +1 -1
  166. package/dist/types/components/ShopeePay/ShopeePay.d.ts +7 -0
  167. package/dist/types/components/ShopeePay/index.d.ts +2 -0
  168. package/dist/types/components/ShopeePay/type.d.ts +61 -0
  169. package/dist/types/components/SubmitButton/SubmitButton.d.ts +1 -1
  170. package/dist/types/components/TNGWallet/TNGWallet.d.ts +7 -0
  171. package/dist/types/components/TNGWallet/index.d.ts +2 -0
  172. package/dist/types/components/TNGWallet/type.d.ts +61 -0
  173. package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +3 -0
  174. package/dist/types/components/business/QRCodeModal/index.d.ts +2 -0
  175. package/dist/types/components/business/QRCodeModal/type.d.ts +18 -0
  176. package/dist/types/components/business/index.d.ts +1 -0
  177. package/dist/types/components/index.d.ts +9 -0
  178. package/dist/types/components/internal/Accordion/Accordion.d.ts +3 -0
  179. package/dist/types/components/internal/Accordion/accordionTransition.d.ts +8 -0
  180. package/dist/types/components/internal/Accordion/components/AccordionItem/AccordionItem.d.ts +3 -0
  181. package/dist/types/components/internal/Accordion/components/AccordionItem/index.d.ts +2 -0
  182. package/dist/types/components/internal/Accordion/components/AccordionItem/type.d.ts +18 -0
  183. package/dist/types/components/internal/Accordion/index.d.ts +3 -0
  184. package/dist/types/components/internal/Accordion/type.d.ts +18 -0
  185. package/dist/types/components/internal/Modal/type.d.ts +2 -0
  186. package/dist/types/components/internal/QRCode/QRCode.d.ts +2 -0
  187. package/dist/types/components/internal/QRCode/index.d.ts +2 -0
  188. package/dist/types/components/internal/QRCode/type.d.ts +9 -0
  189. package/dist/types/components/internal/icons/IconBoost.d.ts +2 -0
  190. package/dist/types/components/internal/icons/IconCard2.d.ts +2 -0
  191. package/dist/types/components/internal/icons/IconGCash.d.ts +2 -0
  192. package/dist/types/components/internal/icons/IconGcashComplete.d.ts +2 -0
  193. package/dist/types/components/internal/icons/IconGrabPay.d.ts +2 -0
  194. package/dist/types/components/internal/icons/IconLinePay.d.ts +2 -0
  195. package/dist/types/components/internal/icons/IconMayBankQRPay.d.ts +2 -0
  196. package/dist/types/components/internal/icons/IconNinePay.d.ts +2 -0
  197. package/dist/types/components/internal/icons/IconPaymaya.d.ts +2 -0
  198. package/dist/types/components/internal/icons/IconRedirect.d.ts +2 -0
  199. package/dist/types/components/internal/icons/IconScan.d.ts +2 -0
  200. package/dist/types/components/internal/icons/IconShopeePay.d.ts +2 -0
  201. package/dist/types/components/internal/icons/IconTNGWallet.d.ts +2 -0
  202. package/dist/types/components/internal/icons/IconUnionPay.d.ts +2 -0
  203. package/dist/types/components/internal/icons/index.d.ts +13 -0
  204. package/dist/types/components/wallets/GCash/GCash.d.ts +6 -0
  205. package/dist/types/components/wallets/GCash/index.d.ts +2 -0
  206. package/dist/types/components/wallets/GCash/type.d.ts +66 -0
  207. package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -0
  208. package/dist/types/components/wallets/Paymaya/index.d.ts +2 -0
  209. package/dist/types/components/wallets/Paymaya/type.d.ts +61 -0
  210. package/dist/types/config.d.ts +9 -9
  211. package/dist/types/constant.d.ts +28 -3
  212. package/dist/types/core/PayKKaCheckout.d.ts +10 -0
  213. package/dist/types/core/Session.d.ts +2 -0
  214. package/dist/types/core/error.d.ts +3 -1
  215. package/dist/types/core/query.d.ts +2 -2
  216. package/dist/types/hooks/usePayState.d.ts +0 -3
  217. package/dist/types/i18n/I18n.d.ts +1 -1
  218. package/dist/types/i18n/locales/de-DE.d.ts +13 -0
  219. package/dist/types/i18n/locales/en-GB.d.ts +13 -0
  220. package/dist/types/i18n/locales/es-ES.d.ts +13 -0
  221. package/dist/types/i18n/locales/fr-FR.d.ts +13 -0
  222. package/dist/types/i18n/locales/ja-JP.d.ts +13 -0
  223. package/dist/types/i18n/locales/ko-KR.d.ts +13 -0
  224. package/dist/types/i18n/locales/pt-PT.d.ts +13 -0
  225. package/dist/types/i18n/locales/ru-RU.d.ts +13 -0
  226. package/dist/types/i18n/locales/zh-CN.d.ts +13 -0
  227. package/dist/types/i18n/locales/zh-HK.d.ts +13 -0
  228. package/dist/types/i18n/locales/zh-TW.d.ts +13 -0
  229. package/dist/types/i18n/util.d.ts +5 -0
  230. package/dist/types/index.d.ts +1 -1
  231. package/dist/types/types/index.d.ts +10 -3
  232. package/dist/types/types/message.d.ts +1 -0
  233. package/dist/types/utils/array.d.ts +1 -0
  234. package/dist/types/utils/card-brand/brands.d.ts +4 -3
  235. package/dist/types/utils/card-brand/index.d.ts +9 -6
  236. package/dist/types/utils/card-brand/luhn.d.ts +9 -0
  237. package/dist/types/utils/date.d.ts +9 -0
  238. package/dist/types/utils/detect.d.ts +1 -0
  239. package/dist/types/utils/format.d.ts +7 -1
  240. package/dist/types/utils/index.d.ts +7 -0
  241. package/dist/types/utils/location.d.ts +7 -0
  242. package/dist/types/utils/object.d.ts +1 -0
  243. package/dist/types/utils/redirect.d.ts +5 -0
  244. package/dist/types/utils/system-info/get-browser-info.d.ts +1 -1
  245. package/dist/types/utils/system-info/get-system-info.d.ts +3 -2
  246. package/dist/types/utils/system-info/index.d.ts +3 -3
  247. package/package.json +4 -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 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
+ }
@@ -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,2 @@
1
+ export * from './ShopeePay';
2
+ export * from './type';
@@ -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 function SubmitButton(props: SubmitButtonProps): import("preact").JSX.Element;
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,2 @@
1
+ export * from './TNGWallet';
2
+ export * from './type';
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ import type { QRCodeModalProps } from './type';
2
+ import './qr-code-modal.scss';
3
+ export declare const QRCodeModal: (props: QRCodeModalProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './QRCodeModal';
2
+ export * from './type';
@@ -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,3 @@
1
+ import { type AccordionProps } from './type';
2
+ import './accordion.scss';
3
+ export declare const Accordion: ({ value, onChange, children, enableTransition }: AccordionProps) => import("preact/compat").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 手风琴组件过渡动画
3
+ * 收起或者展开的时候,需要获取内容高度,然后设置高度
4
+ * @param item 需要设置动画的元素
5
+ * @param unfold 是否展开
6
+ * @param enable 是否启用动画,默认启用
7
+ */
8
+ export declare const accordionTransition: (item: HTMLDivElement, unfold: boolean, enable?: boolean) => void;
@@ -0,0 +1,3 @@
1
+ import type { AccordionItemProps } from './type';
2
+ import './accordion-item.scss';
3
+ export declare const AccordionItem: (props: AccordionItemProps) => import("preact/compat").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { AccordionItem } from './AccordionItem';
2
+ export type { AccordionItemProps } from './type';
@@ -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,3 @@
1
+ export { Accordion } from './Accordion';
2
+ export type { AccordionProps } from './type';
3
+ export { AccordionItem } from './components/AccordionItem';
@@ -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,2 @@
1
+ import type { QRCodeProps } from './type';
2
+ export declare const QRCode: ({ value, size, className, style }: QRCodeProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './QRCode';
2
+ export * from './type';
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconBoost: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconCard2: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconGCash: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare function IconGcashComplete({ size, style, className }: IconProps): import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconGrabPay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconLinePay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconMayBankQRPay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconNinePay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconPaymaya: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconRedirect: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconScan: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconShopeePay: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare const IconTNGWallet: ({ size, style, className }: IconProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './type';
2
+ export declare function IconUnionPay({ size, style, className }: IconProps): import("preact").JSX.Element;
@@ -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
+ }>;
@@ -0,0 +1,2 @@
1
+ export * from './GCash';
2
+ export * from './type';
@@ -0,0 +1,66 @@
1
+ import type { PayKKaError } from '../../..';
2
+ import type { PayRes } from '../../../api';
3
+ import type { FormValidateError } from '../../internal/Form';
4
+ export interface GCashProps {
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
+ * @internal
51
+ * 是否展示二维码弹窗
52
+ */
53
+ enableQRCodeModal?: boolean;
54
+ }
55
+ export interface GCashRef {
56
+ /** 停止轮询支付结果 */
57
+ stopRetry: () => void;
58
+ /** 开始轮询支付结果 */
59
+ startRetry: (timeout?: number) => void;
60
+ /** 更新表单地址 */
61
+ updateAddress: () => void;
62
+ /** 更新表单邮箱 */
63
+ updateEmail: () => void;
64
+ /** 不展示支付按钮时,可调用该方法进行支付 */
65
+ payment: () => void;
66
+ }
@@ -0,0 +1,6 @@
1
+ import type { PaymayaProps, PaymayaRef } from './type';
2
+ import type { CoreProps } from '../../../types';
3
+ import './paymaya.scss';
4
+ export declare const Paymaya: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<PaymayaProps & CoreProps> & {
5
+ ref?: import("preact").Ref<PaymayaRef> | undefined;
6
+ }>;
@@ -0,0 +1,2 @@
1
+ export * from './Paymaya';
2
+ export * from './type';
@@ -0,0 +1,61 @@
1
+ import type { PayKKaError } from '../../..';
2
+ import type { PayRes } from '../../../api';
3
+ import type { FormValidateError } from '../../internal/Form';
4
+ export interface PaymayaProps {
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 PaymayaRef {
51
+ /** 停止轮询支付结果 */
52
+ stopRetry: () => void;
53
+ /** 开始轮询支付结果 */
54
+ startRetry: (timeout?: number) => void;
55
+ /** 更新表单地址 */
56
+ updateAddress: () => void;
57
+ /** 更新表单邮箱 */
58
+ updateEmail: () => void;
59
+ /** 不展示支付按钮时,可调用该方法进行支付 */
60
+ payment: () => void;
61
+ }
@@ -1,5 +1,5 @@
1
- import { type LocaleKeyType } from "./i18n";
2
- import { type FraudDetectionEnv } from "./types";
1
+ import { type LocaleKeyType } from './i18n';
2
+ import { type FraudDetectionEnv } from './types';
3
3
  export declare let apiUrl: string;
4
4
  export declare let cdnOrigin: any;
5
5
  export declare let cdnDir: any;
@@ -8,11 +8,11 @@ export declare let fraudDetectionEnv: FraudDetectionEnv | undefined;
8
8
  export declare let customReqHeaders: Recordable;
9
9
  export declare let customLocale: LocaleKeyType | undefined;
10
10
  export declare let hidePaymentButton: boolean;
11
- export declare function setApiUrl(url: string): void;
12
- export declare function setCDNUrl(url: string): void;
13
- export declare function setFraudDetectionEnv(env: FraudDetectionEnv): void;
14
- export declare function setCustomReqHeaders(headers: Recordable): void;
15
- export declare function setCustomLocale(locale: LocaleKeyType): void;
16
- export declare function setCheckoutConfig(params: {
11
+ export declare const setApiUrl: (url: string) => void;
12
+ export declare const setCDNUrl: (url: string) => void;
13
+ export declare const setFraudDetectionEnv: (env: FraudDetectionEnv) => void;
14
+ export declare const setCustomReqHeaders: (headers: Recordable) => void;
15
+ export declare const setCustomLocale: (locale: LocaleKeyType) => void;
16
+ export declare const setCheckoutConfig: (params: {
17
17
  hidePaymentButton?: boolean;
18
- }): void;
18
+ }) => void;