@paykka/card-checkout-ui 0.14.0 → 0.15.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 (292) hide show
  1. package/README.md +1 -1
  2. package/dist/card-checkout-ui.js +20 -20
  3. package/dist/card-checkout-ui.umd.cjs +20 -20
  4. package/dist/es/api/http.js +1 -1
  5. package/dist/es/api/index.js +1 -1
  6. package/dist/es/api/modules/checkout/index.js +1 -3
  7. package/dist/es/api/modules/checkout/map.js +12 -4
  8. package/dist/es/api/modules/encrypted-card/index.js +3 -2
  9. package/dist/es/api/modules/get-browser-params.js +4 -5
  10. package/dist/es/api/modules/index.js +1 -1
  11. package/dist/es/api/modules/map.js +4 -1
  12. package/dist/es/components/AccordionItem/AccordionItem.js +1 -1
  13. package/dist/es/components/AccountNameField/index.js +1 -1
  14. package/dist/es/components/AddressField/index.js +1 -1
  15. package/dist/es/components/ApplePay/index.js +34 -21
  16. package/dist/es/components/CPFField/index.js +1 -1
  17. package/dist/es/components/Card/index.js +38 -30
  18. package/dist/es/components/CardBrands/index.js +1 -1
  19. package/dist/es/components/CardExpireDateField/index.js +1 -1
  20. package/dist/es/components/CardHolderNameField/index.js +1 -1
  21. package/dist/es/components/CardIBANField/index.js +1 -1
  22. package/dist/es/components/CardNo/index.js +1 -1
  23. package/dist/es/components/CardNumberField/index.js +1 -1
  24. package/dist/es/components/CardSecurityCodeField/index.js +1 -1
  25. package/dist/es/components/CardSelector/index.js +2 -2
  26. package/dist/es/components/CombinedCardInfo/index.js +1 -1
  27. package/dist/es/components/DropIn/index.js +117 -123
  28. package/dist/es/components/EmailField/EmailField.js +1 -1
  29. package/dist/es/components/EncryptedCard/index.js +5 -5
  30. package/dist/es/components/GooglePay/index.js +32 -29
  31. package/dist/es/components/GuideCard/index.js +2 -2
  32. package/dist/es/components/PaymentButton/index.js +22 -7
  33. package/dist/es/components/RecurringTip/index.js +1 -1
  34. package/dist/es/components/SecuredIframe/index.js +3 -4
  35. package/dist/es/components/Sepa/index.js +15 -7
  36. package/dist/es/components/SubmitButton/index.js +2 -2
  37. package/dist/es/components/ThreeDS/index.js +32 -20
  38. package/dist/es/components/Tip/index.js +1 -1
  39. package/dist/es/components/business/BlikCodeField/BlikCodeField.js +1 -1
  40. package/dist/es/components/business/BlikCodeField/index.js +1 -1
  41. package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +3 -3
  42. package/dist/es/components/business/BlikConfirmModal/index.js +2 -2
  43. package/dist/es/components/business/NameField/NameField.js +1 -1
  44. package/dist/es/components/business/NameField/index.js +1 -1
  45. package/dist/es/components/business/PhoneField/PhoneField.js +1 -1
  46. package/dist/es/components/business/PhoneField/index.js +1 -1
  47. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +2 -2
  48. package/dist/es/components/business/QRCodeModal/index.js +1 -1
  49. package/dist/es/components/business/Tooltip/Tooltip.js +1 -1
  50. package/dist/es/components/business/Tooltip/index.js +1 -1
  51. package/dist/es/components/business/index.js +2 -2
  52. package/dist/es/components/index.js +4 -4
  53. package/dist/es/components/internal/Accordion/index.js +1 -1
  54. package/dist/es/components/internal/Button/{Button.js → Button2.js} +2 -2
  55. package/dist/es/components/internal/Button/index.js +2 -2
  56. package/dist/es/components/internal/CheckBox/CheckBox.js +1 -1
  57. package/dist/es/components/internal/CheckBox/index.js +1 -1
  58. package/dist/es/components/internal/Form/type.js +1 -1
  59. package/dist/es/components/internal/Info/Info.js +1 -1
  60. package/dist/es/components/internal/Info/index.js +1 -1
  61. package/dist/es/components/internal/Input/type.js +1 -1
  62. package/dist/es/components/internal/Loading/Loading2.js +20 -0
  63. package/dist/es/{api/modules/line-pay → components/internal/Loading}/index.js +3 -2
  64. package/dist/es/components/internal/Loading/loading.js +1 -0
  65. package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -1
  66. package/dist/es/components/internal/LoadingCheck/index.js +1 -1
  67. package/dist/es/components/internal/Modal/Modal.js +1 -1
  68. package/dist/es/components/internal/QRCode/QRCode.js +1 -1
  69. package/dist/es/components/internal/QRCode/index.js +1 -1
  70. package/dist/es/components/internal/Select/Select.js +1 -1
  71. package/dist/es/components/internal/Select/SelectMenu.js +1 -1
  72. package/dist/es/components/internal/Select/SelectMenuItem.js +1 -1
  73. package/dist/es/components/internal/icons/IconAlipayPlus.js +116 -0
  74. package/dist/es/components/internal/icons/IconError.js +2 -2
  75. package/dist/es/components/internal/icons/IconSuccess.js +2 -2
  76. package/dist/es/components/internal/icons/IconWechatPayGlobal.js +45 -0
  77. package/dist/es/components/internal/icons/IconWechatPayGlobalComplete.js +107 -0
  78. package/dist/es/components/wallets/AliPay/AliPay.js +186 -0
  79. package/dist/es/components/wallets/AliPay/ali-pay.js +1 -0
  80. package/dist/es/components/wallets/AliPay/index.js +1 -0
  81. package/dist/es/components/wallets/AliPay/type.js +1 -0
  82. package/dist/es/components/wallets/Bancontact/Bancontact.js +7 -10
  83. package/dist/es/components/wallets/Blik/Blik.js +14 -11
  84. package/dist/es/components/wallets/Boost/Boost.js +6 -9
  85. package/dist/es/components/wallets/GCash/GCash.js +7 -10
  86. package/dist/es/components/wallets/GrabPay/GrabPay.js +7 -14
  87. package/dist/es/components/wallets/IDeal/IDeal.js +7 -10
  88. package/dist/es/components/wallets/LinePay/LinePay.js +6 -9
  89. package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +6 -9
  90. package/dist/es/components/wallets/NinePay/NinePay.js +6 -9
  91. package/dist/es/components/wallets/OVO/OVO.js +7 -10
  92. package/dist/es/components/wallets/OpayWallet/OpayWallet.js +6 -9
  93. package/dist/es/components/wallets/P24/P24.js +7 -10
  94. package/dist/es/components/wallets/PagaWallet/PagaWallet.js +6 -9
  95. package/dist/es/components/wallets/Paymaya/Paymaya.js +6 -9
  96. package/dist/es/components/wallets/PicPay/PicPay.js +54 -217
  97. package/dist/es/components/wallets/Pix/Pix.js +54 -217
  98. package/dist/es/components/wallets/ShopeePay/ShopeePay.js +6 -9
  99. package/dist/es/components/wallets/Skrill/Skrill.js +7 -10
  100. package/dist/es/components/wallets/TNGWallet/TNGWallet.js +6 -9
  101. package/dist/es/components/wallets/Trustly/Trustly.js +7 -10
  102. package/dist/es/components/wallets/Vietqr/Vietqr.js +14 -15
  103. package/dist/es/components/wallets/WechatPay/WechatPay.js +250 -0
  104. package/dist/es/components/wallets/WechatPay/index.js +1 -0
  105. package/dist/es/components/wallets/WechatPay/type.js +1 -0
  106. package/dist/es/components/wallets/WechatPay/util.js +47 -0
  107. package/dist/es/components/wallets/WechatPay/wechat-pay.js +1 -0
  108. package/dist/es/components/wallets/Zalopay/Zalopay.js +10 -13
  109. package/dist/es/components/wallets/index.js +2 -0
  110. package/dist/es/constant.js +7 -0
  111. package/dist/es/core/checkout.js +36 -9
  112. package/dist/es/core/create-child.js +5 -4
  113. package/dist/es/core/index.js +1 -1
  114. package/dist/es/core/logger.js +1 -1
  115. package/dist/es/core/payment.js +13 -0
  116. package/dist/es/core/preview.js +29 -0
  117. package/dist/es/core/query.js +12 -3
  118. package/dist/es/core/session.js +36 -6
  119. package/dist/es/core/theme.js +1 -1
  120. package/dist/es/hooks/index.js +1 -1
  121. package/dist/es/hooks/useBaseWallet.js +121 -52
  122. package/dist/es/hooks/useI18n.js +3 -3
  123. package/dist/es/i18n/locales/de-DE.js +7 -0
  124. package/dist/es/i18n/locales/en-GB.js +7 -0
  125. package/dist/es/i18n/locales/es-ES.js +7 -0
  126. package/dist/es/i18n/locales/fr-FR.js +7 -0
  127. package/dist/es/i18n/locales/ja-JP.js +7 -0
  128. package/dist/es/i18n/locales/ko-KR.js +7 -0
  129. package/dist/es/i18n/locales/nl-NL.js +7 -0
  130. package/dist/es/i18n/locales/pt-PT.js +7 -0
  131. package/dist/es/i18n/locales/ru-RU.js +7 -0
  132. package/dist/es/i18n/locales/zh-CN.js +7 -0
  133. package/dist/es/i18n/locales/zh-HK.js +7 -0
  134. package/dist/es/i18n/locales/zh-TW.js +7 -0
  135. package/dist/es/i18n/util.js +10 -10
  136. package/dist/es/index.js +7 -5
  137. package/dist/es/out/base-fraud-detection.js +1 -1
  138. package/dist/es/out/fraud-detection.js +59 -44
  139. package/dist/es/out/paykka-detection.js +5 -7
  140. package/dist/es/out/stripe-radar.js +1 -1
  141. package/dist/es/out/worldpay-ddc-manager.js +3 -0
  142. package/dist/es/out/worldpay-ddc.js +1 -1
  143. package/dist/es/style.css +1 -1
  144. package/dist/es/types/event.js +10 -1
  145. package/dist/es/types/index.js +7 -0
  146. package/dist/es/utils/array.js +19 -5
  147. package/dist/es/utils/business/amount.js +15 -0
  148. package/dist/es/utils/business/index.js +1 -0
  149. package/dist/es/utils/detect.js +8 -0
  150. package/dist/es/utils/index.js +7 -9
  151. package/dist/es/utils/location.js +8 -0
  152. package/dist/es/utils/number.js +19 -0
  153. package/dist/es/utils/redirect.js +2 -0
  154. package/dist/style.css +1 -1
  155. package/dist/types/api/modules/checkout/type.d.ts +1 -1
  156. package/dist/types/api/modules/index.d.ts +0 -17
  157. package/dist/types/api/modules/threeDS/index.d.ts +13 -5
  158. package/dist/types/components/ApplePay/type.d.ts +6 -2
  159. package/dist/types/components/Card/type.d.ts +2 -18
  160. package/dist/types/components/DropIn/layout.d.ts +33 -0
  161. package/dist/types/components/DropIn/type.d.ts +6 -6
  162. package/dist/types/components/GooglePay/createGooglePay.d.ts +1 -1
  163. package/dist/types/components/GooglePay/type.d.ts +6 -2
  164. package/dist/types/components/PaymentButton/type.d.ts +2 -0
  165. package/dist/types/components/Sepa/type.d.ts +3 -4
  166. package/dist/types/components/business/QRCodeModal/type.d.ts +12 -3
  167. package/dist/types/components/index.d.ts +0 -2
  168. package/dist/types/components/internal/Loading/Loading.d.ts +2 -1
  169. package/dist/types/components/internal/Loading/type.d.ts +8 -0
  170. package/dist/types/components/internal/ResultMessage/ResultMessage.d.ts +3 -0
  171. package/dist/types/components/internal/ResultMessage/index.d.ts +2 -0
  172. package/dist/types/components/internal/ResultMessage/type.d.ts +13 -0
  173. package/dist/types/components/internal/icons/IconAlipayPlus.d.ts +2 -0
  174. package/dist/types/components/internal/icons/IconError.d.ts +1 -1
  175. package/dist/types/components/internal/icons/IconSuccess.d.ts +1 -1
  176. package/dist/types/components/internal/icons/IconWechatPayGlobal.d.ts +2 -0
  177. package/dist/types/components/internal/icons/IconWechatPayGlobalComplete.d.ts +2 -0
  178. package/dist/types/components/internal/icons/index.d.ts +3 -0
  179. package/dist/types/components/{AliPay → wallets/AliPay}/AliPay.d.ts +9 -4
  180. package/dist/types/components/wallets/AliPay/type.d.ts +7 -0
  181. package/dist/types/components/wallets/Bancontact/type.d.ts +2 -24
  182. package/dist/types/components/wallets/Blik/type.d.ts +2 -24
  183. package/dist/types/components/wallets/Boost/type.d.ts +2 -24
  184. package/dist/types/components/wallets/GCash/type.d.ts +2 -24
  185. package/dist/types/components/wallets/GrabPay/type.d.ts +2 -12
  186. package/dist/types/components/wallets/IDeal/type.d.ts +2 -24
  187. package/dist/types/components/wallets/LinePay/type.d.ts +2 -24
  188. package/dist/types/components/wallets/MayBankQRPay/type.d.ts +2 -24
  189. package/dist/types/components/wallets/NinePay/type.d.ts +2 -24
  190. package/dist/types/components/wallets/OVO/type.d.ts +2 -24
  191. package/dist/types/components/wallets/OpayWallet/type.d.ts +2 -24
  192. package/dist/types/components/wallets/P24/type.d.ts +2 -24
  193. package/dist/types/components/wallets/PagaWallet/type.d.ts +2 -24
  194. package/dist/types/components/wallets/Paymaya/type.d.ts +2 -24
  195. package/dist/types/components/wallets/PicPay/type.d.ts +2 -24
  196. package/dist/types/components/wallets/Pix/type.d.ts +2 -24
  197. package/dist/types/components/wallets/ShopeePay/type.d.ts +2 -24
  198. package/dist/types/components/wallets/Skrill/type.d.ts +2 -12
  199. package/dist/types/components/wallets/TNGWallet/type.d.ts +2 -24
  200. package/dist/types/components/wallets/Trustly/type.d.ts +2 -16
  201. package/dist/types/components/wallets/Vietqr/type.d.ts +2 -24
  202. package/dist/types/components/wallets/WechatPay/WechatPay.d.ts +16 -0
  203. package/dist/types/components/wallets/WechatPay/type.d.ts +12 -0
  204. package/dist/types/components/wallets/WechatPay/util.d.ts +13 -0
  205. package/dist/types/components/wallets/Zalopay/type.d.ts +2 -24
  206. package/dist/types/components/wallets/index.d.ts +2 -0
  207. package/dist/types/components/wallets/type.d.ts +0 -14
  208. package/dist/types/constant.d.ts +8 -0
  209. package/dist/types/core/index.d.ts +1 -0
  210. package/dist/types/core/preview.d.ts +1 -0
  211. package/dist/types/core/session.d.ts +2 -2
  212. package/dist/types/hooks/index.d.ts +0 -1
  213. package/dist/types/hooks/useBaseWallet.d.ts +27 -5
  214. package/dist/types/hooks/useI18n.d.ts +1 -1
  215. package/dist/types/hooks/usePayState.d.ts +1 -4
  216. package/dist/types/i18n/I18n.d.ts +1 -0
  217. package/dist/types/i18n/locales/de-DE.d.ts +7 -0
  218. package/dist/types/i18n/locales/en-GB.d.ts +7 -0
  219. package/dist/types/i18n/locales/es-ES.d.ts +7 -0
  220. package/dist/types/i18n/locales/fr-FR.d.ts +7 -0
  221. package/dist/types/i18n/locales/ja-JP.d.ts +7 -0
  222. package/dist/types/i18n/locales/ko-KR.d.ts +7 -0
  223. package/dist/types/i18n/locales/nl-NL.d.ts +7 -0
  224. package/dist/types/i18n/locales/pt-PT.d.ts +7 -0
  225. package/dist/types/i18n/locales/ru-RU.d.ts +7 -0
  226. package/dist/types/i18n/locales/zh-CN.d.ts +7 -0
  227. package/dist/types/i18n/locales/zh-HK.d.ts +7 -0
  228. package/dist/types/i18n/locales/zh-TW.d.ts +7 -0
  229. package/dist/types/i18n/util.d.ts +8 -1
  230. package/dist/types/index.d.ts +2 -1
  231. package/dist/types/out/fraud-detection.d.ts +2 -5
  232. package/dist/types/out/types.d.ts +5 -6
  233. package/dist/types/out/worldpay-ddc-manager.d.ts +1 -0
  234. package/dist/types/types/event.d.ts +24 -2
  235. package/dist/types/types/index.d.ts +14 -0
  236. package/dist/types/types/message.d.ts +3 -1
  237. package/dist/types/types/payment.d.ts +26 -3
  238. package/dist/types/utils/app-payment.d.ts +1 -0
  239. package/dist/types/utils/array.d.ts +17 -0
  240. package/dist/types/utils/business/amount.d.ts +7 -0
  241. package/dist/types/utils/business/index.d.ts +1 -0
  242. package/dist/types/utils/detect.d.ts +3 -0
  243. package/dist/types/utils/index.d.ts +1 -6
  244. package/dist/types/utils/number.d.ts +4 -0
  245. package/dist/types/utils/redirect.d.ts +10 -0
  246. package/dist/types/utils/system-info/get-browser-info.d.ts +4 -0
  247. package/package.json +4 -2
  248. package/dist/es/api/modules/ali-pay/index.js +0 -16
  249. package/dist/es/api/modules/boost/index.js +0 -5
  250. package/dist/es/api/modules/gcash/index.js +0 -5
  251. package/dist/es/api/modules/grab-pay/index.js +0 -5
  252. package/dist/es/api/modules/may-bank-qr-pay/index.js +0 -5
  253. package/dist/es/api/modules/nine-pay/index.js +0 -5
  254. package/dist/es/api/modules/opay-wallet/index.js +0 -5
  255. package/dist/es/api/modules/paga-wallet/index.js +0 -5
  256. package/dist/es/api/modules/paymaya/index.js +0 -5
  257. package/dist/es/api/modules/pic-pay/index.js +0 -16
  258. package/dist/es/api/modules/pix/index.js +0 -16
  259. package/dist/es/api/modules/shopee-pay/index.js +0 -5
  260. package/dist/es/api/modules/tng-wallet/index.js +0 -5
  261. package/dist/es/api/modules/vietqr/index.js +0 -5
  262. package/dist/es/api/modules/wechat-pay/index.js +0 -16
  263. package/dist/es/api/modules/zalopay/index.js +0 -5
  264. package/dist/es/components/AliPay/index.js +0 -332
  265. package/dist/es/components/WechatPay/index.js +0 -340
  266. package/dist/es/hooks/usePayment.js +0 -1
  267. package/dist/types/api/modules/ali-pay/index.d.ts +0 -4
  268. package/dist/types/api/modules/boost/index.d.ts +0 -4
  269. package/dist/types/api/modules/gcash/index.d.ts +0 -4
  270. package/dist/types/api/modules/grab-pay/index.d.ts +0 -4
  271. package/dist/types/api/modules/line-pay/index.d.ts +0 -4
  272. package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +0 -4
  273. package/dist/types/api/modules/nine-pay/index.d.ts +0 -4
  274. package/dist/types/api/modules/opay-wallet/index.d.ts +0 -4
  275. package/dist/types/api/modules/paga-wallet/index.d.ts +0 -4
  276. package/dist/types/api/modules/paymaya/index.d.ts +0 -4
  277. package/dist/types/api/modules/pic-pay/index.d.ts +0 -4
  278. package/dist/types/api/modules/pix/index.d.ts +0 -4
  279. package/dist/types/api/modules/shopee-pay/index.d.ts +0 -4
  280. package/dist/types/api/modules/tng-wallet/index.d.ts +0 -4
  281. package/dist/types/api/modules/vietqr/index.d.ts +0 -4
  282. package/dist/types/api/modules/wechat-pay/index.d.ts +0 -4
  283. package/dist/types/api/modules/zalopay/index.d.ts +0 -4
  284. package/dist/types/components/AliPay/type.d.ts +0 -26
  285. package/dist/types/components/WechatPay/WechatPay.d.ts +0 -10
  286. package/dist/types/components/WechatPay/type.d.ts +0 -28
  287. package/dist/types/hooks/usePayment.d.ts +0 -8
  288. package/dist/types/hooks/useRetry.console-tests.d.ts +0 -41
  289. package/dist/types/utils/behavior-tracker.d.ts +0 -36
  290. /package/dist/es/components/internal/Button/{button2.js → button.js} +0 -0
  291. /package/dist/types/components/{AliPay → wallets/AliPay}/index.d.ts +0 -0
  292. /package/dist/types/components/{WechatPay → wallets/WechatPay}/index.d.ts +0 -0
@@ -0,0 +1,116 @@
1
+ import { u } from "../../../core.js";
2
+ import { COMMON_CLASS_NAME } from "../../../constant.js";
3
+ import { isUndefined } from "../../../utils/is.js";
4
+ import "../../../utils/card-brand/brands.js";
5
+ import "../../../utils/system-info/get-browser-info.js";
6
+ import { normalizedClass } from "../../../utils/format.js";
7
+ const IconAlipayPlus = ({ size, style, className }) => {
8
+ const computedSize = !isUndefined(size) ? `${size}px` : "1em";
9
+ return /* @__PURE__ */ u(
10
+ "svg",
11
+ {
12
+ height: computedSize,
13
+ viewBox: "0 0 145 40",
14
+ fill: "none",
15
+ style,
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ className: normalizedClass(COMMON_CLASS_NAME, className),
18
+ children: /* @__PURE__ */ u("g", { width: "145", height: "40", children: /* @__PURE__ */ u("g", { children: [
19
+ /* @__PURE__ */ u(
20
+ "path",
21
+ {
22
+ fill: "#06f",
23
+ d: "M105.2 36.5h-2.9c-.7 0-1.1-.7-.8-1.3l2.4-5.5c.1-.1.1-.3 0-.4l-7.1-17.2c-.3-.6.2-1.3.8-1.3h2.9c.7 0 1.4.4 1.7 1.1l4.3 10.9c.1.2.3.2.3 0l4.5-10.9c.3-.7.9-1.1 1.7-1.1h2.9c.7 0 1.1.7.8 1.3l-9.8 23.2c-.4.9-.7 1.2-1.7 1.2zM52.4 35.6V11.8c0-.5.4-.9.9-.9h3.1c.5 0 .9.4.9.9v1.8c0 .2.3.3.4.1 1.2-2.1 3.6-2.8 5.8-2.8 4.8 0 9.2 4.1 9.2 9.9 0 5.9-4.4 9.9-9.2 9.9-1.7 0-4.5-.5-5.9-2.4-.1-.1-.3-.1-.3.1v7.2c0 .5-.4.9-.9.9h-3.1c-.5 0-.9-.4-.9-.9zm10.2-9.3c3 0 5.3-2.1 5.3-5.6s-2.3-5.6-5.3-5.6c-2.7 0-5.3 2.2-5.3 5.6s2.6 5.6 5.3 5.6zM93.9 30.2h-3.1c-.5 0-.9-.4-.9-.9v-1.6c0-.2-.2-.3-.3-.1-1.2 2-3.4 3.1-5.9 3.1-4.8 0-9.3-4-9.3-9.9s4.5-10 9.3-10c2.3 0 4.7.8 5.9 2.8.1.2.4.1.4-.1v-1.7c0-.5.4-.9.9-.9H94c.5 0 .9.4.9.9v17.5c-.1.4-.5.9-1 .9zm-4-9.5c0-3.5-2.7-5.7-5.4-5.7-3 0-5.3 2.2-5.3 5.7s2.3 5.6 5.3 5.6c2.7.1 5.4-2.1 5.4-5.6zM38.7 30.1h-3.3c-.5 0-.9-.4-.9-.9v-24c0-.5.4-.9.9-.9h3.3c.5 0 .9.4.9.9v24.1c0 .4-.4.8-.9.8zM47.6 30.2h-3.3c-.5 0-.9-.4-.9-.9V11.8c0-.5.4-.9.9-.9h3.3c.5 0 .9.4.9.9v17.5c0 .4-.4.9-.9.9zM47.6 9.4h-3.3c-.5 0-.9-.4-.9-.9V5.2c0-.5.4-.9.9-.9h3.3c.5 0 .9.4.9.9v3.3c0 .4-.4.9-.9.9z"
24
+ }
25
+ ),
26
+ /* @__PURE__ */ u(
27
+ "path",
28
+ {
29
+ fill: "#00b5ff",
30
+ d: "M138.5 10.9h-1.1c-.3 0-.4.1-.8.1-2 .4-3.6 1.5-4.8 4.6h5.2c.3 0 .6-.2.8-.5l1.4-3.2c.1-.5-.2-1-.7-1z"
31
+ }
32
+ ),
33
+ /* @__PURE__ */ u(
34
+ "path",
35
+ {
36
+ fill: "#06f",
37
+ d: "M136.5 10.9c-5 .2-9.7 3.9-10.5 9.1l-.2 1.3c-.1.5.3 1 .8 1h3c.4 0 .8-.3.8-.7l.5-2.4c.2-1.4.5-2.5.9-3.5 1.1-3.1 2.7-4.2 4.8-4.6.4-.1.5-.1.8-.1 0-.1-.8-.1-.9-.1z"
38
+ }
39
+ ),
40
+ /* @__PURE__ */ u(
41
+ "path",
42
+ {
43
+ fill: "#00b5ff",
44
+ d: "M119.9 15.6h1.1c.3 0 .4-.1.8-.1 2-.4 3.6-1.5 4.8-4.6h-5.2c-.3 0-.6.2-.8.5l-1.4 3.2c-.2.5.2 1 .7 1z"
45
+ }
46
+ ),
47
+ /* @__PURE__ */ u(
48
+ "path",
49
+ {
50
+ fill: "#06f",
51
+ d: "M121.9 15.6c5-.2 9.7-3.9 10.5-9.1l.2-1.3c.1-.5-.3-1-.8-1h-3c-.4 0-.8.3-.8.7l-.5 2.4c-.2 1.4-.5 2.5-.9 3.5-1.1 3.1-2.7 4.2-4.8 4.6-.4.1-.5.1-.8.1 0 .1.8.1.9.1zM17.2 11.7c.2-.4.7-.4.9 0 1.3 3.2 7 17.5 7 17.5.2.5.7.9 1.3.9H30c.5 0 .8-.5.6-.9C29 25.3 22.3 9.5 20.4 5c-.2-.5-.7-.8-1.2-.8h-3.1c-.5 0-1 .3-1.2.8-1.8 4.2-8.6 20.3-10.1 24.3-.2.4.2.9.6.9h3.4c.6 0 1.2-.3 1.4-.9l7-17.6z"
52
+ }
53
+ ),
54
+ /* @__PURE__ */ u(
55
+ "linearGradient",
56
+ {
57
+ id: "AlipayNormalAgg-SVGID_1_",
58
+ gradientUnits: "userSpaceOnUse",
59
+ x1: "8.52",
60
+ y1: "26.369",
61
+ x2: "27.728",
62
+ y2: "15.279",
63
+ children: [
64
+ /* @__PURE__ */ u("stop", { offset: "0", stopColor: "#0055ef" }),
65
+ /* @__PURE__ */ u("stop", { offset: "0.104", stopColor: "#0058f2" }),
66
+ /* @__PURE__ */ u("stop", { offset: "0.175", stopColor: "#0061fa" }),
67
+ /* @__PURE__ */ u("stop", { offset: "0.2", stopColor: "#06f" }),
68
+ /* @__PURE__ */ u("stop", { offset: "0.357", stopColor: "#006cff" }),
69
+ /* @__PURE__ */ u("stop", { offset: "0.564", stopColor: "#007cff" }),
70
+ /* @__PURE__ */ u("stop", { offset: "0.798", stopColor: "#0098ff" }),
71
+ /* @__PURE__ */ u("stop", { offset: "1", stopColor: "#00b5ff" })
72
+ ]
73
+ }
74
+ ),
75
+ /* @__PURE__ */ u(
76
+ "path",
77
+ {
78
+ d: "M33.4 14.8c-.4-.9-1-2.1-1.5-2.8-.3-.4-.7-.5-1.2-.4-6.8 1.4-11.8 4.5-13.8 6.6-3.1 3.2-3.1 6.2-1.1 7.9-.7-1.3.3-3.1 3.1-5 5.3-3.6 14-5.2 14-5.2.4-.1.7-.7.5-1.1z",
79
+ fill: "url(#AlipayNormalAgg-SVGID_1_)"
80
+ }
81
+ ),
82
+ /* @__PURE__ */ u("g", { children: [
83
+ /* @__PURE__ */ u(
84
+ "linearGradient",
85
+ {
86
+ id: "AlipayNormalAgg-SVGID_00000142147938912688315580000006714253196792241286_",
87
+ gradientUnits: "userSpaceOnUse",
88
+ x1: "14.207",
89
+ y1: "23.792",
90
+ x2: "25.44",
91
+ y2: "27.88",
92
+ children: [
93
+ /* @__PURE__ */ u("stop", { offset: "0", stopColor: "#000abd" }),
94
+ /* @__PURE__ */ u("stop", { offset: "0.115", stopColor: "#0014c1" }),
95
+ /* @__PURE__ */ u("stop", { offset: "0.307", stopColor: "#002ecb" }),
96
+ /* @__PURE__ */ u("stop", { offset: "0.554", stopColor: "#0058db" }),
97
+ /* @__PURE__ */ u("stop", { offset: "0.843", stopColor: "#0092f2" }),
98
+ /* @__PURE__ */ u("stop", { offset: "1", stopColor: "#00b5ff" })
99
+ ]
100
+ }
101
+ ),
102
+ /* @__PURE__ */ u(
103
+ "path",
104
+ {
105
+ d: "M15.9 24.1c-.4.8-.4 1.5-.1 2 .8.7 3 1.9 8.8 1.7L23.5 25c-2.7.3-6.2.4-7.6-.9z",
106
+ fill: "url(#AlipayNormalAgg-SVGID_00000142147938912688315580000006714253196792241286_)"
107
+ }
108
+ )
109
+ ] })
110
+ ] }) })
111
+ }
112
+ );
113
+ };
114
+ export {
115
+ IconAlipayPlus
116
+ };
@@ -4,7 +4,7 @@ import { isUndefined } from "../../../utils/is.js";
4
4
  import "../../../utils/card-brand/brands.js";
5
5
  import "../../../utils/system-info/get-browser-info.js";
6
6
  import { normalizedClass } from "../../../utils/format.js";
7
- function IconError({ size, style, className }) {
7
+ const IconError = ({ size, style, className }) => {
8
8
  const computedSize = !isUndefined(size) ? `${size}px` : "1em";
9
9
  return /* @__PURE__ */ u(
10
10
  "svg",
@@ -34,7 +34,7 @@ function IconError({ size, style, className }) {
34
34
  ]
35
35
  }
36
36
  );
37
- }
37
+ };
38
38
  export {
39
39
  IconError
40
40
  };
@@ -4,7 +4,7 @@ import { isUndefined } from "../../../utils/is.js";
4
4
  import "../../../utils/card-brand/brands.js";
5
5
  import "../../../utils/system-info/get-browser-info.js";
6
6
  import { normalizedClass } from "../../../utils/format.js";
7
- function IconSuccess({ size, style, className }) {
7
+ const IconSuccess = ({ size, style, className }) => {
8
8
  const computedSize = !isUndefined(size) ? `${size}px` : "1em";
9
9
  return /* @__PURE__ */ u(
10
10
  "svg",
@@ -31,7 +31,7 @@ function IconSuccess({ size, style, className }) {
31
31
  ]
32
32
  }
33
33
  );
34
- }
34
+ };
35
35
  export {
36
36
  IconSuccess
37
37
  };
@@ -0,0 +1,45 @@
1
+ import { u } from "../../../core.js";
2
+ import { COMMON_CLASS_NAME } from "../../../constant.js";
3
+ import { isUndefined } from "../../../utils/is.js";
4
+ import "../../../utils/card-brand/brands.js";
5
+ import "../../../utils/system-info/get-browser-info.js";
6
+ import { normalizedClass } from "../../../utils/format.js";
7
+ const IconWechatPayGlobal = ({ size, style, className }) => {
8
+ const computedSize = !isUndefined(size) ? `${size}px` : "1em";
9
+ return /* @__PURE__ */ u(
10
+ "svg",
11
+ {
12
+ width: computedSize,
13
+ height: computedSize,
14
+ viewBox: "0 0 24 24",
15
+ fill: "none",
16
+ style,
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ className: normalizedClass(COMMON_CLASS_NAME, className),
19
+ children: [
20
+ /* @__PURE__ */ u("g", { id: "icon-wechat", children: /* @__PURE__ */ u("g", { id: "Component 33", children: [
21
+ /* @__PURE__ */ u("rect", { x: "1", y: "3", width: "22", height: "17.2857", rx: "3.45714", fill: "white" }),
22
+ /* @__PURE__ */ u(
23
+ "g",
24
+ {
25
+ id: "_隔离模式",
26
+ "clip-path": "url(#clip0_3676_31540)",
27
+ children: /* @__PURE__ */ u(
28
+ "path",
29
+ {
30
+ id: "Vector",
31
+ d: "M9.40768 13.8658C9.32212 13.9095 9.22515 13.9342 9.12247 13.9342C8.88479 13.9342 8.67754 13.803 8.56915 13.611L8.52732 13.5197L6.79702 9.72066C6.77801 9.67883 6.7666 9.6332 6.7666 9.58756C6.7666 9.41263 6.90921 9.27003 7.08414 9.27003C7.15639 9.27003 7.22104 9.29284 7.27428 9.33277L9.31642 10.7874C9.46473 10.8843 9.64346 10.9414 9.83551 10.9414C9.94959 10.9414 10.058 10.9205 10.1607 10.8824L19.7667 6.60803C18.044 4.5811 15.207 3.25391 11.9993 3.25391C6.74759 3.25391 2.49219 6.80007 2.49219 11.1772C2.49219 13.5635 3.77185 15.714 5.77786 17.1667C5.93948 17.2807 6.04406 17.469 6.04406 17.6838C6.04406 17.7542 6.02885 17.8188 6.00983 17.8854C5.85011 18.4824 5.59342 19.4389 5.58201 19.4845C5.56109 19.5587 5.53067 19.6385 5.53067 19.7165C5.53067 19.8914 5.67328 20.034 5.84821 20.034C5.91666 20.034 5.9737 20.0093 6.03075 19.9751L8.11281 18.7734C8.26873 18.684 8.43415 18.627 8.61669 18.627C8.71366 18.627 8.80873 18.6422 8.8962 18.6688C9.86783 18.9483 10.9155 19.1023 11.9993 19.1023C17.2511 19.1023 21.5065 15.5561 21.5065 11.1791C21.5065 9.85377 21.1148 8.60643 20.4227 7.5074L9.47614 13.8278L9.40578 13.8677L9.40768 13.8658Z",
32
+ fill: "#07C160"
33
+ }
34
+ )
35
+ }
36
+ )
37
+ ] }) }),
38
+ /* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "clip0_3676_31540", children: /* @__PURE__ */ u("rect", { width: "19.0143", height: "16.7763", fill: "white", transform: "translate(2.49219 3.25391)" }) }) })
39
+ ]
40
+ }
41
+ );
42
+ };
43
+ export {
44
+ IconWechatPayGlobal
45
+ };
@@ -0,0 +1,107 @@
1
+ import { u } from "../../../core.js";
2
+ import { COMMON_CLASS_NAME } from "../../../constant.js";
3
+ import { isUndefined } from "../../../utils/is.js";
4
+ import "../../../utils/card-brand/brands.js";
5
+ import "../../../utils/system-info/get-browser-info.js";
6
+ import { normalizedClass } from "../../../utils/format.js";
7
+ const IconWechatPayGlobalComplete = ({ size, style, className }) => {
8
+ const computedSize = !isUndefined(size) ? `${size}px` : "1em";
9
+ return /* @__PURE__ */ u(
10
+ "svg",
11
+ {
12
+ height: computedSize,
13
+ viewBox: "0 0 113 22",
14
+ fill: "none",
15
+ style,
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ className: normalizedClass(COMMON_CLASS_NAME, className),
18
+ children: /* @__PURE__ */ u("g", { id: "Frame 427319256", children: /* @__PURE__ */ u("g", { id: "白色标志", children: [
19
+ /* @__PURE__ */ u(
20
+ "path",
21
+ {
22
+ id: "Vector",
23
+ d: "M9.53982 14.1044C9.43416 14.1584 9.31441 14.1889 9.18762 14.1889C8.89411 14.1889 8.63818 14.0269 8.50434 13.7898L8.45268 13.6771L6.31596 8.98569C6.29248 8.93403 6.2784 8.87768 6.2784 8.82132C6.2784 8.6053 6.4545 8.4292 6.67052 8.4292C6.75974 8.4292 6.83958 8.45738 6.90532 8.50669L9.42712 10.3029C9.61027 10.4227 9.83098 10.4931 10.0681 10.4931C10.209 10.4931 10.3429 10.4673 10.4696 10.4203L22.332 5.14194C20.2046 2.63893 16.7013 1 12.7402 1C6.25492 1 1 5.3791 1 10.7843C1 13.7311 2.58023 16.3867 5.05741 18.1806C5.257 18.3215 5.38614 18.554 5.38614 18.8193C5.38614 18.9062 5.36736 18.986 5.34388 19.0682C5.14664 19.8055 4.82965 20.9865 4.81557 21.0429C4.78974 21.1344 4.75217 21.2331 4.75217 21.3293C4.75217 21.5454 4.92827 21.7215 5.14429 21.7215C5.22882 21.7215 5.29926 21.6909 5.3697 21.6487L7.94081 20.1647C8.13335 20.0543 8.33763 19.9839 8.56304 19.9839C8.68279 19.9839 8.80019 20.0027 8.9082 20.0356C10.1081 20.3807 11.4018 20.5709 12.7402 20.5709C19.2255 20.5709 24.4804 16.1918 24.4804 10.7866C24.4804 9.15005 23.9967 7.60973 23.142 6.25257L9.62435 14.0575L9.53748 14.1068L9.53982 14.1044Z",
24
+ fill: "white"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ u("g", { id: "Group", children: [
28
+ /* @__PURE__ */ u(
29
+ "path",
30
+ {
31
+ id: "Vector_2",
32
+ d: "M34.474 16.9286L31.5859 5.54291H33.1403L34.4928 11.3027C34.8309 12.7397 35.1338 14.1414 35.3381 15.238H35.371C35.5565 14.1062 35.911 12.7537 36.3008 11.2862L37.82 5.54291H39.358L40.7433 11.3191C41.065 12.688 41.3679 14.0217 41.5369 15.2215H41.5698C41.807 13.9724 42.1263 12.7044 42.4808 11.2862L43.9836 5.54291H45.4863L42.2601 16.9286H40.7222L39.2852 11.0162C38.9306 9.54632 38.6935 8.431 38.5408 7.28281H38.508C38.3225 8.431 38.0524 9.52988 37.6298 10.9998L36.0073 16.9286H34.4693H34.474Z",
33
+ fill: "white"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ u(
37
+ "path",
38
+ {
39
+ id: "Vector_3",
40
+ d: "M46.7784 13.1111C46.8113 15.1046 48.0792 15.9311 49.5655 15.9311C50.6292 15.9311 51.289 15.7456 51.829 15.5085L52.0991 16.5721C51.5755 16.8093 50.6621 17.0957 49.3636 17.0957C46.8629 17.0957 45.3438 15.4239 45.3438 12.9749C45.3438 10.5259 46.8136 8.56531 49.1945 8.56531C51.8643 8.56531 52.5569 10.9133 52.5569 12.4161C52.5569 12.719 52.5405 12.9397 52.5053 13.1088H46.7784V13.1111ZM51.1199 12.0475C51.1364 11.1012 50.7325 9.63132 49.0748 9.63132C47.5556 9.63132 46.9122 11.0167 46.7948 12.0475H51.1199Z",
41
+ fill: "white"
42
+ }
43
+ ),
44
+ /* @__PURE__ */ u(
45
+ "path",
46
+ {
47
+ id: "Vector_4",
48
+ d: "M62.5127 16.5415C61.9891 16.8116 60.8597 17.098 59.4743 17.098C56.2645 17.098 53.8672 15.0717 53.8672 11.3383C53.8672 7.60491 56.2833 5.37427 59.8124 5.37427C61.2142 5.37427 62.083 5.66308 62.4728 5.84857L62.144 7.08129C61.604 6.81127 60.8103 6.60934 59.8641 6.60934C57.1944 6.60934 55.4216 8.31636 55.4216 11.289C55.4216 14.0761 57.0253 15.8489 59.7796 15.8489C60.6906 15.8489 61.604 15.6634 62.1957 15.3769L62.515 16.5439L62.5127 16.5415Z",
49
+ fill: "white"
50
+ }
51
+ ),
52
+ /* @__PURE__ */ u(
53
+ "path",
54
+ {
55
+ id: "Vector_5",
56
+ d: "M63.9281 5.57141H65.4144V10.0374H65.4473C65.6845 9.61474 66.0554 9.22731 66.511 8.99016C66.9501 8.72013 67.4737 8.56751 68.0302 8.56751C69.129 8.56751 70.8854 9.24375 70.8854 12.0637V16.9289H69.3991V12.2164C69.3991 10.8991 68.9083 9.80023 67.5065 9.80023C66.5438 9.80023 65.7995 10.4765 65.5131 11.2865C65.4285 11.4885 65.4121 11.7092 65.4121 11.9957V16.9289H63.9258V5.57141H63.9281Z",
57
+ fill: "white"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ u(
61
+ "path",
62
+ {
63
+ id: "Vector_6",
64
+ d: "M78.5226 14.9711C78.5226 15.6802 78.5555 16.3729 78.64 16.9317H77.3064L77.1702 15.9009H77.1185C76.6794 16.5419 75.7848 17.1172 74.6178 17.1172C72.9625 17.1172 72.1172 15.9526 72.1172 14.7692C72.1172 12.7921 73.8735 11.712 77.034 11.7285V11.5594C77.034 10.8832 76.8485 9.65044 75.1767 9.66688C74.3995 9.66688 73.6058 9.88759 73.0306 10.275L72.7488 9.24423C73.3781 8.84741 74.3666 8.56799 75.3974 8.56799C77.9145 8.56799 78.5226 10.275 78.5226 11.9116V14.9688V14.9711ZM77.0692 12.7569C75.4467 12.724 73.6058 13.0105 73.6058 14.5978C73.6058 15.5769 74.2469 16.016 74.9912 16.016C76.0713 16.016 76.764 15.3397 77.0011 14.6471C77.0528 14.4944 77.0692 14.3254 77.0692 14.1751V12.7569Z",
65
+ fill: "white"
66
+ }
67
+ ),
68
+ /* @__PURE__ */ u(
69
+ "path",
70
+ {
71
+ id: "Vector_7",
72
+ d: "M88.8281 5.61139C89.5443 5.4846 90.4788 5.38129 91.681 5.38129C93.1368 5.38129 94.2122 5.71706 94.8978 6.33459C95.52 6.88403 95.9075 7.71524 95.9075 8.73664C95.9075 9.75803 95.5975 10.5963 95.0152 11.1927C94.2239 12.0309 92.956 12.4489 91.5096 12.4489C91.0588 12.4489 90.6526 12.4325 90.3121 12.3432V16.9454H88.8305V5.61139H88.8281ZM90.3074 11.1363C90.6361 11.2326 91.0494 11.2655 91.5354 11.2655C93.3317 11.2655 94.4165 10.3826 94.4165 8.81647C94.4165 7.25033 93.3317 6.55531 91.7068 6.55531C91.0541 6.55531 90.5657 6.61636 90.305 6.67271V11.1387L90.3074 11.1363Z",
73
+ fill: "white"
74
+ }
75
+ ),
76
+ /* @__PURE__ */ u(
77
+ "path",
78
+ {
79
+ id: "Vector_8",
80
+ d: "M101.402 16.9454L101.27 15.9053H101.226C100.772 16.5486 99.8849 17.1333 98.7062 17.1333C97.0437 17.1333 96.1914 15.9522 96.1914 14.7711C96.1914 12.7777 97.9595 11.6811 101.139 11.7046V11.5309C101.139 10.8617 100.951 9.6219 99.265 9.63129C98.4995 9.63129 97.6988 9.85905 97.1212 10.2441L96.7808 9.24856C97.4617 8.80947 98.4596 8.52771 99.4975 8.52771C102.015 8.52771 102.627 10.2488 102.627 11.8971V14.9778C102.627 15.6798 102.66 16.3819 102.752 16.9478H101.402V16.9454ZM101.169 12.7401C99.5491 12.7049 97.6942 12.996 97.6942 14.588C97.6942 15.5695 98.3399 16.0203 99.0912 16.0203C100.176 16.0203 100.859 15.337 101.096 14.642C101.148 14.4823 101.167 14.3133 101.167 14.1701V12.7377L101.169 12.7401Z",
81
+ fill: "white"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ u(
85
+ "path",
86
+ {
87
+ id: "Vector_9",
88
+ d: "M104.893 8.71289L106.691 13.578C106.884 14.1228 107.086 14.7685 107.22 15.2569H107.262C107.41 14.7732 107.591 14.1416 107.788 13.5428L109.417 8.71054H111.005L108.753 14.5736C107.687 17.4053 106.952 18.8447 105.933 19.7369C105.193 20.378 104.463 20.6315 104.097 20.6973L103.726 19.4458C104.102 19.3284 104.588 19.0936 105.038 18.7155C105.442 18.3892 105.942 17.8092 106.29 17.0484C106.365 16.8911 106.405 16.7808 106.405 16.6868C106.405 16.6023 106.381 16.4849 106.302 16.3018L103.266 8.70819H104.893V8.71289Z",
89
+ fill: "white"
90
+ }
91
+ ),
92
+ /* @__PURE__ */ u(
93
+ "path",
94
+ {
95
+ id: "Vector_10",
96
+ d: "M82.0964 7.25043V8.75317H84.2237V9.88493H82.0964V14.2781C82.0964 15.2925 82.3828 15.8654 83.2117 15.8654C83.6179 15.8654 83.841 15.8302 83.9842 15.7903L84.2777 16.861C84.0006 16.9924 83.3972 17.1005 82.8219 17.1005C82.1293 17.1005 81.5728 16.8633 81.2182 16.4759C80.812 16.0204 80.6429 15.2925 80.6429 14.3298V9.88728H79.375V8.75552H80.6429V7.25277H82.0964V7.25043Z",
97
+ fill: "white"
98
+ }
99
+ )
100
+ ] })
101
+ ] }) })
102
+ }
103
+ );
104
+ };
105
+ export {
106
+ IconWechatPayGlobalComplete
107
+ };
@@ -0,0 +1,186 @@
1
+ import { w, A, h, F, y, u, b } from "../../../core.js";
2
+ import "./ali-pay.js";
3
+ import { PaymentMethod, PaymentCategory, COMMON_CLASS_NAME, PaymentType } from "../../../constant.js";
4
+ import { CoreContext } from "../../../core/context.js";
5
+ import "../../../utils/card-brand/brands.js";
6
+ import "../../../utils/system-info/get-browser-info.js";
7
+ import { normalizedClass } from "../../../utils/format.js";
8
+ import "../../../out/fraud-detection.js";
9
+ import { useBEM } from "../../../hooks/useBEM.js";
10
+ import { usePayState } from "../../../hooks/usePayState.js";
11
+ import { useBaseWallet } from "../../../hooks/useBaseWallet.js";
12
+ import { DEFAULT_ADDRESS, AddressField } from "../../AddressField/index.js";
13
+ import { createEmailCore, EmailField } from "../../EmailField/EmailField.js";
14
+ import "../../internal/Form/type.js";
15
+ import "../../internal/Form/context.js";
16
+ import "../../internal/Form/FormItem.js";
17
+ import { Form } from "../../internal/Form/Form.js";
18
+ import { Info } from "../../internal/Info/Info.js";
19
+ import { RecurringTip } from "../../RecurringTip/index.js";
20
+ import { PaymentButton } from "../../PaymentButton/index.js";
21
+ import { calcAmountWithFee } from "../../../utils/business/amount.js";
22
+ import { GuideCard } from "../../GuideCard/index.js";
23
+ const { bem } = useBEM("ali-pay");
24
+ const fieldClassNames = bem("field");
25
+ const CURR_PAYMENT_METHOD = PaymentMethod.ALI_PAY;
26
+ const AliPay = w((props, ref) => {
27
+ const {
28
+ session,
29
+ core,
30
+ showGuideCard = true,
31
+ hidePaymentButton = false
32
+ } = props;
33
+ const addressCore = core.getAddressCore();
34
+ const emailState = createEmailCore();
35
+ const { i18n, sessionReady, disabled } = usePayState(session, props.core);
36
+ const formRef = A(null);
37
+ const [form, setForm] = h({
38
+ email: "",
39
+ address: { ...DEFAULT_ADDRESS }
40
+ });
41
+ const [validated, setValidated] = h(false);
42
+ const addressFieldRef = A(null);
43
+ const emailFieldRef = A(null);
44
+ F(ref, () => ({
45
+ stopRetry: () => stopRetry(),
46
+ startRetry: (timeout) => startRetry(timeout),
47
+ updateAddress: () => {
48
+ var _a;
49
+ if (!(fieldStatus == null ? void 0 : fieldStatus.address.show))
50
+ return;
51
+ const address = addressCore.getAddressState();
52
+ form.address = address;
53
+ setForm(form);
54
+ (_a = addressFieldRef.current) == null ? void 0 : _a.update(address);
55
+ validateFormSilently();
56
+ },
57
+ updateEmail: () => {
58
+ var _a;
59
+ if (!(fieldStatus == null ? void 0 : fieldStatus.email.show))
60
+ return;
61
+ form.email = emailState.email;
62
+ setForm(form);
63
+ (_a = emailFieldRef.current) == null ? void 0 : _a.update(emailState.email);
64
+ validateFormSilently();
65
+ },
66
+ payment: () => {
67
+ hidePaymentButton && onSubmit();
68
+ }
69
+ }));
70
+ const {
71
+ isEnabled,
72
+ fieldStatus,
73
+ paymentButtonStatus,
74
+ setPaymentButtonStatus,
75
+ errorMessage,
76
+ setErrorMessage,
77
+ payment,
78
+ startRetry,
79
+ stopRetry,
80
+ getPaymentMethodContext
81
+ } = useBaseWallet(CURR_PAYMENT_METHOD, props, {
82
+ getFormData: () => form
83
+ });
84
+ y(() => {
85
+ if (!sessionReady)
86
+ return;
87
+ const { bill = {}, country } = (session == null ? void 0 : session.checkout) || {};
88
+ country && addressCore.setCountry(country);
89
+ form.email = bill.email ?? "";
90
+ form.address.country = country;
91
+ }, [sessionReady]);
92
+ const validateFormSilently = () => {
93
+ var _a;
94
+ (_a = formRef.current) == null ? void 0 : _a.validate(void 0, false).then(() => setValidated(true)).catch(() => setValidated(false));
95
+ };
96
+ y(() => {
97
+ validateFormSilently();
98
+ }, [form]);
99
+ const onSubmit = async () => {
100
+ var _a;
101
+ setErrorMessage("");
102
+ (_a = formRef.current) == null ? void 0 : _a.validate(async (errors) => {
103
+ var _a2;
104
+ (fieldStatus == null ? void 0 : fieldStatus.address.show) && addressCore.setValidateAllFields(true);
105
+ const submitResult = await ((_a2 = props.onSubmit) == null ? void 0 : _a2.call(props, errors, getPaymentMethodContext()));
106
+ if (submitResult === false)
107
+ return;
108
+ if (errors) {
109
+ setPaymentButtonStatus("unSubmit");
110
+ return;
111
+ }
112
+ setPaymentButtonStatus("loading");
113
+ await payment();
114
+ });
115
+ };
116
+ const setFormRef = (dom) => {
117
+ formRef.current = dom;
118
+ dom && validateFormSilently();
119
+ };
120
+ const Button = () => {
121
+ var _a, _b;
122
+ const { channelParams = {} } = (session == null ? void 0 : session.checkout) ?? {};
123
+ const amount = (_b = (_a = core == null ? void 0 : core.payment) == null ? void 0 : _a.amount.value) == null ? void 0 : _b.amount;
124
+ const totalAmount = amount ? calcAmountWithFee(amount, channelParams.aliPay) : 0;
125
+ return /* @__PURE__ */ u(
126
+ PaymentButton,
127
+ {
128
+ className: bem("button"),
129
+ status: paymentButtonStatus,
130
+ disabled,
131
+ verified: validated,
132
+ onClick: onSubmit,
133
+ amount: totalAmount
134
+ }
135
+ );
136
+ };
137
+ const Email = () => {
138
+ return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.email.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
139
+ EmailField,
140
+ {
141
+ ref: emailFieldRef,
142
+ value: form.email,
143
+ disabled: (fieldStatus == null ? void 0 : fieldStatus.email.disabled) || disabled
144
+ }
145
+ ) }) });
146
+ };
147
+ const Address = () => {
148
+ return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.address.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
149
+ AddressField,
150
+ {
151
+ ref: addressFieldRef,
152
+ value: form.address,
153
+ disabled,
154
+ onChange: (value) => setForm(Object.assign(form, { address: value }))
155
+ }
156
+ ) }) });
157
+ };
158
+ const ErrorMessage = () => {
159
+ return /* @__PURE__ */ u(b, { children: !!errorMessage && /* @__PURE__ */ u(Info, { className: bem("error"), content: errorMessage }) });
160
+ };
161
+ return /* @__PURE__ */ u(
162
+ CoreContext.Provider,
163
+ {
164
+ value: {
165
+ i18n,
166
+ session,
167
+ core
168
+ },
169
+ children: isEnabled && i18n.ready.value && /* @__PURE__ */ u(b, { children: [
170
+ showGuideCard && /* @__PURE__ */ u(GuideCard, { type: PaymentCategory.ALI_PAY }),
171
+ /* @__PURE__ */ u("div", { className: core.theme.className, children: /* @__PURE__ */ u(Form, { form, ref: setFormRef, onFormChange: (form2) => setForm(form2), children: /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, bem()), children: [
172
+ Email(),
173
+ Address(),
174
+ (session == null ? void 0 : session.checkout.paymentType) === PaymentType.RECURRING && RecurringTip(),
175
+ /* @__PURE__ */ u("div", { className: bem("footer-wrapper"), children: [
176
+ ErrorMessage(),
177
+ !hidePaymentButton && Button()
178
+ ] })
179
+ ] }) }) })
180
+ ] })
181
+ }
182
+ );
183
+ });
184
+ export {
185
+ AliPay
186
+ };
@@ -0,0 +1 @@
1
+ import "./AliPay.js";
@@ -3,9 +3,9 @@ import { useBEM } from "../../../hooks/useBEM.js";
3
3
  import { CoreContext } from "../../../core/context.js";
4
4
  import "../../../utils/card-brand/brands.js";
5
5
  import "../../../utils/system-info/get-browser-info.js";
6
- import { normalizedClass, formatAmount } from "../../../utils/format.js";
6
+ import { normalizedClass } from "../../../utils/format.js";
7
7
  import { PaymentMethod, PaymentCategory, COMMON_CLASS_NAME, PaymentType } from "../../../constant.js";
8
- import "../../../out/worldpay-jsc-origin.js";
8
+ import "../../../out/fraud-detection.js";
9
9
  import { usePayState } from "../../../hooks/usePayState.js";
10
10
  import { useBaseWallet } from "../../../hooks/useBaseWallet.js";
11
11
  import "./bancontact2.js";
@@ -27,7 +27,7 @@ import "../../business/PhoneField/config.js";
27
27
  import "../../business/PhoneField/phone-field.js";
28
28
  import "../../business/Tooltip/tooltip2.js";
29
29
  import "../../business/BlikCodeField/blik-code-field.js";
30
- import "../../internal/Button/button2.js";
30
+ import "../../internal/Button/button.js";
31
31
  import "../../business/BlikConfirmModal/blik-confirm-modal.js";
32
32
  import "../../internal/LoadingCheck/loading-check.js";
33
33
  import { RecurringTip } from "../../RecurringTip/index.js";
@@ -122,7 +122,9 @@ const Bancontact = w((props, ref) => {
122
122
  setErrorMessage("");
123
123
  (_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
124
124
  var _a3;
125
- (_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext());
125
+ const submitResult = await ((_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext()));
126
+ if (submitResult === false)
127
+ return;
126
128
  if (errors) {
127
129
  setPaymentButtonStatus("unSubmit");
128
130
  return;
@@ -153,10 +155,6 @@ const Bancontact = w((props, ref) => {
153
155
  ) }) });
154
156
  };
155
157
  const Button = () => {
156
- var _a2;
157
- const transAmount = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.transAmount;
158
- const amountText = (transAmount == null ? void 0 : transAmount.amount) ? formatAmount(transAmount).jointSymbol() : "";
159
- const text = i18n.get("common.pay") + (amountText ? ` ${amountText}` : "");
160
158
  return /* @__PURE__ */ u(
161
159
  PaymentButton,
162
160
  {
@@ -164,8 +162,7 @@ const Bancontact = w((props, ref) => {
164
162
  status: paymentButtonStatus,
165
163
  disabled,
166
164
  verified: validated,
167
- onClick: onSubmit,
168
- children: text
165
+ onClick: onSubmit
169
166
  }
170
167
  );
171
168
  };
@@ -3,9 +3,9 @@ import { useBEM } from "../../../hooks/useBEM.js";
3
3
  import { CoreContext } from "../../../core/context.js";
4
4
  import "../../../utils/card-brand/brands.js";
5
5
  import "../../../utils/system-info/get-browser-info.js";
6
- import { normalizedClass, formatAmount, limitedToNumber } from "../../../utils/format.js";
6
+ import { normalizedClass, limitedToNumber } from "../../../utils/format.js";
7
7
  import { PaymentMethod, COMMON_CLASS_NAME, PaymentType } from "../../../constant.js";
8
- import "../../../out/worldpay-jsc-origin.js";
8
+ import "../../../out/fraud-detection.js";
9
9
  import { usePayState } from "../../../hooks/usePayState.js";
10
10
  import { useBaseWallet } from "../../../hooks/useBaseWallet.js";
11
11
  import "./blik2.js";
@@ -116,8 +116,14 @@ const Blik = w((props, ref) => {
116
116
  getFormData: () => {
117
117
  return {
118
118
  ...form,
119
- firstName: form.name,
120
- checkCode: limitedToNumber(form.checkCode)
119
+ firstName: form.name
120
+ };
121
+ },
122
+ getExtraPaymentParams: () => {
123
+ return {
124
+ payment: {
125
+ checkCode: limitedToNumber(form.checkCode)
126
+ }
121
127
  };
122
128
  },
123
129
  onProcessing: () => {
@@ -152,7 +158,9 @@ const Blik = w((props, ref) => {
152
158
  setErrorMessage("");
153
159
  (_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
154
160
  var _a3;
155
- (_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext());
161
+ const submitResult = await ((_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext()));
162
+ if (submitResult === false)
163
+ return;
156
164
  if (errors) {
157
165
  setPaymentButtonStatus("unSubmit");
158
166
  return;
@@ -183,10 +191,6 @@ const Blik = w((props, ref) => {
183
191
  ) }) });
184
192
  };
185
193
  const Button = () => {
186
- var _a2;
187
- const transAmount = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.transAmount;
188
- const amountText = (transAmount == null ? void 0 : transAmount.amount) ? formatAmount(transAmount).jointSymbol() : "";
189
- const text = i18n.get("common.pay") + (amountText ? ` ${amountText}` : "");
190
194
  return /* @__PURE__ */ u(
191
195
  PaymentButton,
192
196
  {
@@ -194,8 +198,7 @@ const Blik = w((props, ref) => {
194
198
  status: paymentButtonStatus,
195
199
  verified: validated,
196
200
  disabled,
197
- onClick: onSubmit,
198
- children: text
201
+ onClick: onSubmit
199
202
  }
200
203
  );
201
204
  };