@paykka/card-checkout-ui 0.8.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/card-checkout-ui.js +20 -13
- package/dist/card-checkout-ui.umd.cjs +20 -13
- package/dist/es/_commonjsHelpers.js +1 -0
- package/dist/es/api/http.js +19 -21
- package/dist/es/api/index.js +1 -0
- package/dist/es/api/modules/ali-pay/index.js +19 -11
- package/dist/es/api/modules/apple-pay/index.js +10 -26
- package/dist/es/api/modules/boost/index.js +56 -0
- package/dist/es/api/modules/card/index.js +17 -11
- package/dist/es/api/modules/checkout/index.js +6 -6
- package/dist/es/api/modules/checkout/map.js +23 -6
- package/dist/es/api/modules/gcash/index.js +56 -0
- package/dist/es/api/modules/get-browser-params.js +2 -2
- package/dist/es/api/modules/google-pay/index.js +10 -26
- package/dist/es/api/modules/grab-pay/index.js +56 -0
- package/dist/es/api/modules/index.js +1 -0
- package/dist/es/api/modules/line-pay/index.js +56 -0
- package/dist/es/api/modules/may-bank-qr-pay/index.js +56 -0
- package/dist/es/api/modules/nine-pay/index.js +56 -0
- package/dist/es/api/modules/paymaya/index.js +56 -0
- package/dist/es/api/modules/sepa/index.js +19 -11
- package/dist/es/api/modules/shopee-pay/index.js +56 -0
- package/dist/es/api/modules/tng-wallet/index.js +56 -0
- package/dist/es/api/modules/wechat-pay/index.js +18 -31
- package/dist/es/components/AccordionItem/AccordionItem.js +36 -0
- package/dist/es/components/AliPay/index.js +27 -39
- package/dist/es/components/ApplePay/index.js +16 -37
- package/dist/es/components/Boost/index.js +322 -0
- package/dist/es/components/Card/index.js +52 -41
- package/dist/es/components/CardBrands/index.js +2 -2
- package/dist/es/components/CardNumberField/index.js +113 -106
- package/dist/es/components/DropIn/index.js +204 -49
- package/dist/es/components/GooglePay/index.js +5 -4
- package/dist/es/components/GrabPay/index.js +322 -0
- package/dist/es/components/GuideCard/index.js +43 -0
- package/dist/es/components/LinePay/index.js +322 -0
- package/dist/es/components/MayBankQRPay/index.js +322 -0
- package/dist/es/components/NinePay/index.js +322 -0
- package/dist/es/components/SecuredIframe/index.js +3 -2
- package/dist/es/components/Sepa/index.js +6 -9
- package/dist/es/components/ShopeePay/index.js +322 -0
- package/dist/es/components/SubmitButton/index.js +6 -20
- package/dist/es/components/TNGWallet/index.js +322 -0
- package/dist/es/components/WechatPay/index.js +30 -49
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +41 -0
- package/dist/es/components/business/QRCodeModal/index.js +6 -0
- package/dist/es/components/business/QRCodeModal/qr-code-modal.js +1 -0
- package/dist/es/components/business/QRCodeModal/type.js +1 -0
- package/dist/es/components/business/index.js +6 -0
- package/dist/es/components/index.js +9 -0
- package/dist/es/components/internal/Accordion/Accordion.js +14 -0
- package/dist/es/components/internal/Accordion/accordion2.js +1 -0
- package/dist/es/components/internal/Accordion/accordionTransition.js +26 -0
- package/dist/es/components/internal/Accordion/index.js +7 -0
- package/dist/es/components/internal/Accordion/type.js +10 -0
- package/dist/es/components/internal/Modal/Modal.js +17 -3
- package/dist/es/components/internal/Modal/index.js +1 -0
- package/dist/es/components/internal/Modal/type.js +1 -0
- package/dist/es/components/internal/QRCode/QRCode.js +31 -0
- package/dist/es/components/internal/QRCode/index.js +4 -0
- package/dist/es/components/internal/QRCode/type.js +1 -0
- package/dist/es/components/internal/icons/IconBoost.js +63 -0
- package/dist/es/components/internal/icons/IconCard.js +1 -40
- package/dist/es/components/internal/icons/IconCard2.js +60 -0
- package/dist/es/components/internal/icons/IconGCash.js +196 -0
- package/dist/es/components/internal/icons/IconGcashComplete.js +184 -0
- package/dist/es/components/internal/icons/IconGrabPay.js +59 -0
- package/dist/es/components/internal/icons/IconLinePay.js +99 -0
- package/dist/es/components/internal/icons/IconMayBankQRPay.js +69 -0
- package/dist/es/components/internal/icons/IconNinePay.js +255 -0
- package/dist/es/components/internal/icons/IconPaymaya.js +114 -0
- package/dist/es/components/internal/icons/IconRedirect.js +58 -0
- package/dist/es/components/internal/icons/IconScan.js +102 -0
- package/dist/es/components/internal/icons/IconShopeePay.js +108 -0
- package/dist/es/components/internal/icons/IconTNGWallet.js +119 -0
- package/dist/es/components/internal/icons/IconUnionPay.js +65 -0
- package/dist/es/components/wallets/GCash/GCash.js +356 -0
- package/dist/es/components/wallets/GCash/g-cash.js +1 -0
- package/dist/es/components/wallets/GCash/index.js +1 -0
- package/dist/es/components/wallets/GCash/type.js +1 -0
- package/dist/es/components/wallets/Paymaya/Paymaya.js +323 -0
- package/dist/es/components/wallets/Paymaya/index.js +1 -0
- package/dist/es/components/wallets/Paymaya/paymaya2.js +1 -0
- package/dist/es/components/wallets/Paymaya/type.js +1 -0
- package/dist/es/config.js +12 -12
- package/dist/es/constant.js +84 -4
- package/dist/es/core/PayKKaCheckout.js +28 -3
- package/dist/es/core/Session.js +24 -23
- package/dist/es/core/error.js +7 -0
- package/dist/es/core/query.js +3 -2
- package/dist/es/core.js +2082 -70
- package/dist/es/hooks/usePayState.js +0 -3
- package/dist/es/i18n/I18n.js +8 -2
- package/dist/es/i18n/locales/de-DE.js +16 -1
- package/dist/es/i18n/locales/en-GB.js +16 -1
- package/dist/es/i18n/locales/es-ES.js +16 -1
- package/dist/es/i18n/locales/fr-FR.js +16 -1
- package/dist/es/i18n/locales/ja-JP.js +16 -1
- package/dist/es/i18n/locales/ko-KR.js +16 -1
- package/dist/es/i18n/locales/pt-PT.js +16 -1
- package/dist/es/i18n/locales/ru-RU.js +16 -1
- package/dist/es/i18n/locales/zh-CN.js +16 -1
- package/dist/es/i18n/locales/zh-HK.js +16 -1
- package/dist/es/i18n/locales/zh-TW.js +16 -1
- package/dist/es/i18n/util.js +12 -3
- package/dist/es/index.js +20 -0
- package/dist/es/style.css +1 -1192
- package/dist/es/types/index.js +1 -0
- package/dist/es/utils/array.js +9 -0
- package/dist/es/utils/card-brand/brands.js +11 -1
- package/dist/es/utils/card-brand/index.js +4 -3
- package/dist/es/utils/card-brand/luhn.js +25 -0
- package/dist/es/utils/date.js +25 -0
- package/dist/es/utils/detect.js +6 -0
- package/dist/es/utils/format.js +28 -12
- package/dist/es/utils/index.js +9 -1
- package/dist/es/utils/location.js +37 -0
- package/dist/es/utils/object.js +14 -0
- package/dist/es/utils/redirect.js +32 -0
- package/dist/es/utils/system-info/get-browser-info.js +4 -4
- package/dist/es/utils/system-info/get-system-info.js +11 -7
- package/dist/es/utils/system-info/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/api/http.d.ts +4 -10
- package/dist/types/api/modules/ali-pay/index.d.ts +2 -1
- package/dist/types/api/modules/apple-pay/index.d.ts +2 -1
- package/dist/types/api/modules/boost/index.d.ts +24 -0
- package/dist/types/api/modules/card/index.d.ts +1 -1
- package/dist/types/api/modules/checkout/index.d.ts +2 -2
- package/dist/types/api/modules/checkout/type.d.ts +9 -0
- package/dist/types/api/modules/gcash/index.d.ts +24 -0
- package/dist/types/api/modules/get-browser-params.d.ts +2 -2
- package/dist/types/api/modules/google-pay/index.d.ts +2 -1
- package/dist/types/api/modules/grab-pay/index.d.ts +24 -0
- package/dist/types/api/modules/index.d.ts +9 -0
- package/dist/types/api/modules/line-pay/index.d.ts +24 -0
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +24 -0
- package/dist/types/api/modules/nine-pay/index.d.ts +24 -0
- package/dist/types/api/modules/paymaya/index.d.ts +24 -0
- package/dist/types/api/modules/sepa/index.d.ts +2 -1
- package/dist/types/api/modules/shopee-pay/index.d.ts +24 -0
- package/dist/types/api/modules/tng-wallet/index.d.ts +24 -0
- package/dist/types/api/modules/wechat-pay/index.d.ts +2 -1
- package/dist/types/components/Boost/Boost.d.ts +7 -0
- package/dist/types/components/Boost/index.d.ts +2 -0
- package/dist/types/components/Boost/type.d.ts +61 -0
- package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +1 -1
- package/dist/types/components/DropIn/config.d.ts +7 -0
- package/dist/types/components/DropIn/type.d.ts +11 -3
- package/dist/types/components/GrabPay/GrabPay.d.ts +7 -0
- package/dist/types/components/GrabPay/index.d.ts +2 -0
- package/dist/types/components/GrabPay/type.d.ts +61 -0
- package/dist/types/components/GuideCard/GuideCard.d.ts +3 -0
- package/dist/types/components/GuideCard/index.d.ts +2 -0
- package/dist/types/components/GuideCard/type.d.ts +4 -0
- package/dist/types/components/LinePay/LinePay.d.ts +7 -0
- package/dist/types/components/LinePay/index.d.ts +2 -0
- package/dist/types/components/LinePay/type.d.ts +61 -0
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -0
- package/dist/types/components/MayBankQRPay/index.d.ts +2 -0
- package/dist/types/components/MayBankQRPay/type.d.ts +61 -0
- package/dist/types/components/NinePay/NinePay.d.ts +6 -0
- package/dist/types/components/NinePay/index.d.ts +2 -0
- package/dist/types/components/NinePay/type.d.ts +61 -0
- package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +1 -1
- package/dist/types/components/ShopeePay/ShopeePay.d.ts +7 -0
- package/dist/types/components/ShopeePay/index.d.ts +2 -0
- package/dist/types/components/ShopeePay/type.d.ts +61 -0
- package/dist/types/components/SubmitButton/SubmitButton.d.ts +1 -1
- package/dist/types/components/TNGWallet/TNGWallet.d.ts +7 -0
- package/dist/types/components/TNGWallet/index.d.ts +2 -0
- package/dist/types/components/TNGWallet/type.d.ts +61 -0
- package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +3 -0
- package/dist/types/components/business/QRCodeModal/index.d.ts +2 -0
- package/dist/types/components/business/QRCodeModal/type.d.ts +18 -0
- package/dist/types/components/business/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +9 -0
- package/dist/types/components/internal/Accordion/Accordion.d.ts +3 -0
- package/dist/types/components/internal/Accordion/accordionTransition.d.ts +8 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/AccordionItem.d.ts +3 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/index.d.ts +2 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/type.d.ts +18 -0
- package/dist/types/components/internal/Accordion/index.d.ts +3 -0
- package/dist/types/components/internal/Accordion/type.d.ts +18 -0
- package/dist/types/components/internal/Modal/type.d.ts +2 -0
- package/dist/types/components/internal/QRCode/QRCode.d.ts +2 -0
- package/dist/types/components/internal/QRCode/index.d.ts +2 -0
- package/dist/types/components/internal/QRCode/type.d.ts +9 -0
- package/dist/types/components/internal/icons/IconBoost.d.ts +2 -0
- package/dist/types/components/internal/icons/IconCard2.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGCash.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGcashComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGrabPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconLinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconMayBankQRPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconNinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconPaymaya.d.ts +2 -0
- package/dist/types/components/internal/icons/IconRedirect.d.ts +2 -0
- package/dist/types/components/internal/icons/IconScan.d.ts +2 -0
- package/dist/types/components/internal/icons/IconShopeePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconTNGWallet.d.ts +2 -0
- package/dist/types/components/internal/icons/IconUnionPay.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +13 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +6 -0
- package/dist/types/components/wallets/GCash/index.d.ts +2 -0
- package/dist/types/components/wallets/GCash/type.d.ts +66 -0
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -0
- package/dist/types/components/wallets/Paymaya/index.d.ts +2 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +61 -0
- package/dist/types/config.d.ts +9 -9
- package/dist/types/constant.d.ts +28 -3
- package/dist/types/core/PayKKaCheckout.d.ts +10 -0
- package/dist/types/core/Session.d.ts +2 -0
- package/dist/types/core/error.d.ts +3 -1
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/hooks/usePayState.d.ts +0 -3
- package/dist/types/i18n/I18n.d.ts +1 -1
- package/dist/types/i18n/locales/de-DE.d.ts +13 -0
- package/dist/types/i18n/locales/en-GB.d.ts +13 -0
- package/dist/types/i18n/locales/es-ES.d.ts +13 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +13 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +13 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +13 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +13 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +13 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +13 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +13 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +13 -0
- package/dist/types/i18n/util.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts +10 -3
- package/dist/types/types/message.d.ts +1 -0
- package/dist/types/utils/array.d.ts +1 -0
- package/dist/types/utils/card-brand/brands.d.ts +4 -3
- package/dist/types/utils/card-brand/index.d.ts +9 -6
- package/dist/types/utils/card-brand/luhn.d.ts +9 -0
- package/dist/types/utils/date.d.ts +9 -0
- package/dist/types/utils/detect.d.ts +1 -0
- package/dist/types/utils/format.d.ts +7 -1
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/location.d.ts +7 -0
- package/dist/types/utils/object.d.ts +1 -0
- package/dist/types/utils/redirect.d.ts +5 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +1 -1
- package/dist/types/utils/system-info/get-system-info.d.ts +3 -2
- package/dist/types/utils/system-info/index.d.ts +3 -3
- package/package.json +4 -2
|
@@ -11,118 +11,125 @@ import "../internal/Input/type.js";
|
|
|
11
11
|
import { EFieldType } from "../SecuredFieldsProvider/index.js";
|
|
12
12
|
import { getSupportedCardBrands, getSupportedCardBrandsLengths, finCardBrandInfoByCode, findCardBrandInfo } from "../../utils/card-brand/index.js";
|
|
13
13
|
import { trimAll, limitedToNumber } from "../../utils/format.js";
|
|
14
|
-
const CardNumberField = w(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}));
|
|
45
|
-
const { i18n } = useI18n();
|
|
46
|
-
const [value, setValue] = h("");
|
|
47
|
-
const [validationStatus, setValidationStatus] = h("");
|
|
48
|
-
const brands = getSupportedCardBrands(supportedCardBrands);
|
|
49
|
-
const brandLengths = getSupportedCardBrandsLengths(brands);
|
|
50
|
-
const [brandIcon, setBrandIcon] = h(void 0);
|
|
51
|
-
y(() => {
|
|
52
|
-
setBrandIcon(value ? () => {
|
|
53
|
-
var _a;
|
|
54
|
-
return (_a = findCardBrandInfo(trimAll(value), brands)) == null ? void 0 : _a.icon;
|
|
55
|
-
} : void 0);
|
|
56
|
-
}, [value]);
|
|
57
|
-
const rule = {
|
|
58
|
-
trigger: ["blur", "submit"],
|
|
59
|
-
validator(value2) {
|
|
60
|
-
if (security) {
|
|
61
|
-
const result = formItemRef.current.getValidateResult();
|
|
62
|
-
if (result.status === "error") {
|
|
63
|
-
throw new Error(result.errors[0].message);
|
|
64
|
-
} else if (result.status === "success") {
|
|
65
|
-
return true;
|
|
14
|
+
const CardNumberField = w(
|
|
15
|
+
(props, ref) => {
|
|
16
|
+
const { supportedCardBrands = [], className, security, showLabel } = props;
|
|
17
|
+
const inputRef = A(null);
|
|
18
|
+
const formItemRef = A(null);
|
|
19
|
+
F(ref, () => ({
|
|
20
|
+
input: inputRef.current,
|
|
21
|
+
focus: () => {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
24
|
+
},
|
|
25
|
+
blur: () => {
|
|
26
|
+
var _a;
|
|
27
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
28
|
+
},
|
|
29
|
+
resetValidation: (status, errorTip) => {
|
|
30
|
+
var _a;
|
|
31
|
+
(_a = formItemRef.current) == null ? void 0 : _a.resetValidation(status, [{ message: errorTip }]);
|
|
32
|
+
},
|
|
33
|
+
binValueChanged: (binValue) => {
|
|
34
|
+
setValue(binValue);
|
|
35
|
+
},
|
|
36
|
+
brandChanged: (brand2) => {
|
|
37
|
+
if (brand2) {
|
|
38
|
+
const brandInfo = finCardBrandInfoByCode(brand2);
|
|
39
|
+
setBrandIcon(() => brandInfo == null ? void 0 : brandInfo.icon);
|
|
40
|
+
setBrand(brandInfo == null ? void 0 : brandInfo.code);
|
|
41
|
+
} else {
|
|
42
|
+
setBrandIcon(void 0);
|
|
43
|
+
setBrand(void 0);
|
|
66
44
|
}
|
|
45
|
+
},
|
|
46
|
+
getCardBrand: () => {
|
|
47
|
+
return findCardBrandInfo(trimAll(value), brands) || { code: brand };
|
|
67
48
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
}));
|
|
50
|
+
const { i18n } = useI18n();
|
|
51
|
+
const [value, setValue] = h("");
|
|
52
|
+
const [validationStatus, setValidationStatus] = h("");
|
|
53
|
+
const brands = getSupportedCardBrands(supportedCardBrands);
|
|
54
|
+
const brandLengths = getSupportedCardBrandsLengths(brands);
|
|
55
|
+
const [brandIcon, setBrandIcon] = h(void 0);
|
|
56
|
+
const [brand, setBrand] = h(void 0);
|
|
57
|
+
y(() => {
|
|
58
|
+
setBrandIcon(value ? () => {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = findCardBrandInfo(trimAll(value), brands)) == null ? void 0 : _a.icon;
|
|
61
|
+
} : void 0);
|
|
62
|
+
}, [value]);
|
|
63
|
+
const rule = {
|
|
64
|
+
trigger: ["blur", "submit"],
|
|
65
|
+
validator(value2) {
|
|
66
|
+
if (security) {
|
|
67
|
+
const result = formItemRef.current.getValidateResult();
|
|
68
|
+
if (result.status === "error") {
|
|
69
|
+
throw new Error(result.errors[0].message);
|
|
70
|
+
} else if (result.status === "success") {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
value2 = trimAll(value2 ?? "");
|
|
75
|
+
if (!brandLengths.includes(value2.length)) {
|
|
76
|
+
throw new Error(i18n.get("card.cardNumber.incomplete"));
|
|
77
|
+
}
|
|
78
|
+
const cardBrand = findCardBrandInfo(value2, brands);
|
|
79
|
+
if (!cardBrand) {
|
|
80
|
+
throw new Error(i18n.get("card.cardNumber.invalid"));
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
71
83
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
};
|
|
85
|
+
function onInput(event) {
|
|
86
|
+
var _a;
|
|
87
|
+
const { currentTarget, inputType } = event;
|
|
88
|
+
const selectionStart = currentTarget.selectionStart;
|
|
89
|
+
let val = limitedToNumber(currentTarget.value);
|
|
90
|
+
val = val.replace(/(\d{4})(?=\d)/g, "$1 ");
|
|
91
|
+
let pos = selectionStart;
|
|
92
|
+
if (pos % 5 === 0) {
|
|
93
|
+
pos = clamp(selectionStart + (inputType === "insertText" ? 1 : -1), 0);
|
|
75
94
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function onInput(event) {
|
|
80
|
-
var _a;
|
|
81
|
-
const { currentTarget, inputType } = event;
|
|
82
|
-
const selectionStart = currentTarget.selectionStart;
|
|
83
|
-
let val = limitedToNumber(currentTarget.value);
|
|
84
|
-
val = val.replace(/(\d{4})(?=\d)/g, "$1 ");
|
|
85
|
-
let pos = selectionStart;
|
|
86
|
-
if (pos % 5 === 0) {
|
|
87
|
-
pos = clamp(selectionStart + (inputType === "insertText" ? 1 : -1), 0);
|
|
95
|
+
setValue(currentTarget.value = val);
|
|
96
|
+
currentTarget.setSelectionRange(pos, pos);
|
|
97
|
+
(_a = props.onInput) == null ? void 0 : _a.call(props, event);
|
|
88
98
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
const RightIcon = () => {
|
|
100
|
+
if (validationStatus !== "error") {
|
|
101
|
+
const Icon = brandIcon ?? IconCardNo;
|
|
102
|
+
return /* @__PURE__ */ u(Icon, { size: 32 });
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return /* @__PURE__ */ u(
|
|
106
|
+
FormItem,
|
|
107
|
+
{
|
|
108
|
+
label: i18n.get("card.cardNumber.label"),
|
|
109
|
+
showLabel,
|
|
110
|
+
path: "number",
|
|
111
|
+
ref: formItemRef,
|
|
112
|
+
rule,
|
|
113
|
+
onValidationStatusChange: setValidationStatus,
|
|
114
|
+
className,
|
|
115
|
+
children: /* @__PURE__ */ u(
|
|
116
|
+
Input,
|
|
117
|
+
{
|
|
118
|
+
type: "text",
|
|
119
|
+
inputmode: "numeric",
|
|
120
|
+
ref: inputRef,
|
|
121
|
+
maxLength: 23,
|
|
122
|
+
value,
|
|
123
|
+
onInput,
|
|
124
|
+
rightIcon: RightIcon(),
|
|
125
|
+
placeholder: i18n.get("card.cardNumber.placeholder"),
|
|
126
|
+
children: security && /* @__PURE__ */ u("div", { style: "width:100%;height:100%", "data-sf": EFieldType.CARD_NUMBER })
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
);
|
|
92
131
|
}
|
|
93
|
-
|
|
94
|
-
if (validationStatus !== "error") {
|
|
95
|
-
const Icon = brandIcon ?? IconCardNo;
|
|
96
|
-
return /* @__PURE__ */ u(Icon, { size: 32 });
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return /* @__PURE__ */ u(
|
|
100
|
-
FormItem,
|
|
101
|
-
{
|
|
102
|
-
label: i18n.get("card.cardNumber.label"),
|
|
103
|
-
showLabel,
|
|
104
|
-
path: "number",
|
|
105
|
-
ref: formItemRef,
|
|
106
|
-
rule,
|
|
107
|
-
onValidationStatusChange: setValidationStatus,
|
|
108
|
-
className,
|
|
109
|
-
children: /* @__PURE__ */ u(
|
|
110
|
-
Input,
|
|
111
|
-
{
|
|
112
|
-
type: "text",
|
|
113
|
-
inputmode: "numeric",
|
|
114
|
-
ref: inputRef,
|
|
115
|
-
maxLength: 23,
|
|
116
|
-
value,
|
|
117
|
-
onInput,
|
|
118
|
-
rightIcon: RightIcon(),
|
|
119
|
-
placeholder: i18n.get("card.cardNumber.placeholder"),
|
|
120
|
-
children: security && /* @__PURE__ */ u("div", { style: "width:100%;height:100%", "data-sf": EFieldType.CARD_NUMBER })
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
});
|
|
132
|
+
);
|
|
126
133
|
export {
|
|
127
134
|
CardNumberField
|
|
128
135
|
};
|
|
@@ -2,24 +2,63 @@ import { u, w, h, A, F, y, b } from "../../core.js";
|
|
|
2
2
|
import "../../utils/card-brand/brands.js";
|
|
3
3
|
import "../../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { CoreContext } from "../../core/context.js";
|
|
5
|
-
import { CardPaymentMethods, PaymentMethod, PaymentCategory, SessionMode } from "../../constant.js";
|
|
5
|
+
import { CardPaymentMethods, PaymentMethod, PaymentCategory, SessionMode, PaymentMethod2CategoryMap } from "../../constant.js";
|
|
6
6
|
import { Card } from "../Card/index.js";
|
|
7
7
|
import { ApplePay } from "../ApplePay/index.js";
|
|
8
8
|
import { GooglePay } from "../GooglePay/index.js";
|
|
9
|
+
import { Boost } from "../Boost/index.js";
|
|
10
|
+
import { NinePay } from "../NinePay/index.js";
|
|
11
|
+
import { LinePay } from "../LinePay/index.js";
|
|
12
|
+
import { TNGWallet } from "../TNGWallet/index.js";
|
|
13
|
+
import { MayBankQRPay } from "../MayBankQRPay/index.js";
|
|
14
|
+
import { ShopeePay } from "../ShopeePay/index.js";
|
|
15
|
+
import { GrabPay } from "../GrabPay/index.js";
|
|
16
|
+
import { GCash } from "../wallets/GCash/GCash.js";
|
|
17
|
+
import { Paymaya } from "../wallets/Paymaya/Paymaya.js";
|
|
9
18
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
10
19
|
import { intersection } from "../../utils/index.js";
|
|
11
20
|
import { PayKKaError } from "../../core/error.js";
|
|
12
21
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
13
|
-
import {
|
|
22
|
+
import { Accordion } from "../internal/Accordion/Accordion.js";
|
|
23
|
+
import { AccordionItem } from "../AccordionItem/AccordionItem.js";
|
|
24
|
+
import { IconLinePay } from "../internal/icons/IconLinePay.js";
|
|
25
|
+
import { IconBoost } from "../internal/icons/IconBoost.js";
|
|
26
|
+
import { IconGrabPay } from "../internal/icons/IconGrabPay.js";
|
|
27
|
+
import { IconNinePay } from "../internal/icons/IconNinePay.js";
|
|
28
|
+
import { IconMayBankQRPay } from "../internal/icons/IconMayBankQRPay.js";
|
|
29
|
+
import { IconShopeePay } from "../internal/icons/IconShopeePay.js";
|
|
30
|
+
import { IconTNGWallet } from "../internal/icons/IconTNGWallet.js";
|
|
31
|
+
import { IconCard2 } from "../internal/icons/IconCard2.js";
|
|
32
|
+
import { IconGCash } from "../internal/icons/IconGCash.js";
|
|
33
|
+
import { IconPaymaya } from "../internal/icons/IconPaymaya.js";
|
|
34
|
+
import { removeElementFromArray } from "../../utils/array.js";
|
|
14
35
|
const dropInSupportedPaymentMethods = [
|
|
15
36
|
...CardPaymentMethods,
|
|
16
37
|
PaymentMethod.GOOGLE_PAY,
|
|
17
|
-
PaymentMethod.APPLE_PAY
|
|
38
|
+
PaymentMethod.APPLE_PAY,
|
|
39
|
+
PaymentMethod.BOOST,
|
|
40
|
+
PaymentMethod.GRAB_PAY,
|
|
41
|
+
PaymentMethod.LINE_PAY,
|
|
42
|
+
PaymentMethod.NINE_PAY,
|
|
43
|
+
PaymentMethod.SHOPEE_PAY,
|
|
44
|
+
PaymentMethod.TNG_WALLET,
|
|
45
|
+
PaymentMethod.MAY_BANK_QR_PAY,
|
|
46
|
+
PaymentMethod.GCASH,
|
|
47
|
+
PaymentMethod.PAYMAYA
|
|
18
48
|
];
|
|
19
49
|
const PaymentComponentMap = {
|
|
20
50
|
[PaymentCategory.CARD]: Card,
|
|
21
51
|
[PaymentCategory.APPLE_PAY]: ApplePay,
|
|
22
|
-
[PaymentCategory.GOOGLE_PAY]: GooglePay
|
|
52
|
+
[PaymentCategory.GOOGLE_PAY]: GooglePay,
|
|
53
|
+
[PaymentCategory.BOOST]: Boost,
|
|
54
|
+
[PaymentCategory.NINE_PAY]: NinePay,
|
|
55
|
+
[PaymentCategory.LINE_PAY]: LinePay,
|
|
56
|
+
[PaymentCategory.TNG_WALLET]: TNGWallet,
|
|
57
|
+
[PaymentCategory.MAY_BANK_QR_PAY]: MayBankQRPay,
|
|
58
|
+
[PaymentCategory.SHOPEE_PAY]: ShopeePay,
|
|
59
|
+
[PaymentCategory.GRAB_PAY]: GrabPay,
|
|
60
|
+
[PaymentCategory.GCASH]: GCash,
|
|
61
|
+
[PaymentCategory.PAYMAYA]: Paymaya
|
|
23
62
|
// [PaymentCategory.WECHAT_PAY]: WechatPay,
|
|
24
63
|
// [PaymentCategory.ALI_PAY]: AliPay,
|
|
25
64
|
// [PaymentCategory.SEPA_DEBIT]: Sepa
|
|
@@ -54,14 +93,61 @@ const PaymentTabs = (props) => {
|
|
|
54
93
|
}
|
|
55
94
|
)) });
|
|
56
95
|
};
|
|
96
|
+
const paymentCategoryOptionMap = {
|
|
97
|
+
[PaymentCategory.CARD]: {
|
|
98
|
+
icon: IconCard2,
|
|
99
|
+
nameKey: "dropIn.card.label"
|
|
100
|
+
},
|
|
101
|
+
[PaymentCategory.LINE_PAY]: {
|
|
102
|
+
icon: IconLinePay,
|
|
103
|
+
nameKey: "dropIn.linePay.label"
|
|
104
|
+
},
|
|
105
|
+
[PaymentCategory.BOOST]: {
|
|
106
|
+
icon: IconBoost,
|
|
107
|
+
nameKey: "dropIn.boost.label"
|
|
108
|
+
},
|
|
109
|
+
[PaymentCategory.GRAB_PAY]: {
|
|
110
|
+
icon: IconGrabPay,
|
|
111
|
+
nameKey: "dropIn.grabPay.label"
|
|
112
|
+
},
|
|
113
|
+
[PaymentCategory.NINE_PAY]: {
|
|
114
|
+
icon: IconNinePay,
|
|
115
|
+
nameKey: "dropIn.ninePay.label"
|
|
116
|
+
},
|
|
117
|
+
[PaymentCategory.MAY_BANK_QR_PAY]: {
|
|
118
|
+
icon: IconMayBankQRPay,
|
|
119
|
+
nameKey: "dropIn.mayBankQRPay.label"
|
|
120
|
+
},
|
|
121
|
+
[PaymentCategory.SHOPEE_PAY]: {
|
|
122
|
+
icon: IconShopeePay,
|
|
123
|
+
nameKey: "dropIn.shopeePay.label"
|
|
124
|
+
},
|
|
125
|
+
[PaymentCategory.TNG_WALLET]: {
|
|
126
|
+
icon: IconTNGWallet,
|
|
127
|
+
nameKey: "dropIn.TNGWallet.label"
|
|
128
|
+
},
|
|
129
|
+
[PaymentCategory.GCASH]: {
|
|
130
|
+
icon: IconGCash,
|
|
131
|
+
nameKey: "dropIn.gcash.label"
|
|
132
|
+
},
|
|
133
|
+
[PaymentCategory.PAYMAYA]: {
|
|
134
|
+
icon: IconPaymaya,
|
|
135
|
+
nameKey: "dropIn.paymaya.label"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
57
138
|
const { bem } = useBEM("drop-in");
|
|
58
139
|
const DropIn = w((props, ref) => {
|
|
59
|
-
const {
|
|
140
|
+
const {
|
|
141
|
+
paymentMethods: paymentMethodsConfig,
|
|
142
|
+
layout = "accordion",
|
|
143
|
+
session,
|
|
144
|
+
core,
|
|
145
|
+
enableAccordionTransition = true
|
|
146
|
+
} = props;
|
|
60
147
|
const { i18n, sessionReady } = usePayState(session);
|
|
61
148
|
const [paymentCategoryOptions, setPaymentCategoryOptions] = h([]);
|
|
62
|
-
const [activePaymentCategory, setActivePaymentCategory] = h(
|
|
63
|
-
|
|
64
|
-
);
|
|
149
|
+
const [activePaymentCategory, setActivePaymentCategory] = h();
|
|
150
|
+
const [enablePaymentMethod, setEnablePaymentMethod] = h();
|
|
65
151
|
const [headerPaymentCategories, setHeaderPaymentCategories] = h(
|
|
66
152
|
[]
|
|
67
153
|
);
|
|
@@ -78,14 +164,24 @@ const DropIn = w((props, ref) => {
|
|
|
78
164
|
}
|
|
79
165
|
}));
|
|
80
166
|
y(() => {
|
|
167
|
+
var _a, _b;
|
|
81
168
|
if (!activePaymentCategory) {
|
|
82
169
|
return;
|
|
83
170
|
}
|
|
84
|
-
|
|
85
|
-
|
|
171
|
+
const currCompInst = componentInstMap.current[activePaymentCategory];
|
|
172
|
+
if (currCompInst) {
|
|
173
|
+
const ref2 = currCompInst.ref;
|
|
174
|
+
(_a = ref2.updateAddress) == null ? void 0 : _a.call(ref2);
|
|
175
|
+
(_b = ref2.updateEmail) == null ? void 0 : _b.call(ref2);
|
|
86
176
|
}
|
|
87
|
-
renderComponent(activePaymentCategory);
|
|
88
177
|
}, [activePaymentCategory]);
|
|
178
|
+
y(() => {
|
|
179
|
+
if (paymentCategories == null ? void 0 : paymentCategories.length) {
|
|
180
|
+
paymentCategories.forEach((category) => {
|
|
181
|
+
renderComponent(category);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}, [paymentCategories]);
|
|
89
185
|
y(() => {
|
|
90
186
|
if (headerPaymentCategories == null ? void 0 : headerPaymentCategories.length) {
|
|
91
187
|
renderComponent(PaymentCategory.APPLE_PAY);
|
|
@@ -113,32 +209,46 @@ const DropIn = w((props, ref) => {
|
|
|
113
209
|
}
|
|
114
210
|
};
|
|
115
211
|
const initPaymentCategories = (enablePaymentMethods) => {
|
|
212
|
+
const cpyEnablePaymentMethods = [...enablePaymentMethods];
|
|
116
213
|
const paymentCategoryOptions2 = [];
|
|
117
214
|
const paymentCategories2 = [];
|
|
118
215
|
const headerPaymentCategories2 = [];
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} else {
|
|
123
|
-
paymentCategories2.push(PaymentCategory.APPLE_PAY);
|
|
124
|
-
}
|
|
216
|
+
if (cpyEnablePaymentMethods.includes(PaymentMethod.APPLE_PAY)) {
|
|
217
|
+
headerPaymentCategories2.push(PaymentCategory.APPLE_PAY);
|
|
218
|
+
removeElementFromArray(cpyEnablePaymentMethods, PaymentMethod.APPLE_PAY);
|
|
125
219
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
} else {
|
|
130
|
-
paymentCategories2.push(PaymentCategory.APPLE_PAY);
|
|
131
|
-
}
|
|
220
|
+
if (cpyEnablePaymentMethods.includes(PaymentMethod.GOOGLE_PAY)) {
|
|
221
|
+
headerPaymentCategories2.push(PaymentCategory.GOOGLE_PAY);
|
|
222
|
+
removeElementFromArray(cpyEnablePaymentMethods, PaymentMethod.GOOGLE_PAY);
|
|
132
223
|
}
|
|
133
|
-
const isCardEnable = !!intersection(
|
|
224
|
+
const isCardEnable = !!intersection(cpyEnablePaymentMethods, CardPaymentMethods).length;
|
|
134
225
|
if (isCardEnable) {
|
|
135
226
|
paymentCategories2.push(PaymentCategory.CARD);
|
|
136
227
|
paymentCategoryOptions2.push({
|
|
137
228
|
type: PaymentCategory.CARD,
|
|
138
|
-
|
|
139
|
-
|
|
229
|
+
icon: () => {
|
|
230
|
+
const Icon = paymentCategoryOptionMap[PaymentCategory.CARD].icon;
|
|
231
|
+
return Icon ? /* @__PURE__ */ u(Icon, { size: 24 }) : null;
|
|
232
|
+
},
|
|
233
|
+
name: i18n.get(paymentCategoryOptionMap[PaymentCategory.CARD].nameKey)
|
|
140
234
|
});
|
|
141
235
|
}
|
|
236
|
+
cpyEnablePaymentMethods.forEach((method) => {
|
|
237
|
+
if (cpyEnablePaymentMethods.includes(method)) {
|
|
238
|
+
const type = PaymentMethod2CategoryMap[method];
|
|
239
|
+
if (type) {
|
|
240
|
+
paymentCategories2.push(type);
|
|
241
|
+
paymentCategoryOptions2.push({
|
|
242
|
+
type,
|
|
243
|
+
icon: () => {
|
|
244
|
+
const Icon = paymentCategoryOptionMap[type].icon;
|
|
245
|
+
return Icon ? /* @__PURE__ */ u(Icon, { size: 24 }) : null;
|
|
246
|
+
},
|
|
247
|
+
name: i18n.get(paymentCategoryOptionMap[type].nameKey)
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
142
252
|
if (paymentCategoryOptions2.length) {
|
|
143
253
|
setPaymentCategoryOptions(paymentCategoryOptions2);
|
|
144
254
|
setActivePaymentCategory(paymentCategoryOptions2[0].type);
|
|
@@ -157,7 +267,7 @@ const DropIn = w((props, ref) => {
|
|
|
157
267
|
if (((_a = session.checkout) == null ? void 0 : _a.sessionMode) === SessionMode.COMPONENT) {
|
|
158
268
|
(_c = (_b = props.core.config).onInitError) == null ? void 0 : _c.call(
|
|
159
269
|
_b,
|
|
160
|
-
new PayKKaError("ERROR", "Please send the correct
|
|
270
|
+
new PayKKaError("ERROR", "Please send the correct session when creating the checkout")
|
|
161
271
|
);
|
|
162
272
|
return;
|
|
163
273
|
}
|
|
@@ -170,38 +280,83 @@ const DropIn = w((props, ref) => {
|
|
|
170
280
|
return;
|
|
171
281
|
}
|
|
172
282
|
initPaymentCategories(enablePaymentMethods);
|
|
283
|
+
if (core.processingPaymentMethod) {
|
|
284
|
+
const category = PaymentMethod2CategoryMap[core.processingPaymentMethod];
|
|
285
|
+
category && setActivePaymentCategory(category);
|
|
286
|
+
core.enablePaymentMethod.value = core.processingPaymentMethod;
|
|
287
|
+
}
|
|
173
288
|
}, [sessionReady, i18n.ready.value]);
|
|
174
|
-
|
|
175
|
-
|
|
289
|
+
y(() => {
|
|
290
|
+
if (core.enablePaymentMethod.value) {
|
|
291
|
+
setEnablePaymentMethod(
|
|
292
|
+
PaymentMethod2CategoryMap[core.enablePaymentMethod.value]
|
|
293
|
+
);
|
|
294
|
+
} else {
|
|
295
|
+
setEnablePaymentMethod(void 0);
|
|
296
|
+
}
|
|
297
|
+
}, [core.enablePaymentMethod.value]);
|
|
298
|
+
const HeaderField = () => {
|
|
299
|
+
return /* @__PURE__ */ u(b, { children: headerPaymentCategories == null ? void 0 : headerPaymentCategories.map((category) => /* @__PURE__ */ u(
|
|
176
300
|
"div",
|
|
177
301
|
{
|
|
178
302
|
className: bem("header-payment"),
|
|
179
303
|
ref: (el) => componentMountRefMap.current[category] = el
|
|
180
304
|
}
|
|
181
|
-
))
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
305
|
+
)) });
|
|
306
|
+
};
|
|
307
|
+
const OtherLine = () => {
|
|
308
|
+
return /* @__PURE__ */ u(b, { children: !!(headerPaymentCategories == null ? void 0 : headerPaymentCategories.length) && /* @__PURE__ */ u("div", { className: bem("other"), children: [
|
|
309
|
+
/* @__PURE__ */ u("div", { className: bem("other-line") }),
|
|
310
|
+
/* @__PURE__ */ u("div", { className: bem("other-text"), children: i18n.get("dropIn.otherPaymentMethod") }),
|
|
311
|
+
/* @__PURE__ */ u("div", { className: bem("other-line") })
|
|
312
|
+
] }) });
|
|
313
|
+
};
|
|
314
|
+
return /* @__PURE__ */ u(CoreContext.Provider, { value: { i18n }, children: i18n.ready.value && /* @__PURE__ */ u("div", { className: bem(), children: [
|
|
315
|
+
HeaderField(),
|
|
316
|
+
!!paymentCategoryOptions.length && /* @__PURE__ */ u(b, { children: [
|
|
317
|
+
OtherLine(),
|
|
318
|
+
layout === "accordion" ? /* @__PURE__ */ u(b, { children: /* @__PURE__ */ u("div", { className: bem("accordion-wrapper"), children: /* @__PURE__ */ u(
|
|
319
|
+
Accordion,
|
|
190
320
|
{
|
|
191
321
|
value: activePaymentCategory,
|
|
192
|
-
|
|
193
|
-
onChange: (item) => handlePaymentCategoryChange(item)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
322
|
+
enableTransition: enableAccordionTransition,
|
|
323
|
+
onChange: (item) => handlePaymentCategoryChange(item),
|
|
324
|
+
children: paymentCategoryOptions.map((item) => /* @__PURE__ */ u(
|
|
325
|
+
AccordionItem,
|
|
326
|
+
{
|
|
327
|
+
title: item.name,
|
|
328
|
+
value: item.type,
|
|
329
|
+
header: /* @__PURE__ */ u("div", { className: bem("accordion-icon"), children: item.icon() }),
|
|
330
|
+
disabled: !!enablePaymentMethod && enablePaymentMethod !== item.type,
|
|
331
|
+
children: /* @__PURE__ */ u(
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
style: "padding: 0 2px",
|
|
335
|
+
ref: (el) => componentMountRefMap.current[item.type] = el
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
}
|
|
339
|
+
))
|
|
201
340
|
}
|
|
202
|
-
))
|
|
341
|
+
) }) }) : /* @__PURE__ */ u(b, { children: [
|
|
342
|
+
/* @__PURE__ */ u("div", { className: bem("tabs-wrapper"), children: /* @__PURE__ */ u(
|
|
343
|
+
PaymentTabs,
|
|
344
|
+
{
|
|
345
|
+
value: activePaymentCategory,
|
|
346
|
+
tabs: paymentCategoryOptions,
|
|
347
|
+
onChange: (item) => handlePaymentCategoryChange(item)
|
|
348
|
+
}
|
|
349
|
+
) }),
|
|
350
|
+
paymentCategories == null ? void 0 : paymentCategories.map((category) => /* @__PURE__ */ u(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
style: { display: category === activePaymentCategory ? "block" : "none" },
|
|
354
|
+
ref: (el) => componentMountRefMap.current[category] = el
|
|
355
|
+
}
|
|
356
|
+
))
|
|
357
|
+
] })
|
|
203
358
|
] })
|
|
204
|
-
] }) })
|
|
359
|
+
] }) });
|
|
205
360
|
});
|
|
206
361
|
export {
|
|
207
362
|
DropIn,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { w, F, h, q, y, A, u, b } from "../../core.js";
|
|
2
2
|
import { isTimeoutError } from "../../api/http.js";
|
|
3
3
|
import { SessionMode, PaymentMethod } from "../../constant.js";
|
|
4
|
+
import "../../utils/card-brand/brands.js";
|
|
5
|
+
import "../../utils/system-info/get-browser-info.js";
|
|
6
|
+
import { extractAreaCodeAndPhoneNumber } from "../../utils/format.js";
|
|
4
7
|
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
5
8
|
import { getGooglePayInfo, googlePay } from "../../api/modules/google-pay/index.js";
|
|
6
9
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
7
10
|
import "../../core/context.js";
|
|
8
|
-
import "../../utils/card-brand/brands.js";
|
|
9
|
-
import "../../utils/system-info/get-browser-info.js";
|
|
10
|
-
import { extractAreaCodeAndPhoneNumber } from "../../utils/format.js";
|
|
11
11
|
import { PayKKaError } from "../../core/error.js";
|
|
12
12
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
13
13
|
import { useRetry } from "../../hooks/useRetry.js";
|
|
@@ -206,7 +206,7 @@ const GooglePay = w((props, ref) => {
|
|
|
206
206
|
if (sessionMode === SessionMode.DROP_IN && !isDropIn) {
|
|
207
207
|
(_b = (_a2 = props.core.config).onInitError) == null ? void 0 : _b.call(
|
|
208
208
|
_a2,
|
|
209
|
-
new PayKKaError("ERROR", "Please send the correct
|
|
209
|
+
new PayKKaError("ERROR", "Please send the correct session when creating the checkout")
|
|
210
210
|
);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
@@ -293,6 +293,7 @@ const GooglePay = w((props, ref) => {
|
|
|
293
293
|
fraudDetectionId: fraudDetection == null ? void 0 : fraudDetection.fraudDetectionID
|
|
294
294
|
})
|
|
295
295
|
},
|
|
296
|
+
props.core,
|
|
296
297
|
{ locale: i18n.locale }
|
|
297
298
|
);
|
|
298
299
|
}());
|