@paykka/card-checkout-ui 0.7.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 (266) hide show
  1. package/dist/card-checkout-ui.js +27 -20
  2. package/dist/card-checkout-ui.umd.cjs +27 -20
  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 +29 -1
  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 +58 -60
  27. package/dist/es/components/ApplePay/index.js +29 -43
  28. package/dist/es/components/Boost/index.js +322 -0
  29. package/dist/es/components/Card/index.js +89 -75
  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 +365 -0
  33. package/dist/es/components/GooglePay/index.js +15 -7
  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 +8 -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 +51 -61
  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 +10 -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 +3 -0
  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 +94 -4
  87. package/dist/es/core/PayKKaCheckout.js +38 -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 +3 -4
  93. package/dist/es/i18n/I18n.js +8 -2
  94. package/dist/es/i18n/locales/de-DE.js +19 -1
  95. package/dist/es/i18n/locales/en-GB.js +19 -1
  96. package/dist/es/i18n/locales/es-ES.js +19 -1
  97. package/dist/es/i18n/locales/fr-FR.js +19 -1
  98. package/dist/es/i18n/locales/ja-JP.js +19 -1
  99. package/dist/es/i18n/locales/ko-KR.js +19 -1
  100. package/dist/es/i18n/locales/pt-PT.js +19 -1
  101. package/dist/es/i18n/locales/ru-RU.js +19 -1
  102. package/dist/es/i18n/locales/zh-CN.js +19 -1
  103. package/dist/es/i18n/locales/zh-HK.js +19 -1
  104. package/dist/es/i18n/locales/zh-TW.js +19 -1
  105. package/dist/es/i18n/util.js +20 -0
  106. package/dist/es/index.js +24 -0
  107. package/dist/es/style.css +1 -1096
  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/map.d.ts +2 -1
  131. package/dist/types/api/modules/checkout/type.d.ts +20 -2
  132. package/dist/types/api/modules/gcash/index.d.ts +24 -0
  133. package/dist/types/api/modules/get-browser-params.d.ts +2 -2
  134. package/dist/types/api/modules/google-pay/index.d.ts +2 -1
  135. package/dist/types/api/modules/grab-pay/index.d.ts +24 -0
  136. package/dist/types/api/modules/index.d.ts +9 -0
  137. package/dist/types/api/modules/line-pay/index.d.ts +24 -0
  138. package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +24 -0
  139. package/dist/types/api/modules/nine-pay/index.d.ts +24 -0
  140. package/dist/types/api/modules/paymaya/index.d.ts +24 -0
  141. package/dist/types/api/modules/sepa/index.d.ts +2 -1
  142. package/dist/types/api/modules/shopee-pay/index.d.ts +24 -0
  143. package/dist/types/api/modules/tng-wallet/index.d.ts +24 -0
  144. package/dist/types/api/modules/wechat-pay/index.d.ts +2 -1
  145. package/dist/types/components/AliPay/AliPay.d.ts +2 -1
  146. package/dist/types/components/AliPay/type.d.ts +1 -2
  147. package/dist/types/components/ApplePay/ApplePay.d.ts +2 -1
  148. package/dist/types/components/ApplePay/type.d.ts +9 -6
  149. package/dist/types/components/Boost/Boost.d.ts +7 -0
  150. package/dist/types/components/Boost/index.d.ts +2 -0
  151. package/dist/types/components/Boost/type.d.ts +61 -0
  152. package/dist/types/components/Card/Card.d.ts +2 -1
  153. package/dist/types/components/Card/type.d.ts +2 -2
  154. package/dist/types/components/DropIn/DropIn.d.ts +6 -0
  155. package/dist/types/components/DropIn/components/PaymentTabs/PaymentTabs.d.ts +3 -0
  156. package/dist/types/components/DropIn/components/PaymentTabs/index.d.ts +2 -0
  157. package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +11 -0
  158. package/dist/types/components/DropIn/config.d.ts +7 -0
  159. package/dist/types/components/DropIn/index.d.ts +2 -0
  160. package/dist/types/components/DropIn/type.d.ts +57 -0
  161. package/dist/types/components/GooglePay/GooglePay.d.ts +2 -1
  162. package/dist/types/components/GooglePay/type.d.ts +20 -9
  163. package/dist/types/components/GrabPay/GrabPay.d.ts +7 -0
  164. package/dist/types/components/GrabPay/index.d.ts +2 -0
  165. package/dist/types/components/GrabPay/type.d.ts +61 -0
  166. package/dist/types/components/GuideCard/GuideCard.d.ts +3 -0
  167. package/dist/types/components/GuideCard/index.d.ts +2 -0
  168. package/dist/types/components/GuideCard/type.d.ts +4 -0
  169. package/dist/types/components/LinePay/LinePay.d.ts +7 -0
  170. package/dist/types/components/LinePay/index.d.ts +2 -0
  171. package/dist/types/components/LinePay/type.d.ts +61 -0
  172. package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -0
  173. package/dist/types/components/MayBankQRPay/index.d.ts +2 -0
  174. package/dist/types/components/MayBankQRPay/type.d.ts +61 -0
  175. package/dist/types/components/NinePay/NinePay.d.ts +6 -0
  176. package/dist/types/components/NinePay/index.d.ts +2 -0
  177. package/dist/types/components/NinePay/type.d.ts +61 -0
  178. package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +1 -1
  179. package/dist/types/components/Sepa/Sepa.d.ts +2 -1
  180. package/dist/types/components/Sepa/type.d.ts +1 -2
  181. package/dist/types/components/ShopeePay/ShopeePay.d.ts +7 -0
  182. package/dist/types/components/ShopeePay/index.d.ts +2 -0
  183. package/dist/types/components/ShopeePay/type.d.ts +61 -0
  184. package/dist/types/components/SubmitButton/SubmitButton.d.ts +1 -1
  185. package/dist/types/components/TNGWallet/TNGWallet.d.ts +7 -0
  186. package/dist/types/components/TNGWallet/index.d.ts +2 -0
  187. package/dist/types/components/TNGWallet/type.d.ts +61 -0
  188. package/dist/types/components/WechatPay/WechatPay.d.ts +2 -1
  189. package/dist/types/components/WechatPay/type.d.ts +1 -2
  190. package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +3 -0
  191. package/dist/types/components/business/QRCodeModal/index.d.ts +2 -0
  192. package/dist/types/components/business/QRCodeModal/type.d.ts +18 -0
  193. package/dist/types/components/business/index.d.ts +1 -0
  194. package/dist/types/components/index.d.ts +10 -0
  195. package/dist/types/components/internal/Accordion/Accordion.d.ts +3 -0
  196. package/dist/types/components/internal/Accordion/accordionTransition.d.ts +8 -0
  197. package/dist/types/components/internal/Accordion/components/AccordionItem/AccordionItem.d.ts +3 -0
  198. package/dist/types/components/internal/Accordion/components/AccordionItem/index.d.ts +2 -0
  199. package/dist/types/components/internal/Accordion/components/AccordionItem/type.d.ts +18 -0
  200. package/dist/types/components/internal/Accordion/index.d.ts +3 -0
  201. package/dist/types/components/internal/Accordion/type.d.ts +18 -0
  202. package/dist/types/components/internal/Modal/index.d.ts +2 -0
  203. package/dist/types/components/internal/Modal/type.d.ts +3 -1
  204. package/dist/types/components/internal/QRCode/QRCode.d.ts +2 -0
  205. package/dist/types/components/internal/QRCode/index.d.ts +2 -0
  206. package/dist/types/components/internal/QRCode/type.d.ts +9 -0
  207. package/dist/types/components/internal/icons/IconBoost.d.ts +2 -0
  208. package/dist/types/components/internal/icons/IconCard.d.ts +2 -0
  209. package/dist/types/components/internal/icons/IconCard2.d.ts +2 -0
  210. package/dist/types/components/internal/icons/IconGCash.d.ts +2 -0
  211. package/dist/types/components/internal/icons/IconGcashComplete.d.ts +2 -0
  212. package/dist/types/components/internal/icons/IconGrabPay.d.ts +2 -0
  213. package/dist/types/components/internal/icons/IconLinePay.d.ts +2 -0
  214. package/dist/types/components/internal/icons/IconMayBankQRPay.d.ts +2 -0
  215. package/dist/types/components/internal/icons/IconNinePay.d.ts +2 -0
  216. package/dist/types/components/internal/icons/IconPaymaya.d.ts +2 -0
  217. package/dist/types/components/internal/icons/IconRedirect.d.ts +2 -0
  218. package/dist/types/components/internal/icons/IconScan.d.ts +2 -0
  219. package/dist/types/components/internal/icons/IconShopeePay.d.ts +2 -0
  220. package/dist/types/components/internal/icons/IconTNGWallet.d.ts +2 -0
  221. package/dist/types/components/internal/icons/IconUnionPay.d.ts +2 -0
  222. package/dist/types/components/internal/icons/index.d.ts +14 -0
  223. package/dist/types/components/wallets/GCash/GCash.d.ts +6 -0
  224. package/dist/types/components/wallets/GCash/index.d.ts +2 -0
  225. package/dist/types/components/wallets/GCash/type.d.ts +66 -0
  226. package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -0
  227. package/dist/types/components/wallets/Paymaya/index.d.ts +2 -0
  228. package/dist/types/components/wallets/Paymaya/type.d.ts +61 -0
  229. package/dist/types/config.d.ts +9 -9
  230. package/dist/types/constant.d.ts +38 -2
  231. package/dist/types/core/PayKKaCheckout.d.ts +11 -0
  232. package/dist/types/core/Session.d.ts +2 -0
  233. package/dist/types/core/error.d.ts +3 -1
  234. package/dist/types/core/query.d.ts +2 -2
  235. package/dist/types/hooks/usePayState.d.ts +0 -3
  236. package/dist/types/i18n/I18n.d.ts +1 -1
  237. package/dist/types/i18n/locales/de-DE.d.ts +15 -0
  238. package/dist/types/i18n/locales/en-GB.d.ts +15 -0
  239. package/dist/types/i18n/locales/es-ES.d.ts +15 -0
  240. package/dist/types/i18n/locales/fr-FR.d.ts +15 -0
  241. package/dist/types/i18n/locales/ja-JP.d.ts +15 -0
  242. package/dist/types/i18n/locales/ko-KR.d.ts +15 -0
  243. package/dist/types/i18n/locales/pt-PT.d.ts +15 -0
  244. package/dist/types/i18n/locales/ru-RU.d.ts +15 -0
  245. package/dist/types/i18n/locales/zh-CN.d.ts +15 -0
  246. package/dist/types/i18n/locales/zh-HK.d.ts +15 -0
  247. package/dist/types/i18n/locales/zh-TW.d.ts +15 -0
  248. package/dist/types/i18n/util.d.ts +10 -0
  249. package/dist/types/index.d.ts +1 -1
  250. package/dist/types/types/index.d.ts +34 -7
  251. package/dist/types/types/message.d.ts +1 -0
  252. package/dist/types/utils/array.d.ts +1 -0
  253. package/dist/types/utils/card-brand/brands.d.ts +4 -3
  254. package/dist/types/utils/card-brand/index.d.ts +9 -6
  255. package/dist/types/utils/card-brand/luhn.d.ts +9 -0
  256. package/dist/types/utils/date.d.ts +9 -0
  257. package/dist/types/utils/detect.d.ts +1 -0
  258. package/dist/types/utils/format.d.ts +7 -1
  259. package/dist/types/utils/index.d.ts +7 -0
  260. package/dist/types/utils/location.d.ts +7 -0
  261. package/dist/types/utils/object.d.ts +1 -0
  262. package/dist/types/utils/redirect.d.ts +5 -0
  263. package/dist/types/utils/system-info/get-browser-info.d.ts +1 -1
  264. package/dist/types/utils/system-info/get-system-info.d.ts +3 -2
  265. package/dist/types/utils/system-info/index.d.ts +3 -3
  266. package/package.json +65 -63
@@ -1,6 +1,6 @@
1
- export declare function getBrowserParams(params?: {
1
+ export declare const getBrowserParams: (params?: {
2
2
  fraudDetectionId?: string;
3
- }): Promise<{
3
+ }) => Promise<{
4
4
  user_agent: string;
5
5
  color_depth: number;
6
6
  language: string;
@@ -1,3 +1,4 @@
1
+ import type { PayKKaCheckout } from '../../../core';
1
2
  import { type RequestOptions } from '../../http';
2
3
  import type { PayBill } from '../type';
3
4
  export declare function googlePay({ sessionId, clientKey, token, bill, browser }: {
@@ -6,7 +7,7 @@ export declare function googlePay({ sessionId, clientKey, token, bill, browser }
6
7
  token: string;
7
8
  bill: PayBill;
8
9
  browser: Recordable;
9
- }, options?: RequestOptions): Promise<import("../type").PayRes>;
10
+ }, core: PayKKaCheckout, options?: RequestOptions): Promise<import("../type").PayRes>;
10
11
  export declare function getGooglePayInfo({ sessionId, clientKey }: {
11
12
  sessionId: string;
12
13
  clientKey?: string;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const grabPay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getGrabPayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -5,6 +5,15 @@ export * from './wechat-pay';
5
5
  export * from './apple-pay';
6
6
  export * from './google-pay';
7
7
  export * from './sepa';
8
+ export * from './boost';
9
+ export * from './line-pay';
10
+ export * from './may-bank-qr-pay';
11
+ export * from './nine-pay';
12
+ export * from './grab-pay';
13
+ export * from './tng-wallet';
14
+ export * from './shopee-pay';
15
+ export * from './gcash';
16
+ export * from './paymaya';
8
17
  export * from './map';
9
18
  export * from './type';
10
19
  export * from './get-browser-params';
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const linePay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getLinePayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const mayBankQRPay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getMayBankQRPayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const ninePay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getNinePayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const paymayaPay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getPaymayaPayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -1,3 +1,4 @@
1
+ import type { PayKKaCheckout } from '../../../core';
1
2
  import { type RequestOptions } from '../../http';
2
3
  export declare function sepaPay({ sessionId, clientKey, payment, bill, browser }: {
3
4
  sessionId: string;
@@ -17,7 +18,7 @@ export declare function sepaPay({ sessionId, clientKey, payment, bill, browser }
17
18
  address2?: string | null;
18
19
  };
19
20
  browser: Recordable;
20
- }, options?: RequestOptions): Promise<import("..").PayRes>;
21
+ }, core: PayKKaCheckout, options?: RequestOptions): Promise<import("..").PayRes>;
21
22
  export declare function getSepaPayInfo({ sessionId, clientKey }: {
22
23
  sessionId: string;
23
24
  clientKey?: string;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const shopeePay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getShopeePayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -0,0 +1,24 @@
1
+ import type { PayKKaCheckout } from '../../../core';
2
+ import { type RequestOptions } from '../../http';
3
+ export declare const tngWalletPay: ({ sessionId, clientKey, payment, bill, browser }: {
4
+ sessionId: string;
5
+ clientKey?: string;
6
+ payment: {
7
+ paymentMethod: string;
8
+ };
9
+ bill: {
10
+ email: string;
11
+ country?: string | null;
12
+ province?: string | null;
13
+ city?: string | null;
14
+ area?: string | null;
15
+ postCode?: string | null;
16
+ address1?: string | null;
17
+ address2?: string | null;
18
+ };
19
+ browser: Recordable;
20
+ }, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
21
+ export declare const getTNGWalletPayInfo: ({ sessionId, clientKey }: {
22
+ sessionId: string;
23
+ clientKey?: string;
24
+ }, options?: RequestOptions) => Promise<import("..").PayRes>;
@@ -1,3 +1,4 @@
1
+ import type { PayKKaCheckout } from '../../../core';
1
2
  import { type RequestOptions } from '../../http';
2
3
  export declare function wechatPay({ sessionId, clientKey, bill, channelUserId }: {
3
4
  sessionId: string;
@@ -13,7 +14,7 @@ export declare function wechatPay({ sessionId, clientKey, bill, channelUserId }:
13
14
  address2?: string | null;
14
15
  };
15
16
  channelUserId?: string;
16
- }, options?: RequestOptions): Promise<import("..").PayRes>;
17
+ }, core: PayKKaCheckout, options?: RequestOptions): Promise<import("..").PayRes>;
17
18
  export declare function getWechatPayInfo({ sessionId, clientKey }: {
18
19
  sessionId: string;
19
20
  clientKey?: string;
@@ -1,5 +1,6 @@
1
1
  import './ali-pay.scss';
2
2
  import type { AliPayProps, AliPayRef } from './type';
3
- export declare const AliPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<AliPayProps> & {
3
+ import type { CoreProps } from '../../types';
4
+ export declare const AliPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<AliPayProps & CoreProps> & {
4
5
  ref?: import("preact").Ref<AliPayRef> | undefined;
5
6
  }>;
@@ -1,8 +1,7 @@
1
1
  import type { PayRes } from '../../api';
2
2
  import type { PayKKaError } from '../../core';
3
- import type { CoreProps } from '../../types';
4
3
  import type { FormValidateError } from '../internal/Form';
5
- export interface AliPayProps extends CoreProps {
4
+ export interface AliPayProps {
6
5
  onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
7
6
  onSuccess?: (...args: any[]) => void;
8
7
  onError?: (error: PayKKaError) => void;
@@ -1,5 +1,6 @@
1
1
  import './apple-pay.scss';
2
2
  import type { ApplePayProps, ApplePayRef } from './type';
3
- export declare const ApplePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ApplePayProps> & {
3
+ import type { CoreProps } from '../../types';
4
+ export declare const ApplePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ApplePayProps & CoreProps> & {
4
5
  ref?: import("preact").Ref<ApplePayRef> | undefined;
5
6
  }>;
@@ -1,6 +1,6 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { CoreProps, PaymentSuccessData } from '../../types';
3
- export interface ApplePayProps extends CoreProps {
2
+ import type { PaymentSuccessData } from '../../types';
3
+ export interface ApplePayProps {
4
4
  /** 支付授权成功后触发 */
5
5
  onSubmit?: () => void;
6
6
  /** 支付成功后触发 */
@@ -13,16 +13,19 @@ export interface ApplePayProps extends CoreProps {
13
13
  onTimeout?: (source: 'retry' | 'channel') => void;
14
14
  /** 收银台已过期时触发 */
15
15
  onExpired?: () => void;
16
- /** 交易被风控拦截时触发 */
17
- onAuthorized?: () => void;
18
16
  /** 支付取消时触发 */
19
17
  onCancel?: () => void;
20
18
  /** Apple Pay 按钮是否可用 */
21
19
  onCanUse?: (canUse: boolean) => void;
22
20
  /**
23
- * 内部使用
21
+ * @internal
22
+ * 交易被风控拦截时触发
23
+ */
24
+ onAuthorized?: () => void;
25
+ /**
26
+ * @internal
27
+ * 点击 GooglePay 按钮
24
28
  */
25
- /** 点击 ApplePay 按钮 */
26
29
  onBtnClick?: () => void;
27
30
  }
28
31
  export interface ApplePayRef {
@@ -0,0 +1,7 @@
1
+ import type { BoostProps } from './type';
2
+ import type { BoostRef } from './type';
3
+ import type { CoreProps } from '../../types';
4
+ import './boost.scss';
5
+ export declare const Boost: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<BoostProps & CoreProps> & {
6
+ ref?: import("preact").Ref<BoostRef> | undefined;
7
+ }>;
@@ -0,0 +1,2 @@
1
+ export * from './Boost';
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 BoostProps {
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 BoostRef {
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,6 @@
1
1
  import './card.scss';
2
2
  import type { CardProps, CardRef } from './type';
3
- export declare const Card: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<CardProps> & {
3
+ import { type CoreProps } from '../../types';
4
+ export declare const Card: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<CardProps & CoreProps> & {
4
5
  ref?: import("preact").Ref<CardRef> | undefined;
5
6
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { CoreProps, ElementStylesConfig, PaymentSuccessData } from '../../types';
2
+ import type { ElementStylesConfig, PaymentSuccessData } from '../../types';
3
3
  import type { FormValidateError } from '../internal/Form';
4
- export interface CardProps extends CoreProps {
4
+ export interface CardProps {
5
5
  /** 定义卡敏感信息表单布局展示,split 为分割布局,combine 为合并布局 */
6
6
  cardInfoLayout?: CardInfoLayout;
7
7
  /**
@@ -0,0 +1,6 @@
1
+ import { type DropInProps, type DropInRefs } from './type';
2
+ import './drop-in.scss';
3
+ import type { CoreProps } from '../../types';
4
+ export declare const DropIn: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<DropInProps & CoreProps> & {
5
+ ref?: import("preact").Ref<DropInRefs> | undefined;
6
+ }>;
@@ -0,0 +1,3 @@
1
+ import type { PaymentTabsProps } from './type';
2
+ import './payment-tabs.scss';
3
+ export declare const PaymentTabs: (props: PaymentTabsProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './PaymentTabs';
@@ -0,0 +1,11 @@
1
+ import type { PaymentCategory } from '../../../../constant';
2
+ import type { PaymentTypeOptions } from '../../type';
3
+ export interface PaymentTabsProps {
4
+ value?: PaymentCategory;
5
+ tabs: PaymentTypeOptions[];
6
+ enabled?: PaymentCategory;
7
+ themeColor?: string;
8
+ onChange?: (type: PaymentCategory) => void;
9
+ }
10
+ export interface PaymentTabsRefs {
11
+ }
@@ -0,0 +1,7 @@
1
+ import { PaymentCategory } from '../../constant';
2
+ import type { ReactNode } from 'preact/compat';
3
+ import type { Translation } from '../../i18n';
4
+ export declare const paymentCategoryOptionMap: Partial<Record<PaymentCategory, {
5
+ icon: ReactNode;
6
+ nameKey: keyof Translation;
7
+ }>>;
@@ -0,0 +1,2 @@
1
+ export * from './DropIn';
2
+ export * from './type';
@@ -0,0 +1,57 @@
1
+ import type { ReactNode } from 'preact/compat';
2
+ import type { PaymentSuccessData } from '../../types';
3
+ import { PaymentCategory, PaymentMethod } from '../../constant';
4
+ import type { ComponentType } from 'preact';
5
+ import type { FormValidateError } from '../internal/Form';
6
+ import type { PayKKaError } from '../../core';
7
+ export interface DropInProps {
8
+ /**
9
+ * 配置各种支付方式的参数
10
+ * 最终展示的支付方式由创建收银台请求返回结果决定,而不是由该参数决定
11
+ */
12
+ paymentMethods?: PaymentMethodsConfig;
13
+ /**
14
+ * 布局,tabs 表示在tab切换式布局,accordion 表示折叠式布局(手风琴)
15
+ * 目前暂不支持 accordion 布局
16
+ *
17
+ * 更新:目前全面放弃 tabs 改用 accordion 布局,不准传 tabs!!!
18
+ * @default accordion
19
+ */
20
+ layout?: 'tabs' | 'accordion';
21
+ /** 提交表单时触发 */
22
+ onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
23
+ /** 支付成功后触发 */
24
+ onSuccess?: (data: PaymentSuccessData) => void;
25
+ /** 支付失败时触发 */
26
+ onError?: (error: PayKKaError) => void;
27
+ /** 支付超时时触发 */
28
+ onTimeout?: () => void;
29
+ /** 收银台已过期时触发 */
30
+ onExpired?: () => void;
31
+ /**
32
+ * @internal
33
+ * 是否启用过渡动画,layout 为 accordion 时有效
34
+ * 默认为 true
35
+ */
36
+ enableAccordionTransition?: boolean;
37
+ }
38
+ export interface DropInRefs {
39
+ /** 不展示支付按钮时,可调用该方法进行支付 */
40
+ payment: () => void;
41
+ }
42
+ export type PaymentMethodsConfig = {
43
+ [key in DropInPaymentCategory]: Partial<PaymentComponentProps<key>>;
44
+ };
45
+ export interface PaymentTypeOptions {
46
+ icon: () => ReactNode;
47
+ name: string;
48
+ type: DropInPaymentCategory;
49
+ }
50
+ /**
51
+ * 当前 drop in 支持的支付方式
52
+ * 目前暂不支持 WeChatPay 和 Alipay
53
+ */
54
+ export declare const dropInSupportedPaymentMethods: PaymentMethod[];
55
+ export type DropInPaymentCategory = PaymentCategory.APPLE_PAY | PaymentCategory.GOOGLE_PAY | PaymentCategory.CARD | PaymentCategory.BOOST | PaymentCategory.GRAB_PAY | PaymentCategory.TNG_WALLET | PaymentCategory.MAY_BANK_QR_PAY | PaymentCategory.SHOPEE_PAY | PaymentCategory.LINE_PAY | PaymentCategory.NINE_PAY | PaymentCategory.GCASH | PaymentCategory.PAYMAYA;
56
+ export declare const PaymentComponentMap: Record<DropInPaymentCategory, ComponentType<any>>;
57
+ export type PaymentComponentProps<P extends keyof typeof PaymentComponentMap> = React.ComponentProps<(typeof PaymentComponentMap)[P]>;
@@ -1,5 +1,6 @@
1
1
  import './google-pay.scss';
2
2
  import type { GooglePayProps, GooglePayRef } from './type';
3
- export declare const GooglePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GooglePayProps> & {
3
+ import type { CoreProps } from '../../types';
4
+ export declare const GooglePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GooglePayProps & CoreProps> & {
4
5
  ref?: import("preact").Ref<GooglePayRef> | undefined;
5
6
  }>;
@@ -1,6 +1,6 @@
1
1
  import type { PayKKaError } from '../../core';
2
- import type { CoreProps, PaymentSuccessData } from '../../types';
3
- export interface GooglePayProps extends CoreProps {
2
+ import type { PaymentSuccessData } from '../../types';
3
+ export interface GooglePayProps {
4
4
  /** 支付授权成功后触发 */
5
5
  onSubmit?: () => void;
6
6
  /** 支付成功后触发 */
@@ -13,19 +13,30 @@ export interface GooglePayProps extends CoreProps {
13
13
  onTimeout?: (source: 'retry' | 'channel') => void;
14
14
  /** 收银台已过期时触发 */
15
15
  onExpired?: () => void;
16
- /** 交易被风控拦截时触发 */
17
- onAuthorized?: () => void;
18
- /** 交易需要 3DS 验证时触发,url 为 3DS 验证链接,incomplete 为 false 表示目前要开始进行 3DS 验证,为 true 表示上一次 3DS 验证还未完成 */
19
- onThreeDS?: (url: string, incomplete: boolean) => void;
20
16
  /** 当前设备环境是否可用于 Google Pay 支付 */
21
17
  onCanUse?: (canUse: boolean) => void;
22
18
  /**
23
- * 内部使用
19
+ * @internal
20
+ * 交易被风控拦截时触发
21
+ */
22
+ onAuthorized?: () => void;
23
+ /**
24
+ * @internal
25
+ * 交易需要 3DS 验证时触发
26
+ * url 为 3DS 验证链接
27
+ * incomplete 为 false 表示目前要开始进行 3DS 验证,为 true 表示上一次 3DS 验证还未完成
28
+ */
29
+ onThreeDS?: (url: string, incomplete: boolean) => void;
30
+ /**
31
+ * @internal
32
+ * 点击 GooglePay 按钮
24
33
  */
25
- /** 点击 GooglePay 按钮 */
26
34
  onBtnClick?: () => void;
27
35
  }
28
36
  export interface GooglePayRef {
29
- /** 3DS 验证流程结束后可调用该方法轮询收银台支付状态 */
37
+ /**
38
+ * @internal
39
+ * 3DS 验证流程结束后可调用该方法轮询收银台支付状态
40
+ */
30
41
  checkThreeDS: () => void;
31
42
  }
@@ -0,0 +1,7 @@
1
+ import type { GrabPayProps } from './type';
2
+ import type { GrabPayRef } from './type';
3
+ import type { CoreProps } from '../../types';
4
+ import './grab-pay.scss';
5
+ export declare const GrabPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GrabPayProps & CoreProps> & {
6
+ ref?: import("preact").Ref<GrabPayRef> | undefined;
7
+ }>;
@@ -0,0 +1,2 @@
1
+ export * from './GrabPay';
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 GrabPayProps {
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 GrabPayRef {
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 { GuideCardProps } from './type';
2
+ import './guide-card.scss';
3
+ export declare const GuideCard: (props: GuideCardProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './GuideCard';
2
+ export * from './type';