@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
package/dist/es/types/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var CardBrandCode = /* @__PURE__ */ ((CardBrandCode2) => {
|
|
|
5
5
|
CardBrandCode2["AMEX"] = "AMEX";
|
|
6
6
|
CardBrandCode2["DISCOVER"] = "DISCOVER";
|
|
7
7
|
CardBrandCode2["DINERS_CLUB"] = "DINERS_CLUB";
|
|
8
|
+
CardBrandCode2["CHINA_UNION_PAY"] = "CHINA_UNION_PAY";
|
|
8
9
|
return CardBrandCode2;
|
|
9
10
|
})(CardBrandCode || {});
|
|
10
11
|
const defaultInputStyleConfig = {
|
|
@@ -7,6 +7,8 @@ import { IconDiscover } from "../../components/internal/icons/IconDiscover.js";
|
|
|
7
7
|
import { IconJcb } from "../../components/internal/icons/IconJcb.js";
|
|
8
8
|
import { IconMasterCard } from "../../components/internal/icons/IconMasterCard.js";
|
|
9
9
|
import { IconVisa } from "../../components/internal/icons/IconVisa.js";
|
|
10
|
+
import { IconUnionPay } from "../../components/internal/icons/IconUnionPay.js";
|
|
11
|
+
import { luhnCheck } from "./luhn.js";
|
|
10
12
|
const cardBrandCodes = Object.values(CardBrandCode);
|
|
11
13
|
const cardBrands = [
|
|
12
14
|
{
|
|
@@ -50,6 +52,13 @@ const cardBrands = [
|
|
|
50
52
|
pattern: /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,
|
|
51
53
|
lengths: [14, 16],
|
|
52
54
|
order: 5
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "China UnionPay",
|
|
58
|
+
code: CardBrandCode.CHINA_UNION_PAY,
|
|
59
|
+
validator: luhnCheck,
|
|
60
|
+
lengths: [14, 15, 16, 17, 18, 19],
|
|
61
|
+
order: 6
|
|
53
62
|
}
|
|
54
63
|
];
|
|
55
64
|
const getCardBrandIconMap = (code) => {
|
|
@@ -59,7 +68,8 @@ const getCardBrandIconMap = (code) => {
|
|
|
59
68
|
[CardBrandCode.JCB]: IconJcb,
|
|
60
69
|
[CardBrandCode.AMEX]: IconAmex,
|
|
61
70
|
[CardBrandCode.DISCOVER]: IconDiscover,
|
|
62
|
-
[CardBrandCode.DINERS_CLUB]: IconDinnersClub
|
|
71
|
+
[CardBrandCode.DINERS_CLUB]: IconDinnersClub,
|
|
72
|
+
[CardBrandCode.CHINA_UNION_PAY]: IconUnionPay
|
|
63
73
|
}[code];
|
|
64
74
|
};
|
|
65
75
|
[
|
|
@@ -3,16 +3,17 @@ function getSupportedCardBrands(supportedCardBrands) {
|
|
|
3
3
|
return supportedCardBrands ? cardBrands.filter((brand) => supportedCardBrands.includes(brand.code)).sort((a, b) => a.order - b.order) : [];
|
|
4
4
|
}
|
|
5
5
|
function findCardBrand(number, brands = cardBrands) {
|
|
6
|
+
var _a, _b;
|
|
6
7
|
for (const item of brands) {
|
|
7
|
-
if (item.pattern.test(number)) {
|
|
8
|
+
if (((_a = item.pattern) == null ? void 0 : _a.test(number)) || ((_b = item.validator) == null ? void 0 : _b.call(item, number))) {
|
|
8
9
|
return item;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
function findCardBrandInfo(number, brands = cardBrands) {
|
|
13
|
-
|
|
14
|
+
var _a, _b;
|
|
14
15
|
for (const item of brands) {
|
|
15
|
-
if (item.pattern.test(number)) {
|
|
16
|
+
if (((_a = item.pattern) == null ? void 0 : _a.test(number)) || ((_b = item.validator) == null ? void 0 : _b.call(item, number))) {
|
|
16
17
|
return getCardBrandInfo(item);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const luhnCheck = (cardNumber) => {
|
|
2
|
+
const luhnRegex = /^(62[0-9]{14,17})$|^(62[0-9]{4}([ -]?)[0-9]{4}\2[0-9]{4}\2[0-9]{1,7})$/;
|
|
3
|
+
if (!luhnRegex.test(cardNumber)) {
|
|
4
|
+
console.log("luhnRegex", cardNumber);
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const cleanNum = cardNumber.replace(/\D/g, "");
|
|
8
|
+
let sum = 0;
|
|
9
|
+
let isEven = false;
|
|
10
|
+
for (let i = cleanNum.length - 1; i >= 0; i--) {
|
|
11
|
+
let digit = parseInt(cleanNum.charAt(i));
|
|
12
|
+
if (isEven) {
|
|
13
|
+
digit *= 2;
|
|
14
|
+
if (digit > 9)
|
|
15
|
+
digit -= 9;
|
|
16
|
+
}
|
|
17
|
+
sum += digit;
|
|
18
|
+
isEven = !isEven;
|
|
19
|
+
}
|
|
20
|
+
console.log("luhnRegex", cardNumber, sum % 10 === 0);
|
|
21
|
+
return sum % 10 === 0;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
luhnCheck
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const DATE_FORMAT = "MM/DD/YYYY";
|
|
2
|
+
const DATE_TIME_FORMAT = `${DATE_FORMAT} HH:mm:ss`;
|
|
3
|
+
const timeTemplateMap = {
|
|
4
|
+
date: DATE_FORMAT,
|
|
5
|
+
datetime: DATE_TIME_FORMAT
|
|
6
|
+
};
|
|
7
|
+
const formatTime = (value, template = "datetime") => {
|
|
8
|
+
if (!value && value !== 0) {
|
|
9
|
+
return "-";
|
|
10
|
+
}
|
|
11
|
+
if (template in timeTemplateMap) {
|
|
12
|
+
template = timeTemplateMap[template];
|
|
13
|
+
}
|
|
14
|
+
let date;
|
|
15
|
+
if (["number", "string"].includes(typeof value)) {
|
|
16
|
+
date = new Date(value);
|
|
17
|
+
} else {
|
|
18
|
+
date = value;
|
|
19
|
+
}
|
|
20
|
+
const pad = (n) => n.toString().padStart(2, "0");
|
|
21
|
+
return template.replace(/YYYY/g, date.getFullYear().toString()).replace(/MM/g, pad(date.getMonth() + 1)).replace(/DD/g, pad(date.getDate())).replace(/HH/g, pad(date.getHours())).replace(/mm/g, pad(date.getMinutes())).replace(/ss/g, pad(date.getSeconds()));
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
formatTime
|
|
25
|
+
};
|
package/dist/es/utils/format.js
CHANGED
|
@@ -36,18 +36,34 @@ function limitedToNumber(val, whitelist = []) {
|
|
|
36
36
|
function trimAll(str) {
|
|
37
37
|
return str.replace(/\s/g, "");
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
const formatAmount = ({ amount, digits, currency, symbol }) => {
|
|
40
|
+
const prefix = amount < 0 ? "-" : "";
|
|
41
|
+
const fixedNumArr = Number(Math.abs(amount)).toFixed(digits).split(".");
|
|
42
|
+
const numCommas = formatNumberWithCommas(fixedNumArr[0]);
|
|
43
|
+
const fixed = fixedNumArr.length === 2 ? [numCommas, fixedNumArr[1]].join(".") : numCommas;
|
|
44
|
+
function formatNumberWithCommas(number) {
|
|
45
|
+
let str = String(number).split("").reverse().join("");
|
|
46
|
+
str = str.replace(/(\d{3})(?=\d)/g, "$1,");
|
|
47
|
+
return str.split("").reverse().join("");
|
|
48
|
+
}
|
|
49
|
+
function fixedAmount() {
|
|
50
|
+
return `${prefix}${fixed}`;
|
|
51
|
+
}
|
|
52
|
+
function jointSymbol() {
|
|
53
|
+
return `${prefix}${symbol}${fixed}`;
|
|
54
|
+
}
|
|
55
|
+
function jointSymbolAndCurrency() {
|
|
56
|
+
return `${prefix}${symbol}${fixed} ${currency}`;
|
|
57
|
+
}
|
|
58
|
+
function jointCurrency() {
|
|
59
|
+
return `${prefix}${fixed} ${currency}`;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
fixedAmount,
|
|
63
|
+
jointSymbol,
|
|
64
|
+
jointSymbolAndCurrency,
|
|
65
|
+
jointCurrency
|
|
66
|
+
};
|
|
51
67
|
};
|
|
52
68
|
function cssVarPrefix(value) {
|
|
53
69
|
return `--${PREFIX}-${value}`;
|
package/dist/es/utils/index.js
CHANGED
|
@@ -20,6 +20,13 @@ const safeParse = (dataStr, defaultValue = {}) => {
|
|
|
20
20
|
return defaultValue;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
const safeStringify = (data, defaultValue = "") => {
|
|
24
|
+
try {
|
|
25
|
+
return JSON.stringify(data);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return defaultValue;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
23
30
|
function isExpired(expireDate) {
|
|
24
31
|
const [month, year] = expireDate.split("/").map(Number);
|
|
25
32
|
const expiryDate = new Date(+`20${year}`, month - 1);
|
|
@@ -41,5 +48,6 @@ export {
|
|
|
41
48
|
getIf,
|
|
42
49
|
intersection,
|
|
43
50
|
isExpired,
|
|
44
|
-
safeParse
|
|
51
|
+
safeParse,
|
|
52
|
+
safeStringify
|
|
45
53
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const getUrlParam = (paramName) => {
|
|
2
|
+
if (typeof window === "undefined")
|
|
3
|
+
return null;
|
|
4
|
+
const params = new URLSearchParams(window.location.search);
|
|
5
|
+
return params.get(paramName);
|
|
6
|
+
};
|
|
7
|
+
const createUrlWithParams = (baseUrl, params) => {
|
|
8
|
+
const url = new URL(baseUrl);
|
|
9
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
10
|
+
url.searchParams.append(key, String(value));
|
|
11
|
+
});
|
|
12
|
+
return url.toString();
|
|
13
|
+
};
|
|
14
|
+
const parseUrl = (url) => {
|
|
15
|
+
try {
|
|
16
|
+
const urlObj = new URL(url);
|
|
17
|
+
const params = {};
|
|
18
|
+
urlObj.searchParams.forEach((value, key) => {
|
|
19
|
+
params[key] = value;
|
|
20
|
+
});
|
|
21
|
+
const baseUrl = urlObj.origin + urlObj.pathname;
|
|
22
|
+
return {
|
|
23
|
+
baseUrl,
|
|
24
|
+
params
|
|
25
|
+
};
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
baseUrl: url,
|
|
29
|
+
params: {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
createUrlWithParams,
|
|
35
|
+
getUrlParam,
|
|
36
|
+
parseUrl
|
|
37
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const deepMerge = (target, source) => {
|
|
2
|
+
const output = { ...target };
|
|
3
|
+
for (const key in source) {
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(source, key) && typeof source[key] === "object" && source[key] !== null && !Array.isArray(source[key]) && typeof output[key] === "object" && output[key] !== null && !Array.isArray(output[key])) {
|
|
5
|
+
output[key] = deepMerge(output[key], source[key]);
|
|
6
|
+
} else {
|
|
7
|
+
output[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return output;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
deepMerge
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { parseUrl, createUrlWithParams } from "./location.js";
|
|
2
|
+
const redirectToPayment = (payInfo) => {
|
|
3
|
+
const { request_url: url, request_method: method } = payInfo;
|
|
4
|
+
if (method === "GET") {
|
|
5
|
+
redirectByGet(url, {});
|
|
6
|
+
} else {
|
|
7
|
+
const { baseUrl, params } = parseUrl(url);
|
|
8
|
+
redirectByPost(baseUrl, params);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const redirectByGet = (baseUrl, params) => {
|
|
12
|
+
const url = createUrlWithParams(baseUrl, params);
|
|
13
|
+
window.location.href = url;
|
|
14
|
+
};
|
|
15
|
+
const redirectByPost = (baseUrl, params) => {
|
|
16
|
+
const form = document.createElement("form");
|
|
17
|
+
form.method = "POST";
|
|
18
|
+
form.action = baseUrl;
|
|
19
|
+
form.style.display = "none";
|
|
20
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
21
|
+
const input = document.createElement("input");
|
|
22
|
+
input.type = "hidden";
|
|
23
|
+
input.name = key;
|
|
24
|
+
input.value = value;
|
|
25
|
+
form.appendChild(input);
|
|
26
|
+
});
|
|
27
|
+
document.body.appendChild(form);
|
|
28
|
+
form.submit();
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
redirectToPayment
|
|
32
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const IEVersion = () => {
|
|
2
2
|
const userAgent = navigator.userAgent;
|
|
3
3
|
const isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1;
|
|
4
4
|
const isEdge = userAgent.indexOf("Edge") > -1 && !isIE;
|
|
@@ -19,7 +19,7 @@ function IEVersion() {
|
|
|
19
19
|
} else {
|
|
20
20
|
return -1;
|
|
21
21
|
}
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
const ua = navigator.userAgent;
|
|
24
24
|
const isAndroid = /android/i.test(ua);
|
|
25
25
|
const isIOS = /iphone|ipad|ipod/i.test(ua);
|
|
@@ -27,7 +27,7 @@ const isWindows = ua.match(/Windows NT ([\d|\d.\d]*)/i);
|
|
|
27
27
|
const isMac = /Macintosh|Mac/i.test(ua);
|
|
28
28
|
const isLinux = /Linux|X11/i.test(ua);
|
|
29
29
|
const isIPadOS = isMac && navigator.maxTouchPoints > 0;
|
|
30
|
-
|
|
30
|
+
const getBrowserInfo = () => {
|
|
31
31
|
let language = navigator.language;
|
|
32
32
|
let osname;
|
|
33
33
|
let osversion;
|
|
@@ -179,7 +179,7 @@ function getBrowserInfo() {
|
|
|
179
179
|
osname,
|
|
180
180
|
osversion
|
|
181
181
|
};
|
|
182
|
-
}
|
|
182
|
+
};
|
|
183
183
|
export {
|
|
184
184
|
getBrowserInfo
|
|
185
185
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getBrowserInfo } from "./get-browser-info.js";
|
|
2
2
|
let browserInfo;
|
|
3
3
|
let _initBrowserInfo = false;
|
|
4
|
-
|
|
4
|
+
const initBrowserInfo = () => {
|
|
5
5
|
if (_initBrowserInfo)
|
|
6
6
|
return;
|
|
7
7
|
browserInfo = getBrowserInfo();
|
|
8
8
|
_initBrowserInfo = true;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
};
|
|
10
|
+
const getDeviceInfo = () => {
|
|
11
11
|
initBrowserInfo();
|
|
12
12
|
const {
|
|
13
13
|
deviceBrand,
|
|
@@ -31,8 +31,8 @@ function getDeviceInfo() {
|
|
|
31
31
|
platform,
|
|
32
32
|
system
|
|
33
33
|
};
|
|
34
|
-
}
|
|
35
|
-
|
|
34
|
+
};
|
|
35
|
+
const getSystemInfo = () => {
|
|
36
36
|
initBrowserInfo();
|
|
37
37
|
const deviceInfo = getDeviceInfo();
|
|
38
38
|
const { ua, browserName, browserVersion, osname, osversion } = browserInfo;
|
|
@@ -46,7 +46,11 @@ function getSystemInfo() {
|
|
|
46
46
|
ua
|
|
47
47
|
});
|
|
48
48
|
return systemInfo;
|
|
49
|
-
}
|
|
49
|
+
};
|
|
50
|
+
const isMobile = () => {
|
|
51
|
+
return getDeviceInfo().deviceType === "MOBILE";
|
|
52
|
+
};
|
|
50
53
|
export {
|
|
51
|
-
getSystemInfo
|
|
54
|
+
getSystemInfo,
|
|
55
|
+
isMobile
|
|
52
56
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFingerprint } from "./finger-print.js";
|
|
2
2
|
import "./get-browser-info.js";
|
|
3
3
|
import { getSystemInfo } from "./get-system-info.js";
|
|
4
|
-
|
|
4
|
+
const getTimeZoneOffset = () => {
|
|
5
5
|
let offsetMinutes = (/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
6
6
|
const offsetHours = Math.abs(Math.floor(offsetMinutes / 60));
|
|
7
7
|
const offsetSign = offsetMinutes < 0 ? "+" : "-";
|
|
@@ -9,8 +9,8 @@ function getTimeZoneOffset() {
|
|
|
9
9
|
const hour = offsetHours.toString().padStart(2, "0");
|
|
10
10
|
const min = offsetMinutes.toString().padStart(2, "0");
|
|
11
11
|
return `${offsetSign}${hour}:${min}`;
|
|
12
|
-
}
|
|
13
|
-
async
|
|
12
|
+
};
|
|
13
|
+
const getBrowser = async () => {
|
|
14
14
|
const { ua, deviceType, osName } = getSystemInfo();
|
|
15
15
|
const { colorDepth, height: screenHeight, width: screenWidth } = window.screen;
|
|
16
16
|
return {
|
|
@@ -26,7 +26,7 @@ async function getBrowser() {
|
|
|
26
26
|
osName,
|
|
27
27
|
deviceFingerprintId: await getFingerprint()
|
|
28
28
|
};
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
export {
|
|
31
31
|
getBrowser
|
|
32
32
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.paykka-card-checkout,.paykka-card-checkout *{box-sizing:border-box}@media (min-width: 480px){.paykka-card-checkout-ali-pay__email{padding-bottom:20px}}.paykka-card-checkout-ali-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__error{margin-top:20px}}.paykka-card-checkout-ali-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__button{margin-top:20px}}.paykka-card-checkout-address-field__first-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-bottom-right-radius:0;border-bottom-left-radius:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-radius:0;border-top:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-top-right-radius:0;border-top-left-radius:0;border-top:0}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-form-item{font-size:16px}.paykka-card-checkout-form-item__label{margin-bottom:8px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}@media (min-width: 480px){.paykka-card-checkout-form-item__label{margin-bottom:10px}}.paykka-card-checkout-form-item__error-text{margin-top:4px;color:#f53f3f;font-size:14px}.paykka-card-checkout-input{position:relative;box-sizing:border-box;font-size:16px}.paykka-card-checkout-input__input-wrapper{display:flex;align-items:center;height:44px;width:100%;border-radius:8px;border:1px solid #E1E1E5;transition:border .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);caret-color:var(--paykka-card-checkout-input-color, #4F43DF) .paykka-card-checkout-input__input-wrapper --error;caret-color-border:1px solid #F53F3F}.paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-input__input-wrapper:focus{border:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-input__input-wrapper-disabled{cursor:not-allowed;background:#f5f5f7}.paykka-card-checkout-input__input-wrapper-disabled:active,.paykka-card-checkout-input__input-wrapper-disabled--focus,.paykka-card-checkout-input__input-wrapper-disabled:focus{border:1px solid #F5F5F7;box-shadow:0 0 0 2px #f5f5f7}.paykka-card-checkout-input__input{outline:none;border:none;height:100%;width:100%;border-radius:8px;caret-color:var(--paykka-card-checkout-input-color, #4F43DF);font-size:16px;padding-left:12px;background-color:transparent}.paykka-card-checkout-input__input::placeholder{color:#c2c2c2}.paykka-card-checkout-input__input:-webkit-autofill,.paykka-card-checkout-input__input:-internal-autofill-selected{background-color:transparent!important}.paykka-card-checkout-input__right-icon{padding-right:12px;display:flex;align-items:center;flex-shrink:0;margin-left:12px}.paykka-card-checkout-input__left-icon{padding-left:12px;display:flex;align-items:center;flex-shrink:0;margin-right:12px}.paykka-card-checkout-select__wrapper{width:100%;position:relative;cursor:pointer}.paykka-card-checkout-select__render-label{position:absolute;top:0;line-height:44px;height:44px;padding:0 16px;display:flex}.paykka-card-checkout-select__render-label--placeholder{color:#c2c2c2}.paykka-card-checkout-select__render-label--hidden{visibility:hidden}.paykka-card-checkout-select__menu{margin-top:4px;width:100%;max-height:260px;background:#fff;box-shadow:0 4px 14px #0000001a;border-radius:4px;border:1px solid #EBEBEF;overflow-y:auto;z-index:999;position:absolute}.paykka-card-checkout-select__menu-item{padding:6px 12px;line-height:32px;color:#626266;cursor:pointer;display:flex;justify-content:space-between}.paykka-card-checkout-select__menu-item:hover,.paykka-card-checkout-select__menu-item:active,.paykka-card-checkout-select__menu-item--selected,.paykka-card-checkout-select__menu-item:focus{color:#1f1f1f;background:#f3f3f5}.paykka-card-checkout-select__menu-item-icon{margin-left:10px;display:flex;align-items:center}.paykka-card-checkout-select__menu-no-data{height:200px;display:flex;justify-content:center;align-items:center;color:#c2c2c2}.paykka-card-checkout-info{display:flex;align-items:center;padding:10px 14px;border-radius:4px}.paykka-card-checkout-info--error{background-color:#ffece8}.paykka-card-checkout-info__icon{margin-right:8px;height:1.3em;display:flex;align-items:center}.paykka-card-checkout-info__content{text-align:justify;word-break:break-all}.paykka-card-checkout-recurring-tip{display:flex;color:#a9a9a9}.paykka-card-checkout-recurring-tip__icon{width:20px;display:flex;padding-top:4px;padding-right:4px}.paykka-card-checkout-submit-button--success{opacity:1!important;background-color:#00b42a!important}.paykka-card-checkout-submit-button__text{line-height:1}.paykka-card-checkout-submit-button__text--not-verified{color:#fff9}.paykka-card-checkout-button{display:flex;align-items:center;justify-content:center;width:100%;height:44px;padding:0 14px;border-radius:8px;border:0;background-color:var(--paykka-card-checkout-button-bg-color, #4F43DF);color:var(--paykka-card-checkout-button-text-color, #fff);font-size:16px;cursor:pointer;text-decoration:none;transition:background-color .3s cubic-bezier(.4,0,.2,1)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):hover{background-color:var(--paykka-card-checkout-button-bg-color-hover, #3f33bb)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):active{background-color:var(--paykka-card-checkout-button-bg-color-active, #312498)}.paykka-card-checkout-button--loading{cursor:wait}.paykka-card-checkout-button--disabled{cursor:not-allowed;opacity:.5}.paykka-card-checkout-button--dashed{border:1px dashed #DFDFE5;color:#1f1f1f;background-color:transparent}.paykka-card-checkout-button__icon{display:flex;align-items:center;margin-right:12px}.paykka-card-checkout-loading-check{display:inline-flex;align-items:center;overflow:hidden;--circle-transition-time: .3s;--check-dashoffset: 50}.paykka-card-checkout-loading-check__circle{transition:stroke-dasharray var(--circle-transition-time) linear}.paykka-card-checkout-loading-check__circle--loading{animation:spin 1s infinite linear;transform-origin:center}.paykka-card-checkout-loading-check__check{stroke-dasharray:var(--check-dashoffset);stroke-dashoffset:var(--check-dashoffset);animation:tick .5s ease-out;animation-fill-mode:forwards;animation-delay:var(--circle-transition-time)}@keyframes tick{0%{stroke-dashoffset:var(--check-dashoffset)}to{stroke-dashoffset:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.paykka-card-checkout-card{min-width:280px}.paykka-card-checkout-card__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__field{margin-bottom:20px}}.paykka-card-checkout-card__center{display:flex;justify-content:space-between}.paykka-card-checkout-card__center>div{width:calc((100% - 20px)/2);transition:width .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__center>div{width:calc((100% - 32px)/2)}}.paykka-card-checkout-card__card-info{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__card-info{margin-bottom:20px}}.paykka-card-checkout-card__holder-name{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__holder-name{margin-bottom:20px}}.paykka-card-checkout-card__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__button{margin-top:20px}}.paykka-card-checkout-card__card-brands{margin-top:8px}.paykka-card-checkout-card__card-number-wrapper{position:relative}.paykka-card-checkout-card__change-box{display:flex;align-items:center;color:#4f43df;font-size:14px;position:absolute;top:0;right:0;cursor:pointer}.paykka-card-checkout-card__card-selector-wrapper{display:flex;justify-content:space-between}.paykka-card-checkout-card__address{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__address{margin-bottom:20px}}.paykka-card-checkout-card__store-checkbox{margin-top:16px}@media (min-width: 480px){.paykka-card-checkout-card__store-checkbox{margin-top:20px}}.paykka-card-checkout-card-brands{display:flex;flex-wrap:wrap;gap:6px}.paykka-card-checkout-card-brands__more{line-height:32px;font-size:13px;color:#687282}.paykka-card-checkout-card-selector__action{padding:8px 12px}.paykka-card-checkout-card-selector__label{display:flex;align-items:center}.paykka-card-checkout-card-selector__card-no{margin-left:12px}.paykka-card-checkout-card-selector__change{display:flex;align-items:center;color:#4f43df;font-size:14px}.paykka-card-checkout-card-no__wrapper{display:flex;align-items:center}.paykka-card-checkout-card-no__dot{width:4px;height:4px;background:currentColor;margin-right:4px;border-radius:50%}.paykka-card-checkout-card-no__card-no{margin-left:4px}.paykka-card-checkout-check-box{display:inline-flex;align-items:center;font-size:14px;background-color:transparent;cursor:pointer}.paykka-card-checkout-check-box:hover .paykka-card-checkout-check-box__inner{border-color:#4f43df}.paykka-card-checkout-check-box--checked .paykka-card-checkout-check-box__inner{border-color:#4f43df;background-color:#4f43df}.paykka-card-checkout-check-box__inner{width:14px;height:14px;border:1px solid #E1E1E5;border-radius:2px;margin-right:8px;transition:border-color .2s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.paykka-card-checkout-modal{position:fixed;left:0;right:0;top:0;bottom:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-modal__mask{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#0006}.paykka-card-checkout-modal__content{position:relative;z-index:9999;border-radius:8px;background-color:#fff;box-shadow:0 8px 16px -8px #00000014,0 12px 32px #0000000f,0 16px 48px 16px #0000000a;display:flex;flex-direction:column}.paykka-card-checkout-modal__close{cursor:pointer;right:0;position:absolute;transform:translateY(-150%);color:#d2d2d2}.paykka-card-checkout-modal__close:hover{color:#fff}.paykka-card-checkout-modal__body{flex:1;padding:36px 28px 24px}.paykka-card-checkout-three-ds-auth__content{height:100%}.paykka-card-checkout-three-ds-auth__last-three-ds{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}.paykka-card-checkout-three-ds-auth__last-three-ds-title{margin-top:20px;margin-bottom:40px;color:#1f1f1f;font-size:20px;font-weight:700;text-align:center}.paykka-card-checkout-combined-card-info{width:100%;height:100%;display:flex}.paykka-card-checkout-combined-card-info__card-number{flex:1}.paykka-card-checkout-combined-card-info__expire-date{width:100px}.paykka-card-checkout-combined-card-info__cvv{width:60px}.paykka-card-checkout-combined-card-info__blank-icon{width:16px;height:16px}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__email{padding-bottom:20px}}.paykka-card-checkout-wechat-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__error{margin-top:20px}}.paykka-card-checkout-wechat-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__button{margin-top:20px}}.paykka-card-checkout-apple-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-apple-pay__error{margin-bottom:20px}}.paykka-card-checkout-apple-pay__button{width:100%;display:flex;align-items:center;justify-content:center;height:44px;--apple-pay-button-width: 100%;--apple-pay-button-height: 44px;--apple-pay-button-border-radius: 8px;--apple-pay-button-padding: 0px 0px;--apple-pay-button-box-sizing: border-box}.paykka-card-checkout-google-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-google-pay__error{margin-bottom:20px}}.paykka-card-checkout-sepa{min-width:280px}.paykka-card-checkout-sepa__field{margin-bottom:24px}.paykka-card-checkout-sepa__holder-name{padding-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-sepa__holder-name{padding-bottom:20px}}.paykka-card-checkout-sepa__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-sepa__button{margin-top:20px}}.paykka-card-checkout-payment-tabs{display:flex;flex-wrap:nowrap;justify-content:start;column-gap:6px}.paykka-card-checkout-payment-tabs__tab{border:2px solid #E1E1E5;padding:12px;border-radius:12px;width:calc((100% - 12px) / 3)}@media (min-width: 480px){.paykka-card-checkout-payment-tabs__tab{padding:16px}}.paykka-card-checkout-payment-tabs__name{color:#626266}::-webkit-scrollbar{height:6px;width:6px}::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}::-webkit-scrollbar-button{display:none!important}::-moz-scrollbar-button{display:none!important}.paykka-card-checkout-drop-in__header-payment{margin-bottom:10px}.paykka-card-checkout-drop-in__other{display:flex;justify-content:center;align-items:center;margin-top:14px}@media (min-width: 480px){.paykka-card-checkout-drop-in__other{margin-top:30px}}.paykka-card-checkout-drop-in__other-text{margin:0 14px;color:#6e6e7e}.paykka-card-checkout-drop-in__other-line{background-color:#dfdfe5;flex-grow:.5;height:1px}.paykka-card-checkout-drop-in__tabs-wrapper{margin-top:16px;margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-drop-in__tabs-wrapper{margin-top:24px;margin-bottom:24px}}
|
|
1
|
+
.paykka-card-checkout,.paykka-card-checkout *{box-sizing:border-box}@media (min-width: 480px){.paykka-card-checkout-ali-pay__email{padding-bottom:20px}}.paykka-card-checkout-ali-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__error{margin-top:20px}}.paykka-card-checkout-ali-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__button{margin-top:20px}}.paykka-card-checkout-address-field__first-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-bottom-right-radius:0;border-bottom-left-radius:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-radius:0;border-top:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-top-right-radius:0;border-top-left-radius:0;border-top:0}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-form-item{font-size:16px}.paykka-card-checkout-form-item__label{margin-bottom:8px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}@media (min-width: 480px){.paykka-card-checkout-form-item__label{margin-bottom:10px}}.paykka-card-checkout-form-item__error-text{margin-top:4px;color:#f53f3f;font-size:14px}.paykka-card-checkout-input{position:relative;box-sizing:border-box;font-size:16px}.paykka-card-checkout-input__input-wrapper{display:flex;align-items:center;height:44px;width:100%;border-radius:8px;border:1px solid #E1E1E5;transition:border .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);caret-color:var(--paykka-card-checkout-input-color, #4F43DF) .paykka-card-checkout-input__input-wrapper --error;caret-color-border:1px solid #F53F3F}.paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-input__input-wrapper:focus{border:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-input__input-wrapper-disabled{cursor:not-allowed;background:#f5f5f7}.paykka-card-checkout-input__input-wrapper-disabled:active,.paykka-card-checkout-input__input-wrapper-disabled--focus,.paykka-card-checkout-input__input-wrapper-disabled:focus{border:1px solid #F5F5F7;box-shadow:0 0 0 2px #f5f5f7}.paykka-card-checkout-input__input{outline:none;border:none;height:100%;width:100%;border-radius:8px;caret-color:var(--paykka-card-checkout-input-color, #4F43DF);font-size:16px;padding-left:12px;background-color:transparent}.paykka-card-checkout-input__input::placeholder{color:#c2c2c2}.paykka-card-checkout-input__input:-webkit-autofill,.paykka-card-checkout-input__input:-internal-autofill-selected{background-color:transparent!important}.paykka-card-checkout-input__right-icon{padding-right:12px;display:flex;align-items:center;flex-shrink:0;margin-left:12px}.paykka-card-checkout-input__left-icon{padding-left:12px;display:flex;align-items:center;flex-shrink:0;margin-right:12px}.paykka-card-checkout-select__wrapper{width:100%;position:relative;cursor:pointer}.paykka-card-checkout-select__render-label{position:absolute;top:0;line-height:44px;height:44px;padding:0 16px;display:flex}.paykka-card-checkout-select__render-label--placeholder{color:#c2c2c2}.paykka-card-checkout-select__render-label--hidden{visibility:hidden}.paykka-card-checkout-select__menu{margin-top:4px;width:100%;max-height:260px;background:#fff;box-shadow:0 4px 14px #0000001a;border-radius:4px;border:1px solid #EBEBEF;overflow-y:auto;z-index:999;position:absolute}.paykka-card-checkout-select__menu-item{padding:6px 12px;line-height:32px;color:#626266;cursor:pointer;display:flex;justify-content:space-between}.paykka-card-checkout-select__menu-item:hover,.paykka-card-checkout-select__menu-item:active,.paykka-card-checkout-select__menu-item--selected,.paykka-card-checkout-select__menu-item:focus{color:#1f1f1f;background:#f3f3f5}.paykka-card-checkout-select__menu-item-icon{margin-left:10px;display:flex;align-items:center}.paykka-card-checkout-select__menu-no-data{height:200px;display:flex;justify-content:center;align-items:center;color:#c2c2c2}.paykka-card-checkout-info{display:flex;align-items:center;padding:10px 14px;border-radius:4px}.paykka-card-checkout-info--error{background-color:#ffece8}.paykka-card-checkout-info__icon{margin-right:8px;height:1.3em;display:flex;align-items:center}.paykka-card-checkout-info__content{text-align:justify;word-break:break-all}.paykka-card-checkout-recurring-tip{display:flex;color:#a9a9a9}.paykka-card-checkout-recurring-tip__icon{width:20px;display:flex;padding-top:4px;padding-right:4px}.paykka-card-checkout-submit-button--success{opacity:1!important;background-color:#00b42a!important}.paykka-card-checkout-submit-button__text{line-height:1}.paykka-card-checkout-submit-button__text--not-verified{color:#fff9}.paykka-card-checkout-button{display:flex;align-items:center;justify-content:center;width:100%;height:44px;padding:0 14px;border-radius:8px;border:0;background-color:var(--paykka-card-checkout-button-bg-color, #4F43DF);color:var(--paykka-card-checkout-button-text-color, #fff);font-size:16px;cursor:pointer;text-decoration:none;transition:background-color .3s cubic-bezier(.4,0,.2,1)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):hover{background-color:var(--paykka-card-checkout-button-bg-color-hover, #3f33bb)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):active{background-color:var(--paykka-card-checkout-button-bg-color-active, #312498)}.paykka-card-checkout-button--loading{cursor:wait}.paykka-card-checkout-button--disabled{cursor:not-allowed;opacity:.5}.paykka-card-checkout-button--dashed{border:1px dashed #DFDFE5;color:#1f1f1f;background-color:transparent}.paykka-card-checkout-button__icon{display:flex;align-items:center;margin-right:12px}.paykka-card-checkout-loading-check{display:inline-flex;align-items:center;overflow:hidden;--circle-transition-time: .3s;--check-dashoffset: 50}.paykka-card-checkout-loading-check__circle{transition:stroke-dasharray var(--circle-transition-time) linear}.paykka-card-checkout-loading-check__circle--loading{animation:spin 1s infinite linear;transform-origin:center}.paykka-card-checkout-loading-check__check{stroke-dasharray:var(--check-dashoffset);stroke-dashoffset:var(--check-dashoffset);animation:tick .5s ease-out;animation-fill-mode:forwards;animation-delay:var(--circle-transition-time)}@keyframes tick{0%{stroke-dashoffset:var(--check-dashoffset)}to{stroke-dashoffset:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.paykka-card-checkout-card{min-width:280px}.paykka-card-checkout-card__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__field{margin-bottom:20px}}.paykka-card-checkout-card__center{display:flex;justify-content:space-between}.paykka-card-checkout-card__center>div{width:calc((100% - 20px)/2);transition:width .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__center>div{width:calc((100% - 32px)/2)}}.paykka-card-checkout-card__card-info{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__card-info{margin-bottom:20px}}.paykka-card-checkout-card__holder-name{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__holder-name{margin-bottom:20px}}.paykka-card-checkout-card__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__button{margin-top:20px}}.paykka-card-checkout-card__card-brands{margin-top:8px}.paykka-card-checkout-card__card-number-wrapper{position:relative}.paykka-card-checkout-card__change-box{display:flex;align-items:center;color:#4f43df;font-size:14px;position:absolute;top:0;right:0;cursor:pointer}.paykka-card-checkout-card__card-selector-wrapper{display:flex;justify-content:space-between}.paykka-card-checkout-card__address{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__address{margin-bottom:20px}}.paykka-card-checkout-card__store-checkbox{margin-top:16px}@media (min-width: 480px){.paykka-card-checkout-card__store-checkbox{margin-top:20px}}.paykka-card-checkout-card-brands{display:flex;flex-wrap:wrap;gap:6px}.paykka-card-checkout-card-brands__more{line-height:32px;font-size:13px;color:#687282}.paykka-card-checkout-card-selector__action{padding:8px 12px}.paykka-card-checkout-card-selector__label{display:flex;align-items:center}.paykka-card-checkout-card-selector__card-no{margin-left:12px}.paykka-card-checkout-card-selector__change{display:flex;align-items:center;color:#4f43df;font-size:14px}.paykka-card-checkout-card-no__wrapper{display:flex;align-items:center}.paykka-card-checkout-card-no__dot{width:4px;height:4px;background:currentColor;margin-right:4px;border-radius:50%}.paykka-card-checkout-card-no__card-no{margin-left:4px}.paykka-card-checkout-check-box{display:inline-flex;align-items:center;font-size:14px;background-color:transparent;cursor:pointer}.paykka-card-checkout-check-box:hover .paykka-card-checkout-check-box__inner{border-color:#4f43df}.paykka-card-checkout-check-box--checked .paykka-card-checkout-check-box__inner{border-color:#4f43df;background-color:#4f43df}.paykka-card-checkout-check-box__inner{width:14px;height:14px;border:1px solid #E1E1E5;border-radius:2px;margin-right:8px;transition:border-color .2s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.paykka-card-checkout-modal{position:fixed;left:0;right:0;top:0;bottom:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-modal__mask{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#0006}.paykka-card-checkout-modal__content{position:relative;z-index:9999;border-radius:8px;background-color:#fff;box-shadow:0 8px 16px -8px #00000014,0 12px 32px #0000000f,0 16px 48px 16px #0000000a;display:flex;flex-direction:column}.paykka-card-checkout-modal__close{cursor:pointer;right:0;position:absolute;transform:translateY(-150%);color:#d2d2d2}.paykka-card-checkout-modal__close:hover{color:#fff}.paykka-card-checkout-modal__body{flex:1;padding:36px 28px 24px}.paykka-card-checkout-three-ds-auth__content{height:100%}.paykka-card-checkout-three-ds-auth__last-three-ds{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}.paykka-card-checkout-three-ds-auth__last-three-ds-title{margin-top:20px;margin-bottom:40px;color:#1f1f1f;font-size:20px;font-weight:700;text-align:center}.paykka-card-checkout-combined-card-info{width:100%;height:100%;display:flex}.paykka-card-checkout-combined-card-info__card-number{flex:1}.paykka-card-checkout-combined-card-info__expire-date{width:100px}.paykka-card-checkout-combined-card-info__cvv{width:60px}.paykka-card-checkout-combined-card-info__blank-icon{width:16px;height:16px}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__email{padding-bottom:20px}}.paykka-card-checkout-wechat-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__error{margin-top:20px}}.paykka-card-checkout-wechat-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__button{margin-top:20px}}.paykka-card-checkout-apple-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-apple-pay__error{margin-bottom:20px}}.paykka-card-checkout-apple-pay__button{width:100%;display:flex;align-items:center;justify-content:center;height:44px;--apple-pay-button-width: 100%;--apple-pay-button-height: 44px;--apple-pay-button-border-radius: 8px;--apple-pay-button-padding: 0px 0px;--apple-pay-button-box-sizing: border-box}.paykka-card-checkout-google-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-google-pay__error{margin-bottom:20px}}.paykka-card-checkout-sepa{min-width:280px}.paykka-card-checkout-sepa__field{margin-bottom:24px}.paykka-card-checkout-sepa__holder-name{padding-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-sepa__holder-name{padding-bottom:20px}}.paykka-card-checkout-sepa__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-sepa__button{margin-top:20px}}.paykka-card-checkout-boost{min-width:280px}.paykka-card-checkout-boost__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-boost__field{margin-bottom:20px}}.paykka-card-checkout-boost__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-boost__button{margin-top:20px}}.paykka-card-checkout-guide-card{border:1px solid #E1E1E5;border-radius:12px;padding:14px;margin-bottom:24px}@media (min-width: 480px){.paykka-card-checkout-guide-card{padding:16px;margin-bottom:32px}}.paykka-card-checkout-guide-card__content{display:flex;align-items:center}.paykka-card-checkout-guide-card__icon{margin-left:6px}.paykka-card-checkout-guide-card__description{color:#a3a3a7;font-size:14px;margin-left:12px}.paykka-card-checkout-nine-pay{min-width:280px}.paykka-card-checkout-nine-pay__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-nine-pay__field{margin-bottom:20px}}.paykka-card-checkout-nine-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-nine-pay__button{margin-top:20px}}.paykka-card-checkout-line-pay{min-width:280px}.paykka-card-checkout-line-pay__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-line-pay__field{margin-bottom:20px}}.paykka-card-checkout-line-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-line-pay__button{margin-top:20px}}.paykka-card-checkout-tng-wallet{min-width:280px}.paykka-card-checkout-tng-wallet__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-tng-wallet__field{margin-bottom:20px}}.paykka-card-checkout-tng-wallet__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-tng-wallet__button{margin-top:20px}}.paykka-card-checkout-may-bank-qr-pay{min-width:280px}.paykka-card-checkout-may-bank-qr-pay__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-may-bank-qr-pay__field{margin-bottom:20px}}.paykka-card-checkout-may-bank-qr-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-may-bank-qr-pay__button{margin-top:20px}}.paykka-card-checkout-shopee-pay{min-width:280px}.paykka-card-checkout-shopee-pay__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-shopee-pay__field{margin-bottom:20px}}.paykka-card-checkout-shopee-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-shopee-pay__button{margin-top:20px}}.paykka-card-checkout-grab-pay{min-width:280px}.paykka-card-checkout-grab-pay__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-grab-pay__field{margin-bottom:20px}}.paykka-card-checkout-grab-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-grab-pay__button{margin-top:20px}}.paykka-card-checkout-qr-code-modal{padding-top:20px;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-qr-code-modal__container{width:208px}.paykka-card-checkout-qr-code-modal__title{font-size:18px;font-weight:550;text-align:center}.paykka-card-checkout-qr-code-modal__body{margin:20px 0;padding:16px;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-qr-code-modal__icon{height:22px}.paykka-card-checkout-qr-code-modal__qr-code{margin-top:16px;width:176px;height:176px;border-radius:4px;background-color:#fff;overflow:hidden}.paykka-card-checkout-qr-code-modal__expired-time{margin-top:16px;color:#fff;font-size:14px;text-align:center}.paykka-card-checkout-qr-code-modal__expired-time-text{color:#fff;font-size:14px;text-align:center}.paykka-card-checkout-qr-code-modal__amount{font-size:22px;color:#1f1f1f;font-weight:550}.paykka-card-checkout-gcash{min-width:280px}.paykka-card-checkout-gcash__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-gcash__field{margin-bottom:20px}}.paykka-card-checkout-gcash__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-gcash__button{margin-top:20px}}.paykka-card-checkout-paymaya{min-width:280px}.paykka-card-checkout-paymaya__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-paymaya__field{margin-bottom:20px}}.paykka-card-checkout-paymaya__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-paymaya__button{margin-top:20px}}.paykka-card-checkout-payment-tabs{display:flex;flex-wrap:nowrap;justify-content:flex-start;column-gap:6px}.paykka-card-checkout-payment-tabs__tab{border:2px solid #E1E1E5;padding:12px;border-radius:12px;width:calc((100% - 12px) / 3)}@media (min-width: 480px){.paykka-card-checkout-payment-tabs__tab{padding:16px}}.paykka-card-checkout-payment-tabs__name{color:#626266}.paykka-card-checkout-drop-in__header-payment{margin-bottom:10px}.paykka-card-checkout-drop-in__other{display:flex;justify-content:center;align-items:center;margin-top:14px;margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-drop-in__other{margin-top:30px;margin-bottom:24px}}.paykka-card-checkout-drop-in__accordion-icon{display:flex;align-items:center}.paykka-card-checkout-drop-in__other-text{margin:0 14px;color:#6e6e7e}.paykka-card-checkout-drop-in__other-line{background-color:#dfdfe5;flex-grow:.5;height:1px}.paykka-card-checkout-drop-in__tabs-wrapper{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-drop-in__tabs-wrapper{margin-bottom:24px}}.paykka-card-checkout-drop-in__accordion-icon{margin-right:10px}::-webkit-scrollbar{height:6px;width:6px}::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}::-webkit-scrollbar-button{display:none!important}::-moz-scrollbar-button{display:none!important}.paykka-card-checkout-accordion-item{border:1px solid #E1E1E5;border-radius:8px;margin-bottom:10px;padding:0 16px;transition:all .3s linear}@media (min-width: 480px){.paykka-card-checkout-accordion-item{padding:0 14px}}.paykka-card-checkout-accordion-item--disabled{cursor:not-allowed;opacity:.4}.paykka-card-checkout-accordion-item__header{cursor:pointer;display:flex;align-items:center;padding-top:14px;padding-bottom:16px;font-size:14px;line-height:20px;transition:all .3s linear}@media (min-width: 480px){.paykka-card-checkout-accordion-item__header{padding-top:16px;padding-bottom:16px;font-size:16px;line-height:22px}}.paykka-card-checkout-accordion-item__title{font-size:16px;line-height:22px;color:#626266}.paykka-card-checkout-accordion-item__title--active{color:#4f43df}.paykka-card-checkout-accordion-item__content{max-height:0;opacity:0;overflow:hidden}.paykka-card-checkout-accordion-item__content--active{opacity:1;padding-bottom:14px}@media (min-width: 480px){.paykka-card-checkout-accordion-item__content--active{padding-bottom:16px}}
|
package/dist/types/api/http.d.ts
CHANGED
|
@@ -6,15 +6,9 @@ export interface RequestOptions {
|
|
|
6
6
|
export declare enum EHttpCode {
|
|
7
7
|
INTERNAL_SERVER_ERROR = "500"
|
|
8
8
|
}
|
|
9
|
-
export declare
|
|
10
|
-
declare function get<T = any>(url: string, params?: Recordable, options?: RequestOptions): Promise<T>;
|
|
11
|
-
declare function post<T = any>(url: string, params?: Recordable, options?: RequestOptions): Promise<T>;
|
|
9
|
+
export declare const request: <T = any, P = any>(method: 'get' | 'post', url: string, params?: P, { timeout, headers, locale }?: RequestOptions) => Promise<T>;
|
|
12
10
|
export declare const http: {
|
|
13
|
-
get:
|
|
14
|
-
post:
|
|
11
|
+
get: <T = any, P = any>(url: string, params?: P, options?: RequestOptions) => Promise<T>;
|
|
12
|
+
post: <T_1 = any, P_1 = any>(url: string, params?: P_1 | undefined, options?: RequestOptions) => Promise<T_1>;
|
|
15
13
|
};
|
|
16
|
-
export declare
|
|
17
|
-
constructor(message: string);
|
|
18
|
-
}
|
|
19
|
-
export declare function isTimeoutError(error: any): boolean;
|
|
20
|
-
export {};
|
|
14
|
+
export declare const isTimeoutError: (error: any) => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PayKKaCheckout } from '../../../core';
|
|
1
2
|
import { type RequestOptions } from '../../http';
|
|
2
3
|
export declare function aliPay({ sessionId, clientKey, bill }: {
|
|
3
4
|
sessionId: string;
|
|
@@ -12,7 +13,7 @@ export declare function aliPay({ sessionId, clientKey, bill }: {
|
|
|
12
13
|
address1?: string | null;
|
|
13
14
|
address2?: string | null;
|
|
14
15
|
};
|
|
15
|
-
}, options?: RequestOptions): Promise<import("..").PayRes>;
|
|
16
|
+
}, core: PayKKaCheckout, options?: RequestOptions): Promise<import("..").PayRes>;
|
|
16
17
|
export declare function getAliPayInfo({ sessionId, clientKey }: {
|
|
17
18
|
sessionId: string;
|
|
18
19
|
clientKey?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PayKKaCheckout } from '../../../core';
|
|
1
2
|
import { type RequestOptions } from '../../http';
|
|
2
3
|
import type { PayBill } from '../type';
|
|
3
4
|
export declare function getMerchantSession(options?: RequestOptions): Promise<any>;
|
|
@@ -7,7 +8,7 @@ export declare function applePay({ sessionId, clientKey, token, bill, browser }:
|
|
|
7
8
|
token: string;
|
|
8
9
|
bill: PayBill;
|
|
9
10
|
browser: Recordable;
|
|
10
|
-
}, options?: RequestOptions): Promise<import("../type").PayRes>;
|
|
11
|
+
}, core: PayKKaCheckout, options?: RequestOptions): Promise<import("../type").PayRes>;
|
|
11
12
|
export declare function getApplePayInfo({ sessionId, clientKey }: {
|
|
12
13
|
sessionId: string;
|
|
13
14
|
clientKey?: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PayKKaCheckout } from '../../../core';
|
|
2
|
+
import { type RequestOptions } from '../../http';
|
|
3
|
+
export declare const boostPay: ({ sessionId, clientKey, payment, bill, browser }: {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
clientKey?: string;
|
|
6
|
+
payment: {
|
|
7
|
+
paymentMethod: string;
|
|
8
|
+
};
|
|
9
|
+
bill: {
|
|
10
|
+
email: string;
|
|
11
|
+
country?: string | null;
|
|
12
|
+
province?: string | null;
|
|
13
|
+
city?: string | null;
|
|
14
|
+
area?: string | null;
|
|
15
|
+
postCode?: string | null;
|
|
16
|
+
address1?: string | null;
|
|
17
|
+
address2?: string | null;
|
|
18
|
+
};
|
|
19
|
+
browser: Recordable;
|
|
20
|
+
}, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
|
|
21
|
+
export declare const getBoostPayInfo: ({ sessionId, clientKey }: {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
clientKey?: string;
|
|
24
|
+
}, options?: RequestOptions) => Promise<import("..").PayRes>;
|
|
@@ -24,7 +24,7 @@ export declare function cardPay({ sessionId, clientKey, payment, bill, browser }
|
|
|
24
24
|
address2?: string | null;
|
|
25
25
|
};
|
|
26
26
|
browser: Recordable;
|
|
27
|
-
}, options?: RequestOptions): Promise<import("..").PayRes>;
|
|
27
|
+
}, extraParams?: Recordable, options?: RequestOptions): Promise<import("..").PayRes>;
|
|
28
28
|
export declare function getCardPayInfo({ sessionId, clientKey }: {
|
|
29
29
|
sessionId: string;
|
|
30
30
|
clientKey?: string;
|
|
@@ -2,5 +2,5 @@ import { type RequestOptions } from '../../http';
|
|
|
2
2
|
import type { CheckoutRes, QueryCheckoutParams } from './type';
|
|
3
3
|
export * from './type';
|
|
4
4
|
export * from './map';
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
5
|
+
export declare const getCheckoutInfo: ({ sessionId, clientKey }: QueryCheckoutParams, options?: RequestOptions) => Promise<CheckoutRes>;
|
|
6
|
+
export declare const onceGetCheckoutInfo: ({ sessionId, clientKey }: QueryCheckoutParams, options?: RequestOptions) => Promise<CheckoutRes>;
|
|
@@ -36,9 +36,18 @@ export interface CardTokenInfo {
|
|
|
36
36
|
last4: string;
|
|
37
37
|
billingAddressFilled: boolean;
|
|
38
38
|
}
|
|
39
|
+
export interface WalletChannelParams {
|
|
40
|
+
neededToCompute?: boolean;
|
|
41
|
+
fee?: Amount;
|
|
42
|
+
totalAmount?: Amount;
|
|
43
|
+
percentageFee?: number;
|
|
44
|
+
transactionFee?: number;
|
|
45
|
+
}
|
|
39
46
|
export interface ChannelParams {
|
|
40
47
|
applePay?: ChannelApplePay;
|
|
41
48
|
googlePay?: ChannelGooglePay;
|
|
49
|
+
wechatPay?: WalletChannelParams;
|
|
50
|
+
aliPay?: WalletChannelParams;
|
|
42
51
|
}
|
|
43
52
|
export interface CheckoutRes {
|
|
44
53
|
merchantId: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PayKKaCheckout } from '../../../core';
|
|
2
|
+
import { type RequestOptions } from '../../http';
|
|
3
|
+
export declare const gcashPay: ({ sessionId, clientKey, payment, bill, browser }: {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
clientKey?: string;
|
|
6
|
+
payment: {
|
|
7
|
+
paymentMethod: string;
|
|
8
|
+
};
|
|
9
|
+
bill: {
|
|
10
|
+
email: string;
|
|
11
|
+
country?: string | null;
|
|
12
|
+
province?: string | null;
|
|
13
|
+
city?: string | null;
|
|
14
|
+
area?: string | null;
|
|
15
|
+
postCode?: string | null;
|
|
16
|
+
address1?: string | null;
|
|
17
|
+
address2?: string | null;
|
|
18
|
+
};
|
|
19
|
+
browser: Recordable;
|
|
20
|
+
}, core: PayKKaCheckout, options?: RequestOptions) => Promise<import("..").PayRes>;
|
|
21
|
+
export declare const getGcashPayInfo: ({ sessionId, clientKey }: {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
clientKey?: string;
|
|
24
|
+
}, options?: RequestOptions) => Promise<import("..").PayRes>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PayKKaCheckout } from '../../../core';
|
|
1
2
|
import { type RequestOptions } from '../../http';
|
|
2
3
|
import type { PayBill } from '../type';
|
|
3
4
|
export declare function googlePay({ sessionId, clientKey, token, bill, browser }: {
|
|
@@ -6,7 +7,7 @@ export declare function googlePay({ sessionId, clientKey, token, bill, browser }
|
|
|
6
7
|
token: string;
|
|
7
8
|
bill: PayBill;
|
|
8
9
|
browser: Recordable;
|
|
9
|
-
}, options?: RequestOptions): Promise<import("../type").PayRes>;
|
|
10
|
+
}, core: PayKKaCheckout, options?: RequestOptions): Promise<import("../type").PayRes>;
|
|
10
11
|
export declare function getGooglePayInfo({ sessionId, clientKey }: {
|
|
11
12
|
sessionId: string;
|
|
12
13
|
clientKey?: string;
|