@paykka/card-checkout-ui 0.11.6 → 0.13.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/dist/card-checkout-ui.js +19 -19
- package/dist/card-checkout-ui.umd.cjs +19 -19
- package/dist/es/_commonjsHelpers.js +82 -1
- package/dist/es/api/index.js +1 -0
- package/dist/es/api/modules/address/index.js +9 -9
- package/dist/es/api/modules/ali-pay/index.js +10 -49
- package/dist/es/api/modules/apple-pay/index.js +13 -59
- package/dist/es/api/modules/boost/index.js +8 -48
- package/dist/es/api/modules/card/index.js +10 -54
- package/dist/es/api/modules/checkout/index.js +11 -9
- package/dist/es/api/modules/checkout/map.js +25 -18
- package/dist/es/api/modules/encrypted-card/index.js +3 -2
- package/dist/es/api/modules/gcash/index.js +8 -48
- package/dist/es/api/modules/get-browser-params.js +4 -1
- package/dist/es/api/modules/google-pay/index.js +10 -56
- package/dist/es/api/modules/grab-pay/index.js +8 -48
- package/dist/es/api/modules/index.js +1 -0
- package/dist/es/api/modules/line-pay/index.js +8 -48
- package/dist/es/api/modules/map.js +17 -11
- package/dist/es/api/modules/may-bank-qr-pay/index.js +8 -48
- package/dist/es/api/modules/nine-pay/index.js +8 -48
- package/dist/es/api/modules/paymaya/index.js +8 -48
- package/dist/es/api/modules/risk/index.js +2 -1
- package/dist/es/api/modules/sepa/index.js +10 -51
- package/dist/es/api/modules/shopee-pay/index.js +8 -48
- package/dist/es/api/modules/threeDS/index.js +3 -0
- package/dist/es/api/modules/tng-wallet/index.js +8 -48
- package/dist/es/api/modules/wechat-pay/index.js +10 -51
- package/dist/es/api/modules/zalopay/index.js +16 -0
- package/dist/es/api/utils/index.js +59 -0
- package/dist/es/components/AddressField/index.js +37 -37
- package/dist/es/components/AliPay/index.js +158 -111
- package/dist/es/components/ApplePay/index.js +99 -67
- package/dist/es/components/Boost/index.js +91 -70
- package/dist/es/components/Card/index.js +114 -107
- package/dist/es/components/CardSelector/index.js +1 -1
- package/dist/es/components/DropIn/index.js +12 -4
- package/dist/es/components/EncryptedCard/index.js +6 -2
- package/dist/es/components/GooglePay/index.js +94 -60
- package/dist/es/components/GrabPay/index.js +91 -70
- package/dist/es/components/GuideCard/index.js +10 -7
- package/dist/es/components/LinePay/index.js +91 -70
- package/dist/es/components/MayBankQRPay/index.js +302 -275
- package/dist/es/components/NinePay/index.js +91 -70
- package/dist/es/components/SecuredFieldsProvider/index.js +26 -9
- package/dist/es/components/SecuredIframe/index.js +40 -61
- package/dist/es/components/Sepa/index.js +72 -53
- package/dist/es/components/ShopeePay/index.js +91 -70
- package/dist/es/components/SubmitButton/index.js +8 -7
- package/dist/es/components/TNGWallet/index.js +91 -70
- package/dist/es/components/ThreeDS/index.js +32 -7
- package/dist/es/components/WechatPay/index.js +151 -102
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +26 -6
- package/dist/es/components/index.js +1 -0
- package/dist/es/components/internal/Form/FormItem.js +1 -1
- package/dist/es/components/internal/Form/util.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/Select/Select.js +19 -8
- package/dist/es/components/internal/Select/SelectMenu.js +2 -2
- package/dist/es/components/internal/Select/SelectMenuItem.js +12 -4
- package/dist/es/components/internal/icons/IconError.js +7 -4
- package/dist/es/components/internal/icons/IconZalopay.js +47 -0
- package/dist/es/components/internal/icons/IconZalopayComplete.js +48 -0
- package/dist/es/components/wallets/GCash/GCash.js +80 -56
- package/dist/es/components/wallets/Paymaya/Paymaya.js +91 -70
- package/dist/es/components/wallets/Zalopay/Zalopay.js +381 -0
- package/dist/es/components/wallets/Zalopay/index.js +1 -0
- package/dist/es/components/wallets/Zalopay/type.js +1 -0
- package/dist/es/components/wallets/Zalopay/zalopay2.js +1 -0
- package/dist/es/config.js +5 -5
- package/dist/es/constant.js +8 -2
- package/dist/es/core/{Address.js → address.js} +8 -16
- package/dist/es/core/{PayKKaCheckout.js → checkout.js} +101 -27
- package/dist/es/core/create.js +1 -1
- package/dist/es/core/query.js +3 -2
- package/dist/es/core/{Session.js → session.js} +28 -32
- package/dist/es/core/theme.js +65 -0
- package/dist/es/core.js +0 -4
- package/dist/es/hooks/usePayment.js +14 -0
- package/dist/es/i18n/locales/de-DE.js +3 -1
- package/dist/es/i18n/locales/en-GB.js +3 -1
- package/dist/es/i18n/locales/es-ES.js +3 -1
- package/dist/es/i18n/locales/fr-FR.js +3 -1
- package/dist/es/i18n/locales/ja-JP.js +3 -1
- package/dist/es/i18n/locales/ko-KR.js +3 -1
- package/dist/es/i18n/locales/nl-NL.js +3 -1
- package/dist/es/i18n/locales/pt-PT.js +3 -1
- package/dist/es/i18n/locales/ru-RU.js +3 -1
- package/dist/es/i18n/locales/zh-CN.js +3 -1
- package/dist/es/i18n/locales/zh-HK.js +3 -1
- package/dist/es/i18n/locales/zh-TW.js +3 -1
- package/dist/es/index.js +21 -7
- package/dist/es/style.css +1 -1
- package/dist/es/types/index.js +7 -0
- package/dist/es/utils/colors.js +5 -1
- package/dist/es/utils/format.js +0 -5
- package/dist/es/utils/object.js +31 -1
- package/dist/es/utils/payment.js +82 -0
- package/dist/es/utils/redirect.js +4 -4
- package/dist/es/utils/string.js +10 -0
- package/dist/es/utils/system-info/is-ua-webview.js +14 -12
- package/dist/es/utils/theme.js +7 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/address/index.d.ts +15 -6
- package/dist/types/api/modules/ali-pay/index.d.ts +3 -19
- package/dist/types/api/modules/apple-pay/index.d.ts +4 -14
- package/dist/types/api/modules/boost/index.d.ts +3 -23
- package/dist/types/api/modules/card/index.d.ts +3 -30
- package/dist/types/api/modules/checkout/index.d.ts +3 -3
- package/dist/types/api/modules/checkout/map.d.ts +3 -3
- package/dist/types/api/modules/checkout/type.d.ts +33 -4
- package/dist/types/api/modules/gcash/index.d.ts +3 -23
- package/dist/types/api/modules/get-browser-params.d.ts +1 -0
- package/dist/types/api/modules/google-pay/index.d.ts +3 -13
- package/dist/types/api/modules/grab-pay/index.d.ts +3 -23
- package/dist/types/api/modules/index.d.ts +1 -0
- package/dist/types/api/modules/line-pay/index.d.ts +3 -23
- package/dist/types/api/modules/map.d.ts +2 -2
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +3 -23
- package/dist/types/api/modules/nine-pay/index.d.ts +3 -23
- package/dist/types/api/modules/paymaya/index.d.ts +3 -23
- package/dist/types/api/modules/sepa/index.d.ts +3 -24
- package/dist/types/api/modules/shopee-pay/index.d.ts +3 -23
- package/dist/types/api/modules/tng-wallet/index.d.ts +3 -23
- package/dist/types/api/modules/type.d.ts +74 -21
- package/dist/types/api/modules/wechat-pay/index.d.ts +3 -20
- package/dist/types/api/modules/zalopay/index.d.ts +4 -0
- package/dist/types/api/utils/index.d.ts +48 -0
- package/dist/types/components/AddressField/type.d.ts +3 -9
- package/dist/types/components/AliPay/AliPay.d.ts +6 -2
- package/dist/types/components/AliPay/type.d.ts +15 -2
- package/dist/types/components/ApplePay/ApplePay.d.ts +6 -2
- package/dist/types/components/ApplePay/type.d.ts +10 -14
- package/dist/types/components/ApplePay/utils.d.ts +1 -1
- package/dist/types/components/Boost/Boost.d.ts +6 -2
- package/dist/types/components/Boost/type.d.ts +2 -24
- package/dist/types/components/Card/Card.d.ts +6 -2
- package/dist/types/components/Card/type.d.ts +3 -43
- package/dist/types/components/DropIn/DropIn.d.ts +6 -2
- package/dist/types/components/DropIn/type.d.ts +4 -10
- package/dist/types/components/GooglePay/GooglePay.d.ts +6 -2
- package/dist/types/components/GooglePay/createGooglePay.d.ts +2 -1
- package/dist/types/components/GooglePay/type.d.ts +10 -26
- package/dist/types/components/GrabPay/GrabPay.d.ts +6 -2
- package/dist/types/components/GrabPay/type.d.ts +3 -25
- package/dist/types/components/LinePay/LinePay.d.ts +6 -2
- package/dist/types/components/LinePay/type.d.ts +3 -25
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -2
- package/dist/types/components/MayBankQRPay/type.d.ts +3 -25
- package/dist/types/components/NinePay/NinePay.d.ts +6 -2
- package/dist/types/components/NinePay/type.d.ts +3 -25
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +5 -0
- package/dist/types/components/SecuredIframe/HiddenIframe.d.ts +3 -1
- package/dist/types/components/Sepa/Sepa.d.ts +6 -2
- package/dist/types/components/Sepa/type.d.ts +3 -2
- package/dist/types/components/ShopeePay/ShopeePay.d.ts +6 -2
- package/dist/types/components/ShopeePay/type.d.ts +3 -25
- package/dist/types/components/TNGWallet/TNGWallet.d.ts +6 -2
- package/dist/types/components/TNGWallet/type.d.ts +3 -25
- package/dist/types/components/ThreeDS/components/ThreeDSAuth/type.d.ts +2 -0
- package/dist/types/components/WechatPay/WechatPay.d.ts +6 -2
- package/dist/types/components/WechatPay/type.d.ts +15 -2
- package/dist/types/components/business/QRCodeModal/type.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/internal/Loading/Loading.d.ts +1 -0
- package/dist/types/components/internal/Select/SelectMenu.d.ts +1 -1
- package/dist/types/components/internal/icons/IconZalopay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconZalopayComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +6 -2
- package/dist/types/components/wallets/GCash/type.d.ts +3 -35
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -2
- package/dist/types/components/wallets/Paymaya/type.d.ts +3 -25
- package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +10 -0
- package/dist/types/components/wallets/Zalopay/index.d.ts +2 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +39 -0
- package/dist/types/config.d.ts +2 -4
- package/dist/types/constant.d.ts +3 -1
- package/dist/types/core/{Address.d.ts → address.d.ts} +23 -24
- package/dist/types/core/{PayKKaCheckout.d.ts → checkout.d.ts} +9 -3
- package/dist/types/core/context.d.ts +3 -2
- package/dist/types/core/index.d.ts +3 -2
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/core/session.d.ts +23 -0
- package/dist/types/core/theme.d.ts +7 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/usePayment.d.ts +8 -0
- package/dist/types/i18n/locales/de-DE.d.ts +2 -0
- package/dist/types/i18n/locales/en-GB.d.ts +2 -0
- package/dist/types/i18n/locales/es-ES.d.ts +2 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +2 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +2 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +2 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +2 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +2 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +2 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +2 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +2 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types/index.d.ts +70 -32
- package/dist/types/types/message.d.ts +30 -25
- package/dist/types/utils/card-brand/index.d.ts +3 -3
- package/dist/types/utils/colors.d.ts +1 -0
- package/dist/types/utils/index.d.ts +4 -2
- package/dist/types/utils/object.d.ts +7 -0
- package/dist/types/utils/payment.d.ts +37 -0
- package/dist/types/utils/string.d.ts +1 -0
- package/dist/types/utils/style.d.ts +1 -1
- package/dist/types/utils/system-info/is-ua-webview.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +4 -0
- package/package.json +3 -3
- package/dist/es/utils/deep-freeze.js +0 -13
- package/dist/es/utils/obj.js +0 -22
- package/dist/types/core/Session.d.ts +0 -16
- package/dist/types/utils/deep-freeze.d.ts +0 -1
- package/dist/types/utils/obj.d.ts +0 -6
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { w, A, F, h, y, q, u } from "../../core.js";
|
|
1
|
+
import { w, A, F, h, y, q, u, b } from "../../core.js";
|
|
2
2
|
import { isTimeoutError } from "../../api/http.js";
|
|
3
|
-
import { COMMON_CLASS_NAME, PaymentType } from "../../constant.js";
|
|
4
3
|
import "../../utils/card-brand/brands.js";
|
|
5
4
|
import "../../utils/system-info/get-browser-info.js";
|
|
6
|
-
import {
|
|
5
|
+
import { normalizedClass, formatAmount } from "../../utils/format.js";
|
|
6
|
+
import { formatPaymentResult } from "../../utils/payment.js";
|
|
7
|
+
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
8
|
+
import { COMMON_CLASS_NAME, PaymentType, PaymentMethod, SessionMode } from "../../constant.js";
|
|
7
9
|
import { getWechatPayInfo, wechatPay } from "../../api/modules/wechat-pay/index.js";
|
|
8
10
|
import { CoreContext } from "../../core/context.js";
|
|
9
11
|
import { PayKKaError } from "../../core/error.js";
|
|
10
|
-
import { createAddressCore } from "../../core/Address.js";
|
|
11
12
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
12
13
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
13
14
|
import { useRetry } from "../../hooks/useRetry.js";
|
|
14
15
|
import { AddressField } from "../AddressField/index.js";
|
|
15
|
-
import {
|
|
16
|
+
import { createEmailCore, EmailField } from "../EmailField/EmailField.js";
|
|
16
17
|
import "../internal/Form/type.js";
|
|
17
18
|
import "../internal/Form/context.js";
|
|
18
19
|
import "../internal/Form/FormItem.js";
|
|
@@ -21,10 +22,11 @@ import { Info } from "../internal/Info/Info.js";
|
|
|
21
22
|
import { RecurringTip } from "../RecurringTip/index.js";
|
|
22
23
|
import { SubmitButton } from "../SubmitButton/index.js";
|
|
23
24
|
const { bem } = useBEM("wechat-pay");
|
|
25
|
+
const fieldClassNames = bem("field");
|
|
24
26
|
const WechatPay = w((props, ref) => {
|
|
25
|
-
var _a
|
|
26
|
-
const { session } = props;
|
|
27
|
-
const
|
|
27
|
+
var _a;
|
|
28
|
+
const { session, core, showEmail = false, showAddress = false } = props;
|
|
29
|
+
const addressCore = core.getAddressCore();
|
|
28
30
|
const emailState = createEmailCore();
|
|
29
31
|
const emailFieldRef = A(null);
|
|
30
32
|
F(ref, () => ({
|
|
@@ -40,13 +42,21 @@ const WechatPay = w((props, ref) => {
|
|
|
40
42
|
},
|
|
41
43
|
updateAddress: () => {
|
|
42
44
|
var _a2;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
if (!(fieldStatus == null ? void 0 : fieldStatus.address.show))
|
|
46
|
+
return;
|
|
47
|
+
const newForm = Object.assign(form, { address: addressCore.getAddressState() });
|
|
48
|
+
setForm(newForm);
|
|
49
|
+
(_a2 = addressFieldRef.current) == null ? void 0 : _a2.update(addressCore.getAddressState());
|
|
50
|
+
validateForm();
|
|
45
51
|
},
|
|
46
52
|
updateEmail: () => {
|
|
47
53
|
var _a2;
|
|
48
|
-
|
|
54
|
+
if (!(fieldStatus == null ? void 0 : fieldStatus.email.show))
|
|
55
|
+
return;
|
|
56
|
+
const newForm = Object.assign(form, { email: emailState.email });
|
|
57
|
+
setForm(newForm);
|
|
49
58
|
(_a2 = emailFieldRef.current) == null ? void 0 : _a2.update(emailState.email);
|
|
59
|
+
validateForm();
|
|
50
60
|
}
|
|
51
61
|
}));
|
|
52
62
|
const { setErrorMsg, i18n, errorMsg, sessionReady } = usePayState(session, props.core);
|
|
@@ -55,19 +65,19 @@ const WechatPay = w((props, ref) => {
|
|
|
55
65
|
const [form, setForm] = h({
|
|
56
66
|
email: "",
|
|
57
67
|
address: {
|
|
58
|
-
country:
|
|
59
|
-
province:
|
|
60
|
-
city:
|
|
61
|
-
area:
|
|
62
|
-
postCode:
|
|
63
|
-
address1:
|
|
64
|
-
address2:
|
|
68
|
+
country: void 0,
|
|
69
|
+
province: void 0,
|
|
70
|
+
city: void 0,
|
|
71
|
+
area: void 0,
|
|
72
|
+
postCode: void 0,
|
|
73
|
+
address1: void 0,
|
|
74
|
+
address2: void 0
|
|
65
75
|
}
|
|
66
76
|
});
|
|
67
77
|
const [validated, setValidated] = h(false);
|
|
68
|
-
const
|
|
69
|
-
const [requiredBill, setRequiredBill] = h(false);
|
|
78
|
+
const [fieldStatus, setFieldStatus] = h();
|
|
70
79
|
const addressFieldRef = A(null);
|
|
80
|
+
const [isCheckoutEnabled, setIsCheckoutEnabled] = h(false);
|
|
71
81
|
function validateForm() {
|
|
72
82
|
var _a2;
|
|
73
83
|
(_a2 = formRef.current) == null ? void 0 : _a2.validate(void 0, false).then(() => {
|
|
@@ -76,23 +86,46 @@ const WechatPay = w((props, ref) => {
|
|
|
76
86
|
setValidated(false);
|
|
77
87
|
});
|
|
78
88
|
}
|
|
89
|
+
const initFieldStatus = () => {
|
|
90
|
+
const { field, sessionMode } = session.checkout;
|
|
91
|
+
const { email, address } = field;
|
|
92
|
+
if (sessionMode === SessionMode.COMPONENT) {
|
|
93
|
+
if (email.disabled) {
|
|
94
|
+
email.show = showEmail;
|
|
95
|
+
}
|
|
96
|
+
if (showAddress && !(address == null ? void 0 : address.show)) {
|
|
97
|
+
address.show = true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
setFieldStatus({ ...field });
|
|
101
|
+
};
|
|
79
102
|
y(() => {
|
|
80
103
|
validateForm();
|
|
81
104
|
}, [form]);
|
|
105
|
+
const processOnSuccess = (res) => {
|
|
106
|
+
var _a2, _b;
|
|
107
|
+
setSubmitButtonStatus("success");
|
|
108
|
+
(_b = props.onSuccess) == null ? void 0 : _b.call(
|
|
109
|
+
props,
|
|
110
|
+
formatPaymentResult({
|
|
111
|
+
...res,
|
|
112
|
+
returnUrl: (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.returnUrl
|
|
113
|
+
})
|
|
114
|
+
);
|
|
115
|
+
};
|
|
82
116
|
y(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
form.email = (session == null ? void 0 : session.checkout.bill.email) ?? "";
|
|
90
|
-
disabledEmail.current = !!(session == null ? void 0 : session.checkout.bill.email);
|
|
91
|
-
(session == null ? void 0 : session.checkout.bill.billingAddressCollection) === "REQUIRED" ? setRequiredBill(true) : setRequiredBill(false);
|
|
92
|
-
!requiredBill && setTimeout(() => {
|
|
93
|
-
validateForm();
|
|
94
|
-
}, 100);
|
|
117
|
+
if (!sessionReady) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const { bill = {}, supportMethods = [], country } = (session == null ? void 0 : session.checkout) || {};
|
|
121
|
+
if (!supportMethods.includes(PaymentMethod.WECHAT_PAY)) {
|
|
122
|
+
return;
|
|
95
123
|
}
|
|
124
|
+
initFieldStatus();
|
|
125
|
+
setIsCheckoutEnabled(true);
|
|
126
|
+
country && addressCore.setCountry(country);
|
|
127
|
+
form.email = bill.email ?? "";
|
|
128
|
+
form.address.country = country;
|
|
96
129
|
}, [sessionReady]);
|
|
97
130
|
const onTimeout = q(
|
|
98
131
|
(message) => {
|
|
@@ -110,68 +143,82 @@ const WechatPay = w((props, ref) => {
|
|
|
110
143
|
onTimeout: () => onTimeout(i18n.get("common.queryTimeout"))
|
|
111
144
|
}
|
|
112
145
|
);
|
|
146
|
+
const getPaymentParams = async () => {
|
|
147
|
+
var _a2;
|
|
148
|
+
return {
|
|
149
|
+
sessionId: session.sessionId,
|
|
150
|
+
clientKey: session.clientKey,
|
|
151
|
+
bill: (fieldStatus == null ? void 0 : fieldStatus.address.show) ? {
|
|
152
|
+
email: form.email,
|
|
153
|
+
addressLine1: form.address.address1,
|
|
154
|
+
addressLine2: form.address.address2,
|
|
155
|
+
postalCode: form.address.postCode,
|
|
156
|
+
country: form.address.country,
|
|
157
|
+
district: form.address.area,
|
|
158
|
+
state: form.address.province ? addressCore.getLabel(form.address.province, addressCore.getProvinceOption()) ?? form.address.province : void 0,
|
|
159
|
+
city: form.address.city ? addressCore.getLabel(form.address.city, addressCore.getCityOptions()) ?? form.address.city : void 0
|
|
160
|
+
} : {
|
|
161
|
+
email: form.email
|
|
162
|
+
},
|
|
163
|
+
channelUserId: await ((_a2 = props.onGetOpenId) == null ? void 0 : _a2.call(props)),
|
|
164
|
+
payment: {
|
|
165
|
+
paymentMethod: PaymentMethod.WECHAT_PAY
|
|
166
|
+
},
|
|
167
|
+
browser: await getBrowserParams()
|
|
168
|
+
};
|
|
169
|
+
};
|
|
113
170
|
async function pay(search = false, timeout) {
|
|
114
|
-
var _a2,
|
|
171
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
115
172
|
try {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
clientKey: session.clientKey,
|
|
126
|
-
bill: requiredBill ? {
|
|
127
|
-
email: form.email,
|
|
128
|
-
...form.address,
|
|
129
|
-
province: addressState.getLabel(
|
|
130
|
-
form.address.province,
|
|
131
|
-
addressState.getProvinceOption()
|
|
132
|
-
) ?? form.address.province,
|
|
133
|
-
city: addressState.getLabel(form.address.city, addressState.getCityOptions()) ?? form.address.city
|
|
134
|
-
} : {
|
|
135
|
-
email: form.email
|
|
173
|
+
const requestOptions = { locale: i18n.locale, timeout };
|
|
174
|
+
let res = null;
|
|
175
|
+
if (search) {
|
|
176
|
+
const extraParams = (_b = (_a2 = core.config)._getExtraParams) == null ? void 0 : _b.call(_a2, "query", PaymentMethod.WECHAT_PAY);
|
|
177
|
+
res = await getWechatPayInfo(
|
|
178
|
+
{
|
|
179
|
+
sessionId: session.sessionId,
|
|
180
|
+
clientKey: session.clientKey,
|
|
181
|
+
paymentMethod: PaymentMethod.WECHAT_PAY
|
|
136
182
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
183
|
+
extraParams,
|
|
184
|
+
requestOptions
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", PaymentMethod.WECHAT_PAY);
|
|
188
|
+
res = await wechatPay(await getPaymentParams(), extraParams, requestOptions);
|
|
189
|
+
}
|
|
190
|
+
const { status, orderStatus, errorMessage, payInfo, errorCode, sessionId } = res;
|
|
191
|
+
sessionId && (session.sessionId = sessionId);
|
|
192
|
+
!search && ((_e = props.onSubmitResponse) == null ? void 0 : _e.call(props, res));
|
|
144
193
|
if (status === "PROCESSING") {
|
|
145
194
|
if (!orderStatus) {
|
|
146
195
|
setSubmitButtonStatus("unSubmit");
|
|
147
196
|
return { end: true };
|
|
148
197
|
} else if (orderStatus === "SUCCESS") {
|
|
149
|
-
|
|
150
|
-
(_c2 = props.onSuccess) == null ? void 0 : _c2.call(props);
|
|
198
|
+
processOnSuccess(res);
|
|
151
199
|
return { end: true };
|
|
152
200
|
} else if (orderStatus === "FAILURE") {
|
|
153
|
-
setErrorMsg(errorMessage);
|
|
201
|
+
errorMessage && setErrorMsg(errorMessage);
|
|
154
202
|
setSubmitButtonStatus("unSubmit");
|
|
155
|
-
(
|
|
203
|
+
(_f = props.onError) == null ? void 0 : _f.call(props, new PayKKaError("API_ERROR", errorMessage, { code: errorCode }));
|
|
156
204
|
return { end: true };
|
|
157
205
|
} else if (orderStatus === "PROCESSING") {
|
|
158
206
|
if (!search) {
|
|
159
|
-
await ((
|
|
207
|
+
await ((_g = props.onCallWxPayBox) == null ? void 0 : _g.call(props, payInfo));
|
|
160
208
|
startReFetchPayInfo();
|
|
161
209
|
}
|
|
162
210
|
return { end: false };
|
|
163
211
|
} else if (orderStatus === "CANCELED") {
|
|
164
212
|
setSubmitButtonStatus("unSubmit");
|
|
165
|
-
(
|
|
213
|
+
(_h = props.onTimeout) == null ? void 0 : _h.call(props, "channel");
|
|
166
214
|
return { end: true };
|
|
167
215
|
}
|
|
168
216
|
} else if (status === "SUCCESS") {
|
|
169
|
-
|
|
170
|
-
(_g2 = props.onSuccess) == null ? void 0 : _g2.call(props);
|
|
217
|
+
processOnSuccess(res);
|
|
171
218
|
return { end: true };
|
|
172
219
|
} else if (status === "EXPIRED") {
|
|
173
220
|
setSubmitButtonStatus("unSubmit");
|
|
174
|
-
(
|
|
221
|
+
(_i = props.onExpired) == null ? void 0 : _i.call(props);
|
|
175
222
|
return { end: true };
|
|
176
223
|
}
|
|
177
224
|
setSubmitButtonStatus("unSubmit");
|
|
@@ -186,8 +233,8 @@ const WechatPay = w((props, ref) => {
|
|
|
186
233
|
}
|
|
187
234
|
} else {
|
|
188
235
|
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
189
|
-
setErrorMsg(message);
|
|
190
|
-
(
|
|
236
|
+
message && setErrorMsg(message);
|
|
237
|
+
(_j = props.onError) == null ? void 0 : _j.call(props, new PayKKaError("API_ERROR", message, { code: error.code, cause: error }));
|
|
191
238
|
setSubmitButtonStatus("unSubmit");
|
|
192
239
|
return { end: true };
|
|
193
240
|
}
|
|
@@ -198,7 +245,7 @@ const WechatPay = w((props, ref) => {
|
|
|
198
245
|
setErrorMsg("");
|
|
199
246
|
(_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
|
|
200
247
|
var _a3;
|
|
201
|
-
|
|
248
|
+
(fieldStatus == null ? void 0 : fieldStatus.address.show) && addressCore.setValidateAllFields(true);
|
|
202
249
|
(_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors);
|
|
203
250
|
if (errors) {
|
|
204
251
|
setSubmitButtonStatus("unSubmit");
|
|
@@ -232,43 +279,45 @@ const WechatPay = w((props, ref) => {
|
|
|
232
279
|
formRef.current = dom;
|
|
233
280
|
dom && validateForm();
|
|
234
281
|
};
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
282
|
+
const Email = () => {
|
|
283
|
+
return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.email.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
|
|
284
|
+
EmailField,
|
|
285
|
+
{
|
|
286
|
+
ref: emailFieldRef,
|
|
287
|
+
value: form.email,
|
|
288
|
+
disabled: fieldStatus == null ? void 0 : fieldStatus.email.disabled
|
|
289
|
+
}
|
|
290
|
+
) }) });
|
|
291
|
+
};
|
|
292
|
+
const Address = () => {
|
|
293
|
+
var _a2, _b;
|
|
294
|
+
return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.address.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
|
|
295
|
+
AddressField,
|
|
296
|
+
{
|
|
297
|
+
ref: addressFieldRef,
|
|
298
|
+
value: form.address,
|
|
299
|
+
country: ((_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.country) || ((_b = session == null ? void 0 : session.checkout) == null ? void 0 : _b.bill.country),
|
|
300
|
+
onAddressChange: (value) => setForm(Object.assign(form, { address: value }))
|
|
301
|
+
}
|
|
302
|
+
) }) });
|
|
241
303
|
};
|
|
242
304
|
return /* @__PURE__ */ u(
|
|
243
305
|
CoreContext.Provider,
|
|
244
306
|
{
|
|
245
307
|
value: {
|
|
246
308
|
i18n,
|
|
247
|
-
session
|
|
309
|
+
session,
|
|
310
|
+
core
|
|
248
311
|
},
|
|
249
|
-
children:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
),
|
|
259
|
-
requiredBill && /* @__PURE__ */ u(
|
|
260
|
-
AddressField,
|
|
261
|
-
{
|
|
262
|
-
ref: addressFieldRef,
|
|
263
|
-
value: form.address,
|
|
264
|
-
country: ((_g = session == null ? void 0 : session.checkout) == null ? void 0 : _g.country) || ((_h = session == null ? void 0 : session.checkout) == null ? void 0 : _h.bill.country),
|
|
265
|
-
onAddressChange: (value) => setForm(Object.assign(form, { address: value }))
|
|
266
|
-
}
|
|
267
|
-
),
|
|
268
|
-
((_i = session == null ? void 0 : session.checkout) == null ? void 0 : _i.paymentType) === PaymentType.RECURRING && RecurringTip(),
|
|
269
|
-
!!errorMsg && /* @__PURE__ */ u(Info, { className: bem("error"), content: errorMsg }),
|
|
270
|
-
Button()
|
|
271
|
-
] }) })
|
|
312
|
+
children: isCheckoutEnabled && i18n.ready.value && /* @__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: [
|
|
313
|
+
Email(),
|
|
314
|
+
Address(),
|
|
315
|
+
((_a = session == null ? void 0 : session.checkout) == null ? void 0 : _a.paymentType) === PaymentType.RECURRING && RecurringTip(),
|
|
316
|
+
/* @__PURE__ */ u("div", { className: bem("footer-wrapper"), children: [
|
|
317
|
+
!!errorMsg && /* @__PURE__ */ u(Info, { className: bem("error"), content: errorMsg }),
|
|
318
|
+
Button()
|
|
319
|
+
] })
|
|
320
|
+
] }) }) })
|
|
272
321
|
}
|
|
273
322
|
);
|
|
274
323
|
});
|
|
@@ -1,35 +1,55 @@
|
|
|
1
1
|
import { u, b } from "../../../core.js";
|
|
2
2
|
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
3
|
import { useI18n } from "../../../hooks/useI18n.js";
|
|
4
|
-
import "../../../api/http.js";
|
|
5
4
|
import "../../../utils/card-brand/brands.js";
|
|
6
5
|
import "../../../utils/system-info/get-browser-info.js";
|
|
7
6
|
import { formatAmount } from "../../../utils/format.js";
|
|
8
7
|
import { formatTime } from "../../../utils/date.js";
|
|
8
|
+
import "../../../api/http.js";
|
|
9
9
|
import { useBreakpoints } from "../../../hooks/useBreakpoints.js";
|
|
10
10
|
import { Modal } from "../../internal/Modal/Modal.js";
|
|
11
11
|
import "./qr-code-modal.js";
|
|
12
12
|
import { QRCode } from "../../internal/QRCode/QRCode.js";
|
|
13
13
|
const { bem } = useBEM("qr-code-modal");
|
|
14
14
|
const QRCodeModal = (props) => {
|
|
15
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
title,
|
|
17
|
+
bgColor = "#FFFFFF",
|
|
18
|
+
textColor = "#1F1F1F",
|
|
19
|
+
expiredTime,
|
|
20
|
+
amount,
|
|
21
|
+
icon,
|
|
22
|
+
qrCode,
|
|
23
|
+
onClose
|
|
24
|
+
} = props;
|
|
16
25
|
const { i18n } = useI18n();
|
|
17
26
|
const breakpoints = useBreakpoints();
|
|
27
|
+
const useRoundBorder = !bgColor || ["transparent", "white", "#FFFFFF"].includes(bgColor);
|
|
28
|
+
const RoundBorder = () => {
|
|
29
|
+
return /* @__PURE__ */ u("div", { className: bem("round-border"), children: [
|
|
30
|
+
/* @__PURE__ */ u("div", { className: bem("round-border-item") }),
|
|
31
|
+
/* @__PURE__ */ u("div", { className: bem("round-border-item") }),
|
|
32
|
+
/* @__PURE__ */ u("div", { className: bem("round-border-item") }),
|
|
33
|
+
/* @__PURE__ */ u("div", { className: bem("round-border-item") })
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
18
36
|
return /* @__PURE__ */ u(
|
|
19
37
|
Modal,
|
|
20
38
|
{
|
|
21
39
|
show: true,
|
|
22
40
|
width: breakpoints.smaller("xs") ? "90vw" : "340px",
|
|
23
|
-
appendToBody: true,
|
|
24
41
|
onChange: (status) => !status && (onClose == null ? void 0 : onClose()),
|
|
25
42
|
children: /* @__PURE__ */ u("div", { className: bem(), children: [
|
|
26
43
|
/* @__PURE__ */ u("div", { className: bem("title"), children: title }),
|
|
27
44
|
/* @__PURE__ */ u("div", { className: bem("container"), children: /* @__PURE__ */ u("div", { className: bem("body"), style: { backgroundColor: bgColor }, children: [
|
|
28
45
|
icon && /* @__PURE__ */ u("div", { className: bem("icon"), children: icon }),
|
|
29
|
-
/* @__PURE__ */ u("div", { className: bem("qr-code"), children:
|
|
46
|
+
/* @__PURE__ */ u("div", { className: bem("qr-code-container"), children: [
|
|
47
|
+
useRoundBorder && /* @__PURE__ */ u(RoundBorder, {}),
|
|
48
|
+
/* @__PURE__ */ u("div", { className: bem("qr-code"), children: /* @__PURE__ */ u(QRCode, { size: 160, value: qrCode }) })
|
|
49
|
+
] }),
|
|
30
50
|
expiredTime && /* @__PURE__ */ u(b, { children: [
|
|
31
|
-
/* @__PURE__ */ u("div", { className: bem("expired-time"), children: formatTime(expiredTime) }),
|
|
32
|
-
/* @__PURE__ */ u("div", { className: bem("expired-time-text"), children: i18n.get("qrCode.expired") })
|
|
51
|
+
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time"), children: formatTime(expiredTime) }),
|
|
52
|
+
/* @__PURE__ */ u("div", { style: { color: textColor }, className: bem("expired-time-text"), children: i18n.get("qrCode.expired") })
|
|
33
53
|
] })
|
|
34
54
|
] }) }),
|
|
35
55
|
amount && /* @__PURE__ */ u("div", { className: bem("amount"), children: formatAmount(amount).jointSymbolAndCurrency() })
|
|
@@ -5,7 +5,7 @@ import { isNil } from "../../../utils/is.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 { set } from "../../../utils/
|
|
8
|
+
import { set } from "../../../utils/object.js";
|
|
9
9
|
import { FormItemContext, FormContext } from "./context.js";
|
|
10
10
|
import { formItemBEM, formItemLabelClassName, formItemErrorMessageClassName } from "./type.js";
|
|
11
11
|
import { getActiveRules } from "./util.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { w, h, T, u, b, P } from "../../../core.js";
|
|
2
2
|
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
3
|
import { useI18n } from "../../../hooks/useI18n.js";
|
|
4
|
-
import "../../../api/http.js";
|
|
5
4
|
import "../../../utils/card-brand/brands.js";
|
|
6
5
|
import "../../../utils/system-info/get-browser-info.js";
|
|
6
|
+
import "../../../api/http.js";
|
|
7
7
|
import "./modal2.js";
|
|
8
8
|
const { bem } = useBEM("modal");
|
|
9
9
|
const Modal = w((props) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w, x, h, A,
|
|
1
|
+
import { w, x, h, A, y, F, q, u } from "../../../core.js";
|
|
2
2
|
import { useBEM } from "../../../hooks/useBEM.js";
|
|
3
3
|
import "../../../core/context.js";
|
|
4
4
|
import { isNil } from "../../../utils/is.js";
|
|
@@ -27,7 +27,10 @@ const Select = w((props, ref) => {
|
|
|
27
27
|
const inputRef = A(null);
|
|
28
28
|
const [dropMenuVisible, setDropMenuVisible] = h(false);
|
|
29
29
|
const [doFilter, setDoFilter] = h(false);
|
|
30
|
-
|
|
30
|
+
y(() => {
|
|
31
|
+
if (doFilter) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
31
34
|
setSelectOptions(props.options ?? []);
|
|
32
35
|
if (!isNil(props.value) && props.options.length > 0) {
|
|
33
36
|
const item = findItemByValue(props.value, props.options);
|
|
@@ -82,7 +85,7 @@ const Select = w((props, ref) => {
|
|
|
82
85
|
if (isNil(inputValue) || inputValue === "") {
|
|
83
86
|
setIsInputChange(false);
|
|
84
87
|
}
|
|
85
|
-
if (selectOptions.length
|
|
88
|
+
if (!selectOptions.length && props.options.length) {
|
|
86
89
|
setInputValue("");
|
|
87
90
|
setIsInputChange(false);
|
|
88
91
|
} else {
|
|
@@ -110,13 +113,21 @@ const Select = w((props, ref) => {
|
|
|
110
113
|
}
|
|
111
114
|
let startClick;
|
|
112
115
|
let endClick;
|
|
113
|
-
|
|
116
|
+
const handleMouseDown = q((e) => {
|
|
114
117
|
startClick = e;
|
|
115
|
-
});
|
|
116
|
-
|
|
118
|
+
}, []);
|
|
119
|
+
const handleMouseUp = q((e) => {
|
|
117
120
|
endClick = e;
|
|
118
121
|
validateClickOut(endClick, startClick);
|
|
119
|
-
});
|
|
122
|
+
}, []);
|
|
123
|
+
y(() => {
|
|
124
|
+
document.addEventListener("mousedown", handleMouseDown);
|
|
125
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
126
|
+
return () => {
|
|
127
|
+
document.removeEventListener("mousedown", handleMouseDown);
|
|
128
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
129
|
+
};
|
|
130
|
+
}, []);
|
|
120
131
|
function validateClickOut(mouseup, mousedown) {
|
|
121
132
|
var _a, _b;
|
|
122
133
|
if (!selectRef.current)
|
|
@@ -130,7 +141,7 @@ const Select = w((props, ref) => {
|
|
|
130
141
|
}
|
|
131
142
|
setDropMenuVisible(false);
|
|
132
143
|
}
|
|
133
|
-
const selectRef =
|
|
144
|
+
const selectRef = A(null);
|
|
134
145
|
const defRightIcon = IconArrowDown({
|
|
135
146
|
style: {
|
|
136
147
|
transform: dropMenuVisible ? "rotate(-180deg)" : "rotate(0deg)",
|
|
@@ -6,10 +6,10 @@ import "../../../utils/card-brand/brands.js";
|
|
|
6
6
|
import "../../../utils/system-info/get-browser-info.js";
|
|
7
7
|
import "../../../api/http.js";
|
|
8
8
|
const { bem } = useBEM("select");
|
|
9
|
-
|
|
9
|
+
const SelectMenu = (props) => {
|
|
10
10
|
const { style, children } = props;
|
|
11
11
|
return /* @__PURE__ */ u("div", { style, class: bem("menu"), children });
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
export {
|
|
14
14
|
SelectMenu
|
|
15
15
|
};
|
|
@@ -12,13 +12,21 @@ function SelectMenuItem(props) {
|
|
|
12
12
|
const { onSelect, ...restProps } = props;
|
|
13
13
|
const { label } = restProps;
|
|
14
14
|
function onClick(e) {
|
|
15
|
+
e.preventDefault();
|
|
15
16
|
e.stopPropagation();
|
|
16
17
|
onSelect == null ? void 0 : onSelect({ ...restProps });
|
|
17
18
|
}
|
|
18
|
-
return /* @__PURE__ */ u(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return /* @__PURE__ */ u(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
onClick: (e) => onClick(e),
|
|
23
|
+
class: bem("menu-item", [{ selected: props.selected }]),
|
|
24
|
+
children: [
|
|
25
|
+
isFunction(label) ? label(props, props.selected) : label,
|
|
26
|
+
props.selected && /* @__PURE__ */ u("div", { class: bem("menu-item-icon"), children: IconTick({}) })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
22
30
|
}
|
|
23
31
|
export {
|
|
24
32
|
SelectMenuItem
|
|
@@ -14,20 +14,23 @@ function IconError({ size, style, className }) {
|
|
|
14
14
|
viewBox: "0 0 16 16",
|
|
15
15
|
fill: "none",
|
|
16
16
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
style
|
|
17
|
+
style: {
|
|
18
|
+
...style,
|
|
19
|
+
marginBottom: "-2px"
|
|
20
|
+
},
|
|
18
21
|
className: normalizedClass(COMMON_CLASS_NAME, className),
|
|
19
22
|
children: [
|
|
20
|
-
/* @__PURE__ */ u("g", { id: "icon-
|
|
23
|
+
/* @__PURE__ */ u("g", { id: "icon-Error", "clip-path": "url(#clip0_765_422)", children: /* @__PURE__ */ u("g", { id: "tips/exclamation-circle-fill", children: /* @__PURE__ */ u(
|
|
21
24
|
"path",
|
|
22
25
|
{
|
|
23
26
|
id: "Vector",
|
|
24
27
|
"fill-rule": "evenodd",
|
|
25
28
|
"clip-rule": "evenodd",
|
|
26
|
-
d: "M1.
|
|
29
|
+
d: "M1.33398 7.99992C1.33398 4.31802 4.31875 1.33325 8.00065 1.33325C11.6826 1.33325 14.6673 4.31802 14.6673 7.99992C14.6673 11.6818 11.6826 14.6666 8.00065 14.6666C4.31875 14.6666 1.33398 11.6818 1.33398 7.99992ZM7.33398 9.99992V11.3333H8.66732V9.99992H7.33398ZM8.66732 9.33325L8.66732 4.66659H7.33399L7.33398 9.33325H8.66732Z",
|
|
27
30
|
fill: "#F53F3F"
|
|
28
31
|
}
|
|
29
32
|
) }) }),
|
|
30
|
-
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "
|
|
33
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "clip0_765_422", children: /* @__PURE__ */ u("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
31
34
|
]
|
|
32
35
|
}
|
|
33
36
|
);
|
|
@@ -0,0 +1,47 @@
|
|
|
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 IconZalopay = ({ 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
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
style,
|
|
18
|
+
className: normalizedClass(COMMON_CLASS_NAME, className),
|
|
19
|
+
children: /* @__PURE__ */ u("g", { id: "9pay", children: [
|
|
20
|
+
/* @__PURE__ */ u("rect", { width: "24", height: "24", rx: "4.8", fill: "white" }),
|
|
21
|
+
/* @__PURE__ */ u(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
id: "Vector",
|
|
25
|
+
"fill-rule": "evenodd",
|
|
26
|
+
"clip-rule": "evenodd",
|
|
27
|
+
d: "M13.5067 13.2344V16.9375H14.1224V18.1751H13.6847C13.1882 18.1751 12.7528 17.9196 12.4994 17.5336C12.0819 17.9301 11.5298 18.1744 10.9218 18.1744C9.62342 18.1744 8.5701 17.0701 8.5701 15.7075C8.5701 14.345 9.62274 13.2407 10.9218 13.2407C11.423 13.2407 11.8865 13.4061 12.2676 13.686V13.2344H13.5067ZM9.80631 15.7068C9.80631 16.3867 10.3571 16.9375 11.037 16.9375C11.7168 16.9375 12.2676 16.3867 12.2676 15.7068C12.2676 15.0269 11.7168 14.4762 11.037 14.4762C10.3571 14.4762 9.80631 15.0269 9.80631 15.7068ZM5.63833 13.2344C4.27576 13.2344 3.16797 14.3429 3.16797 15.7048V20.0256H4.4049V17.8421C4.76859 18.0529 5.18881 18.1751 5.63833 18.1751C7.00092 18.1751 8.10868 17.0666 8.10868 15.7048C8.10868 14.3429 7.0002 13.2344 5.63833 13.2344ZM5.63833 16.9382C4.95843 16.9382 4.4049 16.3846 4.4049 15.7048C4.4049 15.0249 4.95843 14.4713 5.63833 14.4713C6.31822 14.4713 6.87178 15.0249 6.87178 15.7048C6.87178 16.3846 6.31893 16.9382 5.63833 16.9382ZM17.8777 13.2358L16.562 16.305L15.3126 13.2358H13.9765L15.8773 17.9043L14.9677 20.0256H16.3141L19.2241 13.2358H17.8777Z",
|
|
28
|
+
fill: "#00CF6A"
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ u(
|
|
32
|
+
"path",
|
|
33
|
+
{
|
|
34
|
+
id: "Vector_2",
|
|
35
|
+
"fill-rule": "evenodd",
|
|
36
|
+
"clip-rule": "evenodd",
|
|
37
|
+
d: "M8.02423 5.26518C8.13241 5.48157 8.10939 5.73635 7.96418 5.92971L5.02265 9.85197H8.10589V11.0889H3.81714C3.57562 11.0889 3.35784 10.9549 3.24964 10.7385C3.14144 10.5221 3.16448 10.2673 3.30967 10.0739L6.25191 6.15098H3.16797V4.91406H7.45601C7.69823 4.91406 7.91602 5.04878 8.02423 5.26518ZM16.6855 8.61928C16.6855 7.25741 17.7939 6.14892 19.1558 6.14892C20.5177 6.14892 21.6262 7.25741 21.6262 8.61928C21.6262 9.98116 20.5177 11.0896 19.1558 11.0896C17.7939 11.0896 16.6855 9.98116 16.6855 8.61928ZM17.9224 8.61928C17.9224 9.29917 18.4759 9.85271 19.1558 9.85271C19.8364 9.85271 20.3893 9.29917 20.3893 8.61928C20.3893 7.93939 19.8364 7.38585 19.1558 7.38585C18.4752 7.38585 17.9224 7.93939 17.9224 8.61928ZM13.5052 9.85202V6.14892H12.2662V6.60055C11.8851 6.32064 11.4216 6.15521 10.9204 6.15521C9.62132 6.15521 8.56868 7.2595 8.56868 8.62206C8.56868 9.98465 9.62204 11.0889 10.9204 11.0889C11.5284 11.0889 12.0805 10.8446 12.4979 10.4481C12.7513 10.8342 13.1869 11.0896 13.6832 11.0896H14.1209V9.85202H13.5052ZM11.0355 9.85202C10.3557 9.85202 9.80492 9.30127 9.80492 8.62138C9.80492 7.94148 10.3557 7.39073 11.0355 7.39073C11.7154 7.39073 12.2662 7.94148 12.2662 8.62138C12.2662 9.30127 11.7154 9.85202 11.0355 9.85202ZM15.8297 9.85059V4.91406H14.59V9.67049C14.59 10.4537 15.2245 11.0889 16.0077 11.0889H16.4495V9.85059H15.8297Z",
|
|
38
|
+
fill: "#0033C9"
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] })
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
IconZalopay
|
|
47
|
+
};
|