@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.
- package/README.md +1 -1
- package/dist/card-checkout-ui.js +20 -20
- package/dist/card-checkout-ui.umd.cjs +20 -20
- package/dist/es/api/http.js +1 -1
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/modules/checkout/index.js +1 -3
- package/dist/es/api/modules/checkout/map.js +12 -4
- package/dist/es/api/modules/encrypted-card/index.js +3 -2
- package/dist/es/api/modules/get-browser-params.js +4 -5
- package/dist/es/api/modules/index.js +1 -1
- package/dist/es/api/modules/map.js +4 -1
- package/dist/es/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/es/components/AccountNameField/index.js +1 -1
- package/dist/es/components/AddressField/index.js +1 -1
- package/dist/es/components/ApplePay/index.js +34 -21
- package/dist/es/components/CPFField/index.js +1 -1
- package/dist/es/components/Card/index.js +38 -30
- package/dist/es/components/CardBrands/index.js +1 -1
- package/dist/es/components/CardExpireDateField/index.js +1 -1
- package/dist/es/components/CardHolderNameField/index.js +1 -1
- package/dist/es/components/CardIBANField/index.js +1 -1
- package/dist/es/components/CardNo/index.js +1 -1
- package/dist/es/components/CardNumberField/index.js +1 -1
- package/dist/es/components/CardSecurityCodeField/index.js +1 -1
- package/dist/es/components/CardSelector/index.js +2 -2
- package/dist/es/components/CombinedCardInfo/index.js +1 -1
- package/dist/es/components/DropIn/index.js +117 -123
- package/dist/es/components/EmailField/EmailField.js +1 -1
- package/dist/es/components/EncryptedCard/index.js +5 -5
- package/dist/es/components/GooglePay/index.js +32 -29
- package/dist/es/components/GuideCard/index.js +2 -2
- package/dist/es/components/PaymentButton/index.js +22 -7
- package/dist/es/components/RecurringTip/index.js +1 -1
- package/dist/es/components/SecuredIframe/index.js +3 -4
- package/dist/es/components/Sepa/index.js +15 -7
- package/dist/es/components/SubmitButton/index.js +2 -2
- package/dist/es/components/ThreeDS/index.js +32 -20
- package/dist/es/components/Tip/index.js +1 -1
- package/dist/es/components/business/BlikCodeField/BlikCodeField.js +1 -1
- package/dist/es/components/business/BlikCodeField/index.js +1 -1
- package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +3 -3
- package/dist/es/components/business/BlikConfirmModal/index.js +2 -2
- package/dist/es/components/business/NameField/NameField.js +1 -1
- package/dist/es/components/business/NameField/index.js +1 -1
- package/dist/es/components/business/PhoneField/PhoneField.js +1 -1
- package/dist/es/components/business/PhoneField/index.js +1 -1
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +2 -2
- package/dist/es/components/business/QRCodeModal/index.js +1 -1
- package/dist/es/components/business/Tooltip/Tooltip.js +1 -1
- package/dist/es/components/business/Tooltip/index.js +1 -1
- package/dist/es/components/business/index.js +2 -2
- package/dist/es/components/index.js +4 -4
- package/dist/es/components/internal/Accordion/index.js +1 -1
- package/dist/es/components/internal/Button/{Button.js → Button2.js} +2 -2
- package/dist/es/components/internal/Button/index.js +2 -2
- package/dist/es/components/internal/CheckBox/CheckBox.js +1 -1
- package/dist/es/components/internal/CheckBox/index.js +1 -1
- package/dist/es/components/internal/Form/type.js +1 -1
- package/dist/es/components/internal/Info/Info.js +1 -1
- package/dist/es/components/internal/Info/index.js +1 -1
- package/dist/es/components/internal/Input/type.js +1 -1
- package/dist/es/components/internal/Loading/Loading2.js +20 -0
- package/dist/es/{api/modules/line-pay → components/internal/Loading}/index.js +3 -2
- package/dist/es/components/internal/Loading/loading.js +1 -0
- package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -1
- package/dist/es/components/internal/LoadingCheck/index.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/QRCode/QRCode.js +1 -1
- package/dist/es/components/internal/QRCode/index.js +1 -1
- package/dist/es/components/internal/Select/Select.js +1 -1
- package/dist/es/components/internal/Select/SelectMenu.js +1 -1
- package/dist/es/components/internal/Select/SelectMenuItem.js +1 -1
- package/dist/es/components/internal/icons/IconAlipayPlus.js +116 -0
- package/dist/es/components/internal/icons/IconError.js +2 -2
- package/dist/es/components/internal/icons/IconSuccess.js +2 -2
- package/dist/es/components/internal/icons/IconWechatPayGlobal.js +45 -0
- package/dist/es/components/internal/icons/IconWechatPayGlobalComplete.js +107 -0
- package/dist/es/components/wallets/AliPay/AliPay.js +186 -0
- package/dist/es/components/wallets/AliPay/ali-pay.js +1 -0
- package/dist/es/components/wallets/AliPay/index.js +1 -0
- package/dist/es/components/wallets/AliPay/type.js +1 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +7 -10
- package/dist/es/components/wallets/Blik/Blik.js +14 -11
- package/dist/es/components/wallets/Boost/Boost.js +6 -9
- package/dist/es/components/wallets/GCash/GCash.js +7 -10
- package/dist/es/components/wallets/GrabPay/GrabPay.js +7 -14
- package/dist/es/components/wallets/IDeal/IDeal.js +7 -10
- package/dist/es/components/wallets/LinePay/LinePay.js +6 -9
- package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +6 -9
- package/dist/es/components/wallets/NinePay/NinePay.js +6 -9
- package/dist/es/components/wallets/OVO/OVO.js +7 -10
- package/dist/es/components/wallets/OpayWallet/OpayWallet.js +6 -9
- package/dist/es/components/wallets/P24/P24.js +7 -10
- package/dist/es/components/wallets/PagaWallet/PagaWallet.js +6 -9
- package/dist/es/components/wallets/Paymaya/Paymaya.js +6 -9
- package/dist/es/components/wallets/PicPay/PicPay.js +54 -217
- package/dist/es/components/wallets/Pix/Pix.js +54 -217
- package/dist/es/components/wallets/ShopeePay/ShopeePay.js +6 -9
- package/dist/es/components/wallets/Skrill/Skrill.js +7 -10
- package/dist/es/components/wallets/TNGWallet/TNGWallet.js +6 -9
- package/dist/es/components/wallets/Trustly/Trustly.js +7 -10
- package/dist/es/components/wallets/Vietqr/Vietqr.js +14 -15
- package/dist/es/components/wallets/WechatPay/WechatPay.js +250 -0
- package/dist/es/components/wallets/WechatPay/index.js +1 -0
- package/dist/es/components/wallets/WechatPay/type.js +1 -0
- package/dist/es/components/wallets/WechatPay/util.js +47 -0
- package/dist/es/components/wallets/WechatPay/wechat-pay.js +1 -0
- package/dist/es/components/wallets/Zalopay/Zalopay.js +10 -13
- package/dist/es/components/wallets/index.js +2 -0
- package/dist/es/constant.js +7 -0
- package/dist/es/core/checkout.js +36 -9
- package/dist/es/core/create-child.js +5 -4
- package/dist/es/core/index.js +1 -1
- package/dist/es/core/logger.js +1 -1
- package/dist/es/core/payment.js +13 -0
- package/dist/es/core/preview.js +29 -0
- package/dist/es/core/query.js +12 -3
- package/dist/es/core/session.js +36 -6
- package/dist/es/core/theme.js +1 -1
- package/dist/es/hooks/index.js +1 -1
- package/dist/es/hooks/useBaseWallet.js +121 -52
- package/dist/es/hooks/useI18n.js +3 -3
- package/dist/es/i18n/locales/de-DE.js +7 -0
- package/dist/es/i18n/locales/en-GB.js +7 -0
- package/dist/es/i18n/locales/es-ES.js +7 -0
- package/dist/es/i18n/locales/fr-FR.js +7 -0
- package/dist/es/i18n/locales/ja-JP.js +7 -0
- package/dist/es/i18n/locales/ko-KR.js +7 -0
- package/dist/es/i18n/locales/nl-NL.js +7 -0
- package/dist/es/i18n/locales/pt-PT.js +7 -0
- package/dist/es/i18n/locales/ru-RU.js +7 -0
- package/dist/es/i18n/locales/zh-CN.js +7 -0
- package/dist/es/i18n/locales/zh-HK.js +7 -0
- package/dist/es/i18n/locales/zh-TW.js +7 -0
- package/dist/es/i18n/util.js +10 -10
- package/dist/es/index.js +7 -5
- package/dist/es/out/base-fraud-detection.js +1 -1
- package/dist/es/out/fraud-detection.js +59 -44
- package/dist/es/out/paykka-detection.js +5 -7
- package/dist/es/out/stripe-radar.js +1 -1
- package/dist/es/out/worldpay-ddc-manager.js +3 -0
- package/dist/es/out/worldpay-ddc.js +1 -1
- package/dist/es/style.css +1 -1
- package/dist/es/types/event.js +10 -1
- package/dist/es/types/index.js +7 -0
- package/dist/es/utils/array.js +19 -5
- package/dist/es/utils/business/amount.js +15 -0
- package/dist/es/utils/business/index.js +1 -0
- package/dist/es/utils/detect.js +8 -0
- package/dist/es/utils/index.js +7 -9
- package/dist/es/utils/location.js +8 -0
- package/dist/es/utils/number.js +19 -0
- package/dist/es/utils/redirect.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/checkout/type.d.ts +1 -1
- package/dist/types/api/modules/index.d.ts +0 -17
- package/dist/types/api/modules/threeDS/index.d.ts +13 -5
- package/dist/types/components/ApplePay/type.d.ts +6 -2
- package/dist/types/components/Card/type.d.ts +2 -18
- package/dist/types/components/DropIn/layout.d.ts +33 -0
- package/dist/types/components/DropIn/type.d.ts +6 -6
- package/dist/types/components/GooglePay/createGooglePay.d.ts +1 -1
- package/dist/types/components/GooglePay/type.d.ts +6 -2
- package/dist/types/components/PaymentButton/type.d.ts +2 -0
- package/dist/types/components/Sepa/type.d.ts +3 -4
- package/dist/types/components/business/QRCodeModal/type.d.ts +12 -3
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/internal/Loading/Loading.d.ts +2 -1
- package/dist/types/components/internal/Loading/type.d.ts +8 -0
- package/dist/types/components/internal/ResultMessage/ResultMessage.d.ts +3 -0
- package/dist/types/components/internal/ResultMessage/index.d.ts +2 -0
- package/dist/types/components/internal/ResultMessage/type.d.ts +13 -0
- package/dist/types/components/internal/icons/IconAlipayPlus.d.ts +2 -0
- package/dist/types/components/internal/icons/IconError.d.ts +1 -1
- package/dist/types/components/internal/icons/IconSuccess.d.ts +1 -1
- package/dist/types/components/internal/icons/IconWechatPayGlobal.d.ts +2 -0
- package/dist/types/components/internal/icons/IconWechatPayGlobalComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/components/{AliPay → wallets/AliPay}/AliPay.d.ts +9 -4
- package/dist/types/components/wallets/AliPay/type.d.ts +7 -0
- package/dist/types/components/wallets/Bancontact/type.d.ts +2 -24
- package/dist/types/components/wallets/Blik/type.d.ts +2 -24
- package/dist/types/components/wallets/Boost/type.d.ts +2 -24
- package/dist/types/components/wallets/GCash/type.d.ts +2 -24
- package/dist/types/components/wallets/GrabPay/type.d.ts +2 -12
- package/dist/types/components/wallets/IDeal/type.d.ts +2 -24
- package/dist/types/components/wallets/LinePay/type.d.ts +2 -24
- package/dist/types/components/wallets/MayBankQRPay/type.d.ts +2 -24
- package/dist/types/components/wallets/NinePay/type.d.ts +2 -24
- package/dist/types/components/wallets/OVO/type.d.ts +2 -24
- package/dist/types/components/wallets/OpayWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/P24/type.d.ts +2 -24
- package/dist/types/components/wallets/PagaWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/Paymaya/type.d.ts +2 -24
- package/dist/types/components/wallets/PicPay/type.d.ts +2 -24
- package/dist/types/components/wallets/Pix/type.d.ts +2 -24
- package/dist/types/components/wallets/ShopeePay/type.d.ts +2 -24
- package/dist/types/components/wallets/Skrill/type.d.ts +2 -12
- package/dist/types/components/wallets/TNGWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/Trustly/type.d.ts +2 -16
- package/dist/types/components/wallets/Vietqr/type.d.ts +2 -24
- package/dist/types/components/wallets/WechatPay/WechatPay.d.ts +16 -0
- package/dist/types/components/wallets/WechatPay/type.d.ts +12 -0
- package/dist/types/components/wallets/WechatPay/util.d.ts +13 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +2 -24
- package/dist/types/components/wallets/index.d.ts +2 -0
- package/dist/types/components/wallets/type.d.ts +0 -14
- package/dist/types/constant.d.ts +8 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/preview.d.ts +1 -0
- package/dist/types/core/session.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useBaseWallet.d.ts +27 -5
- package/dist/types/hooks/useI18n.d.ts +1 -1
- package/dist/types/hooks/usePayState.d.ts +1 -4
- package/dist/types/i18n/I18n.d.ts +1 -0
- package/dist/types/i18n/locales/de-DE.d.ts +7 -0
- package/dist/types/i18n/locales/en-GB.d.ts +7 -0
- package/dist/types/i18n/locales/es-ES.d.ts +7 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +7 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +7 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +7 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +7 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +7 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +7 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +7 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +7 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +7 -0
- package/dist/types/i18n/util.d.ts +8 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/out/fraud-detection.d.ts +2 -5
- package/dist/types/out/types.d.ts +5 -6
- package/dist/types/out/worldpay-ddc-manager.d.ts +1 -0
- package/dist/types/types/event.d.ts +24 -2
- package/dist/types/types/index.d.ts +14 -0
- package/dist/types/types/message.d.ts +3 -1
- package/dist/types/types/payment.d.ts +26 -3
- package/dist/types/utils/app-payment.d.ts +1 -0
- package/dist/types/utils/array.d.ts +17 -0
- package/dist/types/utils/business/amount.d.ts +7 -0
- package/dist/types/utils/business/index.d.ts +1 -0
- package/dist/types/utils/detect.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -6
- package/dist/types/utils/number.d.ts +4 -0
- package/dist/types/utils/redirect.d.ts +10 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +4 -0
- package/package.json +4 -2
- package/dist/es/api/modules/ali-pay/index.js +0 -16
- package/dist/es/api/modules/boost/index.js +0 -5
- package/dist/es/api/modules/gcash/index.js +0 -5
- package/dist/es/api/modules/grab-pay/index.js +0 -5
- package/dist/es/api/modules/may-bank-qr-pay/index.js +0 -5
- package/dist/es/api/modules/nine-pay/index.js +0 -5
- package/dist/es/api/modules/opay-wallet/index.js +0 -5
- package/dist/es/api/modules/paga-wallet/index.js +0 -5
- package/dist/es/api/modules/paymaya/index.js +0 -5
- package/dist/es/api/modules/pic-pay/index.js +0 -16
- package/dist/es/api/modules/pix/index.js +0 -16
- package/dist/es/api/modules/shopee-pay/index.js +0 -5
- package/dist/es/api/modules/tng-wallet/index.js +0 -5
- package/dist/es/api/modules/vietqr/index.js +0 -5
- package/dist/es/api/modules/wechat-pay/index.js +0 -16
- package/dist/es/api/modules/zalopay/index.js +0 -5
- package/dist/es/components/AliPay/index.js +0 -332
- package/dist/es/components/WechatPay/index.js +0 -340
- package/dist/es/hooks/usePayment.js +0 -1
- package/dist/types/api/modules/ali-pay/index.d.ts +0 -4
- package/dist/types/api/modules/boost/index.d.ts +0 -4
- package/dist/types/api/modules/gcash/index.d.ts +0 -4
- package/dist/types/api/modules/grab-pay/index.d.ts +0 -4
- package/dist/types/api/modules/line-pay/index.d.ts +0 -4
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +0 -4
- package/dist/types/api/modules/nine-pay/index.d.ts +0 -4
- package/dist/types/api/modules/opay-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paga-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paymaya/index.d.ts +0 -4
- package/dist/types/api/modules/pic-pay/index.d.ts +0 -4
- package/dist/types/api/modules/pix/index.d.ts +0 -4
- package/dist/types/api/modules/shopee-pay/index.d.ts +0 -4
- package/dist/types/api/modules/tng-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/vietqr/index.d.ts +0 -4
- package/dist/types/api/modules/wechat-pay/index.d.ts +0 -4
- package/dist/types/api/modules/zalopay/index.d.ts +0 -4
- package/dist/types/components/AliPay/type.d.ts +0 -26
- package/dist/types/components/WechatPay/WechatPay.d.ts +0 -10
- package/dist/types/components/WechatPay/type.d.ts +0 -28
- package/dist/types/hooks/usePayment.d.ts +0 -8
- package/dist/types/hooks/useRetry.console-tests.d.ts +0 -41
- package/dist/types/utils/behavior-tracker.d.ts +0 -36
- /package/dist/es/components/internal/Button/{button2.js → button.js} +0 -0
- /package/dist/types/components/{AliPay → wallets/AliPay}/index.d.ts +0 -0
- /package/dist/types/components/{WechatPay → wallets/WechatPay}/index.d.ts +0 -0
package/dist/es/api/http.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../core.js";
|
|
|
4
4
|
import { safeStringify } from "../utils/index.js";
|
|
5
5
|
import { getFetch } from "./fetch.js";
|
|
6
6
|
import { PayKKaError, EPayKKaError } from "../core/error.js";
|
|
7
|
-
import "../out/
|
|
7
|
+
import "../out/fraud-detection.js";
|
|
8
8
|
import { getBrowserInfo } from "../utils/system-info/get-browser-info.js";
|
|
9
9
|
const request = async (method, url, params, { timeout = 2e4, headers, locale } = {}) => {
|
|
10
10
|
const abortController = new AbortController();
|
package/dist/es/api/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RequestCacheManager } from "../../../utils/request-cache-manager.js";
|
|
2
2
|
import { apiPrefix } from "../../../config.js";
|
|
3
3
|
import { http } from "../../http.js";
|
|
4
|
-
import { getBrowserParams } from "../get-browser-params.js";
|
|
5
4
|
import { checkoutMap } from "./map.js";
|
|
6
5
|
const queryCheckout = async (params, extraParams = {}, options) => {
|
|
7
6
|
return http.post(
|
|
@@ -9,8 +8,7 @@ const queryCheckout = async (params, extraParams = {}, options) => {
|
|
|
9
8
|
{
|
|
10
9
|
session_id: params.sessionId,
|
|
11
10
|
client_key: params.clientKey,
|
|
12
|
-
...extraParams
|
|
13
|
-
browser: await getBrowserParams()
|
|
11
|
+
...extraParams
|
|
14
12
|
},
|
|
15
13
|
options
|
|
16
14
|
);
|
|
@@ -63,18 +63,25 @@ const checkoutMap = (res = {}) => {
|
|
|
63
63
|
const { payment_methods, bill, tokens } = support_methods;
|
|
64
64
|
const paymentMethodsInfo = formatPaymentMethodInfo(payment_methods);
|
|
65
65
|
const sessionMode = res.session_mode === "HOST" ? "HOSTED" : res.session_mode;
|
|
66
|
+
const transAmount = {
|
|
67
|
+
currency: res.currency,
|
|
68
|
+
symbol: res.symbol,
|
|
69
|
+
default_fraction_digits: res.default_fraction_digits,
|
|
70
|
+
...res.trans_amount
|
|
71
|
+
};
|
|
66
72
|
return {
|
|
67
73
|
country: res.country,
|
|
68
74
|
merchantId: res.merchant_id,
|
|
69
75
|
sessionId: res.session_id,
|
|
70
76
|
clientKey: res.client_key,
|
|
71
77
|
status: res.status,
|
|
72
|
-
transAmount: amountMap(
|
|
78
|
+
transAmount: amountMap(transAmount),
|
|
73
79
|
expireTime: res.expire_time,
|
|
74
80
|
paymentMethod: res.payment_method,
|
|
75
81
|
// 兼容其他收银台,没有 session_mode 字段就默认 HOSTED
|
|
76
82
|
sessionMode: sessionMode || "HOSTED",
|
|
77
|
-
|
|
83
|
+
// 兼容其他收银台,没有 merchant_name 字段就默认主题中的 merchant_name
|
|
84
|
+
merchantName: res.merchant_name || ((_a = res.theme) == null ? void 0 : _a.merchant_name),
|
|
78
85
|
returnUrl: res.return_url,
|
|
79
86
|
cancelUrl: res.cancel_url,
|
|
80
87
|
locale: res.locale,
|
|
@@ -104,6 +111,7 @@ const checkoutMap = (res = {}) => {
|
|
|
104
111
|
billingAddressFilled: card.billing_address_filled
|
|
105
112
|
})),
|
|
106
113
|
storePaymentMethod: (_b = res.payment) == null ? void 0 : _b.store_payment_method,
|
|
114
|
+
// 对于 field 需要兜底,如果后端没有传字段,则默认需要展示
|
|
107
115
|
field: {
|
|
108
116
|
holderName: {
|
|
109
117
|
show: !!(field == null ? void 0 : field.holder_name_display),
|
|
@@ -121,8 +129,8 @@ const checkoutMap = (res = {}) => {
|
|
|
121
129
|
},
|
|
122
130
|
amountBreakdown: formatAmountBreakdown(res.amount_breakdown),
|
|
123
131
|
finishTime: res.utc_finish_time,
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
rawResponse: res,
|
|
133
|
+
...paymentMethodsInfo
|
|
126
134
|
};
|
|
127
135
|
};
|
|
128
136
|
export {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cardBrandCodes } from "../../../utils/card-brand/brands.js";
|
|
2
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
3
|
+
import { intersection } from "../../../utils/array.js";
|
|
2
4
|
import { http } from "../../http.js";
|
|
3
5
|
import "../../../core.js";
|
|
4
6
|
import { formatPaymentMethodInfo } from "../checkout/map.js";
|
|
5
|
-
import { cardBrandCodes } from "../../../utils/card-brand/brands.js";
|
|
6
7
|
const verifyClientKey = async (clientKey, merchantId, options) => {
|
|
7
8
|
return http.post(
|
|
8
9
|
"/frames/info",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../utils/
|
|
2
|
-
import { getBrowser } from "../../utils/system-info/index.js";
|
|
1
|
+
import { getReferrer } from "../../utils/index.js";
|
|
3
2
|
import { getFingerprint } from "../../utils/system-info/finger-print.js";
|
|
3
|
+
import { getBrowser } from "../../utils/system-info/index.js";
|
|
4
4
|
const getTerminalType = (deviceType) => {
|
|
5
5
|
let terminalType = "WEB";
|
|
6
6
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
@@ -16,13 +16,12 @@ const getTerminalType = (deviceType) => {
|
|
|
16
16
|
return terminalType;
|
|
17
17
|
};
|
|
18
18
|
const getBaseBrowserParams = async (params = {}) => {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const { fraudDetectionId, origin } = params;
|
|
21
20
|
const browser = await getBrowser();
|
|
22
21
|
const terminalType = getTerminalType(browser.deviceType);
|
|
23
22
|
return {
|
|
24
23
|
origin: btoa(origin || window.location.origin),
|
|
25
|
-
referer: btoa(
|
|
24
|
+
referer: btoa(getReferrer()),
|
|
26
25
|
user_agent: browser.userAgent,
|
|
27
26
|
color_depth: browser.colorDepth,
|
|
28
27
|
language: browser.language,
|
|
@@ -36,7 +35,7 @@ const getBaseBrowserParams = async (params = {}) => {
|
|
|
36
35
|
terminal_type: terminalType,
|
|
37
36
|
fraud_detection_id: fraudDetectionId,
|
|
38
37
|
// 当前组件库版本(构建时由 define 注入)
|
|
39
|
-
app_version: "0.
|
|
38
|
+
app_version: "0.15.1"
|
|
40
39
|
};
|
|
41
40
|
};
|
|
42
41
|
const getBrowserParams = async (params = {}) => {
|
|
@@ -22,9 +22,12 @@ const payResMap = (res) => {
|
|
|
22
22
|
finishTime: res.utc_finish_time,
|
|
23
23
|
payInfo: {
|
|
24
24
|
threeDSUrl: (_a = res.authentication_result) == null ? void 0 : _a.authentication_url,
|
|
25
|
-
targetUrl: payInfo.
|
|
25
|
+
targetUrl: payInfo.request_url || payInfo.payment_url,
|
|
26
26
|
requestMethod: payInfo.request_method,
|
|
27
27
|
paymentExpiredAt: res == null ? void 0 : res.payment_expire_time,
|
|
28
|
+
action: payInfo.next_action,
|
|
29
|
+
qrCode: payInfo.qr_code || payInfo.payment_url,
|
|
30
|
+
requestData: payInfo.request_data,
|
|
28
31
|
...payInfo
|
|
29
32
|
},
|
|
30
33
|
rawResponse: res
|
|
@@ -5,7 +5,7 @@ import "../../core/context.js";
|
|
|
5
5
|
import "../../utils/card-brand/brands.js";
|
|
6
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import { normalizedClass } from "../../utils/format.js";
|
|
8
|
-
import "../../out/
|
|
8
|
+
import "../../out/fraud-detection.js";
|
|
9
9
|
import { AccordionContext } from "../internal/Accordion/type.js";
|
|
10
10
|
import { accordionTransition } from "../internal/Accordion/accordionTransition.js";
|
|
11
11
|
const { bem } = useBEM("accordion-item");
|
|
@@ -2,8 +2,8 @@ import { u } from "../../core.js";
|
|
|
2
2
|
import "../../utils/card-brand/brands.js";
|
|
3
3
|
import "../../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
5
|
+
import "../../out/fraud-detection.js";
|
|
5
6
|
import "../../core/context.js";
|
|
6
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
7
7
|
import "../internal/Form/type.js";
|
|
8
8
|
import "../internal/Form/context.js";
|
|
9
9
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -6,8 +6,8 @@ import "../../utils/card-brand/brands.js";
|
|
|
6
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
8
8
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
9
|
+
import "../../out/fraud-detection.js";
|
|
9
10
|
import { CoreContext } from "../../core/context.js";
|
|
10
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
11
11
|
import "../internal/Form/type.js";
|
|
12
12
|
import "../internal/Form/context.js";
|
|
13
13
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -4,15 +4,16 @@ import "../../utils/card-brand/brands.js";
|
|
|
4
4
|
import "../../utils/system-info/get-browser-info.js";
|
|
5
5
|
import { parseE164, underscoreToUpperCamelCase } from "../../utils/format.js";
|
|
6
6
|
import { ApplePayEventType } from "../../types/event.js";
|
|
7
|
+
import { PaymentMethod, SessionMode } from "../../constant.js";
|
|
7
8
|
import { deepMerge } from "../../utils/object.js";
|
|
8
9
|
import { processPaymentStatus, formatPaymentResult } from "../../utils/payment.js";
|
|
9
|
-
import {
|
|
10
|
-
import { PaymentMethod, SessionMode } from "../../constant.js";
|
|
10
|
+
import { buildPaymentParams } from "../../api/utils/index.js";
|
|
11
11
|
import { getApplePayInfo, applePay, getMerchantSession } from "../../api/modules/apple-pay/index.js";
|
|
12
|
+
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
12
13
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
13
14
|
import "../../core/context.js";
|
|
14
15
|
import { PayKKaError } from "../../core/error.js";
|
|
15
|
-
import "../../out/
|
|
16
|
+
import "../../out/fraud-detection.js";
|
|
16
17
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
17
18
|
import { useRetry } from "../../hooks/useRetry.js";
|
|
18
19
|
import { Info } from "../internal/Info/Info.js";
|
|
@@ -154,9 +155,16 @@ const ApplePay = w((props) => {
|
|
|
154
155
|
async () => {
|
|
155
156
|
var _a, _b, _c, _d, _e;
|
|
156
157
|
(_a = props.onLoad) == null ? void 0 : _a.call(props, true);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
let envSupported = false;
|
|
159
|
+
try {
|
|
160
|
+
envSupported = await getApplePayEnvSupported(
|
|
161
|
+
(_d = (_c = (_b = session == null ? void 0 : session.checkout) == null ? void 0 : _b.channelParams) == null ? void 0 : _c.applePay) == null ? void 0 : _d.merchantIdentifier
|
|
162
|
+
);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_ENV_CHECK_ERROR, {
|
|
165
|
+
message: error instanceof Error ? error.message : String(error)
|
|
166
|
+
});
|
|
167
|
+
}
|
|
160
168
|
if (!envSupported) {
|
|
161
169
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_CAN_NOT_USE);
|
|
162
170
|
}
|
|
@@ -214,7 +222,7 @@ const ApplePay = w((props) => {
|
|
|
214
222
|
};
|
|
215
223
|
};
|
|
216
224
|
async function pay(search = false, timeout, token, billingContact, shippingContact) {
|
|
217
|
-
var _a, _b, _c, _d, _e, _f;
|
|
225
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
218
226
|
setErrorMsg("");
|
|
219
227
|
try {
|
|
220
228
|
core.payment.currPaymentMethod.value = CURR_PAYMENT_METHOD;
|
|
@@ -232,16 +240,17 @@ const ApplePay = w((props) => {
|
|
|
232
240
|
requestOptions
|
|
233
241
|
);
|
|
234
242
|
} else {
|
|
243
|
+
const paymentParams = await getPaymentParams(token, billingContact, shippingContact);
|
|
235
244
|
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", CURR_PAYMENT_METHOD);
|
|
236
|
-
|
|
237
|
-
await
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
);
|
|
245
|
+
if ((_e = core.config._checkoutConfig) == null ? void 0 : _e.dynamicSessionId) {
|
|
246
|
+
await core.updateSessionId(buildPaymentParams(paymentParams, extraParams));
|
|
247
|
+
session.sessionId && (paymentParams.sessionId = session.sessionId);
|
|
248
|
+
}
|
|
249
|
+
res = await applePay(paymentParams, extraParams, requestOptions);
|
|
241
250
|
}
|
|
242
251
|
const { errorMessage, errorCode, sessionId } = res;
|
|
243
252
|
sessionId && (session.sessionId = sessionId);
|
|
244
|
-
!search && ((
|
|
253
|
+
!search && ((_f = props.onSubmitResponse) == null ? void 0 : _f.call(props, res, getPaymentMethodContext()));
|
|
245
254
|
let end = true;
|
|
246
255
|
await processPaymentStatus(res, {
|
|
247
256
|
onProcessing: async () => {
|
|
@@ -290,7 +299,7 @@ const ApplePay = w((props) => {
|
|
|
290
299
|
} else {
|
|
291
300
|
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
292
301
|
message && setErrorMsg(message);
|
|
293
|
-
(
|
|
302
|
+
(_g = props.onError) == null ? void 0 : _g.call(
|
|
294
303
|
props,
|
|
295
304
|
new PayKKaError("API_ERROR", message, { code: error.code, cause: error }),
|
|
296
305
|
getPaymentMethodContext()
|
|
@@ -302,7 +311,7 @@ const ApplePay = w((props) => {
|
|
|
302
311
|
}
|
|
303
312
|
}
|
|
304
313
|
const genApplePayRequest = () => {
|
|
305
|
-
var _a, _b, _c, _d, _e;
|
|
314
|
+
var _a, _b, _c, _d, _e, _f;
|
|
306
315
|
const checkout = session == null ? void 0 : session.checkout;
|
|
307
316
|
const { applePay: applePay2 } = (checkout == null ? void 0 : checkout.channelParams) ?? {};
|
|
308
317
|
const requiredBillingContactFields = [
|
|
@@ -311,25 +320,29 @@ const ApplePay = w((props) => {
|
|
|
311
320
|
if (((_b = checkout == null ? void 0 : checkout.bill) == null ? void 0 : _b.billingAddressCollection) === "REQUIRED") {
|
|
312
321
|
requiredBillingContactFields.push("postalAddress");
|
|
313
322
|
}
|
|
323
|
+
const amount = (_c = core.payment) == null ? void 0 : _c.amount.value;
|
|
314
324
|
return {
|
|
315
325
|
merchantCapabilities: ["supports3DS"],
|
|
316
326
|
countryCode: (applePay2 == null ? void 0 : applePay2.countryCode) ?? "",
|
|
317
327
|
requiredBillingContactFields,
|
|
318
|
-
requiredShippingContactFields: (
|
|
319
|
-
currencyCode: (
|
|
320
|
-
supportedNetworks: ((
|
|
328
|
+
requiredShippingContactFields: (_d = applePayConfig.request) == null ? void 0 : _d.requiredShippingContactFields,
|
|
329
|
+
currencyCode: (amount == null ? void 0 : amount.currency) ?? "",
|
|
330
|
+
supportedNetworks: ((_f = (_e = applePay2 == null ? void 0 : applePay2.supportedNetworks) == null ? void 0 : _e.map) == null ? void 0 : _f.call(_e, (item) => underscoreToUpperCamelCase(item))) ?? [],
|
|
321
331
|
total: {
|
|
322
332
|
label: (checkout == null ? void 0 : checkout.theme.merchantName) ?? "",
|
|
323
333
|
type: "final",
|
|
324
|
-
amount: String(
|
|
334
|
+
amount: String((amount == null ? void 0 : amount.amount) || 0)
|
|
325
335
|
}
|
|
326
336
|
};
|
|
327
337
|
};
|
|
328
|
-
const onApplePayButtonClicked = () => {
|
|
338
|
+
const onApplePayButtonClicked = async () => {
|
|
329
339
|
var _a, _b;
|
|
330
340
|
const { onEvent } = props.core.config;
|
|
331
341
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_BUTTON_CLICKED);
|
|
332
|
-
(_a = props.onBtnClick) == null ? void 0 : _a.call(props);
|
|
342
|
+
const btnResult = await ((_a = props.onBtnClick) == null ? void 0 : _a.call(props));
|
|
343
|
+
if (btnResult === false) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
333
346
|
if (!ApplePaySession) {
|
|
334
347
|
return;
|
|
335
348
|
}
|
|
@@ -4,8 +4,8 @@ import "../../utils/card-brand/brands.js";
|
|
|
4
4
|
import "../../utils/system-info/get-browser-info.js";
|
|
5
5
|
import { EInternalFieldType } from "../SecuredFieldsProvider/index.js";
|
|
6
6
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
7
|
+
import "../../out/fraud-detection.js";
|
|
7
8
|
import "../../core/context.js";
|
|
8
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
9
9
|
import "../internal/Form/type.js";
|
|
10
10
|
import "../internal/Form/context.js";
|
|
11
11
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { w, A, h, F, y, q, T, u, b } from "../../core.js";
|
|
2
2
|
import { isTimeoutError } from "../../api/http.js";
|
|
3
|
-
import { intersection } from "../../utils/index.js";
|
|
4
|
-
import { defaultInputStyleConfig } from "../../types/index.js";
|
|
5
3
|
import { getCardPayInfo, cardPay } from "../../api/modules/card/index.js";
|
|
4
|
+
import { safeParse, safeStringify } from "../../utils/index.js";
|
|
5
|
+
import { defaultInputStyleConfig } from "../../types/index.js";
|
|
6
|
+
import { PaymentMethod, PaymentType, SessionMode, COMMON_CLASS_NAME, CardPaymentMethods } from "../../constant.js";
|
|
7
|
+
import { buildPaymentParams } from "../../api/utils/index.js";
|
|
6
8
|
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
7
|
-
import { PaymentMethod, PaymentType, SessionMode, CardPaymentMethods, COMMON_CLASS_NAME } from "../../constant.js";
|
|
8
9
|
import { CoreContext } from "../../core/context.js";
|
|
9
10
|
import { PayKKaError } from "../../core/error.js";
|
|
10
|
-
import "../../out/
|
|
11
|
+
import "../../out/fraud-detection.js";
|
|
11
12
|
import { createPromise } from "../../utils/create-promise.js";
|
|
12
13
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
13
14
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
@@ -29,14 +30,19 @@ import { IconSwitch } from "../internal/icons/IconSwitch.js";
|
|
|
29
30
|
import { Info } from "../internal/Info/Info.js";
|
|
30
31
|
import { RecurringTip } from "../RecurringTip/index.js";
|
|
31
32
|
import { EFieldType, SecuredFieldsProvider } from "../SecuredFieldsProvider/index.js";
|
|
32
|
-
import
|
|
33
|
+
import "../SubmitButton/index.js";
|
|
34
|
+
import "../internal/Button/button.js";
|
|
35
|
+
import "../internal/LoadingCheck/loading-check.js";
|
|
33
36
|
import { ThreeDSAuth } from "../ThreeDS/index.js";
|
|
34
37
|
import { CombinedCardInfo } from "../CombinedCardInfo/index.js";
|
|
38
|
+
import { PaymentButton } from "../PaymentButton/index.js";
|
|
39
|
+
import { intersection } from "../../utils/array.js";
|
|
40
|
+
import { separateInputStyle } from "../../utils/style.js";
|
|
35
41
|
import { cardBrandCodes } from "../../utils/card-brand/brands.js";
|
|
36
42
|
import { findCardBrand } from "../../utils/card-brand/index.js";
|
|
37
|
-
import {
|
|
38
|
-
import { normalizedClass, trimAll, limitedToNumber, formatAmount } from "../../utils/format.js";
|
|
43
|
+
import { createUrlWithParams } from "../../utils/location.js";
|
|
39
44
|
import { formatPaymentResult, processPaymentStatus } from "../../utils/payment.js";
|
|
45
|
+
import { normalizedClass, trimAll, limitedToNumber } from "../../utils/format.js";
|
|
40
46
|
const { bem } = useBEM("card");
|
|
41
47
|
const fieldClassNames = bem("field");
|
|
42
48
|
const CURR_PAYMENT_METHOD = PaymentMethod.BANKCARD;
|
|
@@ -115,8 +121,14 @@ const Card = w((props, ref) => {
|
|
|
115
121
|
}));
|
|
116
122
|
const initFieldStatus = () => {
|
|
117
123
|
const { field, sessionMode } = session.checkout;
|
|
118
|
-
const
|
|
119
|
-
|
|
124
|
+
const cpyField = safeParse(safeStringify(field));
|
|
125
|
+
const { email, address, holderName } = cpyField;
|
|
126
|
+
const { forceCustomFields = false } = core.config._checkoutConfig || {};
|
|
127
|
+
if (forceCustomFields) {
|
|
128
|
+
email.show = showEmail;
|
|
129
|
+
address.show = showAddress;
|
|
130
|
+
holderName.show = showHolderName;
|
|
131
|
+
} else if (sessionMode === SessionMode.COMPONENT) {
|
|
120
132
|
if (email.disabled) {
|
|
121
133
|
email.show = showEmail;
|
|
122
134
|
}
|
|
@@ -128,7 +140,7 @@ const Card = w((props, ref) => {
|
|
|
128
140
|
holderName.disabled = true;
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
|
-
setFieldStatus({ ...
|
|
143
|
+
setFieldStatus({ ...cpyField });
|
|
132
144
|
};
|
|
133
145
|
const initElementStyles = () => {
|
|
134
146
|
if (!styles)
|
|
@@ -236,7 +248,9 @@ const Card = w((props, ref) => {
|
|
|
236
248
|
(_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
|
|
237
249
|
var _a3;
|
|
238
250
|
(fieldStatus == null ? void 0 : fieldStatus.address.show) && addressCore.setValidateAllFields(true);
|
|
239
|
-
(_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext());
|
|
251
|
+
const submitResult = await ((_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext()));
|
|
252
|
+
if (submitResult === false)
|
|
253
|
+
return;
|
|
240
254
|
if (errors) {
|
|
241
255
|
setSubmitButtonStatus("unSubmit");
|
|
242
256
|
return;
|
|
@@ -301,7 +315,7 @@ const Card = w((props, ref) => {
|
|
|
301
315
|
};
|
|
302
316
|
};
|
|
303
317
|
async function pay(search = false, timeout) {
|
|
304
|
-
var _a2, _b2, _c, _d, _e;
|
|
318
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
305
319
|
try {
|
|
306
320
|
core.payment.currPaymentMethod.value = CURR_PAYMENT_METHOD;
|
|
307
321
|
const requestOptions = { locale: i18n.locale, timeout };
|
|
@@ -319,8 +333,12 @@ const Card = w((props, ref) => {
|
|
|
319
333
|
} else {
|
|
320
334
|
const paymentParams = await getPaymentParams();
|
|
321
335
|
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", CURR_PAYMENT_METHOD);
|
|
336
|
+
if ((_e = core.config._checkoutConfig) == null ? void 0 : _e.dynamicSessionId) {
|
|
337
|
+
await core.updateSessionId(buildPaymentParams(paymentParams, extraParams));
|
|
338
|
+
session.sessionId && (paymentParams.sessionId = session.sessionId);
|
|
339
|
+
}
|
|
322
340
|
if (security) {
|
|
323
|
-
(
|
|
341
|
+
(_f = SFPRef.current) == null ? void 0 : _f.payment(paymentParams, extraParams);
|
|
324
342
|
return { end: true };
|
|
325
343
|
} else {
|
|
326
344
|
res = await cardPay(paymentParams, extraParams, requestOptions);
|
|
@@ -344,17 +362,18 @@ const Card = w((props, ref) => {
|
|
|
344
362
|
}
|
|
345
363
|
const processThreeDS = (threeDSUrl, incomplete) => {
|
|
346
364
|
var _a2;
|
|
365
|
+
const finalUrl = createUrlWithParams(threeDSUrl, { locale: i18n.locale });
|
|
347
366
|
if (enable3DSModal) {
|
|
348
367
|
console.log("3ds open");
|
|
349
368
|
setShowThreeDSModal(true);
|
|
350
369
|
setThreeDSInfo({
|
|
351
|
-
url:
|
|
370
|
+
url: finalUrl,
|
|
352
371
|
incomplete,
|
|
353
372
|
width: threeDSFrame == null ? void 0 : threeDSFrame.modalWidth,
|
|
354
373
|
height: threeDSFrame == null ? void 0 : threeDSFrame.modalHeight
|
|
355
374
|
});
|
|
356
375
|
} else {
|
|
357
|
-
(_a2 = props.onThreeDS) == null ? void 0 : _a2.call(props,
|
|
376
|
+
(_a2 = props.onThreeDS) == null ? void 0 : _a2.call(props, finalUrl, incomplete);
|
|
358
377
|
}
|
|
359
378
|
};
|
|
360
379
|
const handleCloseThreeDSModal = () => {
|
|
@@ -369,11 +388,7 @@ const Card = w((props, ref) => {
|
|
|
369
388
|
const { threeDSUrl } = payInfo;
|
|
370
389
|
sessionId && (session.sessionId = sessionId);
|
|
371
390
|
if (!search) {
|
|
372
|
-
(_a2 = props.onSubmitResponse) == null ? void 0 : _a2.call(props, res,
|
|
373
|
-
...getPaymentMethodContext(),
|
|
374
|
-
orderId: res.orderId,
|
|
375
|
-
sessionId: session.sessionId
|
|
376
|
-
});
|
|
391
|
+
(_a2 = props.onSubmitResponse) == null ? void 0 : _a2.call(props, res, getPaymentMethodContext());
|
|
377
392
|
}
|
|
378
393
|
let end = true;
|
|
379
394
|
await processPaymentStatus(res, {
|
|
@@ -434,21 +449,14 @@ const Card = w((props, ref) => {
|
|
|
434
449
|
validateFormSilently();
|
|
435
450
|
}, [form]);
|
|
436
451
|
const Button = () => {
|
|
437
|
-
var _a2;
|
|
438
|
-
const transAmount = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.transAmount;
|
|
439
|
-
const amountText = (transAmount == null ? void 0 : transAmount.amount) ? formatAmount(transAmount).jointSymbol() : "";
|
|
440
|
-
const text = i18n.get("common.pay") + (amountText ? ` ${amountText}` : "");
|
|
441
452
|
return /* @__PURE__ */ u(
|
|
442
|
-
|
|
453
|
+
PaymentButton,
|
|
443
454
|
{
|
|
444
455
|
className: bem("button"),
|
|
445
456
|
status: submitButtonStatus,
|
|
446
457
|
disabled,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
successText: i18n.get("common.paySuccess"),
|
|
450
|
-
onClick: onSubmit,
|
|
451
|
-
verified: validated
|
|
458
|
+
verified: validated,
|
|
459
|
+
onClick: onSubmit
|
|
452
460
|
}
|
|
453
461
|
);
|
|
454
462
|
};
|
|
@@ -3,7 +3,7 @@ import { COMMON_CLASS_NAME } from "../../constant.js";
|
|
|
3
3
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
4
4
|
import "../../core/context.js";
|
|
5
5
|
import { clamp } from "../../utils/index.js";
|
|
6
|
-
import "../../out/
|
|
6
|
+
import "../../out/fraud-detection.js";
|
|
7
7
|
import { getSupportedCardBrands, getCardBrandInfo } from "../../utils/card-brand/index.js";
|
|
8
8
|
import { normalizedClass } from "../../utils/format.js";
|
|
9
9
|
const { bem } = useBEM("card-brands");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { w, A, F, h, u } from "../../core.js";
|
|
2
2
|
import { isExpired } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -2,8 +2,8 @@ import { u } from "../../core.js";
|
|
|
2
2
|
import "../../utils/card-brand/brands.js";
|
|
3
3
|
import "../../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
5
|
+
import "../../out/fraud-detection.js";
|
|
5
6
|
import "../../core/context.js";
|
|
6
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
7
7
|
import "../internal/Form/type.js";
|
|
8
8
|
import "../internal/Form/context.js";
|
|
9
9
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A, h, u } from "../../core.js";
|
|
2
2
|
import { clamp } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -5,7 +5,7 @@ import "../../core/context.js";
|
|
|
5
5
|
import "../../utils/card-brand/brands.js";
|
|
6
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import { normalizedClass } from "../../utils/format.js";
|
|
8
|
-
import "../../out/
|
|
8
|
+
import "../../out/fraud-detection.js";
|
|
9
9
|
const { bem } = useBEM("card-no");
|
|
10
10
|
const CardNo = (props) => {
|
|
11
11
|
const { value, className, style, disabled } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { w, A, F, h, y, u } from "../../core.js";
|
|
2
2
|
import { clamp } from "../../utils/index.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import "../../core/context.js";
|
|
5
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
6
6
|
import "../internal/Form/type.js";
|
|
7
7
|
import "../internal/Form/context.js";
|
|
8
8
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -5,8 +5,8 @@ import "../../utils/system-info/get-browser-info.js";
|
|
|
5
5
|
import { limitedToNumber } from "../../utils/format.js";
|
|
6
6
|
import { EFieldType } from "../SecuredFieldsProvider/index.js";
|
|
7
7
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
8
|
+
import "../../out/fraud-detection.js";
|
|
8
9
|
import "../../core/context.js";
|
|
9
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
10
10
|
import "../internal/Form/type.js";
|
|
11
11
|
import "../internal/Form/context.js";
|
|
12
12
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { A, h, y, u } from "../../core.js";
|
|
2
2
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
3
3
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import "../../out/fraud-detection.js";
|
|
4
5
|
import { finCardBrandInfoByCode } from "../../utils/card-brand/index.js";
|
|
5
6
|
import "../../utils/system-info/get-browser-info.js";
|
|
6
7
|
import "../../core/context.js";
|
|
7
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
8
8
|
import "../internal/Form/type.js";
|
|
9
9
|
import "../internal/Form/context.js";
|
|
10
10
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
11
11
|
import "../internal/Form/Form.js";
|
|
12
12
|
import { Select } from "../internal/Select/Select.js";
|
|
13
|
-
import { Button } from "../internal/Button/
|
|
13
|
+
import { Button } from "../internal/Button/Button2.js";
|
|
14
14
|
import { CardNo } from "../CardNo/index.js";
|
|
15
15
|
import { IconCardNo } from "../internal/icons/IconCardNo.js";
|
|
16
16
|
import { IconSwitch } from "../internal/icons/IconSwitch.js";
|
|
@@ -12,8 +12,8 @@ import { trimAll } from "../../utils/format.js";
|
|
|
12
12
|
import { IconCardNo } from "../internal/icons/IconCardNo.js";
|
|
13
13
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
14
14
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
15
|
+
import "../../out/fraud-detection.js";
|
|
15
16
|
import "../../core/context.js";
|
|
16
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
17
17
|
const { bem } = useBEM("combined-card-info");
|
|
18
18
|
const CombinedCardInfo = w(
|
|
19
19
|
(props, ref) => {
|