@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/types/constant.d.ts
CHANGED
|
@@ -3,10 +3,9 @@ export declare const COMMON_CLASS_NAME = "paykka-card-checkout";
|
|
|
3
3
|
/** 具体的,未分类的支付方式,来自后端 */
|
|
4
4
|
export declare enum PaymentMethod {
|
|
5
5
|
ALL = "ALL",
|
|
6
|
-
ALI_PAY = "ALIPAY_PLUS",
|
|
7
|
-
WECHAT_PAY = "WECHAT_PAY_GLOBAL",
|
|
8
6
|
APPLE_PAY = "APPLE_PAY",
|
|
9
7
|
GOOGLE_PAY = "GOOGLE_PAY",
|
|
8
|
+
/** 银行卡支付 */
|
|
10
9
|
BANKCARD = "BANKCARD",
|
|
11
10
|
VISA = "VISA",
|
|
12
11
|
MASTER_CARD = "MASTER_CARD",
|
|
@@ -15,6 +14,20 @@ export declare enum PaymentMethod {
|
|
|
15
14
|
DINERS_CLUB = "DINERS_CLUB",
|
|
16
15
|
DISCOVER = "DISCOVER",
|
|
17
16
|
BOC = "BOC",
|
|
17
|
+
CHINA_UNION_PAY = "CHINA_UNION_PAY",
|
|
18
|
+
/** 钱包 */
|
|
19
|
+
ALI_PAY = "ALIPAY_PLUS",
|
|
20
|
+
WECHAT_PAY = "WECHAT_PAY_GLOBAL",
|
|
21
|
+
BOOST = "BOOST",
|
|
22
|
+
GRAB_PAY = "GRABPAY",
|
|
23
|
+
TNG_WALLET = "TNG_EWALLET",
|
|
24
|
+
MAY_BANK_QR_PAY = "MAYBANK_QRPAY",
|
|
25
|
+
SHOPEE_PAY = "SHOPEE_PAY",
|
|
26
|
+
LINE_PAY = "LINE_PAY",
|
|
27
|
+
NINE_PAY = "NINE_PAY",
|
|
28
|
+
GCASH = "G_CASH",
|
|
29
|
+
PAYMAYA = "PAYMAYA",
|
|
30
|
+
/** 目前没用 */
|
|
18
31
|
SEPA_DEBIT = "SEPA_DEBIT"
|
|
19
32
|
}
|
|
20
33
|
/** 按照大类区分的支付方式 */
|
|
@@ -24,9 +37,21 @@ export declare enum PaymentCategory {
|
|
|
24
37
|
APPLE_PAY = "applePay",
|
|
25
38
|
GOOGLE_PAY = "googlePay",
|
|
26
39
|
SEPA_DEBIT = "sepaDebit",
|
|
40
|
+
/** 钱包 */
|
|
27
41
|
WECHAT_PAY = "wechatPay",
|
|
28
|
-
ALI_PAY = "aliPay"
|
|
42
|
+
ALI_PAY = "aliPay",
|
|
43
|
+
BOOST = "boost",
|
|
44
|
+
GRAB_PAY = "grabPay",
|
|
45
|
+
TNG_WALLET = "tngEWallet",
|
|
46
|
+
MAY_BANK_QR_PAY = "mayBankQRPay",
|
|
47
|
+
SHOPEE_PAY = "shopeePay",
|
|
48
|
+
LINE_PAY = "linePay",
|
|
49
|
+
NINE_PAY = "ninePay",
|
|
50
|
+
GCASH = "gcash",
|
|
51
|
+
PAYMAYA = "paymaya"
|
|
29
52
|
}
|
|
53
|
+
export declare const PaymentMethod2CategoryMap: Partial<Record<PaymentMethod, PaymentCategory>>;
|
|
54
|
+
export declare const PaymentCategory2MethodMap: Partial<Record<PaymentCategory, PaymentMethod[]>>;
|
|
30
55
|
export declare const CardPaymentMethods: PaymentMethod[];
|
|
31
56
|
export declare enum PaymentType {
|
|
32
57
|
PURCHASE = "PURCHASE",
|
|
@@ -3,6 +3,7 @@ import type { CoreProps, PayKKaEnvConfig, PayKKaInitConfiguration } from '../typ
|
|
|
3
3
|
import { type ComponentInst } from './create';
|
|
4
4
|
import { Session } from './Session';
|
|
5
5
|
import getFraudDetectionInstance from '../out/fraud-detection';
|
|
6
|
+
import type { PaymentMethod } from '../constant';
|
|
6
7
|
export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
|
|
7
8
|
/**
|
|
8
9
|
* 收银台实例
|
|
@@ -10,6 +11,13 @@ export type FraudDetectionType = ReturnType<typeof getFraudDetectionInstance>;
|
|
|
10
11
|
*/
|
|
11
12
|
export declare class PayKKaCheckout {
|
|
12
13
|
#private;
|
|
14
|
+
/** 当前正在处理的支付方式,在第三方支付页面跳回收银台时,会通过 url 参数传递过来 */
|
|
15
|
+
processingPaymentMethod: PaymentMethod | null;
|
|
16
|
+
/**
|
|
17
|
+
* 当前启用的支付方式(禁用则展示禁用样式)
|
|
18
|
+
* 在 DropIn 且有正在处理的支付方式时,会设置为当前支付方式,并把其他支付方式设为禁用
|
|
19
|
+
*/
|
|
20
|
+
enablePaymentMethod: import("@preact/signals").Signal<PaymentMethod | null>;
|
|
13
21
|
constructor(config: PayKKaInitConfiguration);
|
|
14
22
|
private init;
|
|
15
23
|
private initSession;
|
|
@@ -20,10 +28,12 @@ export declare class PayKKaCheckout {
|
|
|
20
28
|
private initEnv;
|
|
21
29
|
private initLocale;
|
|
22
30
|
private initExtraParams;
|
|
31
|
+
private initOtherData;
|
|
23
32
|
get session(): Session;
|
|
24
33
|
get envConfig(): PayKKaEnvConfig;
|
|
25
34
|
get config(): PayKKaInitConfiguration;
|
|
26
35
|
/** 创建组件,把 session 作为组件的 props 传递 */
|
|
27
36
|
create<P extends Recordable>(component: ComponentType<P> | ((props: P) => JSX.Element), props?: Partial<P> | null): ComponentInst<P>;
|
|
28
37
|
getCoreProps(): CoreProps;
|
|
38
|
+
resetEnablePaymentMethod(): void;
|
|
29
39
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type RequestOptions, type QueryCheckoutParams } from '../api';
|
|
2
|
-
export declare
|
|
1
|
+
import { type RequestOptions, type QueryCheckoutParams, type CheckoutRes } from '../api';
|
|
2
|
+
export declare const querySession: ({ sessionId, clientKey }: QueryCheckoutParams, options?: RequestOptions) => Promise<CheckoutRes>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { SubmitButtonStatus } from '../components';
|
|
2
1
|
import type { Session } from '../core';
|
|
3
2
|
export declare function usePayState(session: Session): {
|
|
4
3
|
validated: boolean;
|
|
5
4
|
setValidated: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
|
|
6
|
-
submitButtonStatus: SubmitButtonStatus;
|
|
7
|
-
setSubmitButtonStatus: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<SubmitButtonStatus>>;
|
|
8
5
|
errorMsg: string;
|
|
9
6
|
setErrorMsg: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>;
|
|
10
7
|
i18n: import("../i18n").I18n;
|
|
@@ -11,7 +11,7 @@ export declare class I18n {
|
|
|
11
11
|
private currentLoadId;
|
|
12
12
|
private static instance;
|
|
13
13
|
constructor();
|
|
14
|
-
get(key: keyof Translation): string;
|
|
14
|
+
get(key: keyof Translation, params?: Record<string, string | number>): string;
|
|
15
15
|
get ready(): Signal<boolean>;
|
|
16
16
|
/** 加载国际化翻译文案 */
|
|
17
17
|
load(locale?: LocaleKeyType): void;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
'guideCard.redirectDescription': string;
|
|
3
|
+
'guideCard.scanQRCode': string;
|
|
2
4
|
'dropIn.card.label': string;
|
|
3
5
|
'dropIn.otherPaymentMethod': string;
|
|
6
|
+
'dropIn.boost.label': string;
|
|
7
|
+
'dropIn.TNGWallet.label': string;
|
|
8
|
+
'dropIn.shopeePay.label': string;
|
|
9
|
+
'dropIn.mayBankQRPay.label': string;
|
|
10
|
+
'dropIn.grabPay.label': string;
|
|
11
|
+
'dropIn.linePay.label': string;
|
|
12
|
+
'dropIn.ninePay.label': string;
|
|
13
|
+
'dropIn.gcash.label': string;
|
|
14
|
+
'dropIn.paymaya.label': string;
|
|
4
15
|
'card.cardNumber.label': string;
|
|
5
16
|
'card.cardNumber.incomplete': string;
|
|
6
17
|
'card.cardNumber.invalid': string;
|
|
@@ -54,5 +65,7 @@ declare const _default: {
|
|
|
54
65
|
'threeDS.authenticationSuccessful': string;
|
|
55
66
|
'threeDS.authenticationFailed': string;
|
|
56
67
|
'threeDS.returnToCheckout': string;
|
|
68
|
+
'qrCode.expired': string;
|
|
69
|
+
'qrCode.scanByGcash': string;
|
|
57
70
|
};
|
|
58
71
|
export default _default;
|
|
@@ -4,6 +4,11 @@ import type { CustomLocales, Translation } from './locales';
|
|
|
4
4
|
* 如果 locale 不符合,则取浏览器语言,若仍然不符合则用 en-GB
|
|
5
5
|
*/
|
|
6
6
|
export declare const getRealLocale: (locale: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 如果 local 不在语言列表中,则要看看是否是 en 或 zh 开头
|
|
9
|
+
* 如果都不是,则返回 undefined,这里不做英文兜底,由上层判断
|
|
10
|
+
*/
|
|
11
|
+
export declare const getLocalKey: (locale: string) => string | undefined;
|
|
7
12
|
export declare function loadTranslation(locale: string, customLocales?: CustomLocales): Promise<{
|
|
8
13
|
locale: string;
|
|
9
14
|
translation: Translation;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export * from './components';
|
|
|
2
2
|
export { type ComponentInst, create, querySession, Session, PayKKaCheckout, PayKKaError } from './core';
|
|
3
3
|
export { I18n, LocaleKey } from './i18n';
|
|
4
4
|
export { setApiUrl, setCDNUrl, setFraudDetectionEnv, setCustomReqHeaders, setCustomLocale, setCheckoutConfig } from './config';
|
|
5
|
-
export { getFingerprint } from './utils';
|
|
5
|
+
export { getFingerprint, redirectToPayment } from './utils';
|
|
@@ -3,6 +3,7 @@ import type { LocaleKeyType } from '../i18n';
|
|
|
3
3
|
import type { PayKKaCheckout, PayKKaError, Session } from '../core';
|
|
4
4
|
import type { FraudDetectionEnv } from './fraud-detection';
|
|
5
5
|
import type { FormValidateError } from '../components/internal/Form';
|
|
6
|
+
import type { PaymentMethod } from '../constant';
|
|
6
7
|
export * from './fraud-detection';
|
|
7
8
|
export * from './message';
|
|
8
9
|
export type CustomAttributes<T extends EventTarget, K extends keyof HTMLAttributes<T> = 'style' | 'className'> = Pick<HTMLAttributes<T>, K>;
|
|
@@ -38,10 +39,15 @@ export interface PayKKaInitConfiguration {
|
|
|
38
39
|
/** 收银台已过期时触发 */
|
|
39
40
|
onExpired?: () => void;
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* @internal
|
|
43
|
+
* 环境配置,优先级大于 env 参数
|
|
42
44
|
*/
|
|
43
|
-
/** 环境配置,优先级大于 env 参数 */
|
|
44
45
|
_envConfig?: PayKKaEnvConfig;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* 根据请求类型和请求方式额外传递的参数回调
|
|
49
|
+
*/
|
|
50
|
+
_getExtraParams?: (type: 'info' | 'query' | 'payment', paymentMethod: PaymentMethod) => Recordable;
|
|
45
51
|
}
|
|
46
52
|
/** 收银台创建组件时自动传入的内部属性 */
|
|
47
53
|
export type CoreProps = {
|
|
@@ -82,7 +88,8 @@ export declare enum CardBrandCode {
|
|
|
82
88
|
JCB = "JCB",
|
|
83
89
|
AMEX = "AMEX",
|
|
84
90
|
DISCOVER = "DISCOVER",
|
|
85
|
-
DINERS_CLUB = "DINERS_CLUB"
|
|
91
|
+
DINERS_CLUB = "DINERS_CLUB",
|
|
92
|
+
CHINA_UNION_PAY = "CHINA_UNION_PAY"
|
|
86
93
|
}
|
|
87
94
|
export type CardBrand = `${CardBrandCode}`;
|
|
88
95
|
export interface ElementStylesConfig {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeElementFromArray: (array: any[], element: any) => void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { IconAmex, IconDinnersClub, IconDiscover, IconJcb, IconMasterCard, IconVisa } from '../../components/internal/icons';
|
|
1
|
+
import { IconAmex, IconDinnersClub, IconDiscover, IconJcb, IconMasterCard, IconUnionPay, IconVisa } from '../../components/internal/icons';
|
|
2
2
|
import { CardBrandCode } from '../../types';
|
|
3
3
|
export declare const cardBrandCodes: CardBrandCode[];
|
|
4
4
|
export interface CardBrandConfig {
|
|
5
5
|
name: string;
|
|
6
6
|
code: CardBrandCode;
|
|
7
|
-
pattern
|
|
7
|
+
pattern?: RegExp;
|
|
8
|
+
validator?: (cardNumber: string) => boolean;
|
|
8
9
|
lengths: number[];
|
|
9
10
|
order: number;
|
|
10
11
|
}
|
|
11
12
|
export declare const cardBrands: CardBrandConfig[];
|
|
12
|
-
export declare const getCardBrandIconMap: (code: CardBrandCode) => typeof IconVisa | typeof IconMasterCard | typeof IconJcb | typeof IconAmex | typeof IconDiscover | typeof IconDinnersClub;
|
|
13
|
+
export declare const getCardBrandIconMap: (code: CardBrandCode) => typeof IconVisa | typeof IconMasterCard | typeof IconJcb | typeof IconAmex | typeof IconDiscover | typeof IconDinnersClub | typeof IconUnionPay;
|
|
13
14
|
export type CardBrands = (typeof cardBrands)[number]['code'];
|
|
14
15
|
export declare const cardBrandsLengthList: number[];
|
|
@@ -3,27 +3,30 @@ export { cardBrands, cardBrandsLengthList, cardBrandCodes };
|
|
|
3
3
|
export declare function getSupportedCardBrands(supportedCardBrands?: string[]): CardBrandConfig[];
|
|
4
4
|
export declare function findCardBrand(number: string, brands?: CardBrandConfig[]): CardBrandConfig | undefined;
|
|
5
5
|
export declare function findCardBrandInfo(number: string, brands?: CardBrandConfig[]): {
|
|
6
|
-
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub;
|
|
6
|
+
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub | typeof import("../../components/internal/icons").IconUnionPay;
|
|
7
7
|
name: string;
|
|
8
8
|
code: import("../../types").CardBrandCode;
|
|
9
|
-
pattern
|
|
9
|
+
pattern?: RegExp | undefined;
|
|
10
|
+
validator?: ((cardNumber: string) => boolean) | undefined;
|
|
10
11
|
lengths: number[];
|
|
11
12
|
order: number;
|
|
12
13
|
} | undefined;
|
|
13
14
|
export declare function getCardBrandInfo(brand: CardBrandConfig): {
|
|
14
|
-
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub;
|
|
15
|
+
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub | typeof import("../../components/internal/icons").IconUnionPay;
|
|
15
16
|
name: string;
|
|
16
17
|
code: import("../../types").CardBrandCode;
|
|
17
|
-
pattern
|
|
18
|
+
pattern?: RegExp | undefined;
|
|
19
|
+
validator?: ((cardNumber: string) => boolean) | undefined;
|
|
18
20
|
lengths: number[];
|
|
19
21
|
order: number;
|
|
20
22
|
};
|
|
21
23
|
export type CardBrandInfo = ReturnType<typeof getCardBrandInfo>;
|
|
22
24
|
export declare function finCardBrandInfoByCode(code: string): {
|
|
23
|
-
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub;
|
|
25
|
+
icon: typeof import("../../components/internal/icons").IconVisa | typeof import("../../components/internal/icons").IconMasterCard | typeof import("../../components/internal/icons").IconJcb | typeof import("../../components/internal/icons").IconAmex | typeof import("../../components/internal/icons").IconDiscover | typeof import("../../components/internal/icons").IconDinnersClub | typeof import("../../components/internal/icons").IconUnionPay;
|
|
24
26
|
name: string;
|
|
25
27
|
code: import("../../types").CardBrandCode;
|
|
26
|
-
pattern
|
|
28
|
+
pattern?: RegExp | undefined;
|
|
29
|
+
validator?: ((cardNumber: string) => boolean) | undefined;
|
|
27
30
|
lengths: number[];
|
|
28
31
|
order: number;
|
|
29
32
|
} | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 银行卡号码的校验采用Luhn算法,校验过程大致如下:
|
|
3
|
+
* 1. 从右到左给卡号字符串编号,最右边第一位是1,最右边第二位是2,最右边第三位是3….
|
|
4
|
+
* 2. 从右向左遍历,对每一位字符t执行第三个步骤,并将每一位的计算结果相加得到一个数s。
|
|
5
|
+
* 3. 对每一位的计算规则:如果这一位是奇数位,则返回t本身,如果是偶数位,则先将t乘以2得到一个数n,如果n是一位数(小于10),直接返回n,否则将n的个位数和十位数相加返回。
|
|
6
|
+
* 4. 如果s能够整除10,则此号码有效,否则号码无效。
|
|
7
|
+
* 因为最终的结果会对10取余来判断是否能够整除10,所以又叫做模10算法。
|
|
8
|
+
*/
|
|
9
|
+
export declare const luhnCheck: (cardNumber: string) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DATE_FORMAT = "MM/DD/YYYY";
|
|
2
|
+
export declare const DATE_TIME_FORMAT = "MM/DD/YYYY HH:mm:ss";
|
|
3
|
+
declare const timeTemplateMap: {
|
|
4
|
+
date: string;
|
|
5
|
+
datetime: string;
|
|
6
|
+
};
|
|
7
|
+
type TimeTemplate = keyof typeof timeTemplateMap;
|
|
8
|
+
export declare const formatTime: (value?: Numeric | Date, template?: StringUnion<TimeTemplate>) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEventSupported: (eventName: string, element?: HTMLDivElement) => boolean;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { Amount } from '../api/modules/type';
|
|
1
2
|
export declare const normalizedStyle: <T extends string | Nil | Recordable<any>>(...args: MaybeArray<T>[]) => string;
|
|
2
3
|
export declare const normalizedClass: <T extends string | Nil | Recordable<any>>(...args: MaybeArray<T>[]) => string;
|
|
3
4
|
export declare function limitedToNumber(val: string, whitelist?: string[]): string;
|
|
4
5
|
export declare function trimAll(str: string): string;
|
|
6
|
+
export declare const formatAmount: ({ amount, digits, currency, symbol }: Amount) => {
|
|
7
|
+
fixedAmount: () => string;
|
|
8
|
+
jointSymbol: () => string;
|
|
9
|
+
jointSymbolAndCurrency: () => string;
|
|
10
|
+
jointCurrency: () => string;
|
|
11
|
+
};
|
|
5
12
|
export declare function toFixed(num: number, digits?: number): string;
|
|
6
|
-
export declare const formatAmount: (value?: number | undefined, digits?: number) => string;
|
|
7
13
|
export declare function cssVarPrefix(value: string): string;
|
|
8
14
|
export declare function underscoreToUpperCamelCase(str: string): string;
|
|
9
15
|
export declare function extractAreaCodeAndPhoneNumber(phoneNumber?: string): {
|
|
@@ -9,6 +9,12 @@ export * from './is';
|
|
|
9
9
|
export * from './obj';
|
|
10
10
|
export * from './style';
|
|
11
11
|
export * from './iframe';
|
|
12
|
+
export * from './location';
|
|
13
|
+
export * from './redirect';
|
|
14
|
+
export * from './array';
|
|
15
|
+
export * from './detect';
|
|
16
|
+
export * from './date';
|
|
17
|
+
export * from './object';
|
|
12
18
|
export declare function getIf<T>(value: T, condition: boolean): T | undefined;
|
|
13
19
|
/**
|
|
14
20
|
* 将一个数值限制在指定的范围内
|
|
@@ -18,6 +24,7 @@ export declare function getIf<T>(value: T, condition: boolean): T | undefined;
|
|
|
18
24
|
*/
|
|
19
25
|
export declare function clamp(value: number, min?: number, max?: number): number;
|
|
20
26
|
export declare const safeParse: <T>(dataStr: string, defaultValue?: {}) => T;
|
|
27
|
+
export declare const safeStringify: (data: any, defaultValue?: string) => string;
|
|
21
28
|
/**
|
|
22
29
|
* @description: 日期是否过期
|
|
23
30
|
* @param {string} expireDate MM/YY
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getUrlParams: () => Record<string, string>;
|
|
2
|
+
export declare const getUrlParam: (paramName: string) => string | null;
|
|
3
|
+
export declare const createUrlWithParams: (baseUrl: string, params: Record<string, string | number | boolean>) => string;
|
|
4
|
+
export declare const parseUrl: (url: string) => {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
params: Record<string, string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deepMerge: <T extends Recordable<any>, U extends Recordable<any>>(target: T, source: U) => T & U;
|