@paykka/card-checkout-ui 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/card-checkout-ui.js +20 -20
- package/dist/card-checkout-ui.umd.cjs +20 -20
- package/dist/es/api/http.js +1 -1
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/modules/checkout/index.js +1 -3
- package/dist/es/api/modules/checkout/map.js +12 -4
- package/dist/es/api/modules/encrypted-card/index.js +3 -2
- package/dist/es/api/modules/get-browser-params.js +4 -5
- package/dist/es/api/modules/index.js +1 -1
- package/dist/es/api/modules/map.js +4 -1
- package/dist/es/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/es/components/AccountNameField/index.js +1 -1
- package/dist/es/components/AddressField/index.js +1 -1
- package/dist/es/components/ApplePay/index.js +34 -21
- package/dist/es/components/CPFField/index.js +1 -1
- package/dist/es/components/Card/index.js +38 -30
- package/dist/es/components/CardBrands/index.js +1 -1
- package/dist/es/components/CardExpireDateField/index.js +1 -1
- package/dist/es/components/CardHolderNameField/index.js +1 -1
- package/dist/es/components/CardIBANField/index.js +1 -1
- package/dist/es/components/CardNo/index.js +1 -1
- package/dist/es/components/CardNumberField/index.js +1 -1
- package/dist/es/components/CardSecurityCodeField/index.js +1 -1
- package/dist/es/components/CardSelector/index.js +2 -2
- package/dist/es/components/CombinedCardInfo/index.js +1 -1
- package/dist/es/components/DropIn/index.js +117 -123
- package/dist/es/components/EmailField/EmailField.js +1 -1
- package/dist/es/components/EncryptedCard/index.js +5 -5
- package/dist/es/components/GooglePay/index.js +32 -29
- package/dist/es/components/GuideCard/index.js +2 -2
- package/dist/es/components/PaymentButton/index.js +22 -7
- package/dist/es/components/RecurringTip/index.js +1 -1
- package/dist/es/components/SecuredIframe/index.js +3 -4
- package/dist/es/components/Sepa/index.js +15 -7
- package/dist/es/components/SubmitButton/index.js +2 -2
- package/dist/es/components/ThreeDS/index.js +32 -20
- package/dist/es/components/Tip/index.js +1 -1
- package/dist/es/components/business/BlikCodeField/BlikCodeField.js +1 -1
- package/dist/es/components/business/BlikCodeField/index.js +1 -1
- package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +3 -3
- package/dist/es/components/business/BlikConfirmModal/index.js +2 -2
- package/dist/es/components/business/NameField/NameField.js +1 -1
- package/dist/es/components/business/NameField/index.js +1 -1
- package/dist/es/components/business/PhoneField/PhoneField.js +1 -1
- package/dist/es/components/business/PhoneField/index.js +1 -1
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +2 -2
- package/dist/es/components/business/QRCodeModal/index.js +1 -1
- package/dist/es/components/business/Tooltip/Tooltip.js +1 -1
- package/dist/es/components/business/Tooltip/index.js +1 -1
- package/dist/es/components/business/index.js +2 -2
- package/dist/es/components/index.js +4 -4
- package/dist/es/components/internal/Accordion/index.js +1 -1
- package/dist/es/components/internal/Button/{Button.js → Button2.js} +2 -2
- package/dist/es/components/internal/Button/index.js +2 -2
- package/dist/es/components/internal/CheckBox/CheckBox.js +1 -1
- package/dist/es/components/internal/CheckBox/index.js +1 -1
- package/dist/es/components/internal/Form/type.js +1 -1
- package/dist/es/components/internal/Info/Info.js +1 -1
- package/dist/es/components/internal/Info/index.js +1 -1
- package/dist/es/components/internal/Input/type.js +1 -1
- package/dist/es/components/internal/Loading/Loading2.js +20 -0
- package/dist/es/{api/modules/line-pay → components/internal/Loading}/index.js +3 -2
- package/dist/es/components/internal/Loading/loading.js +1 -0
- package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -1
- package/dist/es/components/internal/LoadingCheck/index.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/QRCode/QRCode.js +1 -1
- package/dist/es/components/internal/QRCode/index.js +1 -1
- package/dist/es/components/internal/Select/Select.js +1 -1
- package/dist/es/components/internal/Select/SelectMenu.js +1 -1
- package/dist/es/components/internal/Select/SelectMenuItem.js +1 -1
- package/dist/es/components/internal/icons/IconAlipayPlus.js +116 -0
- package/dist/es/components/internal/icons/IconError.js +2 -2
- package/dist/es/components/internal/icons/IconSuccess.js +2 -2
- package/dist/es/components/internal/icons/IconWechatPayGlobal.js +45 -0
- package/dist/es/components/internal/icons/IconWechatPayGlobalComplete.js +107 -0
- package/dist/es/components/wallets/AliPay/AliPay.js +186 -0
- package/dist/es/components/wallets/AliPay/ali-pay.js +1 -0
- package/dist/es/components/wallets/AliPay/index.js +1 -0
- package/dist/es/components/wallets/AliPay/type.js +1 -0
- package/dist/es/components/wallets/Bancontact/Bancontact.js +7 -10
- package/dist/es/components/wallets/Blik/Blik.js +14 -11
- package/dist/es/components/wallets/Boost/Boost.js +6 -9
- package/dist/es/components/wallets/GCash/GCash.js +7 -10
- package/dist/es/components/wallets/GrabPay/GrabPay.js +7 -14
- package/dist/es/components/wallets/IDeal/IDeal.js +7 -10
- package/dist/es/components/wallets/LinePay/LinePay.js +6 -9
- package/dist/es/components/wallets/MayBankQRPay/MayBankQRPay.js +6 -9
- package/dist/es/components/wallets/NinePay/NinePay.js +6 -9
- package/dist/es/components/wallets/OVO/OVO.js +7 -10
- package/dist/es/components/wallets/OpayWallet/OpayWallet.js +6 -9
- package/dist/es/components/wallets/P24/P24.js +7 -10
- package/dist/es/components/wallets/PagaWallet/PagaWallet.js +6 -9
- package/dist/es/components/wallets/Paymaya/Paymaya.js +6 -9
- package/dist/es/components/wallets/PicPay/PicPay.js +54 -217
- package/dist/es/components/wallets/Pix/Pix.js +54 -217
- package/dist/es/components/wallets/ShopeePay/ShopeePay.js +6 -9
- package/dist/es/components/wallets/Skrill/Skrill.js +7 -10
- package/dist/es/components/wallets/TNGWallet/TNGWallet.js +6 -9
- package/dist/es/components/wallets/Trustly/Trustly.js +7 -10
- package/dist/es/components/wallets/Vietqr/Vietqr.js +14 -15
- package/dist/es/components/wallets/WechatPay/WechatPay.js +250 -0
- package/dist/es/components/wallets/WechatPay/index.js +1 -0
- package/dist/es/components/wallets/WechatPay/type.js +1 -0
- package/dist/es/components/wallets/WechatPay/util.js +47 -0
- package/dist/es/components/wallets/WechatPay/wechat-pay.js +1 -0
- package/dist/es/components/wallets/Zalopay/Zalopay.js +10 -13
- package/dist/es/components/wallets/index.js +2 -0
- package/dist/es/constant.js +7 -0
- package/dist/es/core/checkout.js +36 -9
- package/dist/es/core/create-child.js +5 -4
- package/dist/es/core/index.js +1 -1
- package/dist/es/core/logger.js +1 -1
- package/dist/es/core/payment.js +13 -0
- package/dist/es/core/preview.js +29 -0
- package/dist/es/core/query.js +12 -3
- package/dist/es/core/session.js +36 -6
- package/dist/es/core/theme.js +1 -1
- package/dist/es/hooks/index.js +1 -1
- package/dist/es/hooks/useBaseWallet.js +121 -52
- package/dist/es/hooks/useI18n.js +3 -3
- package/dist/es/i18n/locales/de-DE.js +7 -0
- package/dist/es/i18n/locales/en-GB.js +7 -0
- package/dist/es/i18n/locales/es-ES.js +7 -0
- package/dist/es/i18n/locales/fr-FR.js +7 -0
- package/dist/es/i18n/locales/ja-JP.js +7 -0
- package/dist/es/i18n/locales/ko-KR.js +7 -0
- package/dist/es/i18n/locales/nl-NL.js +7 -0
- package/dist/es/i18n/locales/pt-PT.js +7 -0
- package/dist/es/i18n/locales/ru-RU.js +7 -0
- package/dist/es/i18n/locales/zh-CN.js +7 -0
- package/dist/es/i18n/locales/zh-HK.js +7 -0
- package/dist/es/i18n/locales/zh-TW.js +7 -0
- package/dist/es/i18n/util.js +10 -10
- package/dist/es/index.js +7 -5
- package/dist/es/out/base-fraud-detection.js +1 -1
- package/dist/es/out/fraud-detection.js +59 -44
- package/dist/es/out/paykka-detection.js +5 -7
- package/dist/es/out/stripe-radar.js +1 -1
- package/dist/es/out/worldpay-ddc-manager.js +3 -0
- package/dist/es/out/worldpay-ddc.js +1 -1
- package/dist/es/style.css +1 -1
- package/dist/es/types/event.js +10 -1
- package/dist/es/types/index.js +7 -0
- package/dist/es/utils/array.js +19 -5
- package/dist/es/utils/business/amount.js +15 -0
- package/dist/es/utils/business/index.js +1 -0
- package/dist/es/utils/detect.js +8 -0
- package/dist/es/utils/index.js +7 -9
- package/dist/es/utils/location.js +8 -0
- package/dist/es/utils/number.js +19 -0
- package/dist/es/utils/redirect.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/checkout/type.d.ts +1 -1
- package/dist/types/api/modules/index.d.ts +0 -17
- package/dist/types/api/modules/threeDS/index.d.ts +13 -5
- package/dist/types/components/ApplePay/type.d.ts +6 -2
- package/dist/types/components/Card/type.d.ts +2 -18
- package/dist/types/components/DropIn/layout.d.ts +33 -0
- package/dist/types/components/DropIn/type.d.ts +6 -6
- package/dist/types/components/GooglePay/createGooglePay.d.ts +1 -1
- package/dist/types/components/GooglePay/type.d.ts +6 -2
- package/dist/types/components/PaymentButton/type.d.ts +2 -0
- package/dist/types/components/Sepa/type.d.ts +3 -4
- package/dist/types/components/business/QRCodeModal/type.d.ts +12 -3
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/internal/Loading/Loading.d.ts +2 -1
- package/dist/types/components/internal/Loading/type.d.ts +8 -0
- package/dist/types/components/internal/ResultMessage/ResultMessage.d.ts +3 -0
- package/dist/types/components/internal/ResultMessage/index.d.ts +2 -0
- package/dist/types/components/internal/ResultMessage/type.d.ts +13 -0
- package/dist/types/components/internal/icons/IconAlipayPlus.d.ts +2 -0
- package/dist/types/components/internal/icons/IconError.d.ts +1 -1
- package/dist/types/components/internal/icons/IconSuccess.d.ts +1 -1
- package/dist/types/components/internal/icons/IconWechatPayGlobal.d.ts +2 -0
- package/dist/types/components/internal/icons/IconWechatPayGlobalComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/components/{AliPay → wallets/AliPay}/AliPay.d.ts +9 -4
- package/dist/types/components/wallets/AliPay/type.d.ts +7 -0
- package/dist/types/components/wallets/Bancontact/type.d.ts +2 -24
- package/dist/types/components/wallets/Blik/type.d.ts +2 -24
- package/dist/types/components/wallets/Boost/type.d.ts +2 -24
- package/dist/types/components/wallets/GCash/type.d.ts +2 -24
- package/dist/types/components/wallets/GrabPay/type.d.ts +2 -12
- package/dist/types/components/wallets/IDeal/type.d.ts +2 -24
- package/dist/types/components/wallets/LinePay/type.d.ts +2 -24
- package/dist/types/components/wallets/MayBankQRPay/type.d.ts +2 -24
- package/dist/types/components/wallets/NinePay/type.d.ts +2 -24
- package/dist/types/components/wallets/OVO/type.d.ts +2 -24
- package/dist/types/components/wallets/OpayWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/P24/type.d.ts +2 -24
- package/dist/types/components/wallets/PagaWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/Paymaya/type.d.ts +2 -24
- package/dist/types/components/wallets/PicPay/type.d.ts +2 -24
- package/dist/types/components/wallets/Pix/type.d.ts +2 -24
- package/dist/types/components/wallets/ShopeePay/type.d.ts +2 -24
- package/dist/types/components/wallets/Skrill/type.d.ts +2 -12
- package/dist/types/components/wallets/TNGWallet/type.d.ts +2 -24
- package/dist/types/components/wallets/Trustly/type.d.ts +2 -16
- package/dist/types/components/wallets/Vietqr/type.d.ts +2 -24
- package/dist/types/components/wallets/WechatPay/WechatPay.d.ts +16 -0
- package/dist/types/components/wallets/WechatPay/type.d.ts +12 -0
- package/dist/types/components/wallets/WechatPay/util.d.ts +13 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +2 -24
- package/dist/types/components/wallets/index.d.ts +2 -0
- package/dist/types/components/wallets/type.d.ts +0 -14
- package/dist/types/constant.d.ts +8 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/preview.d.ts +1 -0
- package/dist/types/core/session.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useBaseWallet.d.ts +27 -5
- package/dist/types/hooks/useI18n.d.ts +1 -1
- package/dist/types/hooks/usePayState.d.ts +1 -4
- package/dist/types/i18n/I18n.d.ts +1 -0
- package/dist/types/i18n/locales/de-DE.d.ts +7 -0
- package/dist/types/i18n/locales/en-GB.d.ts +7 -0
- package/dist/types/i18n/locales/es-ES.d.ts +7 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +7 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +7 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +7 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +7 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +7 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +7 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +7 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +7 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +7 -0
- package/dist/types/i18n/util.d.ts +8 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/out/fraud-detection.d.ts +2 -5
- package/dist/types/out/types.d.ts +5 -6
- package/dist/types/out/worldpay-ddc-manager.d.ts +1 -0
- package/dist/types/types/event.d.ts +24 -2
- package/dist/types/types/index.d.ts +14 -0
- package/dist/types/types/message.d.ts +3 -1
- package/dist/types/types/payment.d.ts +26 -3
- package/dist/types/utils/app-payment.d.ts +1 -0
- package/dist/types/utils/array.d.ts +17 -0
- package/dist/types/utils/business/amount.d.ts +7 -0
- package/dist/types/utils/business/index.d.ts +1 -0
- package/dist/types/utils/detect.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -6
- package/dist/types/utils/number.d.ts +4 -0
- package/dist/types/utils/redirect.d.ts +10 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +4 -0
- package/package.json +4 -2
- package/dist/es/api/modules/ali-pay/index.js +0 -16
- package/dist/es/api/modules/boost/index.js +0 -5
- package/dist/es/api/modules/gcash/index.js +0 -5
- package/dist/es/api/modules/grab-pay/index.js +0 -5
- package/dist/es/api/modules/may-bank-qr-pay/index.js +0 -5
- package/dist/es/api/modules/nine-pay/index.js +0 -5
- package/dist/es/api/modules/opay-wallet/index.js +0 -5
- package/dist/es/api/modules/paga-wallet/index.js +0 -5
- package/dist/es/api/modules/paymaya/index.js +0 -5
- package/dist/es/api/modules/pic-pay/index.js +0 -16
- package/dist/es/api/modules/pix/index.js +0 -16
- package/dist/es/api/modules/shopee-pay/index.js +0 -5
- package/dist/es/api/modules/tng-wallet/index.js +0 -5
- package/dist/es/api/modules/vietqr/index.js +0 -5
- package/dist/es/api/modules/wechat-pay/index.js +0 -16
- package/dist/es/api/modules/zalopay/index.js +0 -5
- package/dist/es/components/AliPay/index.js +0 -332
- package/dist/es/components/WechatPay/index.js +0 -340
- package/dist/es/hooks/usePayment.js +0 -1
- package/dist/types/api/modules/ali-pay/index.d.ts +0 -4
- package/dist/types/api/modules/boost/index.d.ts +0 -4
- package/dist/types/api/modules/gcash/index.d.ts +0 -4
- package/dist/types/api/modules/grab-pay/index.d.ts +0 -4
- package/dist/types/api/modules/line-pay/index.d.ts +0 -4
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +0 -4
- package/dist/types/api/modules/nine-pay/index.d.ts +0 -4
- package/dist/types/api/modules/opay-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paga-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/paymaya/index.d.ts +0 -4
- package/dist/types/api/modules/pic-pay/index.d.ts +0 -4
- package/dist/types/api/modules/pix/index.d.ts +0 -4
- package/dist/types/api/modules/shopee-pay/index.d.ts +0 -4
- package/dist/types/api/modules/tng-wallet/index.d.ts +0 -4
- package/dist/types/api/modules/vietqr/index.d.ts +0 -4
- package/dist/types/api/modules/wechat-pay/index.d.ts +0 -4
- package/dist/types/api/modules/zalopay/index.d.ts +0 -4
- package/dist/types/components/AliPay/type.d.ts +0 -26
- package/dist/types/components/WechatPay/WechatPay.d.ts +0 -10
- package/dist/types/components/WechatPay/type.d.ts +0 -28
- package/dist/types/hooks/usePayment.d.ts +0 -8
- package/dist/types/hooks/useRetry.console-tests.d.ts +0 -41
- package/dist/types/utils/behavior-tracker.d.ts +0 -36
- /package/dist/es/components/internal/Button/{button2.js → button.js} +0 -0
- /package/dist/types/components/{AliPay → wallets/AliPay}/index.d.ts +0 -0
- /package/dist/types/components/{WechatPay → wallets/WechatPay}/index.d.ts +0 -0
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { w, A, F, h, y, q, u, b } from "../../core.js";
|
|
2
|
-
import { isTimeoutError } from "../../api/http.js";
|
|
3
|
-
import "../../utils/card-brand/brands.js";
|
|
4
|
-
import "../../utils/system-info/get-browser-info.js";
|
|
5
|
-
import { normalizedClass, formatAmount } from "../../utils/format.js";
|
|
6
|
-
import { processPaymentStatus, formatPaymentResult } from "../../utils/payment.js";
|
|
7
|
-
import { getBrowserParams } from "../../api/modules/get-browser-params.js";
|
|
8
|
-
import { PaymentMethod, COMMON_CLASS_NAME, PaymentType, SessionMode } from "../../constant.js";
|
|
9
|
-
import { getWechatPayInfo, wechatPay } from "../../api/modules/wechat-pay/index.js";
|
|
10
|
-
import { CoreContext } from "../../core/context.js";
|
|
11
|
-
import { PayKKaError } from "../../core/error.js";
|
|
12
|
-
import "../../out/worldpay-jsc-origin.js";
|
|
13
|
-
import { useBEM } from "../../hooks/useBEM.js";
|
|
14
|
-
import { usePayState } from "../../hooks/usePayState.js";
|
|
15
|
-
import { useRetry } from "../../hooks/useRetry.js";
|
|
16
|
-
import { DEFAULT_ADDRESS, AddressField } from "../AddressField/index.js";
|
|
17
|
-
import { createEmailCore, EmailField } from "../EmailField/EmailField.js";
|
|
18
|
-
import "../internal/Form/type.js";
|
|
19
|
-
import "../internal/Form/context.js";
|
|
20
|
-
import "../internal/Form/FormItem.js";
|
|
21
|
-
import { Form } from "../internal/Form/Form.js";
|
|
22
|
-
import { Info } from "../internal/Info/Info.js";
|
|
23
|
-
import { RecurringTip } from "../RecurringTip/index.js";
|
|
24
|
-
import { SubmitButton } from "../SubmitButton/index.js";
|
|
25
|
-
const CURR_PAYMENT_METHOD = PaymentMethod.WECHAT_PAY;
|
|
26
|
-
const { bem } = useBEM("wechat-pay");
|
|
27
|
-
const fieldClassNames = bem("field");
|
|
28
|
-
const WechatPay = w((props, ref) => {
|
|
29
|
-
var _a;
|
|
30
|
-
const { session, core, showEmail = false, showAddress = false, autoQuery = true } = props;
|
|
31
|
-
const addressCore = core.getAddressCore();
|
|
32
|
-
const emailState = createEmailCore();
|
|
33
|
-
const emailFieldRef = A(null);
|
|
34
|
-
F(ref, () => ({
|
|
35
|
-
stopRetry: () => {
|
|
36
|
-
stopReFetchPayInfo();
|
|
37
|
-
setSubmitButtonStatus("unSubmit");
|
|
38
|
-
},
|
|
39
|
-
startRetry: (timeout) => {
|
|
40
|
-
setSubmitButtonStatus("loading");
|
|
41
|
-
startReFetchPayInfo({ timeout });
|
|
42
|
-
},
|
|
43
|
-
updateAddress: () => {
|
|
44
|
-
var _a2;
|
|
45
|
-
if (!(fieldStatus == null ? void 0 : fieldStatus.address.show))
|
|
46
|
-
return;
|
|
47
|
-
const address = addressCore.getAddressState();
|
|
48
|
-
form.address = address;
|
|
49
|
-
setForm(form);
|
|
50
|
-
(_a2 = addressFieldRef.current) == null ? void 0 : _a2.update(address);
|
|
51
|
-
validateFormSilently();
|
|
52
|
-
},
|
|
53
|
-
updateEmail: () => {
|
|
54
|
-
var _a2;
|
|
55
|
-
if (!(fieldStatus == null ? void 0 : fieldStatus.email.show))
|
|
56
|
-
return;
|
|
57
|
-
form.email = emailState.email;
|
|
58
|
-
setForm(form);
|
|
59
|
-
(_a2 = emailFieldRef.current) == null ? void 0 : _a2.update(emailState.email);
|
|
60
|
-
validateFormSilently();
|
|
61
|
-
}
|
|
62
|
-
}));
|
|
63
|
-
const { setErrorMsg, fraudDetection, i18n, errorMsg, sessionReady, disabled } = usePayState(session, props.core);
|
|
64
|
-
const [submitButtonStatus, setSubmitButtonStatus] = h("unSubmit");
|
|
65
|
-
const formRef = A(null);
|
|
66
|
-
const [form, setForm] = h({
|
|
67
|
-
email: "",
|
|
68
|
-
address: { ...DEFAULT_ADDRESS }
|
|
69
|
-
});
|
|
70
|
-
const [validated, setValidated] = h(false);
|
|
71
|
-
const [fieldStatus, setFieldStatus] = h();
|
|
72
|
-
const addressFieldRef = A(null);
|
|
73
|
-
const [isCheckoutEnabled, setIsCheckoutEnabled] = h(false);
|
|
74
|
-
const getPaymentMethodContext = () => {
|
|
75
|
-
return {
|
|
76
|
-
paymentMethod: CURR_PAYMENT_METHOD
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
const validateFormSilently = () => {
|
|
80
|
-
var _a2;
|
|
81
|
-
(_a2 = formRef.current) == null ? void 0 : _a2.validate(void 0, false).then(() => setValidated(true)).catch(() => setValidated(false));
|
|
82
|
-
};
|
|
83
|
-
const initFieldStatus = () => {
|
|
84
|
-
const { field, sessionMode } = session.checkout;
|
|
85
|
-
const { email, address } = field;
|
|
86
|
-
if (sessionMode === SessionMode.COMPONENT) {
|
|
87
|
-
if (email.disabled) {
|
|
88
|
-
email.show = showEmail;
|
|
89
|
-
}
|
|
90
|
-
if (showAddress && !(address == null ? void 0 : address.show)) {
|
|
91
|
-
address.show = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
setFieldStatus({ ...field });
|
|
95
|
-
};
|
|
96
|
-
y(() => {
|
|
97
|
-
validateFormSilently();
|
|
98
|
-
}, [form]);
|
|
99
|
-
const processOnSuccess = (res) => {
|
|
100
|
-
var _a2, _b;
|
|
101
|
-
setSubmitButtonStatus("success");
|
|
102
|
-
const result = formatPaymentResult({
|
|
103
|
-
...res,
|
|
104
|
-
returnUrl: (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.returnUrl
|
|
105
|
-
});
|
|
106
|
-
(_b = props.onSuccess) == null ? void 0 : _b.call(props, result, getPaymentMethodContext());
|
|
107
|
-
};
|
|
108
|
-
y(() => {
|
|
109
|
-
var _a2;
|
|
110
|
-
if (!sessionReady) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const { bill = {}, supportMethods = [], country } = (session == null ? void 0 : session.checkout) || {};
|
|
114
|
-
if (!supportMethods.includes(CURR_PAYMENT_METHOD)) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
initFieldStatus();
|
|
118
|
-
setIsCheckoutEnabled(true);
|
|
119
|
-
country && addressCore.setCountry(country);
|
|
120
|
-
form.email = bill.email ?? "";
|
|
121
|
-
form.address.country = country;
|
|
122
|
-
if (autoQuery && ((_a2 = core.payment) == null ? void 0 : _a2.currPaymentMethod.value) === CURR_PAYMENT_METHOD) {
|
|
123
|
-
setSubmitButtonStatus("loading");
|
|
124
|
-
startReFetchPayInfo();
|
|
125
|
-
}
|
|
126
|
-
}, [sessionReady]);
|
|
127
|
-
const onTimeout = q(
|
|
128
|
-
(message) => {
|
|
129
|
-
var _a2;
|
|
130
|
-
core.payment.resetCurrPaymentMethod();
|
|
131
|
-
setErrorMsg(message || i18n.get("common.payTimeout"));
|
|
132
|
-
setSubmitButtonStatus("unSubmit");
|
|
133
|
-
(_a2 = props.onTimeout) == null ? void 0 : _a2.call(props, "retry", getPaymentMethodContext());
|
|
134
|
-
},
|
|
135
|
-
[i18n, props.onTimeout]
|
|
136
|
-
);
|
|
137
|
-
const { start: startReFetchPayInfo, stop: stopReFetchPayInfo } = useRetry(
|
|
138
|
-
(timeout) => pay(true, timeout),
|
|
139
|
-
{
|
|
140
|
-
timeout: 2 * 60 * 1e3,
|
|
141
|
-
onTimeout: () => onTimeout(i18n.get("common.queryTimeout"))
|
|
142
|
-
}
|
|
143
|
-
);
|
|
144
|
-
const getPaymentParams = async () => {
|
|
145
|
-
var _a2;
|
|
146
|
-
return {
|
|
147
|
-
sessionId: session.sessionId,
|
|
148
|
-
clientKey: session.clientKey,
|
|
149
|
-
bill: (fieldStatus == null ? void 0 : fieldStatus.address.show) ? {
|
|
150
|
-
email: form.email,
|
|
151
|
-
addressLine1: form.address.address1,
|
|
152
|
-
addressLine2: form.address.address2,
|
|
153
|
-
postalCode: form.address.postCode,
|
|
154
|
-
country: form.address.country,
|
|
155
|
-
district: form.address.area,
|
|
156
|
-
state: form.address.province ? addressCore.getLabel(form.address.province, addressCore.getProvinceOption()) ?? form.address.province : void 0,
|
|
157
|
-
city: form.address.city ? addressCore.getLabel(form.address.city, addressCore.getCityOptions()) ?? form.address.city : void 0
|
|
158
|
-
} : {
|
|
159
|
-
email: form.email
|
|
160
|
-
},
|
|
161
|
-
channelUserId: await ((_a2 = props.onGetOpenId) == null ? void 0 : _a2.call(props)),
|
|
162
|
-
payment: {
|
|
163
|
-
paymentMethod: CURR_PAYMENT_METHOD
|
|
164
|
-
},
|
|
165
|
-
browser: await getBrowserParams({
|
|
166
|
-
fraudDetectionId: await (fraudDetection == null ? void 0 : fraudDetection.getFraudDetectionId())
|
|
167
|
-
})
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
async function pay(search = false, timeout) {
|
|
171
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
172
|
-
try {
|
|
173
|
-
core.payment.currPaymentMethod.value = CURR_PAYMENT_METHOD;
|
|
174
|
-
const requestOptions = { locale: i18n.locale, timeout };
|
|
175
|
-
let res = null;
|
|
176
|
-
if (search) {
|
|
177
|
-
const extraParams = (_b = (_a2 = core.config)._getExtraParams) == null ? void 0 : _b.call(_a2, "query", CURR_PAYMENT_METHOD);
|
|
178
|
-
res = await getWechatPayInfo(
|
|
179
|
-
{
|
|
180
|
-
sessionId: session.sessionId,
|
|
181
|
-
clientKey: session.clientKey,
|
|
182
|
-
paymentMethod: CURR_PAYMENT_METHOD
|
|
183
|
-
},
|
|
184
|
-
extraParams,
|
|
185
|
-
requestOptions
|
|
186
|
-
);
|
|
187
|
-
} else {
|
|
188
|
-
const extraParams = (_d = (_c = core.config)._getExtraParams) == null ? void 0 : _d.call(_c, "payment", CURR_PAYMENT_METHOD);
|
|
189
|
-
res = await wechatPay(await getPaymentParams(), extraParams, requestOptions);
|
|
190
|
-
}
|
|
191
|
-
const { errorMessage, payInfo, errorCode, sessionId } = res;
|
|
192
|
-
sessionId && (session.sessionId = sessionId);
|
|
193
|
-
!search && ((_e = props.onSubmitResponse) == null ? void 0 : _e.call(props, res, getPaymentMethodContext()));
|
|
194
|
-
let end = true;
|
|
195
|
-
await processPaymentStatus(res, {
|
|
196
|
-
onProcessing: async () => {
|
|
197
|
-
var _a3;
|
|
198
|
-
if (!search) {
|
|
199
|
-
await ((_a3 = props.onCallWxPayBox) == null ? void 0 : _a3.call(props, payInfo));
|
|
200
|
-
startReFetchPayInfo();
|
|
201
|
-
}
|
|
202
|
-
end = false;
|
|
203
|
-
},
|
|
204
|
-
onSuccess: () => {
|
|
205
|
-
processOnSuccess(res);
|
|
206
|
-
},
|
|
207
|
-
onFailure: () => {
|
|
208
|
-
var _a3;
|
|
209
|
-
core.payment.resetCurrPaymentMethod();
|
|
210
|
-
errorMessage && setErrorMsg(errorMessage);
|
|
211
|
-
setSubmitButtonStatus("unSubmit");
|
|
212
|
-
(_a3 = props.onError) == null ? void 0 : _a3.call(
|
|
213
|
-
props,
|
|
214
|
-
new PayKKaError("API_ERROR", errorMessage, { code: errorCode }),
|
|
215
|
-
getPaymentMethodContext()
|
|
216
|
-
);
|
|
217
|
-
},
|
|
218
|
-
onCanceled: () => {
|
|
219
|
-
var _a3;
|
|
220
|
-
core.payment.resetCurrPaymentMethod();
|
|
221
|
-
setSubmitButtonStatus("unSubmit");
|
|
222
|
-
(_a3 = props.onTimeout) == null ? void 0 : _a3.call(props, "channel", getPaymentMethodContext());
|
|
223
|
-
},
|
|
224
|
-
onExpired: () => {
|
|
225
|
-
var _a3;
|
|
226
|
-
setSubmitButtonStatus("unSubmit");
|
|
227
|
-
(_a3 = props.onExpired) == null ? void 0 : _a3.call(props, getPaymentMethodContext());
|
|
228
|
-
},
|
|
229
|
-
onDefault: () => {
|
|
230
|
-
core.payment.resetCurrPaymentMethod();
|
|
231
|
-
setSubmitButtonStatus("unSubmit");
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
return { end };
|
|
235
|
-
} catch (error) {
|
|
236
|
-
if (isTimeoutError(error)) {
|
|
237
|
-
if (search) {
|
|
238
|
-
return { end: false };
|
|
239
|
-
} else {
|
|
240
|
-
onTimeout();
|
|
241
|
-
return { end: true };
|
|
242
|
-
}
|
|
243
|
-
} else {
|
|
244
|
-
core.payment.resetCurrPaymentMethod();
|
|
245
|
-
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
246
|
-
message && setErrorMsg(message);
|
|
247
|
-
(_f = props.onError) == null ? void 0 : _f.call(
|
|
248
|
-
props,
|
|
249
|
-
new PayKKaError("API_ERROR", message, { code: error.code, cause: error }),
|
|
250
|
-
getPaymentMethodContext()
|
|
251
|
-
);
|
|
252
|
-
setSubmitButtonStatus("unSubmit");
|
|
253
|
-
return { end: true };
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
async function onSubmit() {
|
|
258
|
-
var _a2;
|
|
259
|
-
setErrorMsg("");
|
|
260
|
-
(_a2 = formRef.current) == null ? void 0 : _a2.validate(async (errors) => {
|
|
261
|
-
var _a3;
|
|
262
|
-
(fieldStatus == null ? void 0 : fieldStatus.address.show) && addressCore.setValidateAllFields(true);
|
|
263
|
-
(_a3 = props.onSubmit) == null ? void 0 : _a3.call(props, errors, getPaymentMethodContext());
|
|
264
|
-
if (errors) {
|
|
265
|
-
setSubmitButtonStatus("unSubmit");
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
setErrorMsg("");
|
|
269
|
-
setSubmitButtonStatus("loading");
|
|
270
|
-
await pay();
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
const Button = () => {
|
|
274
|
-
const { transAmount, channelParams = {} } = (session == null ? void 0 : session.checkout) ?? {};
|
|
275
|
-
const { totalAmount } = channelParams.wechatPay ?? {};
|
|
276
|
-
const amountObj = ((totalAmount == null ? void 0 : totalAmount.amount) ? totalAmount : transAmount) || {};
|
|
277
|
-
const amountText = (amountObj == null ? void 0 : amountObj.amount) ? formatAmount(amountObj).jointSymbol() : "";
|
|
278
|
-
const text = i18n.get("common.pay") + (amountText ? ` ${amountText}` : "");
|
|
279
|
-
return /* @__PURE__ */ u(
|
|
280
|
-
SubmitButton,
|
|
281
|
-
{
|
|
282
|
-
className: bem("button"),
|
|
283
|
-
status: submitButtonStatus,
|
|
284
|
-
disabled,
|
|
285
|
-
text,
|
|
286
|
-
loadingText: i18n.get("common.payProcessing"),
|
|
287
|
-
successText: i18n.get("common.paySuccess"),
|
|
288
|
-
onClick: onSubmit,
|
|
289
|
-
verified: validated
|
|
290
|
-
}
|
|
291
|
-
);
|
|
292
|
-
};
|
|
293
|
-
const setFormRef = (dom) => {
|
|
294
|
-
formRef.current = dom;
|
|
295
|
-
dom && validateFormSilently();
|
|
296
|
-
};
|
|
297
|
-
const Email = () => {
|
|
298
|
-
return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.email.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
|
|
299
|
-
EmailField,
|
|
300
|
-
{
|
|
301
|
-
ref: emailFieldRef,
|
|
302
|
-
value: form.email,
|
|
303
|
-
disabled: (fieldStatus == null ? void 0 : fieldStatus.email.disabled) || disabled
|
|
304
|
-
}
|
|
305
|
-
) }) });
|
|
306
|
-
};
|
|
307
|
-
const Address = () => {
|
|
308
|
-
return /* @__PURE__ */ u(b, { children: (fieldStatus == null ? void 0 : fieldStatus.address.show) && /* @__PURE__ */ u("div", { className: fieldClassNames, children: /* @__PURE__ */ u(
|
|
309
|
-
AddressField,
|
|
310
|
-
{
|
|
311
|
-
ref: addressFieldRef,
|
|
312
|
-
value: form.address,
|
|
313
|
-
disabled,
|
|
314
|
-
onChange: (value) => setForm(Object.assign(form, { address: value }))
|
|
315
|
-
}
|
|
316
|
-
) }) });
|
|
317
|
-
};
|
|
318
|
-
return /* @__PURE__ */ u(
|
|
319
|
-
CoreContext.Provider,
|
|
320
|
-
{
|
|
321
|
-
value: {
|
|
322
|
-
i18n,
|
|
323
|
-
session,
|
|
324
|
-
core
|
|
325
|
-
},
|
|
326
|
-
children: isCheckoutEnabled && i18n.ready.value && /* @__PURE__ */ u("div", { className: core.theme.className, children: /* @__PURE__ */ u(Form, { form, ref: setFormRef, onFormChange: (form2) => setForm(form2), children: /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, bem()), children: [
|
|
327
|
-
Email(),
|
|
328
|
-
Address(),
|
|
329
|
-
((_a = session == null ? void 0 : session.checkout) == null ? void 0 : _a.paymentType) === PaymentType.RECURRING && RecurringTip(),
|
|
330
|
-
/* @__PURE__ */ u("div", { className: bem("footer-wrapper"), children: [
|
|
331
|
-
!!errorMsg && /* @__PURE__ */ u(Info, { className: bem("error"), content: errorMsg }),
|
|
332
|
-
Button()
|
|
333
|
-
] })
|
|
334
|
-
] }) }) })
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
});
|
|
338
|
-
export {
|
|
339
|
-
WechatPay
|
|
340
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../core.js";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const aliPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getAliPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const boostPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getBoostPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const gcashPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getGcashPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const grabPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getGrabPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const linePay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getLinePayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const mayBankQRPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getMayBankQRPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const ninePay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getNinePayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
2
|
-
import { type RequestOptions } from '../../http';
|
|
3
|
-
export declare const opayWalletPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getOpayWalletPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
2
|
-
import { type RequestOptions } from '../../http';
|
|
3
|
-
export declare const pagaWalletPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getPagaWalletPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
2
|
-
import { type RequestOptions } from '../../http';
|
|
3
|
-
export declare const paymayaPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getPaymayaPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
2
|
-
import { type RequestOptions } from '../../http';
|
|
3
|
-
export declare const picPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getPicPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
2
|
-
import { type RequestOptions } from '../../http';
|
|
3
|
-
export declare const pixPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getPixPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const shopeePay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getShopeePayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const tngWalletPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getTNGWalletPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const vietqrPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getVietqrPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const wechatPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getWechatPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from '../../http';
|
|
2
|
-
import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
|
|
3
|
-
export declare const zalopayPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
4
|
-
export declare const getZalopayPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { PayKKaCommonConfig } from '../../types';
|
|
2
|
-
import type { PaymentCommonProps } from '../../types/payment';
|
|
3
|
-
export interface AliPayProps extends PayKKaCommonConfig, PaymentCommonProps {
|
|
4
|
-
/**
|
|
5
|
-
* 是否展示邮箱
|
|
6
|
-
* @remarks
|
|
7
|
-
* - 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
-
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
-
* @defaultValue false
|
|
10
|
-
*/
|
|
11
|
-
showEmail?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 是否展示邮箱
|
|
14
|
-
* @remarks
|
|
15
|
-
* - 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
16
|
-
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
17
|
-
* @defaultValue false
|
|
18
|
-
*/
|
|
19
|
-
showAddress?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface AliPayRef {
|
|
22
|
-
stopRetry: () => void;
|
|
23
|
-
startRetry: (timeout?: number) => void;
|
|
24
|
-
updateAddress: () => void;
|
|
25
|
-
updateEmail: () => void;
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import './wechat-pay.scss';
|
|
2
|
-
import type { WechatPayProps, WechatPayRef } from './type';
|
|
3
|
-
export declare const WechatPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<WechatPayProps & import("../../types").PayKKaCommonConfig & {
|
|
4
|
-
session: import("../../core").Session;
|
|
5
|
-
core: import("../../core").PayKKaCheckout;
|
|
6
|
-
threeDSFrame?: import("../../types").ThreeDSFrameConfig | undefined;
|
|
7
|
-
isDropIn?: boolean | undefined;
|
|
8
|
-
}> & {
|
|
9
|
-
ref?: import("preact").Ref<WechatPayRef> | undefined;
|
|
10
|
-
}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { PayKKaCommonConfig } from '../../types';
|
|
2
|
-
import type { PaymentCommonProps } from '../../types/payment';
|
|
3
|
-
export interface WechatPayProps extends PayKKaCommonConfig, PaymentCommonProps {
|
|
4
|
-
/**
|
|
5
|
-
* 是否展示邮箱
|
|
6
|
-
* @remarks
|
|
7
|
-
* - 若配置 true 但创建收银台时已经传了,就展示禁用状态。
|
|
8
|
-
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
9
|
-
* @defaultValue false
|
|
10
|
-
*/
|
|
11
|
-
showEmail?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 是否展示邮箱
|
|
14
|
-
* @remarks
|
|
15
|
-
* - 若配置 true 但创建收银台时已经传了,还是展示,先不禁用。
|
|
16
|
-
* - 若配置 false 但创建收银台时未传,依旧会展示该输入框。
|
|
17
|
-
* @defaultValue false
|
|
18
|
-
*/
|
|
19
|
-
showAddress?: boolean;
|
|
20
|
-
onGetOpenId?: () => Promise<string>;
|
|
21
|
-
onCallWxPayBox?: (payInfo: any) => Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export interface WechatPayRef {
|
|
24
|
-
stopRetry: () => void;
|
|
25
|
-
startRetry: (timeout?: number) => void;
|
|
26
|
-
updateAddress: () => void;
|
|
27
|
-
updateEmail: () => void;
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SubmitButtonStatus } from '../components';
|
|
2
|
-
/** 支付状态管理 */
|
|
3
|
-
export declare const usePaymentStatus: () => {
|
|
4
|
-
paymentButtonStatus: SubmitButtonStatus;
|
|
5
|
-
setPaymentButtonStatus: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<SubmitButtonStatus>>;
|
|
6
|
-
errorMsg: string;
|
|
7
|
-
setErrorMsg: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>;
|
|
8
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** 纯函数:阶梯解析 + 抖动公式(固定 Math.random,便于对照) */
|
|
2
|
-
export declare function runPureConsoleTests(): {
|
|
3
|
-
ok: boolean;
|
|
4
|
-
passed: number;
|
|
5
|
-
failed: number;
|
|
6
|
-
failures: string[];
|
|
7
|
-
};
|
|
8
|
-
/** Hook:固定 interval,cb 第 3 次 end;校验首段延迟、次数、resolve 结果 */
|
|
9
|
-
export declare function runHookFixedIntervalDemo(): Promise<{
|
|
10
|
-
ok: boolean;
|
|
11
|
-
detail: string[];
|
|
12
|
-
}>;
|
|
13
|
-
/** Hook:短阶梯 + pollTiers;校验 cb 次数与 resolve */
|
|
14
|
-
export declare function runHookPollTiersDemo(): Promise<{
|
|
15
|
-
ok: boolean;
|
|
16
|
-
detail: string[];
|
|
17
|
-
}>;
|
|
18
|
-
export type UseRetryConsoleRunSummary = {
|
|
19
|
-
pure: {
|
|
20
|
-
ok: boolean;
|
|
21
|
-
passed: number;
|
|
22
|
-
failed: number;
|
|
23
|
-
failures: string[];
|
|
24
|
-
};
|
|
25
|
-
hookFixed: {
|
|
26
|
-
ok: boolean;
|
|
27
|
-
detail: string[];
|
|
28
|
-
};
|
|
29
|
-
hookTiers: {
|
|
30
|
-
ok: boolean;
|
|
31
|
-
detail: string[];
|
|
32
|
-
};
|
|
33
|
-
allOk: boolean;
|
|
34
|
-
};
|
|
35
|
-
export declare function runAll(): Promise<UseRetryConsoleRunSummary>;
|
|
36
|
-
export declare const __paykkaUseRetryTests: {
|
|
37
|
-
readonly runPureConsoleTests: typeof runPureConsoleTests;
|
|
38
|
-
readonly runHookFixedIntervalDemo: typeof runHookFixedIntervalDemo;
|
|
39
|
-
readonly runHookPollTiersDemo: typeof runHookPollTiersDemo;
|
|
40
|
-
readonly runAll: typeof runAll;
|
|
41
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
interface BehaviorTrackerData {
|
|
2
|
-
/** 初始化时间 */
|
|
3
|
-
startTime: number;
|
|
4
|
-
/** 点击次数 */
|
|
5
|
-
clickTimes: number;
|
|
6
|
-
/** 首次点击时间(相对初始化时间而言) */
|
|
7
|
-
firstClickTime: number;
|
|
8
|
-
/** 鼠标移动次数 */
|
|
9
|
-
mouseMoveTimes: number;
|
|
10
|
-
/** 触摸移动次数 */
|
|
11
|
-
touchMoveTimes: number;
|
|
12
|
-
/** 触摸开始次数 */
|
|
13
|
-
touchStartTimes: number;
|
|
14
|
-
/** 滚动次数 */
|
|
15
|
-
scrollTimes: number;
|
|
16
|
-
/** 键盘输入次数 */
|
|
17
|
-
keydownTimes: number;
|
|
18
|
-
/** 焦点变化次数 */
|
|
19
|
-
focusChangeTimes: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 用户行为追踪
|
|
23
|
-
* 用于收集用户行为数据,用于后续分析和优化
|
|
24
|
-
* 如果使用了模拟器/自动化工具,则能通过收集到的数据判断
|
|
25
|
-
*/
|
|
26
|
-
export declare class BehaviorTracker {
|
|
27
|
-
#private;
|
|
28
|
-
static instance: BehaviorTracker;
|
|
29
|
-
constructor();
|
|
30
|
-
get data(): BehaviorTrackerData;
|
|
31
|
-
/** 开始监听用户行为 */
|
|
32
|
-
init(): void;
|
|
33
|
-
/** 停止监听用户行为 */
|
|
34
|
-
destroy(): void;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|