@paykka/card-checkout-ui 0.18.0 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/card-checkout-ui.js +15 -15
- package/dist/card-checkout-ui.umd.cjs +15 -15
- package/dist/es/api/modules/apple-pay/index.js +6 -2
- package/dist/es/api/modules/checkout/map.js +1 -1
- package/dist/es/api/modules/get-browser-params.js +1 -1
- package/dist/es/components/ApplePay/index.js +5 -3
- package/dist/es/components/Card/index.js +48 -31
- package/dist/es/components/DropIn/index.js +21 -5
- package/dist/es/components/GuideCard/index.js +7 -50
- package/dist/es/components/Sepa/index.js +2 -1
- package/dist/es/components/business/QRCodeContent/QRCodeContent.js +68 -0
- package/dist/es/components/business/QRCodeContent/index.js +8 -0
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +5 -44
- package/dist/es/components/business/QRCodeModal/index.js +2 -1
- package/dist/es/components/business/index.js +2 -1
- package/dist/es/components/index.js +3 -1
- package/dist/es/components/internal/Button/Button2.js +2 -2
- package/dist/es/components/internal/icons/IconAlipay.js +43 -0
- package/dist/es/components/internal/icons/IconAlipayHK.js +66 -0
- package/dist/es/components/wallets/Alipay/Alipay.js +148 -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/AlipayHK/AlipayHK.js +148 -0
- package/dist/es/components/wallets/AlipayHK/alipay-hk.js +1 -0
- package/dist/es/components/wallets/AlipayHK/index.js +1 -0
- package/dist/es/components/wallets/AlipayHK/type.js +1 -0
- package/dist/es/components/wallets/{AliPay/AliPay.js → AlipayPlus/AlipayPlus.js} +13 -15
- package/dist/es/components/wallets/AlipayPlus/ali-pay-plus.js +1 -0
- package/dist/es/components/wallets/AlipayPlus/index.js +1 -0
- package/dist/es/components/wallets/AlipayPlus/type.js +1 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +4 -3
- package/dist/es/components/wallets/Blik/Blik.js +4 -3
- package/dist/es/components/wallets/Doku/Doku.js +2 -1
- package/dist/es/components/wallets/EPS/EPS.js +4 -3
- package/dist/es/components/wallets/GCash/GCash.js +2 -0
- package/dist/es/components/wallets/GoPay/GoPay.js +2 -1
- package/dist/es/components/wallets/IDeal/IDeal.js +4 -3
- package/dist/es/components/wallets/Jenius/Jenius.js +2 -1
- package/dist/es/components/wallets/LinkAja/LinkAja.js +2 -1
- package/dist/es/components/wallets/NuPay/NuPay.js +2 -1
- package/dist/es/components/wallets/OVO/OVO.js +2 -1
- package/dist/es/components/wallets/P24/P24.js +2 -1
- package/dist/es/components/wallets/PayByBank/PayByBank.js +2 -1
- package/dist/es/components/wallets/PayU/PayU.js +2 -1
- package/dist/es/components/wallets/Skrill/Skrill.js +2 -1
- package/dist/es/components/wallets/Trustly/Trustly.js +2 -1
- package/dist/es/components/wallets/Twint/Twint.js +2 -1
- package/dist/es/components/wallets/Vietqr/Vietqr.js +2 -0
- package/dist/es/components/wallets/WechatPay/WechatPay.js +4 -2
- package/dist/es/components/wallets/Zalopay/Zalopay.js +2 -0
- package/dist/es/components/wallets/index.js +3 -1
- package/dist/es/constant.js +15 -3
- package/dist/es/core/environment.js +17 -3
- package/dist/es/core/logger.js +1 -1
- package/dist/es/hooks/useBaseWallet.js +13 -5
- package/dist/es/hooks/useRetry.js +6 -0
- package/dist/es/i18n/locales/cs-CZ.js +8 -1
- package/dist/es/i18n/locales/da-DK.js +8 -1
- package/dist/es/i18n/locales/de-DE.js +8 -1
- package/dist/es/i18n/locales/en-GB.js +8 -1
- package/dist/es/i18n/locales/es-ES.js +8 -1
- package/dist/es/i18n/locales/fi-FI.js +8 -1
- package/dist/es/i18n/locales/fil-PH.js +8 -1
- package/dist/es/i18n/locales/fr-FR.js +8 -1
- package/dist/es/i18n/locales/hi-IN.js +8 -1
- package/dist/es/i18n/locales/id-ID.js +8 -1
- package/dist/es/i18n/locales/it-IT.js +8 -1
- package/dist/es/i18n/locales/ja-JP.js +8 -1
- package/dist/es/i18n/locales/ko-KR.js +8 -1
- package/dist/es/i18n/locales/ms-MY.js +8 -1
- package/dist/es/i18n/locales/nb-NO.js +8 -1
- package/dist/es/i18n/locales/nl-NL.js +8 -1
- package/dist/es/i18n/locales/pl-PL.js +8 -1
- package/dist/es/i18n/locales/pt-PT.js +8 -1
- package/dist/es/i18n/locales/ru-RU.js +8 -1
- package/dist/es/i18n/locales/sv-SE.js +8 -1
- package/dist/es/i18n/locales/th-TH.js +8 -1
- package/dist/es/i18n/locales/zh-CN.js +8 -1
- package/dist/es/i18n/locales/zh-HK.js +8 -1
- package/dist/es/i18n/locales/zh-TW.js +8 -1
- package/dist/es/index.js +6 -2
- package/dist/es/polyfill.js +165 -165
- package/dist/es/style.css +1 -1
- package/dist/es/utils/date.js +5 -1
- package/dist/polyfill.js +165 -165
- package/dist/style.css +1 -1
- package/dist/types/api/modules/apple-pay/index.d.ts +3 -1
- package/dist/types/components/DropIn/type.d.ts +1 -1
- package/dist/types/components/business/QRCodeContent/QRCodeContent.d.ts +3 -0
- package/dist/types/components/business/QRCodeContent/index.d.ts +2 -0
- package/dist/types/components/business/QRCodeContent/type.d.ts +23 -0
- package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +0 -1
- package/dist/types/components/business/QRCodeModal/type.d.ts +2 -28
- package/dist/types/components/business/index.d.ts +1 -0
- package/dist/types/components/internal/Button/type.d.ts +1 -0
- package/dist/types/components/internal/icons/IconAlipay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconAlipayHK.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +2 -0
- package/dist/types/components/wallets/Alipay/Alipay.d.ts +15 -0
- package/dist/types/components/wallets/Alipay/index.d.ts +2 -0
- package/dist/types/components/wallets/{AliPay → Alipay}/type.d.ts +2 -2
- package/dist/types/components/wallets/AlipayHK/AlipayHK.d.ts +15 -0
- package/dist/types/components/wallets/AlipayHK/index.d.ts +2 -0
- package/dist/types/components/wallets/AlipayHK/type.d.ts +7 -0
- package/dist/types/components/wallets/AlipayPlus/AlipayPlus.d.ts +15 -0
- package/dist/types/components/wallets/AlipayPlus/index.d.ts +2 -0
- package/dist/types/components/wallets/AlipayPlus/type.d.ts +7 -0
- package/dist/types/components/wallets/Doku/Doku.d.ts +2 -2
- package/dist/types/components/wallets/DragonPay/DragonPay.d.ts +1 -1
- package/dist/types/components/wallets/GoPay/GoPay.d.ts +0 -1
- package/dist/types/components/wallets/IDeal/IDeal.d.ts +1 -1
- package/dist/types/components/wallets/LinkAja/LinkAja.d.ts +2 -2
- package/dist/types/components/wallets/MyBank/MyBank.d.ts +0 -1
- package/dist/types/components/wallets/OnlineBankingEstonia/OnlineBankingEstonia.d.ts +0 -1
- package/dist/types/components/wallets/OnlineBankingFinland/OnlineBankingFinland.d.ts +0 -1
- package/dist/types/components/wallets/P24/P24.d.ts +1 -1
- package/dist/types/components/wallets/PayU/PayU.d.ts +1 -1
- package/dist/types/components/wallets/Twint/Twint.d.ts +0 -1
- package/dist/types/components/wallets/index.d.ts +3 -1
- package/dist/types/constant.d.ts +6 -2
- package/dist/types/hooks/useBaseWallet.d.ts +13 -0
- package/dist/types/hooks/useRetry.d.ts +2 -0
- package/dist/types/i18n/locales/cs-CZ.d.ts +7 -0
- package/dist/types/i18n/locales/da-DK.d.ts +7 -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/fi-FI.d.ts +7 -0
- package/dist/types/i18n/locales/fil-PH.d.ts +7 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +7 -0
- package/dist/types/i18n/locales/hi-IN.d.ts +7 -0
- package/dist/types/i18n/locales/id-ID.d.ts +7 -0
- package/dist/types/i18n/locales/it-IT.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/ms-MY.d.ts +7 -0
- package/dist/types/i18n/locales/nb-NO.d.ts +7 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +7 -0
- package/dist/types/i18n/locales/pl-PL.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/sv-SE.d.ts +7 -0
- package/dist/types/i18n/locales/th-TH.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/utils/date.d.ts +1 -0
- package/package.json +81 -81
- package/dist/es/components/RecurringTip/index.js +0 -21
- package/dist/es/components/wallets/AliPay/index.js +0 -1
- package/dist/types/components/RecurringTip/RecurringTip.d.ts +0 -2
- package/dist/types/components/RecurringTip/index.d.ts +0 -1
- package/dist/types/components/wallets/AliPay/AliPay.d.ts +0 -15
- package/dist/types/components/wallets/AliPay/index.d.ts +0 -2
- /package/dist/es/components/business/{QRCodeModal/qr-code-modal.js → QRCodeContent/qr-code-content.js} +0 -0
- /package/dist/es/components/{wallets/AliPay → business/QRCodeContent}/type.js +0 -0
- /package/dist/es/components/wallets/{AliPay → Alipay}/ali-pay.js +0 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { apiPrefix } from "../../../config.js";
|
|
2
2
|
import { http } from "../../http.js";
|
|
3
|
-
const getMerchantSession = async (options) => {
|
|
4
|
-
return http.post(
|
|
3
|
+
const getMerchantSession = async (params, options) => {
|
|
4
|
+
return http.post(
|
|
5
|
+
`${apiPrefix}/apple-pay/create-session`,
|
|
6
|
+
{ merchant_id: params.merchantId },
|
|
7
|
+
options
|
|
8
|
+
);
|
|
5
9
|
};
|
|
6
10
|
export {
|
|
7
11
|
getMerchantSession
|
|
@@ -31,7 +31,7 @@ const formatPaymentMethodInfo = (paymentMethods = []) => {
|
|
|
31
31
|
};
|
|
32
32
|
} else if (value === PaymentMethod.WECHAT_PAY) {
|
|
33
33
|
channelParams.wechatPay = formatFeeInfo(configuration);
|
|
34
|
-
} else if (value === PaymentMethod.
|
|
34
|
+
} else if (value === PaymentMethod.ALIPAY_PLUS) {
|
|
35
35
|
channelParams.aliPay = formatFeeInfo(configuration);
|
|
36
36
|
}
|
|
37
37
|
if (value === PaymentMethod.BANKCARD) {
|
|
@@ -35,7 +35,7 @@ const getBaseBrowserParams = async (params = {}) => {
|
|
|
35
35
|
terminal_type: terminalType,
|
|
36
36
|
fraud_detection_id: fraudDetectionId,
|
|
37
37
|
// 当前组件库版本(构建时由 define 注入)
|
|
38
|
-
app_version: "0.
|
|
38
|
+
app_version: "0.21.2"
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
const getBrowserParams = async (params = {}) => {
|
|
@@ -368,10 +368,12 @@ const ApplePay = w((props) => {
|
|
|
368
368
|
initApplePaySession({
|
|
369
369
|
request,
|
|
370
370
|
onValidate: async () => {
|
|
371
|
-
var _a2;
|
|
371
|
+
var _a2, _b2, _c;
|
|
372
372
|
onEvent == null ? void 0 : onEvent(ApplePayEventType.APPLE_PAY_VALIDATE_MERCHANT);
|
|
373
|
-
const merchantSession = await getMerchantSession(
|
|
374
|
-
|
|
373
|
+
const merchantSession = await getMerchantSession(
|
|
374
|
+
((_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.sessionMode) === SessionMode.HOSTED ? {} : { merchantId: (_b2 = session == null ? void 0 : session.checkout) == null ? void 0 : _b2.merchantId }
|
|
375
|
+
);
|
|
376
|
+
(_c = applePaySession.current) == null ? void 0 : _c.completeMerchantValidation(merchantSession);
|
|
375
377
|
},
|
|
376
378
|
onAuthorized: async (event) => {
|
|
377
379
|
var _a2;
|
|
@@ -29,7 +29,7 @@ import "../internal/Form/FormItem.js";
|
|
|
29
29
|
import { Form } from "../internal/Form/Form.js";
|
|
30
30
|
import { IconSwitch } from "../internal/icons/IconSwitch.js";
|
|
31
31
|
import { Info } from "../internal/Info/Info.js";
|
|
32
|
-
import {
|
|
32
|
+
import { Tip } from "../Tip/index.js";
|
|
33
33
|
import { EFieldType, SecuredFieldsProvider } from "../SecuredFieldsProvider/index.js";
|
|
34
34
|
import "../SubmitButton/index.js";
|
|
35
35
|
import "../internal/Button/button.js";
|
|
@@ -47,7 +47,7 @@ import { normalizedClass, trimAll, limitedToNumber } from "../../utils/format.js
|
|
|
47
47
|
const { bem } = useBEM("card");
|
|
48
48
|
const CURR_PAYMENT_METHOD = PaymentMethod.BANKCARD;
|
|
49
49
|
const Card = w((props, ref) => {
|
|
50
|
-
var _a, _b;
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
51
51
|
const {
|
|
52
52
|
showCardBrands = true,
|
|
53
53
|
session,
|
|
@@ -154,7 +154,7 @@ const Card = w((props, ref) => {
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
y(() => {
|
|
157
|
-
var _a2, _b2,
|
|
157
|
+
var _a2, _b2, _c2;
|
|
158
158
|
if (!sessionReady)
|
|
159
159
|
return;
|
|
160
160
|
const { status, supportMethods = [], tokens = [], sessionMode, country, bill = {} } = (session == null ? void 0 : session.checkout) || {};
|
|
@@ -173,7 +173,7 @@ const Card = w((props, ref) => {
|
|
|
173
173
|
country && addressCore.setCountry(country);
|
|
174
174
|
form.email = bill.email ?? "";
|
|
175
175
|
form.address.country = country;
|
|
176
|
-
form.token = (
|
|
176
|
+
form.token = (_c2 = tokens[0]) == null ? void 0 : _c2.token;
|
|
177
177
|
setSupportedCardBrands(intersection(cardBrandCodes, supportMethods || []));
|
|
178
178
|
setIsCheckoutEnabled(true);
|
|
179
179
|
if (status === "SUCCESS") {
|
|
@@ -278,6 +278,7 @@ const Card = w((props, ref) => {
|
|
|
278
278
|
paymentMethod = cardBrand.code;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
+
const storePaymentMethodPayload = isShowStoreCheckBox ? { storePaymentMethod } : isForceStorePaymentMethod ? { storePaymentMethod: true } : null;
|
|
281
282
|
return {
|
|
282
283
|
sessionId: session.sessionId,
|
|
283
284
|
clientKey: session.clientKey,
|
|
@@ -291,7 +292,7 @@ const Card = w((props, ref) => {
|
|
|
291
292
|
expYear: `20${expYear}`,
|
|
292
293
|
expMonth,
|
|
293
294
|
cardNo,
|
|
294
|
-
...
|
|
295
|
+
...storePaymentMethodPayload
|
|
295
296
|
}
|
|
296
297
|
},
|
|
297
298
|
bill: (fieldStatus == null ? void 0 : fieldStatus.address.show) ? {
|
|
@@ -316,7 +317,7 @@ const Card = w((props, ref) => {
|
|
|
316
317
|
};
|
|
317
318
|
};
|
|
318
319
|
async function pay(search = false, timeout) {
|
|
319
|
-
var _a2, _b2,
|
|
320
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h;
|
|
320
321
|
try {
|
|
321
322
|
core.payment.currPaymentMethod.value = CURR_PAYMENT_METHOD;
|
|
322
323
|
const requestOptions = { locale: i18n.locale, timeout };
|
|
@@ -333,13 +334,13 @@ const Card = w((props, ref) => {
|
|
|
333
334
|
);
|
|
334
335
|
} else {
|
|
335
336
|
const paymentParams = await getPaymentParams();
|
|
336
|
-
const extraParams = (
|
|
337
|
-
if ((
|
|
337
|
+
const extraParams = (_d2 = (_c2 = core.config)._getExtraParams) == null ? void 0 : _d2.call(_c2, "payment", CURR_PAYMENT_METHOD);
|
|
338
|
+
if ((_e2 = core.config._checkoutConfig) == null ? void 0 : _e2.dynamicSessionId) {
|
|
338
339
|
await core.updateSessionId(buildPaymentParams(paymentParams, extraParams));
|
|
339
340
|
session.sessionId && (paymentParams.sessionId = session.sessionId);
|
|
340
341
|
}
|
|
341
342
|
if (security) {
|
|
342
|
-
(
|
|
343
|
+
(_f2 = SFPRef.current) == null ? void 0 : _f2.payment(paymentParams, extraParams);
|
|
343
344
|
return { end: true };
|
|
344
345
|
} else {
|
|
345
346
|
res = await commonPayment({
|
|
@@ -353,7 +354,7 @@ const Card = w((props, ref) => {
|
|
|
353
354
|
sessionId: session.sessionId,
|
|
354
355
|
clientKey: session.clientKey
|
|
355
356
|
},
|
|
356
|
-
extraParams: (_h = (
|
|
357
|
+
extraParams: (_h = (_g2 = core.config)._getExtraParams) == null ? void 0 : _h.call(_g2, "query", CURR_PAYMENT_METHOD)
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
360
|
});
|
|
@@ -471,7 +472,8 @@ const Card = w((props, ref) => {
|
|
|
471
472
|
status: submitButtonStatus,
|
|
472
473
|
disabled,
|
|
473
474
|
verified: validated,
|
|
474
|
-
onClick: onSubmit
|
|
475
|
+
onClick: onSubmit,
|
|
476
|
+
children: isSaveButton ? i18n.get("common.save") : null
|
|
475
477
|
}
|
|
476
478
|
);
|
|
477
479
|
};
|
|
@@ -556,19 +558,25 @@ const Card = w((props, ref) => {
|
|
|
556
558
|
}
|
|
557
559
|
}
|
|
558
560
|
}
|
|
561
|
+
const isPurchase = ((_a = session == null ? void 0 : session.checkout) == null ? void 0 : _a.paymentType) === PaymentType.PURCHASE;
|
|
562
|
+
const isRecurring = ((_b = session == null ? void 0 : session.checkout) == null ? void 0 : _b.paymentType) === PaymentType.RECURRING;
|
|
559
563
|
const isFastPayment = T(() => {
|
|
560
564
|
var _a2;
|
|
561
565
|
if (!(session == null ? void 0 : session.checkout))
|
|
562
566
|
return;
|
|
563
|
-
const
|
|
564
|
-
const hasCardTokens = !!((_a2 = session == null ? void 0 : session.checkout.tokens) == null ? void 0 : _a2.length);
|
|
567
|
+
const hasCardTokens = !!((_a2 = session.checkout.tokens) == null ? void 0 : _a2.length);
|
|
565
568
|
return isPurchase && hasCardTokens;
|
|
566
|
-
}, [session == null ? void 0 : session.checkout]);
|
|
569
|
+
}, [session == null ? void 0 : session.checkout, isPurchase]);
|
|
570
|
+
const isNoAmount = Number((_d = (_c = session == null ? void 0 : session.checkout) == null ? void 0 : _c.transAmount) == null ? void 0 : _d.amount) === 0;
|
|
571
|
+
const canStorePaymentMethod = !!((_e = session == null ? void 0 : session.checkout) == null ? void 0 : _e.storePaymentMethod);
|
|
572
|
+
const isNoAmountPurchaseStore = isPurchase && isNoAmount && canStorePaymentMethod;
|
|
573
|
+
const isForceStorePaymentMethod = isRecurring || isNoAmountPurchaseStore;
|
|
574
|
+
const isSaveButton = isNoAmountPurchaseStore || isRecurring && isNoAmount;
|
|
567
575
|
const isShowStoreCheckBox = T(() => {
|
|
568
576
|
if (!(session == null ? void 0 : session.checkout))
|
|
569
577
|
return;
|
|
570
|
-
return
|
|
571
|
-
}, [session == null ? void 0 : session.checkout]);
|
|
578
|
+
return isPurchase && canStorePaymentMethod && !isNoAmount;
|
|
579
|
+
}, [session == null ? void 0 : session.checkout, isPurchase, canStorePaymentMethod, isNoAmount]);
|
|
572
580
|
const StoreCheckBox = () => {
|
|
573
581
|
const onCheck = (checked) => {
|
|
574
582
|
setStorePaymentMethod(checked);
|
|
@@ -583,10 +591,20 @@ const Card = w((props, ref) => {
|
|
|
583
591
|
}
|
|
584
592
|
) });
|
|
585
593
|
};
|
|
594
|
+
const StorePaymentTip = () => {
|
|
595
|
+
let tipText = null;
|
|
596
|
+
if (isNoAmountPurchaseStore) {
|
|
597
|
+
tipText = i18n.get("common.storePaymentTip");
|
|
598
|
+
} else if (isRecurring && isNoAmount) {
|
|
599
|
+
tipText = i18n.get("common.recurringStoreTip");
|
|
600
|
+
} else if (isRecurring) {
|
|
601
|
+
tipText = i18n.get("common.recurringTip");
|
|
602
|
+
}
|
|
603
|
+
return tipText ? /* @__PURE__ */ u(Tip, { text: tipText }) : null;
|
|
604
|
+
};
|
|
586
605
|
const changeBox = () => {
|
|
587
|
-
var _a2, _b2
|
|
588
|
-
const
|
|
589
|
-
const hasCardTokens = !!((_c = (_b2 = session == null ? void 0 : session.checkout) == null ? void 0 : _b2.tokens) == null ? void 0 : _c.length);
|
|
606
|
+
var _a2, _b2;
|
|
607
|
+
const hasCardTokens = !!((_b2 = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.tokens) == null ? void 0 : _b2.length);
|
|
590
608
|
const onClick = () => {
|
|
591
609
|
var _a3;
|
|
592
610
|
(_a3 = formRef.current) == null ? void 0 : _a3.resetValidation();
|
|
@@ -649,7 +667,7 @@ const Card = w((props, ref) => {
|
|
|
649
667
|
[EFieldType.CVV]: null
|
|
650
668
|
});
|
|
651
669
|
const onFieldValidStatusChanged = (data) => {
|
|
652
|
-
var _a2, _b2,
|
|
670
|
+
var _a2, _b2, _c2, _d2;
|
|
653
671
|
const fieldRef = splitCardInfo ? fieldRefMap[data.fieldType] : combinedCardInfoRef;
|
|
654
672
|
const error = data.errorTip && i18n.get(data.errorTip);
|
|
655
673
|
if (!splitCardInfo) {
|
|
@@ -670,10 +688,10 @@ const Card = w((props, ref) => {
|
|
|
670
688
|
if (isSuccess) {
|
|
671
689
|
(_b2 = fieldRef.current) == null ? void 0 : _b2.resetValidation("success");
|
|
672
690
|
} else {
|
|
673
|
-
(
|
|
691
|
+
(_c2 = fieldRef.current) == null ? void 0 : _c2.resetValidation("unValidate");
|
|
674
692
|
}
|
|
675
693
|
} else {
|
|
676
|
-
(
|
|
694
|
+
(_d2 = fieldRef.current) == null ? void 0 : _d2.resetValidation(data.status, error);
|
|
677
695
|
}
|
|
678
696
|
setTimeout(() => {
|
|
679
697
|
validateFormSilently();
|
|
@@ -741,7 +759,7 @@ const Card = w((props, ref) => {
|
|
|
741
759
|
) });
|
|
742
760
|
};
|
|
743
761
|
const CardSplitInfo = () => {
|
|
744
|
-
var _a2, _b2,
|
|
762
|
+
var _a2, _b2, _c2, _d2;
|
|
745
763
|
return /* @__PURE__ */ u(b, { children: [
|
|
746
764
|
/* @__PURE__ */ u("div", { children: [
|
|
747
765
|
/* @__PURE__ */ u("div", { className: bem("card-number-wrapper"), children: [
|
|
@@ -761,7 +779,7 @@ const Card = w((props, ref) => {
|
|
|
761
779
|
CardBrands,
|
|
762
780
|
{
|
|
763
781
|
className: bem("card-brands"),
|
|
764
|
-
supportedCardBrands: (
|
|
782
|
+
supportedCardBrands: (_d2 = (_c2 = session == null ? void 0 : session.checkout) == null ? void 0 : _c2.supportMethods) == null ? void 0 : _d2.filter(Boolean)
|
|
765
783
|
}
|
|
766
784
|
)
|
|
767
785
|
] }),
|
|
@@ -786,13 +804,12 @@ const Card = w((props, ref) => {
|
|
|
786
804
|
] });
|
|
787
805
|
};
|
|
788
806
|
const PaymentForm = () => {
|
|
789
|
-
var _a2;
|
|
790
807
|
return /* @__PURE__ */ u(Form, { form, ref: setFormRef, onFormChange: (form2) => setForm(form2), children: /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, PAY_FORM_CLASS_NAME, bem()), children: [
|
|
791
808
|
Email(),
|
|
792
809
|
splitCardInfo ? CardSplitInfo() : CardCombineInfo(),
|
|
793
810
|
CardHolderName(),
|
|
794
811
|
Address(),
|
|
795
|
-
(
|
|
812
|
+
StorePaymentTip(),
|
|
796
813
|
/* @__PURE__ */ u("div", { className: PAY_FORM_FOOTER_CLASS_NAME, children: [
|
|
797
814
|
isShowStoreCheckBox && StoreCheckBox(),
|
|
798
815
|
ErrorMessage(),
|
|
@@ -801,15 +818,15 @@ const Card = w((props, ref) => {
|
|
|
801
818
|
] }) });
|
|
802
819
|
};
|
|
803
820
|
const FastPaymentForm = () => {
|
|
804
|
-
var _a2, _b2,
|
|
821
|
+
var _a2, _b2, _c2, _d2;
|
|
805
822
|
return /* @__PURE__ */ u(Form, { form, ref: setFormRef, onFormChange: (form2) => setForm(form2), children: /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, PAY_FORM_CLASS_NAME, bem()), children: [
|
|
806
823
|
Email(),
|
|
807
824
|
/* @__PURE__ */ u("div", { className: bem("card-selector-wrapper"), children: [
|
|
808
825
|
/* @__PURE__ */ u(
|
|
809
826
|
CardSelector,
|
|
810
827
|
{
|
|
811
|
-
value: (
|
|
812
|
-
cardList: (
|
|
828
|
+
value: (_c2 = (_b2 = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.tokens) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.token,
|
|
829
|
+
cardList: (_d2 = session == null ? void 0 : session.checkout) == null ? void 0 : _d2.tokens,
|
|
813
830
|
disabled,
|
|
814
831
|
onClickEdit: onEditOtherCard,
|
|
815
832
|
onClickChange: onClickChangeCard,
|
|
@@ -844,7 +861,7 @@ const Card = w((props, ref) => {
|
|
|
844
861
|
i18n,
|
|
845
862
|
disabled,
|
|
846
863
|
checkoutId: core.id,
|
|
847
|
-
sessionMode: (
|
|
864
|
+
sessionMode: (_f = session.checkout) == null ? void 0 : _f.sessionMode,
|
|
848
865
|
supportedCardBrands,
|
|
849
866
|
style: inputStyle || defaultInputStyleConfig,
|
|
850
867
|
core,
|
|
@@ -868,7 +885,7 @@ const Card = w((props, ref) => {
|
|
|
868
885
|
ThreeDSAuth,
|
|
869
886
|
{
|
|
870
887
|
show: showThreeDSModal,
|
|
871
|
-
theme: (
|
|
888
|
+
theme: (_g = session == null ? void 0 : session.checkout) == null ? void 0 : _g.theme,
|
|
872
889
|
onClose: handleCloseThreeDSModal,
|
|
873
890
|
checkoutId: core.id,
|
|
874
891
|
...threeDSInfo
|
|
@@ -33,7 +33,9 @@ import { MbWay } from "../wallets/MbWay/MbWay.js";
|
|
|
33
33
|
import { Multibanco } from "../wallets/Multibanco/Multibanco.js";
|
|
34
34
|
import { PayU } from "../wallets/PayU/PayU.js";
|
|
35
35
|
import { Satispay } from "../wallets/Satispay/Satispay.js";
|
|
36
|
-
import {
|
|
36
|
+
import { AlipayPlus } from "../wallets/AlipayPlus/AlipayPlus.js";
|
|
37
|
+
import { Alipay } from "../wallets/Alipay/Alipay.js";
|
|
38
|
+
import { AlipayHK } from "../wallets/AlipayHK/AlipayHK.js";
|
|
37
39
|
import { WechatPay } from "../wallets/WechatPay/WechatPay.js";
|
|
38
40
|
import { PayByBank } from "../wallets/PayByBank/PayByBank.js";
|
|
39
41
|
import { Fpx } from "../wallets/Fpx/Fpx.js";
|
|
@@ -97,6 +99,8 @@ import { IconPayU } from "../internal/icons/IconPayU.js";
|
|
|
97
99
|
import { IconSatispay } from "../internal/icons/IconSatispay.js";
|
|
98
100
|
import { IconWechatPayGlobal } from "../internal/icons/IconWechatPayGlobal.js";
|
|
99
101
|
import { IconAlipayPlus } from "../internal/icons/IconAlipayPlus.js";
|
|
102
|
+
import { IconAlipay } from "../internal/icons/IconAlipay.js";
|
|
103
|
+
import { IconAlipayHK } from "../internal/icons/IconAlipayHK.js";
|
|
100
104
|
import { IconPayByBank } from "../internal/icons/IconPayByBank.js";
|
|
101
105
|
import { IconFpx } from "../internal/icons/IconFpx.js";
|
|
102
106
|
import { IconDragonPay } from "../internal/icons/IconDragonPay.js";
|
|
@@ -120,7 +124,9 @@ const dropInSupportedPaymentMethods = [
|
|
|
120
124
|
...CardPaymentMethods,
|
|
121
125
|
PaymentMethod.GOOGLE_PAY,
|
|
122
126
|
PaymentMethod.APPLE_PAY,
|
|
123
|
-
PaymentMethod.
|
|
127
|
+
PaymentMethod.ALIPAY_PLUS,
|
|
128
|
+
PaymentMethod.ALIPAY_HK,
|
|
129
|
+
PaymentMethod.ALIPAY,
|
|
124
130
|
PaymentMethod.WECHAT_PAY,
|
|
125
131
|
PaymentMethod.SEPA_DEBIT,
|
|
126
132
|
PaymentMethod.BOOST,
|
|
@@ -223,7 +229,9 @@ const PaymentComponentMap = {
|
|
|
223
229
|
[PaymentCategory.LINK_AJA]: LinkAja,
|
|
224
230
|
[PaymentCategory.NU_PAY]: NuPay,
|
|
225
231
|
[PaymentCategory.WECHAT_PAY]: WechatPay,
|
|
226
|
-
[PaymentCategory.
|
|
232
|
+
[PaymentCategory.ALIPAY_PLUS]: AlipayPlus,
|
|
233
|
+
[PaymentCategory.ALIPAY]: Alipay,
|
|
234
|
+
[PaymentCategory.ALIPAY_HK]: AlipayHK,
|
|
227
235
|
[PaymentCategory.SEPA_DEBIT]: Sepa
|
|
228
236
|
};
|
|
229
237
|
const paymentCategoryOptionMap = {
|
|
@@ -423,10 +431,18 @@ const paymentCategoryOptionMap = {
|
|
|
423
431
|
icon: IconNuPay,
|
|
424
432
|
nameKey: "dropIn.nuPay.label"
|
|
425
433
|
},
|
|
426
|
-
[PaymentCategory.
|
|
434
|
+
[PaymentCategory.ALIPAY_PLUS]: {
|
|
427
435
|
icon: IconAlipayPlus,
|
|
436
|
+
nameKey: "dropIn.aliPayPlus.label"
|
|
437
|
+
},
|
|
438
|
+
[PaymentCategory.ALIPAY]: {
|
|
439
|
+
icon: IconAlipay,
|
|
428
440
|
nameKey: "dropIn.aliPay.label"
|
|
429
441
|
},
|
|
442
|
+
[PaymentCategory.ALIPAY_HK]: {
|
|
443
|
+
icon: IconAlipayHK,
|
|
444
|
+
nameKey: "dropIn.aliPayHK.label"
|
|
445
|
+
},
|
|
430
446
|
[PaymentCategory.WECHAT_PAY]: {
|
|
431
447
|
icon: IconWechatPayGlobal,
|
|
432
448
|
nameKey: "dropIn.wechatPay.label"
|
|
@@ -580,7 +596,7 @@ const DropIn = w((props, ref) => {
|
|
|
580
596
|
icon: () => {
|
|
581
597
|
const Icon = paymentCategoryOptionMap[category].icon;
|
|
582
598
|
const iconHeight = 24;
|
|
583
|
-
return Icon ? /* @__PURE__ */ u(Icon, { size: category === PaymentCategory.
|
|
599
|
+
return Icon ? /* @__PURE__ */ u(Icon, { size: category === PaymentCategory.ALIPAY_PLUS ? 20 : iconHeight }) : null;
|
|
584
600
|
},
|
|
585
601
|
name: i18n.get(paymentCategoryOptionMap[category].nameKey)
|
|
586
602
|
}));
|
|
@@ -12,7 +12,6 @@ import { IconRedirect } from "../internal/icons/IconRedirect.js";
|
|
|
12
12
|
import { IconScan } from "../internal/icons/IconScan.js";
|
|
13
13
|
const { bem } = useBEM("guide-card");
|
|
14
14
|
const GuideCard = (props) => {
|
|
15
|
-
var _a, _b;
|
|
16
15
|
const { type } = props;
|
|
17
16
|
const { i18n } = useI18n();
|
|
18
17
|
const redirectGuideCard = {
|
|
@@ -26,59 +25,17 @@ const GuideCard = (props) => {
|
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
27
|
const guideCardInfoMap = {
|
|
29
|
-
[PaymentCategory.ALI_PAY]: redirectGuideCard,
|
|
30
28
|
[PaymentCategory.WECHAT_PAY]: getQRCodeGuideCard(i18n.get("common.wechatPayGlobal")),
|
|
31
|
-
[PaymentCategory.
|
|
32
|
-
[PaymentCategory.
|
|
33
|
-
[PaymentCategory.LINE_PAY]: redirectGuideCard,
|
|
34
|
-
[PaymentCategory.NINE_PAY]: redirectGuideCard,
|
|
35
|
-
[PaymentCategory.SHOPEE_PAY]: redirectGuideCard,
|
|
36
|
-
[PaymentCategory.TNG_WALLET]: redirectGuideCard,
|
|
37
|
-
[PaymentCategory.MAY_BANK_QR_PAY]: redirectGuideCard,
|
|
29
|
+
[PaymentCategory.ALIPAY]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.aliPay.label")),
|
|
30
|
+
[PaymentCategory.ALIPAY_HK]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.aliPayHK.label")),
|
|
38
31
|
[PaymentCategory.GCASH]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.gcash.label")),
|
|
39
|
-
[PaymentCategory.PAYMAYA]: redirectGuideCard,
|
|
40
32
|
[PaymentCategory.ZALOPAY]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.zalopay.label")),
|
|
41
|
-
[PaymentCategory.VIETQR]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.vietqr.label"))
|
|
42
|
-
[PaymentCategory.PIX]: redirectGuideCard,
|
|
43
|
-
[PaymentCategory.PIC_PAY]: redirectGuideCard,
|
|
44
|
-
[PaymentCategory.OPAY_WALLET]: redirectGuideCard,
|
|
45
|
-
[PaymentCategory.PAGA_WALLET]: redirectGuideCard,
|
|
46
|
-
[PaymentCategory.BANCONTACT]: redirectGuideCard,
|
|
47
|
-
[PaymentCategory.IDEAL]: redirectGuideCard,
|
|
48
|
-
[PaymentCategory.BLIK]: redirectGuideCard,
|
|
49
|
-
[PaymentCategory.OVO]: redirectGuideCard,
|
|
50
|
-
[PaymentCategory.SKRILL]: redirectGuideCard,
|
|
51
|
-
[PaymentCategory.TRUSTLY]: redirectGuideCard,
|
|
52
|
-
[PaymentCategory.P24]: redirectGuideCard,
|
|
53
|
-
[PaymentCategory.BANCOMAT_PAY]: redirectGuideCard,
|
|
54
|
-
[PaymentCategory.MY_BANK]: redirectGuideCard,
|
|
55
|
-
[PaymentCategory.BIZUM]: redirectGuideCard,
|
|
56
|
-
[PaymentCategory.EPS]: redirectGuideCard,
|
|
57
|
-
[PaymentCategory.MB_WAY]: redirectGuideCard,
|
|
58
|
-
[PaymentCategory.MULTIBANCO]: redirectGuideCard,
|
|
59
|
-
[PaymentCategory.PAY_U]: redirectGuideCard,
|
|
60
|
-
[PaymentCategory.SATISPAY]: redirectGuideCard,
|
|
61
|
-
[PaymentCategory.PAY_BY_BANK]: redirectGuideCard,
|
|
62
|
-
[PaymentCategory.FPX]: redirectGuideCard,
|
|
63
|
-
[PaymentCategory.DRAGONPAY]: redirectGuideCard,
|
|
64
|
-
[PaymentCategory.UPI]: redirectGuideCard,
|
|
65
|
-
[PaymentCategory.ONLINE_BANKING_FINLAND]: redirectGuideCard,
|
|
66
|
-
[PaymentCategory.ONLINE_BANKING_ESTONIA]: redirectGuideCard,
|
|
67
|
-
[PaymentCategory.ONLINE_BANKING_LATVIA]: redirectGuideCard,
|
|
68
|
-
[PaymentCategory.ONLINE_BANKING_LITHUANIA]: redirectGuideCard,
|
|
69
|
-
[PaymentCategory.ONLINE_BANKING_INDONESIA]: redirectGuideCard,
|
|
70
|
-
[PaymentCategory.ONLINE_BANKING_THAILAND]: redirectGuideCard,
|
|
71
|
-
[PaymentCategory.SWISH]: redirectGuideCard,
|
|
72
|
-
[PaymentCategory.TWINT]: redirectGuideCard,
|
|
73
|
-
[PaymentCategory.DOKU]: redirectGuideCard,
|
|
74
|
-
[PaymentCategory.GO_PAY]: redirectGuideCard,
|
|
75
|
-
[PaymentCategory.JENIUS]: redirectGuideCard,
|
|
76
|
-
[PaymentCategory.LINK_AJA]: redirectGuideCard,
|
|
77
|
-
[PaymentCategory.NU_PAY]: redirectGuideCard
|
|
33
|
+
[PaymentCategory.VIETQR]: isMobile() ? redirectGuideCard : getQRCodeGuideCard(i18n.get("dropIn.vietqr.label"))
|
|
78
34
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */ u("div", { className: bem("
|
|
35
|
+
const guideCardInfo = guideCardInfoMap[type] || redirectGuideCard;
|
|
36
|
+
return /* @__PURE__ */ u(b, { children: guideCardInfo && /* @__PURE__ */ u("div", { className: bem(), children: /* @__PURE__ */ u("div", { className: bem("content"), children: [
|
|
37
|
+
/* @__PURE__ */ u("div", { className: bem("icon"), children: guideCardInfo.icon }),
|
|
38
|
+
/* @__PURE__ */ u("div", { className: bem("description"), children: guideCardInfo.description })
|
|
82
39
|
] }) }) });
|
|
83
40
|
};
|
|
84
41
|
export {
|
|
@@ -11,7 +11,8 @@ import { usePayState } from "../../hooks/usePayState.js";
|
|
|
11
11
|
import { useBaseWallet } from "../../hooks/useBaseWallet.js";
|
|
12
12
|
import { DEFAULT_ADDRESS, AddressField } from "../AddressField/index.js";
|
|
13
13
|
import "../internal/Modal/Modal.js";
|
|
14
|
-
import "../
|
|
14
|
+
import "../internal/Loading/loading.js";
|
|
15
|
+
import "../business/QRCodeContent/qr-code-content.js";
|
|
15
16
|
import { NameField } from "../business/NameField/NameField.js";
|
|
16
17
|
import "../internal/Form/type.js";
|
|
17
18
|
import "../internal/Form/context.js";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { h, y, u, b } from "../../../core.js";
|
|
2
|
+
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
|
+
import { useI18n } from "../../../hooks/useI18n.js";
|
|
4
|
+
import "../../../out/fraud-detection.js";
|
|
5
|
+
import "../../../utils/card-brand/brands.js";
|
|
6
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
7
|
+
import { formatAmount } from "../../../utils/format.js";
|
|
8
|
+
import { formatTime } from "../../../utils/date.js";
|
|
9
|
+
import "../../../core/context.js";
|
|
10
|
+
import "../../../core/logger.js";
|
|
11
|
+
import { QRCode } from "../../internal/QRCode/QRCode.js";
|
|
12
|
+
import { Loading } from "../../internal/Loading/Loading2.js";
|
|
13
|
+
import "./qr-code-content.js";
|
|
14
|
+
const { bem } = useBEM("qr-code-modal");
|
|
15
|
+
const QRCodeContent = (props) => {
|
|
16
|
+
const {
|
|
17
|
+
title,
|
|
18
|
+
bgColor = "#FFFFFF",
|
|
19
|
+
textColor = "#1F1F1F",
|
|
20
|
+
borderColor = "#000000",
|
|
21
|
+
expiredTime,
|
|
22
|
+
amount,
|
|
23
|
+
icon,
|
|
24
|
+
qrCode,
|
|
25
|
+
mode = "image"
|
|
26
|
+
} = props;
|
|
27
|
+
const { i18n } = useI18n();
|
|
28
|
+
const [iframeLoaded, setIframeLoaded] = h(mode !== "iframe");
|
|
29
|
+
y(() => {
|
|
30
|
+
setIframeLoaded(mode !== "iframe");
|
|
31
|
+
}, [mode, qrCode]);
|
|
32
|
+
const useRoundBorder = !bgColor || ["transparent", "white", "#FFFFFF"].includes(bgColor);
|
|
33
|
+
const RoundBorder = () => {
|
|
34
|
+
return /* @__PURE__ */ u("div", { className: bem("round-border"), children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ u("div", { className: bem("round-border-item"), style: { borderColor } }, index)) });
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ u("div", { className: bem(), children: [
|
|
37
|
+
/* @__PURE__ */ u("div", { className: bem("title"), children: title }),
|
|
38
|
+
/* @__PURE__ */ u("div", { className: bem("container"), children: /* @__PURE__ */ u("div", { className: bem("body"), style: { backgroundColor: bgColor }, children: [
|
|
39
|
+
icon && /* @__PURE__ */ u("div", { className: bem("icon"), children: icon }),
|
|
40
|
+
/* @__PURE__ */ u("div", { className: bem("qr-code-container"), children: [
|
|
41
|
+
useRoundBorder && /* @__PURE__ */ u(RoundBorder, {}),
|
|
42
|
+
/* @__PURE__ */ u("div", { className: bem("qr-code"), children: mode === "iframe" ? /* @__PURE__ */ u(b, { children: [
|
|
43
|
+
!iframeLoaded && /* @__PURE__ */ u(Loading, { fixed: false, style: { position: "absolute" } }),
|
|
44
|
+
/* @__PURE__ */ u(
|
|
45
|
+
"iframe",
|
|
46
|
+
{
|
|
47
|
+
className: bem("iframe", { loaded: iframeLoaded }),
|
|
48
|
+
src: qrCode,
|
|
49
|
+
title,
|
|
50
|
+
width: 160,
|
|
51
|
+
height: 160,
|
|
52
|
+
frameBorder: "0",
|
|
53
|
+
onLoad: () => setIframeLoaded(true)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }) : /* @__PURE__ */ u(QRCode, { size: 160, value: qrCode }) })
|
|
57
|
+
] }),
|
|
58
|
+
expiredTime && /* @__PURE__ */ u(b, { children: [
|
|
59
|
+
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time"), children: formatTime(expiredTime) }),
|
|
60
|
+
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time-text"), children: i18n.get("qrCode.expired") })
|
|
61
|
+
] })
|
|
62
|
+
] }) }),
|
|
63
|
+
amount && /* @__PURE__ */ u("div", { className: bem("amount"), children: formatAmount(amount).jointSymbolAndCurrency() })
|
|
64
|
+
] });
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
QRCodeContent
|
|
68
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../../../core.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import "../../../core/context.js";
|
|
5
|
+
import "../../../out/fraud-detection.js";
|
|
6
|
+
import "../../../core/logger.js";
|
|
7
|
+
import "../../internal/Loading/loading.js";
|
|
8
|
+
import "./qr-code-content.js";
|
|
@@ -1,61 +1,22 @@
|
|
|
1
|
-
import { u
|
|
2
|
-
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
|
-
import { useI18n } from "../../../hooks/useI18n.js";
|
|
4
|
-
import "../../../out/fraud-detection.js";
|
|
1
|
+
import { u } from "../../../core.js";
|
|
5
2
|
import "../../../utils/card-brand/brands.js";
|
|
6
3
|
import "../../../utils/system-info/get-browser-info.js";
|
|
7
|
-
import { formatAmount } from "../../../utils/format.js";
|
|
8
|
-
import { formatTime } from "../../../utils/date.js";
|
|
9
4
|
import "../../../core/context.js";
|
|
5
|
+
import "../../../out/fraud-detection.js";
|
|
10
6
|
import "../../../core/logger.js";
|
|
11
7
|
import { useBreakpoints } from "../../../hooks/useBreakpoints.js";
|
|
12
8
|
import { Modal } from "../../internal/Modal/Modal.js";
|
|
13
|
-
import "
|
|
14
|
-
import { QRCode } from "../../internal/QRCode/QRCode.js";
|
|
15
|
-
const { bem } = useBEM("qr-code-modal");
|
|
9
|
+
import { QRCodeContent } from "../QRCodeContent/QRCodeContent.js";
|
|
16
10
|
const QRCodeModal = (props) => {
|
|
17
|
-
const {
|
|
18
|
-
title,
|
|
19
|
-
bgColor = "#FFFFFF",
|
|
20
|
-
textColor = "#1F1F1F",
|
|
21
|
-
borderColor = "#000000",
|
|
22
|
-
expiredTime,
|
|
23
|
-
amount,
|
|
24
|
-
icon,
|
|
25
|
-
qrCode,
|
|
26
|
-
onClose
|
|
27
|
-
} = props;
|
|
28
|
-
const { i18n } = useI18n();
|
|
11
|
+
const { onClose } = props;
|
|
29
12
|
const breakpoints = useBreakpoints();
|
|
30
|
-
const useRoundBorder = !bgColor || ["transparent", "white", "#FFFFFF"].includes(bgColor);
|
|
31
|
-
const RoundBorder = () => {
|
|
32
|
-
return /* @__PURE__ */ u("div", {
|
|
33
|
-
className: bem("round-border"),
|
|
34
|
-
// 表示4个边角
|
|
35
|
-
children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ u("div", { className: bem("round-border-item"), style: { borderColor } }, index))
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
13
|
return /* @__PURE__ */ u(
|
|
39
14
|
Modal,
|
|
40
15
|
{
|
|
41
16
|
show: true,
|
|
42
17
|
width: breakpoints.smaller("xs") ? "90vw" : "340px",
|
|
43
18
|
onChange: (status) => !status && (onClose == null ? void 0 : onClose()),
|
|
44
|
-
children: /* @__PURE__ */ u(
|
|
45
|
-
/* @__PURE__ */ u("div", { className: bem("title"), children: title }),
|
|
46
|
-
/* @__PURE__ */ u("div", { className: bem("container"), children: /* @__PURE__ */ u("div", { className: bem("body"), style: { backgroundColor: bgColor }, children: [
|
|
47
|
-
icon && /* @__PURE__ */ u("div", { className: bem("icon"), children: icon }),
|
|
48
|
-
/* @__PURE__ */ u("div", { className: bem("qr-code-container"), children: [
|
|
49
|
-
useRoundBorder && /* @__PURE__ */ u(RoundBorder, {}),
|
|
50
|
-
/* @__PURE__ */ u("div", { className: bem("qr-code"), children: /* @__PURE__ */ u(QRCode, { size: 160, value: qrCode }) })
|
|
51
|
-
] }),
|
|
52
|
-
expiredTime && /* @__PURE__ */ u(b, { children: [
|
|
53
|
-
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time"), children: formatTime(expiredTime) }),
|
|
54
|
-
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time-text"), children: i18n.get("qrCode.expired") })
|
|
55
|
-
] })
|
|
56
|
-
] }) }),
|
|
57
|
-
amount && /* @__PURE__ */ u("div", { className: bem("amount"), children: formatAmount(amount).jointSymbolAndCurrency() })
|
|
58
|
-
] })
|
|
19
|
+
children: /* @__PURE__ */ u(QRCodeContent, { ...props, mode: "image" })
|
|
59
20
|
}
|
|
60
21
|
);
|
|
61
22
|
};
|
|
@@ -5,4 +5,5 @@ import "../../../core/context.js";
|
|
|
5
5
|
import "../../../out/fraud-detection.js";
|
|
6
6
|
import "../../../core/logger.js";
|
|
7
7
|
import "../../internal/Modal/Modal.js";
|
|
8
|
-
import "
|
|
8
|
+
import "../../internal/Loading/loading.js";
|
|
9
|
+
import "../QRCodeContent/qr-code-content.js";
|
|
@@ -5,7 +5,8 @@ import "../../core/context.js";
|
|
|
5
5
|
import "../../out/fraud-detection.js";
|
|
6
6
|
import "../../core/logger.js";
|
|
7
7
|
import "../internal/Modal/Modal.js";
|
|
8
|
-
import "
|
|
8
|
+
import "../internal/Loading/loading.js";
|
|
9
|
+
import "./QRCodeContent/qr-code-content.js";
|
|
9
10
|
import "../internal/Form/type.js";
|
|
10
11
|
import "../internal/Form/context.js";
|
|
11
12
|
import "../internal/Form/FormItem.js";
|
|
@@ -58,7 +58,9 @@ import "./wallets/MbWay/MbWay.js";
|
|
|
58
58
|
import "./wallets/Multibanco/Multibanco.js";
|
|
59
59
|
import "./wallets/PayU/PayU.js";
|
|
60
60
|
import "./wallets/Satispay/Satispay.js";
|
|
61
|
-
import "./wallets/
|
|
61
|
+
import "./wallets/AlipayPlus/AlipayPlus.js";
|
|
62
|
+
import "./wallets/Alipay/Alipay.js";
|
|
63
|
+
import "./wallets/AlipayHK/AlipayHK.js";
|
|
62
64
|
import "./wallets/WechatPay/WechatPay.js";
|
|
63
65
|
import "./wallets/PayByBank/PayByBank.js";
|
|
64
66
|
import "./wallets/Fpx/Fpx.js";
|
|
@@ -10,7 +10,7 @@ import "../../../out/fraud-detection.js";
|
|
|
10
10
|
import "../../../core/logger.js";
|
|
11
11
|
const { bem } = useBEM("button");
|
|
12
12
|
function Button(props) {
|
|
13
|
-
const { style, className, children, icon, loading, disabled, dashed } = props;
|
|
13
|
+
const { style, className, children, icon, loading, disabled, dashed, ghost } = props;
|
|
14
14
|
function onClick(event) {
|
|
15
15
|
var _a;
|
|
16
16
|
if (loading || disabled)
|
|
@@ -20,7 +20,7 @@ function Button(props) {
|
|
|
20
20
|
return /* @__PURE__ */ u(
|
|
21
21
|
"button",
|
|
22
22
|
{
|
|
23
|
-
className: normalizedClass(COMMON_CLASS_NAME, bem({ loading, disabled, dashed }), className),
|
|
23
|
+
className: normalizedClass(COMMON_CLASS_NAME, bem({ loading, disabled, dashed, ghost }), className),
|
|
24
24
|
style,
|
|
25
25
|
onClick,
|
|
26
26
|
children: [
|