@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
|
@@ -2,6 +2,7 @@ const ptPT = {
|
|
|
2
2
|
// guide card
|
|
3
3
|
"guideCard.redirectDescription": "Após a submissão, você será redirecionado para a página do provedor do método de pagamento para concluir com segurança os passos subsequentes.",
|
|
4
4
|
"guideCard.scanQRCode": "Após a submissão do pedido, use {method} para escanear o código QR.",
|
|
5
|
+
"guideCard.redirectWechatPay": "Após a submissão do pedido, use WeChat Pay",
|
|
5
6
|
// Drop In
|
|
6
7
|
"dropIn.card.label": "Cartão bancário",
|
|
7
8
|
"dropIn.otherPaymentMethod": "Outro método de pagamento",
|
|
@@ -27,6 +28,8 @@ const ptPT = {
|
|
|
27
28
|
"dropIn.skrill.label": "Skrill",
|
|
28
29
|
"dropIn.trustly.label": "Trustly",
|
|
29
30
|
"dropIn.p24.label": "Przelewy24",
|
|
31
|
+
"dropIn.aliPay.label": "Alipay+",
|
|
32
|
+
"dropIn.wechatPay.label": "WeChat Pay",
|
|
30
33
|
// card number
|
|
31
34
|
"card.cardNumber.label": "Número do cartão",
|
|
32
35
|
"card.cardNumber.incomplete": "O número do seu cartão está incompleto",
|
|
@@ -66,6 +69,7 @@ const ptPT = {
|
|
|
66
69
|
"common.unknownError": "Erro Desconhecido",
|
|
67
70
|
"common.cancel": "Cancelar",
|
|
68
71
|
"common.confirm": "Confirmar",
|
|
72
|
+
"common.wechatPayGlobal": "WeChat Pay",
|
|
69
73
|
// common email
|
|
70
74
|
"common.email.label": "Email",
|
|
71
75
|
"common.email.incomplete": "Por favor, insira seu email",
|
|
@@ -109,11 +113,14 @@ const ptPT = {
|
|
|
109
113
|
"threeDS.authenticationSuccessful": "Autenticação bem-sucedida,",
|
|
110
114
|
"threeDS.authenticationFailed": "Autenticação falhou,",
|
|
111
115
|
"threeDS.returnToCheckout": "a regressar em breve.",
|
|
116
|
+
"threeDS.linkExpired": "O link 3DS expirou.",
|
|
117
|
+
"threeDS.linkAlreadyUsed": "Este link já foi utilizado.",
|
|
112
118
|
// qrCode
|
|
113
119
|
"qrCode.expired": "O código QR expirou.",
|
|
114
120
|
"qrCode.scanByGcash": "Escaneie o código QR com GCash",
|
|
115
121
|
"qrCode.scanByZalopay": "Escaneie o código QR com Zalopay",
|
|
116
122
|
"qrCode.scanByVietqr": "Escaneie o código QR com VietQR",
|
|
123
|
+
"qrCode.scanWechatPayGlobal": "Escaneie o código QR com WeChat Pay",
|
|
117
124
|
// cpf
|
|
118
125
|
"cpf.label": "CPF/CNPJ",
|
|
119
126
|
"cpf.incomplete": "Seu CPF/CNPJ está incompleto",
|
|
@@ -2,6 +2,7 @@ const ruRU = {
|
|
|
2
2
|
// guide card
|
|
3
3
|
"guideCard.redirectDescription": "После отправки вы будете перенаправлены на страницу поставщика платежного метода для безопасного завершения последующих шагов.",
|
|
4
4
|
"guideCard.scanQRCode": "После отправки заказа, используйте {method} для сканирования QR-кода.",
|
|
5
|
+
"guideCard.redirectWechatPay": "После отправки заказа используйте WeChat Pay",
|
|
5
6
|
// Drop In
|
|
6
7
|
"dropIn.card.label": "Банковская карта",
|
|
7
8
|
"dropIn.otherPaymentMethod": "Другой способ оплаты",
|
|
@@ -27,6 +28,8 @@ const ruRU = {
|
|
|
27
28
|
"dropIn.skrill.label": "Skrill",
|
|
28
29
|
"dropIn.trustly.label": "Trustly",
|
|
29
30
|
"dropIn.p24.label": "Przelewy24",
|
|
31
|
+
"dropIn.aliPay.label": "Alipay+",
|
|
32
|
+
"dropIn.wechatPay.label": "WeChat Pay",
|
|
30
33
|
// card number
|
|
31
34
|
"card.cardNumber.label": "Номер карты",
|
|
32
35
|
"card.cardNumber.incomplete": "Ваш номер карты неполный",
|
|
@@ -66,6 +69,7 @@ const ruRU = {
|
|
|
66
69
|
"common.unknownError": "Неизвестная ошибка",
|
|
67
70
|
"common.cancel": "Отмена",
|
|
68
71
|
"common.confirm": "Подтвердить",
|
|
72
|
+
"common.wechatPayGlobal": "WeChat Pay",
|
|
69
73
|
// common email
|
|
70
74
|
"common.email.label": "Электронная почта",
|
|
71
75
|
"common.email.incomplete": "Пожалуйста, введите вашу электронную почту",
|
|
@@ -109,11 +113,14 @@ const ruRU = {
|
|
|
109
113
|
"threeDS.authenticationSuccessful": "Аутентификация успешна,",
|
|
110
114
|
"threeDS.authenticationFailed": "Аутентификация не удалась,",
|
|
111
115
|
"threeDS.returnToCheckout": "скоро возврат.",
|
|
116
|
+
"threeDS.linkExpired": "Срок действия ссылки 3DS истек.",
|
|
117
|
+
"threeDS.linkAlreadyUsed": "Эта ссылка уже была использована.",
|
|
112
118
|
// qrCode
|
|
113
119
|
"qrCode.expired": "Срок действия QR-кода истек.",
|
|
114
120
|
"qrCode.scanByGcash": "Сканируйте QR-кодом с GCash",
|
|
115
121
|
"qrCode.scanByZalopay": "Сканируйте QR-кодом с Zalopay",
|
|
116
122
|
"qrCode.scanByVietqr": "Сканируйте QR-кодом с VietQR",
|
|
123
|
+
"qrCode.scanWechatPayGlobal": "Сканируйте QR-кодом с WeChat Pay",
|
|
117
124
|
// cpf
|
|
118
125
|
"cpf.label": "CPF/CNPJ",
|
|
119
126
|
"cpf.incomplete": "Ваш CPF/CNPJ неполный",
|
|
@@ -2,6 +2,7 @@ const zhCN = {
|
|
|
2
2
|
// guide card
|
|
3
3
|
"guideCard.redirectDescription": "提交后,您将被跳转到支付方式品牌方的页面,安全地完成后续步骤。",
|
|
4
4
|
"guideCard.scanQRCode": "提交订单后,用 {method} 扫描二维码。",
|
|
5
|
+
"guideCard.redirectWechatPay": "提交订单后,用微信支付",
|
|
5
6
|
// Drop In
|
|
6
7
|
"dropIn.card.label": "银行卡",
|
|
7
8
|
"dropIn.otherPaymentMethod": "其他支付方式",
|
|
@@ -27,6 +28,8 @@ const zhCN = {
|
|
|
27
28
|
"dropIn.skrill.label": "Skrill",
|
|
28
29
|
"dropIn.trustly.label": "Trustly",
|
|
29
30
|
"dropIn.p24.label": "Przelewy24",
|
|
31
|
+
"dropIn.aliPay.label": "Alipay+",
|
|
32
|
+
"dropIn.wechatPay.label": "WeChat Pay",
|
|
30
33
|
// card number
|
|
31
34
|
"card.cardNumber.label": "卡号",
|
|
32
35
|
"card.cardNumber.incomplete": "您的卡号不完整",
|
|
@@ -66,6 +69,7 @@ const zhCN = {
|
|
|
66
69
|
"common.unknownError": "未知异常",
|
|
67
70
|
"common.cancel": "取消",
|
|
68
71
|
"common.confirm": "确认",
|
|
72
|
+
"common.wechatPayGlobal": "微信支付",
|
|
69
73
|
// form fields
|
|
70
74
|
"form.name.label": "姓名",
|
|
71
75
|
"form.name.placeholder": "请输入您的姓名",
|
|
@@ -109,11 +113,14 @@ const zhCN = {
|
|
|
109
113
|
"threeDS.authenticationSuccessful": "认证成功,",
|
|
110
114
|
"threeDS.authenticationFailed": "认证失败,",
|
|
111
115
|
"threeDS.returnToCheckout": "即将返回",
|
|
116
|
+
"threeDS.linkExpired": "3DS 链接已过期",
|
|
117
|
+
"threeDS.linkAlreadyUsed": "此链接已被使用",
|
|
112
118
|
// qrCode
|
|
113
119
|
"qrCode.expired": "二维码过期",
|
|
114
120
|
"qrCode.scanByGcash": "用 Gcash 扫码",
|
|
115
121
|
"qrCode.scanByZalopay": "用 Zalopay 扫码",
|
|
116
122
|
"qrCode.scanByVietqr": "用 VietQR 扫码",
|
|
123
|
+
"qrCode.scanWechatPayGlobal": "用微信支付扫码",
|
|
117
124
|
// cpf
|
|
118
125
|
"cpf.label": "CPF/CNPJ",
|
|
119
126
|
"cpf.incomplete": "您的身份证件号码不完整",
|
|
@@ -2,6 +2,7 @@ const zhHK = {
|
|
|
2
2
|
// guide card
|
|
3
3
|
"guideCard.redirectDescription": "提交後,您將被跳轉到支付方式品牌方的頁面,安全地完成後續步驟。",
|
|
4
4
|
"guideCard.scanQRCode": "提交訂單後,用 {method} 掃描二維碼。",
|
|
5
|
+
"guideCard.redirectWechatPay": "提交訂單後,用微信支付",
|
|
5
6
|
// Drop In
|
|
6
7
|
"dropIn.card.label": "銀行卡",
|
|
7
8
|
"dropIn.otherPaymentMethod": "其他支付方式",
|
|
@@ -27,6 +28,8 @@ const zhHK = {
|
|
|
27
28
|
"dropIn.skrill.label": "Skrill",
|
|
28
29
|
"dropIn.trustly.label": "Trustly",
|
|
29
30
|
"dropIn.p24.label": "Przelewy24",
|
|
31
|
+
"dropIn.aliPay.label": "Alipay+",
|
|
32
|
+
"dropIn.wechatPay.label": "WeChat Pay",
|
|
30
33
|
// card number
|
|
31
34
|
"card.cardNumber.label": "卡號",
|
|
32
35
|
"card.cardNumber.incomplete": "您的卡號不完整",
|
|
@@ -66,6 +69,7 @@ const zhHK = {
|
|
|
66
69
|
"common.unknownError": "未知異常",
|
|
67
70
|
"common.cancel": "取消",
|
|
68
71
|
"common.confirm": "確認",
|
|
72
|
+
"common.wechatPayGlobal": "微信支付",
|
|
69
73
|
// common email
|
|
70
74
|
"common.email.label": "郵箱",
|
|
71
75
|
"common.email.incomplete": "請輸入郵箱",
|
|
@@ -109,11 +113,14 @@ const zhHK = {
|
|
|
109
113
|
"threeDS.authenticationSuccessful": "認證成功,",
|
|
110
114
|
"threeDS.authenticationFailed": "認證失敗,",
|
|
111
115
|
"threeDS.returnToCheckout": "即將返回",
|
|
116
|
+
"threeDS.linkExpired": "3DS 連結已過期",
|
|
117
|
+
"threeDS.linkAlreadyUsed": "此鏈接已被使用",
|
|
112
118
|
// qrCode
|
|
113
119
|
"qrCode.expired": "二維碼過期",
|
|
114
120
|
"qrCode.scanByGcash": "用 Gcash 掃碼",
|
|
115
121
|
"qrCode.scanByZalopay": "用 Zalopay 掃碼",
|
|
116
122
|
"qrCode.scanByVietqr": "用 VietQR 掃碼",
|
|
123
|
+
"qrCode.scanWechatPayGlobal": "用微信支付掃碼",
|
|
117
124
|
// cpf
|
|
118
125
|
"cpf.label": "CPF/CNPJ",
|
|
119
126
|
"cpf.incomplete": "您的身份證件號碼不完整",
|
|
@@ -2,6 +2,7 @@ const zhTW = {
|
|
|
2
2
|
// guide card
|
|
3
3
|
"guideCard.redirectDescription": "提交後,您將被跳轉到支付方式品牌方的頁面,安全地完成後續步驟。",
|
|
4
4
|
"guideCard.scanQRCode": "提交訂單後,用 {method} 掃描二維碼。",
|
|
5
|
+
"guideCard.redirectWechatPay": "提交訂單後,用微信支付",
|
|
5
6
|
// Drop In
|
|
6
7
|
"dropIn.card.label": "銀行卡",
|
|
7
8
|
"dropIn.otherPaymentMethod": "其他支付方式",
|
|
@@ -27,6 +28,8 @@ const zhTW = {
|
|
|
27
28
|
"dropIn.skrill.label": "Skrill",
|
|
28
29
|
"dropIn.trustly.label": "Trustly",
|
|
29
30
|
"dropIn.p24.label": "Przelewy24",
|
|
31
|
+
"dropIn.aliPay.label": "Alipay+",
|
|
32
|
+
"dropIn.wechatPay.label": "WeChat Pay",
|
|
30
33
|
// card number
|
|
31
34
|
"card.cardNumber.label": "卡號",
|
|
32
35
|
"card.cardNumber.incomplete": "您的卡號不完整",
|
|
@@ -66,6 +69,7 @@ const zhTW = {
|
|
|
66
69
|
"common.unknownError": "未知異常",
|
|
67
70
|
"common.cancel": "取消",
|
|
68
71
|
"common.confirm": "確認",
|
|
72
|
+
"common.wechatPayGlobal": "微信支付",
|
|
69
73
|
// common email
|
|
70
74
|
"common.email.label": "郵箱",
|
|
71
75
|
"common.email.incomplete": "請輸入郵箱",
|
|
@@ -109,11 +113,14 @@ const zhTW = {
|
|
|
109
113
|
"threeDS.authenticationSuccessful": "認證成功,",
|
|
110
114
|
"threeDS.authenticationFailed": "認證失敗,",
|
|
111
115
|
"threeDS.returnToCheckout": "即將返回",
|
|
116
|
+
"threeDS.linkExpired": "3DS 連結已過期",
|
|
117
|
+
"threeDS.linkAlreadyUsed": "此連結已被使用",
|
|
112
118
|
// qrCode
|
|
113
119
|
"qrCode.expired": "二維碼過期",
|
|
114
120
|
"qrCode.scanByGcash": "用 Gcash 掃碼",
|
|
115
121
|
"qrCode.scanByZalopay": "用 Zalopay 掃碼",
|
|
116
122
|
"qrCode.scanByVietqr": "用 VietQR 掃碼",
|
|
123
|
+
"qrCode.scanWechatPayGlobal": "用微信支付掃碼",
|
|
117
124
|
// cpf
|
|
118
125
|
"cpf.label": "CPF/CNPJ",
|
|
119
126
|
"cpf.incomplete": "您的身份證件號碼不完整",
|
package/dist/es/i18n/util.js
CHANGED
|
@@ -3,12 +3,12 @@ import "../utils/card-brand/brands.js";
|
|
|
3
3
|
import { getBrowserInfo } from "../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { LocaleKey, language2LocaleKeyMap, getLocales } from "./locales/index.js";
|
|
5
5
|
import enGB from "./locales/en-GB.js";
|
|
6
|
-
|
|
6
|
+
const normalizedLocale = (locale) => {
|
|
7
7
|
return locale.trim().replaceAll("_", "-").toLowerCase();
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
};
|
|
9
|
+
const getLocaleLanguage = (locale) => {
|
|
10
10
|
return locale.split("-")[0];
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
const getLocaleList = () => {
|
|
13
13
|
return Object.entries(getLocales()).map(([key, value]) => {
|
|
14
14
|
return {
|
|
@@ -18,11 +18,11 @@ const getLocaleList = () => {
|
|
|
18
18
|
};
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const mergeCustomLocales = (customLocales) => {
|
|
22
22
|
const localeList = getLocaleList();
|
|
23
23
|
return localeList;
|
|
24
|
-
}
|
|
25
|
-
|
|
24
|
+
};
|
|
25
|
+
const getTranslation = (locale, customLocales) => {
|
|
26
26
|
var _a, _b;
|
|
27
27
|
const mergedLocaleList = mergeCustomLocales();
|
|
28
28
|
locale = normalizedLocale(locale);
|
|
@@ -32,7 +32,7 @@ function getTranslation(locale, customLocales) {
|
|
|
32
32
|
translation = (_b = mergedLocaleList.find((item) => item.language === language)) == null ? void 0 : _b.translation;
|
|
33
33
|
}
|
|
34
34
|
return translation;
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
const getRealLocale = (locale) => {
|
|
37
37
|
let realLocale = getLocalKey(locale);
|
|
38
38
|
if (!realLocale) {
|
|
@@ -53,7 +53,7 @@ const getLocalKey = (locale) => {
|
|
|
53
53
|
const lowerPrefix = locale == null ? void 0 : locale.slice(0, 2).toLowerCase();
|
|
54
54
|
return language2LocaleKeyMap[locale] || language2LocaleKeyMap[lowerPrefix];
|
|
55
55
|
};
|
|
56
|
-
async
|
|
56
|
+
const loadTranslation = async (locale, customLocales) => {
|
|
57
57
|
let translation = getTranslation(locale);
|
|
58
58
|
if (!translation && locale !== getBrowserInfo().language) {
|
|
59
59
|
locale = getBrowserInfo().language;
|
|
@@ -76,7 +76,7 @@ async function loadTranslation(locale, customLocales) {
|
|
|
76
76
|
locale,
|
|
77
77
|
translation
|
|
78
78
|
};
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
80
|
export {
|
|
81
81
|
getRealLocale,
|
|
82
82
|
loadTranslation
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./style/index.js";
|
|
2
|
-
import { AliPay } from "./components/AliPay/index.js";
|
|
3
2
|
import { Card } from "./components/Card/index.js";
|
|
4
3
|
import { CardBrands } from "./components/CardBrands/index.js";
|
|
5
4
|
import { CardExpireDateField } from "./components/CardExpireDateField/index.js";
|
|
@@ -9,7 +8,6 @@ import { CardSecurityCodeField } from "./components/CardSecurityCodeField/index.
|
|
|
9
8
|
import { CardSelector } from "./components/CardSelector/index.js";
|
|
10
9
|
import { CardNo } from "./components/CardNo/index.js";
|
|
11
10
|
import { SubmitButton } from "./components/SubmitButton/index.js";
|
|
12
|
-
import { WechatPay } from "./components/WechatPay/index.js";
|
|
13
11
|
import { ApplePay } from "./components/ApplePay/index.js";
|
|
14
12
|
import { GooglePay } from "./components/GooglePay/index.js";
|
|
15
13
|
import { SecuredIframe } from "./components/SecuredIframe/index.js";
|
|
@@ -40,6 +38,8 @@ import { IDeal } from "./components/wallets/IDeal/IDeal.js";
|
|
|
40
38
|
import { Skrill } from "./components/wallets/Skrill/Skrill.js";
|
|
41
39
|
import { P24 } from "./components/wallets/P24/P24.js";
|
|
42
40
|
import { Trustly } from "./components/wallets/Trustly/Trustly.js";
|
|
41
|
+
import { AliPay } from "./components/wallets/AliPay/AliPay.js";
|
|
42
|
+
import { WechatPay } from "./components/wallets/WechatPay/WechatPay.js";
|
|
43
43
|
import "./core/context.js";
|
|
44
44
|
import { create } from "./core/create.js";
|
|
45
45
|
import { Session } from "./core/session.js";
|
|
@@ -50,16 +50,16 @@ import { PaymentMethod } from "./constant.js";
|
|
|
50
50
|
import "./utils/card-brand/brands.js";
|
|
51
51
|
import { getFingerprint } from "./utils/system-info/finger-print.js";
|
|
52
52
|
import "./utils/system-info/get-browser-info.js";
|
|
53
|
-
import { CardBrandCode, EPayKKaEnv, PaymentStatus, defaultInputStyleConfig, inputStyleAttrs } from "./types/index.js";
|
|
53
|
+
import { CardBrandCode, EPayKKaEnv, PaymentAction, PaymentStatus, defaultInputStyleConfig, inputStyleAttrs } from "./types/index.js";
|
|
54
54
|
import { redirectToPayment } from "./utils/redirect.js";
|
|
55
55
|
import "./core.js";
|
|
56
56
|
import { I18n } from "./i18n/I18n.js";
|
|
57
57
|
import { LocaleKey } from "./i18n/locales/index.js";
|
|
58
|
+
import "./out/fraud-detection.js";
|
|
58
59
|
import { setApiUrl, setCDNUrl, setCustomLocale, setCustomReqHeaders, setFraudDetectionEnv } from "./config.js";
|
|
59
|
-
import { ApplePayEventType, FraudDetectionEventType, GooglePayEventType, LoggerEventType, PaymentEventType, SecurityIframeEventType, ThreeDSEventType } from "./types/event.js";
|
|
60
|
-
import "./out/worldpay-jsc-origin.js";
|
|
61
60
|
import { ECollMode } from "./types/fraud-detection.js";
|
|
62
61
|
import { MessageAction } from "./types/message.js";
|
|
62
|
+
import { ApplePayEventType, FraudDetectionEventType, GooglePayEventType, LoggerEventType, PaymentEventType, SecurityIframeEventType, ThreeDSEventType, WechatPayEventType } from "./types/event.js";
|
|
63
63
|
export {
|
|
64
64
|
AliPay,
|
|
65
65
|
ApplePay,
|
|
@@ -106,6 +106,7 @@ export {
|
|
|
106
106
|
PayKKaEncryptedCard,
|
|
107
107
|
PayKKaError,
|
|
108
108
|
Paymaya,
|
|
109
|
+
PaymentAction,
|
|
109
110
|
PaymentComponentMap,
|
|
110
111
|
PaymentEventType,
|
|
111
112
|
PaymentMethod,
|
|
@@ -124,6 +125,7 @@ export {
|
|
|
124
125
|
Trustly,
|
|
125
126
|
Vietqr,
|
|
126
127
|
WechatPay,
|
|
128
|
+
WechatPayEventType,
|
|
127
129
|
Zalopay,
|
|
128
130
|
create,
|
|
129
131
|
defaultInputStyleConfig,
|
|
@@ -10,8 +10,8 @@ import "../core.js";
|
|
|
10
10
|
import "../utils/card-brand/brands.js";
|
|
11
11
|
import "../utils/system-info/get-browser-info.js";
|
|
12
12
|
import { PayKKaError, EPayKKaError } from "../core/error.js";
|
|
13
|
+
import "./fraud-detection.js";
|
|
13
14
|
import { DEFAULT_TIMEOUT } from "./config.js";
|
|
14
|
-
import "./worldpay-jsc-origin.js";
|
|
15
15
|
class BaseFraudDetection {
|
|
16
16
|
constructor(params) {
|
|
17
17
|
/** 当前渠道 */
|
|
@@ -30,12 +30,14 @@ import { ChannelCode } from "../constant.js";
|
|
|
30
30
|
import { apiEnv, cdnEnv } from "../core/environment.js";
|
|
31
31
|
import { ECollMode } from "../types/fraud-detection.js";
|
|
32
32
|
import { FraudDetectionEventType } from "../types/event.js";
|
|
33
|
+
import { difference } from "../utils/array.js";
|
|
33
34
|
import { JSC_LIVE_CONFIG, JSC_TEST_CONFIG } from "./config.js";
|
|
34
35
|
import { PayKKaDetection } from "./paykka-detection.js";
|
|
35
36
|
import { StripeRadar } from "./stripe-radar.js";
|
|
36
37
|
import { WorldpayDDCManager } from "./worldpay-ddc-manager.js";
|
|
37
38
|
import { WorldpayJSC } from "./worldpay-jsc.js";
|
|
38
39
|
const DEFAULT_ENV = "eu";
|
|
40
|
+
const DEFAULT_MODES = [ECollMode.SR, ECollMode.WP, ECollMode.WJ];
|
|
39
41
|
let instance = null;
|
|
40
42
|
function getFraudDetectionInstance(config, options) {
|
|
41
43
|
if (!instance) {
|
|
@@ -61,7 +63,7 @@ class FraudDetection {
|
|
|
61
63
|
__publicField(this, "isIIFE", typeof __IS_IIFE__ !== "undefined" && __IS_IIFE__);
|
|
62
64
|
__privateAdd(this, _sessionMode, void 0);
|
|
63
65
|
const { env, clientKey, modes } = config;
|
|
64
|
-
this.modes = (modes == null ? void 0 : modes.length) ? [...modes] :
|
|
66
|
+
this.modes = (modes == null ? void 0 : modes.length) ? [...modes] : DEFAULT_MODES;
|
|
65
67
|
this.options = { ...options };
|
|
66
68
|
this.env = env || DEFAULT_ENV;
|
|
67
69
|
this.clientKey = clientKey;
|
|
@@ -73,16 +75,21 @@ class FraudDetection {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
async getFraudDetectionId(options) {
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
const modes = difference(this.modes, (options == null ? void 0 : options.excludeModes) || []);
|
|
79
|
+
const hasWP = modes.includes(ECollMode.WP);
|
|
80
|
+
const needRefresh = hasWP;
|
|
81
|
+
await this.setChannelSDKConfig(needRefresh);
|
|
82
|
+
const collTasks = [this.paykkaDetectionColl().init()];
|
|
83
|
+
let worldpayDDCManager = null;
|
|
84
|
+
if (hasWP) {
|
|
85
|
+
worldpayDDCManager = this.worldpayDDCManagerColl();
|
|
86
|
+
worldpayDDCManager.updateChannelConfig(this.channelConfig);
|
|
87
|
+
collTasks.push(worldpayDDCManager.init(options));
|
|
88
|
+
}
|
|
89
|
+
await Promise.all(collTasks);
|
|
83
90
|
return this.formatFraudDetectionId({
|
|
84
91
|
s: modes.includes(ECollMode.SR) ? this.stripeRadarColl().getFraudDetectionId() : "",
|
|
85
|
-
w: modes.includes(ECollMode.WP) ? worldpayDDCManager.getFraudDetectionId() : "",
|
|
92
|
+
w: modes.includes(ECollMode.WP) ? (worldpayDDCManager == null ? void 0 : worldpayDDCManager.getFraudDetectionId()) ?? "" : "",
|
|
86
93
|
wr: modes.includes(ECollMode.WJ) ? this.worldpayJSCColl().getFraudDetectionId() : "",
|
|
87
94
|
p: this.paykkaDetectionColl().getFraudDetectionId()
|
|
88
95
|
});
|
|
@@ -116,47 +123,55 @@ class FraudDetection {
|
|
|
116
123
|
return "";
|
|
117
124
|
}
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
/**
|
|
127
|
+
* 设置渠道配置,请求到的配置会缓存
|
|
128
|
+
* @param refresh 是否强制刷新,如果为 true,则跳过缓存强制重新请求渠道配置
|
|
129
|
+
*/
|
|
130
|
+
async setChannelSDKConfig(refresh = false) {
|
|
131
|
+
if (!refresh) {
|
|
132
|
+
if (this.channelConfig)
|
|
133
|
+
return;
|
|
134
|
+
if (this.channelConfigPromise) {
|
|
135
|
+
return this.channelConfigPromise;
|
|
136
|
+
}
|
|
125
137
|
}
|
|
126
138
|
this.channelConfigPromise = new Promise(async (resolve) => {
|
|
127
|
-
|
|
128
|
-
let config = {};
|
|
129
|
-
try {
|
|
130
|
-
browser = await getBrowserParams();
|
|
131
|
-
config = await getChannelSDKConfig({
|
|
132
|
-
channel: [ChannelCode.STRIPE, ChannelCode.WORLDPAY],
|
|
133
|
-
browser
|
|
134
|
-
});
|
|
135
|
-
} catch (error) {
|
|
136
|
-
}
|
|
137
|
-
const { worldPay } = config || {};
|
|
138
|
-
let ddcOrigin = "";
|
|
139
|
-
try {
|
|
140
|
-
ddcOrigin = new URL((worldPay == null ? void 0 : worldPay.ddcCollectUrl) || "").origin;
|
|
141
|
-
} catch (error) {
|
|
142
|
-
ddcOrigin = "";
|
|
143
|
-
}
|
|
144
|
-
this.channelConfig = {
|
|
145
|
-
...config,
|
|
146
|
-
worldPay: {
|
|
147
|
-
...worldPay,
|
|
148
|
-
ddcOrigin
|
|
149
|
-
},
|
|
150
|
-
worldPayJSC: ["eu", "hk"].includes(this.env) ? JSC_LIVE_CONFIG : JSC_TEST_CONFIG,
|
|
151
|
-
paykka: {
|
|
152
|
-
clientKey: this.clientKey,
|
|
153
|
-
sessionMode: __privateGet(this, _sessionMode)
|
|
154
|
-
}
|
|
155
|
-
};
|
|
139
|
+
this.channelConfig = await this.fetchChannelSDKConfig();
|
|
156
140
|
resolve();
|
|
157
141
|
});
|
|
158
142
|
return this.channelConfigPromise;
|
|
159
143
|
}
|
|
144
|
+
async fetchChannelSDKConfig() {
|
|
145
|
+
let browser = {};
|
|
146
|
+
let config = {};
|
|
147
|
+
try {
|
|
148
|
+
browser = await getBrowserParams();
|
|
149
|
+
config = await getChannelSDKConfig({
|
|
150
|
+
channel: [ChannelCode.STRIPE, ChannelCode.WORLDPAY],
|
|
151
|
+
browser
|
|
152
|
+
});
|
|
153
|
+
} catch (error) {
|
|
154
|
+
}
|
|
155
|
+
const { worldPay } = config || {};
|
|
156
|
+
let ddcOrigin = "";
|
|
157
|
+
try {
|
|
158
|
+
ddcOrigin = new URL((worldPay == null ? void 0 : worldPay.ddcCollectUrl) || "").origin;
|
|
159
|
+
} catch (error) {
|
|
160
|
+
ddcOrigin = "";
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
...config,
|
|
164
|
+
worldPay: {
|
|
165
|
+
...worldPay,
|
|
166
|
+
ddcOrigin
|
|
167
|
+
},
|
|
168
|
+
worldPayJSC: ["eu", "hk"].includes(this.env) ? JSC_LIVE_CONFIG : JSC_TEST_CONFIG,
|
|
169
|
+
paykka: {
|
|
170
|
+
clientKey: this.clientKey,
|
|
171
|
+
sessionMode: __privateGet(this, _sessionMode)
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
160
175
|
worldpayDDCManagerColl() {
|
|
161
176
|
const instance2 = new WorldpayDDCManager(this.options, this.channelConfig);
|
|
162
177
|
return instance2;
|
|
@@ -4,16 +4,15 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import "../utils/
|
|
8
|
-
import "../utils/system-info/get-browser-info.js";
|
|
9
|
-
import { ChannelCode } from "../constant.js";
|
|
10
|
-
import { parseUrl } from "../utils/location.js";
|
|
7
|
+
import { getReferrer } from "../utils/index.js";
|
|
11
8
|
import "../core.js";
|
|
12
9
|
import "../core/context.js";
|
|
10
|
+
import "./fraud-detection.js";
|
|
11
|
+
import { ChannelCode } from "../constant.js";
|
|
13
12
|
import { reportUrls } from "../api/modules/risk/index.js";
|
|
14
13
|
import { encryptAES } from "../utils/encrypt.js";
|
|
15
14
|
import { BaseFraudDetection } from "./base-fraud-detection.js";
|
|
16
|
-
import "
|
|
15
|
+
import { parseUrl } from "../utils/location.js";
|
|
17
16
|
const _PayKKaDetection = class _PayKKaDetection extends BaseFraudDetection {
|
|
18
17
|
constructor(options, channelConfig) {
|
|
19
18
|
if (_PayKKaDetection.instance) {
|
|
@@ -47,8 +46,7 @@ const _PayKKaDetection = class _PayKKaDetection extends BaseFraudDetection {
|
|
|
47
46
|
}
|
|
48
47
|
/** 获取页面来源域名 */
|
|
49
48
|
getReferer() {
|
|
50
|
-
|
|
51
|
-
const referer = document.referrer || ((_b = (_a = window.frames) == null ? void 0 : _a.top) == null ? void 0 : _b.document.referrer) || "";
|
|
49
|
+
const referer = getReferrer();
|
|
52
50
|
return parseUrl(referer).origin;
|
|
53
51
|
}
|
|
54
52
|
/** 获取当前页面域名 */
|
|
@@ -11,9 +11,9 @@ import { loadScript } from "../utils/load.js";
|
|
|
11
11
|
import "../core.js";
|
|
12
12
|
import "../core/context.js";
|
|
13
13
|
import { PayKKaError, EPayKKaError } from "../core/error.js";
|
|
14
|
+
import "./fraud-detection.js";
|
|
14
15
|
import { STRIPE_RADAR_TIMEOUT, STRIPE_RADAR_SCRIPT_URL } from "./config.js";
|
|
15
16
|
import { BaseFraudDetection } from "./base-fraud-detection.js";
|
|
16
|
-
import "./worldpay-jsc-origin.js";
|
|
17
17
|
const _StripeRadar = class _StripeRadar extends BaseFraudDetection {
|
|
18
18
|
constructor(options, channelConfig) {
|
|
19
19
|
if (_StripeRadar.instance) {
|
|
@@ -18,6 +18,9 @@ const _WorldpayDDCManager = class _WorldpayDDCManager {
|
|
|
18
18
|
this.channelConfig = channelConfig;
|
|
19
19
|
_WorldpayDDCManager.instance = this;
|
|
20
20
|
}
|
|
21
|
+
updateChannelConfig(channelConfig) {
|
|
22
|
+
this.channelConfig = channelConfig;
|
|
23
|
+
}
|
|
21
24
|
async init(options) {
|
|
22
25
|
this.currentDDC = new WorldpayDDC(this.options, this.channelConfig);
|
|
23
26
|
await this.currentDDC.init(options);
|
|
@@ -12,9 +12,9 @@ import "../utils/system-info/get-browser-info.js";
|
|
|
12
12
|
import { ChannelCode } from "../constant.js";
|
|
13
13
|
import { MessageAction } from "../types/message.js";
|
|
14
14
|
import { postMessageToIframe } from "../utils/iframe.js";
|
|
15
|
+
import "./fraud-detection.js";
|
|
15
16
|
import { DDC_TIMEOUT } from "./config.js";
|
|
16
17
|
import { BaseFraudDetection } from "./base-fraud-detection.js";
|
|
17
|
-
import "./worldpay-jsc-origin.js";
|
|
18
18
|
class WorldpayDDC extends BaseFraudDetection {
|
|
19
19
|
constructor(options, channelConfig) {
|
|
20
20
|
super({
|