@adyen/adyen-web 6.4.0 → 6.5.0
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 +16 -5
- package/dist/cjs/adyen.css +7 -3
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +27 -19
- package/dist/es/adyen.css +7 -3
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/components/ANCV/ANCV.js +1 -1
- package/dist/es/components/ANCV/ANCV.js.map +1 -1
- package/dist/es/components/Ach/Ach.js +1 -1
- package/dist/es/components/Ach/Ach.js.map +1 -1
- package/dist/es/components/Address/Address.js +1 -1
- package/dist/es/components/Address/Address.js.map +1 -1
- package/dist/es/components/Affirm/Affirm.js +1 -1
- package/dist/es/components/Affirm/Affirm.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPay.js +1 -1
- package/dist/es/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPayB2B.js +1 -1
- package/dist/es/components/AfterPay/AfterPayB2B.js.map +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePay.js +1 -1
- package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePayService.js +1 -1
- package/dist/es/components/ApplePay/ApplePayService.js.map +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es/components/Atome/Atome.js +1 -1
- package/dist/es/components/Atome/Atome.js.map +1 -1
- package/dist/es/components/BacsDD/BacsDD.js +1 -1
- package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
- package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es/components/BcmcMobile/BcmcMobile.js +1 -1
- package/dist/es/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskOnline.js +1 -1
- package/dist/es/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskWallet.js +1 -1
- package/dist/es/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es/components/Blik/Blik.js +1 -1
- package/dist/es/components/Blik/Blik.js.map +1 -1
- package/dist/es/components/Boleto/Boleto.js +1 -1
- package/dist/es/components/Boleto/Boleto.js.map +1 -1
- package/dist/es/components/Card/Bancontact.js +1 -1
- package/dist/es/components/Card/Bancontact.js.map +1 -1
- package/dist/es/components/Card/Card.js +1 -1
- package/dist/es/components/Card/Card.js.map +1 -1
- package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
- package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es/components/CashAppPay/services/CashAppService.js +1 -1
- package/dist/es/components/CashAppPay/services/CashAppService.js.map +1 -1
- package/dist/es/components/ClickToPay/ClickToPay.js +1 -1
- package/dist/es/components/ClickToPay/ClickToPay.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCard.js +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/Doku/Doku.js +1 -1
- package/dist/es/components/Doku/Doku.js.map +1 -1
- package/dist/es/components/Donation/Donation.js +1 -1
- package/dist/es/components/Donation/Donation.js.map +1 -1
- package/dist/es/components/Dotpay/index.js +1 -1
- package/dist/es/components/Dotpay/index.js.map +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es/components/Dropin/Dropin.js +1 -1
- package/dist/es/components/Dropin/Dropin.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/DuitNow/DuitNow.js +1 -1
- package/dist/es/components/DuitNow/DuitNow.js.map +1 -1
- package/dist/es/components/EPS/index.js +1 -1
- package/dist/es/components/EPS/index.js.map +1 -1
- package/dist/es/components/Econtext/Econtext.js +1 -1
- package/dist/es/components/Econtext/Econtext.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay10x.js +1 -1
- package/dist/es/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay12x.js +1 -1
- package/dist/es/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay3x.js +1 -1
- package/dist/es/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay4x.js +1 -1
- package/dist/es/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay6x.js +1 -1
- package/dist/es/components/FacilyPay/FacilyPay6x.js.map +1 -1
- package/dist/es/components/Giftcard/Giftcard.js +1 -1
- package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es/components/Giropay/Giropay.js +1 -1
- package/dist/es/components/Giropay/Giropay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePayService.js +1 -1
- package/dist/es/components/GooglePay/GooglePayService.js.map +1 -1
- package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
- package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es/components/MBWay/MBWay.js +1 -1
- package/dist/es/components/MBWay/MBWay.js.map +1 -1
- package/dist/es/components/MealVoucherFR/MealVoucherFR.js +1 -1
- package/dist/es/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingMY.js +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingMY.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingTH.js +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingTH.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingVN.js +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingVN.js.map +1 -1
- package/dist/es/components/Multibanco/Multibanco.js +1 -1
- package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es/components/OnlineBankingCZ/index.js +1 -1
- package/dist/es/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es/components/OnlineBankingFI/OnlineBankingFI.js +1 -1
- package/dist/es/components/OnlineBankingFI/OnlineBankingFI.js.map +1 -1
- package/dist/es/components/OnlineBankingIN/index.js +1 -1
- package/dist/es/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
- package/dist/es/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es/components/OnlineBankingSK/index.js +1 -1
- package/dist/es/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es/components/Oxxo/Oxxo.js +1 -1
- package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es/components/PayByBank/PayByBank.js +1 -1
- package/dist/es/components/PayByBank/PayByBank.js.map +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es/components/PayMe/PayMe.js +1 -1
- package/dist/es/components/PayMe/PayMe.js.map +1 -1
- package/dist/es/components/PayMe/components/PayMeInstructions.js +2 -0
- package/dist/es/components/PayMe/components/PayMeInstructions.js.map +1 -0
- package/dist/es/components/PayMe/components/PayMeIntroduction.js +2 -0
- package/dist/es/components/PayMe/components/PayMeIntroduction.js.map +1 -0
- package/dist/es/components/PayNow/PayNow.js +1 -1
- package/dist/es/components/PayNow/PayNow.js.map +1 -1
- package/dist/es/components/PayNow/components/PayNowInstructions.js +2 -0
- package/dist/es/components/PayNow/components/PayNowInstructions.js.map +1 -0
- package/dist/es/components/PayNow/components/PayNowIntroduction.js +2 -0
- package/dist/es/components/PayNow/components/PayNowIntroduction.js.map +1 -0
- package/dist/es/components/PayPal/Paypal.js +1 -1
- package/dist/es/components/PayPal/Paypal.js.map +1 -1
- package/dist/es/components/PayU/PayuCashcard.js +1 -1
- package/dist/es/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es/components/PayU/PayuNetBanking.js +1 -1
- package/dist/es/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es/components/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es/components/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es/components/Pix/Pix.js +1 -1
- package/dist/es/components/Pix/Pix.js.map +1 -1
- package/dist/es/components/PromptPay/PromptPay.js +1 -1
- package/dist/es/components/PromptPay/PromptPay.js.map +1 -1
- package/dist/es/components/RatePay/RatePay.js +1 -1
- package/dist/es/components/RatePay/RatePay.js.map +1 -1
- package/dist/es/components/RatePay/RatePayDirectDebit.js +1 -1
- package/dist/es/components/RatePay/RatePayDirectDebit.js.map +1 -1
- package/dist/es/components/Redirect/Redirect.js +1 -1
- package/dist/es/components/Redirect/Redirect.js.map +1 -1
- package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
- package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
- package/dist/es/components/Riverty/Riverty.js +1 -1
- package/dist/es/components/Riverty/Riverty.js.map +1 -1
- package/dist/es/components/Sepa/Sepa.js +1 -1
- package/dist/es/components/Sepa/Sepa.js.map +1 -1
- package/dist/es/components/Swish/Swish.js +1 -1
- package/dist/es/components/Swish/Swish.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es/components/Trustly/Trustly.js +1 -1
- package/dist/es/components/Trustly/Trustly.js.map +1 -1
- package/dist/es/components/Twint/Twint.js +1 -1
- package/dist/es/components/Twint/Twint.js.map +1 -1
- package/dist/es/components/UPI/UPI.js +1 -1
- package/dist/es/components/UPI/UPI.js.map +1 -1
- package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
- package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
- package/dist/es/components/Vipps/Vipps.js +1 -1
- package/dist/es/components/Vipps/Vipps.js.map +1 -1
- package/dist/es/components/WalletIN/index.js +1 -1
- package/dist/es/components/WalletIN/index.js.map +1 -1
- package/dist/es/components/WeChat/WeChat.js +1 -1
- package/dist/es/components/WeChat/WeChat.js.map +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
- package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
- package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/Address/Specifications.js +1 -1
- package/dist/es/components/internal/Address/Specifications.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/Button/Button.js +1 -1
- package/dist/es/components/internal/Button/Button.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js +1 -1
- package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/models/ShopperCard.js +1 -1
- package/dist/es/components/internal/ClickToPay/models/ShopperCard.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
- package/dist/es/components/internal/Countdown/CountdownA11yReporter.js +1 -1
- package/dist/es/components/internal/Countdown/CountdownA11yReporter.js.map +1 -1
- package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
- package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
- package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/AbstractCSF.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/AbstractCSF.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es/components/internal/Timeline/Timeline.js +2 -0
- package/dist/es/components/internal/Timeline/Timeline.js.map +1 -0
- package/dist/es/components/internal/Timeline/TimelineWrapper.js +2 -0
- package/dist/es/components/internal/Timeline/TimelineWrapper.js.map +1 -0
- package/dist/es/components/internal/UIElement/UIElement.js +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/core/CheckoutSession/CheckoutSession.js +1 -1
- package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
- package/dist/es/core/Context/Resources.js +1 -1
- package/dist/es/core/Context/Resources.js.map +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es/core/Errors/SRPanel.js +1 -1
- package/dist/es/core/Errors/SRPanel.js.map +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/es/core/RiskModule/RiskModule.js +1 -1
- package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js.map +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
- package/dist/es/core/Services/analytics/collect-id.js +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/core/core.registry.js +1 -1
- package/dist/es/core/core.registry.js.map +1 -1
- package/dist/es/index.d.ts +27 -19
- package/dist/es/language/Language.js +1 -1
- package/dist/es/language/Language.js.map +1 -1
- package/dist/es/utils/Script.js +1 -1
- package/dist/es/utils/Script.js.map +1 -1
- package/dist/es/utils/Storage.js +1 -1
- package/dist/es/utils/Storage.js.map +1 -1
- package/dist/es/utils/Validator/ValidationRuleResult.js +1 -1
- package/dist/es/utils/Validator/ValidationRuleResult.js.map +1 -1
- package/dist/es/utils/Validator/Validator.js +1 -1
- package/dist/es/utils/Validator/Validator.js.map +1 -1
- package/dist/es/utils/constants/currency-decimals.js +1 -1
- package/dist/es/utils/constants/currency-decimals.js.map +1 -1
- package/dist/es/utils/constants/currency-minor-units.js.map +1 -1
- package/dist/es/utils/useForm/reducer.js +1 -1
- package/dist/es/utils/useForm/reducer.js.map +1 -1
- package/dist/es/utils/useForm/useForm.js +1 -1
- package/dist/es/utils/useForm/useForm.js.map +1 -1
- package/dist/es/utils/useIsMobile.js +2 -0
- package/dist/es/utils/useIsMobile.js.map +1 -0
- package/dist/es-legacy/adyen.css +7 -3
- package/dist/es-legacy/adyen.css.map +1 -1
- package/dist/es-legacy/components/BcmcMobile/BcmcMobile.js +1 -1
- package/dist/es-legacy/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es-legacy/components/PayMe/PayMe.js +1 -1
- package/dist/es-legacy/components/PayMe/PayMe.js.map +1 -1
- package/dist/es-legacy/components/PayMe/components/PayMeInstructions.js +2 -0
- package/dist/es-legacy/components/PayMe/components/PayMeInstructions.js.map +1 -0
- package/dist/es-legacy/components/PayMe/components/PayMeIntroduction.js +2 -0
- package/dist/es-legacy/components/PayMe/components/PayMeIntroduction.js.map +1 -0
- package/dist/es-legacy/components/PayNow/PayNow.js +1 -1
- package/dist/es-legacy/components/PayNow/PayNow.js.map +1 -1
- package/dist/es-legacy/components/PayNow/components/PayNowInstructions.js +2 -0
- package/dist/es-legacy/components/PayNow/components/PayNowInstructions.js.map +1 -0
- package/dist/es-legacy/components/PayNow/components/PayNowIntroduction.js +2 -0
- package/dist/es-legacy/components/PayNow/components/PayNowIntroduction.js.map +1 -0
- package/dist/es-legacy/components/Swish/Swish.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
- package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
- package/dist/es-legacy/components/internal/Timeline/Timeline.js +2 -0
- package/dist/es-legacy/components/internal/Timeline/Timeline.js.map +1 -0
- package/dist/es-legacy/components/internal/Timeline/TimelineWrapper.js +2 -0
- package/dist/es-legacy/components/internal/Timeline/TimelineWrapper.js.map +1 -0
- package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
- package/dist/es-legacy/core/core.js +1 -1
- package/dist/es-legacy/utils/constants/currency-decimals.js +1 -1
- package/dist/es-legacy/utils/constants/currency-decimals.js.map +1 -1
- package/dist/es-legacy/utils/constants/currency-minor-units.js.map +1 -1
- package/dist/es-legacy/utils/useForm/reducer.js +1 -1
- package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
- package/dist/es-legacy/utils/useForm/useForm.js +1 -1
- package/dist/es-legacy/utils/useForm/useForm.js.map +1 -1
- package/dist/es-legacy/utils/useIsMobile.js +2 -0
- package/dist/es-legacy/utils/useIsMobile.js.map +1 -0
- package/package.json +4 -2
- package/styles/adyen.css +7 -3
- package/dist/es/components/PayMe/Instructions.js +0 -2
- package/dist/es/components/PayMe/Instructions.js.map +0 -1
- package/dist/es-legacy/components/PayMe/Instructions.js +0 -2
- package/dist/es-legacy/components/PayMe/Instructions.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Component as s}from"../../../../external/preact/dist/preact.js";import{getFields as t,validFieldsReducer as e,getErrorReducer as i,getErrorObject as o}from"./SFPUtils.js";import n from"../lib/CSF/initCSF.js";import r from"./SecuredFieldsProviderHandlers.js";import
|
|
1
|
+
import{Component as s}from"../../../../external/preact/dist/preact.js";import{getFields as t,validFieldsReducer as e,getErrorReducer as i,getErrorObject as o}from"./SFPUtils.js";import n from"../lib/CSF/initCSF.js";import r from"./SecuredFieldsProviderHandlers.js";import d from"./defaultProps.js";import{ENCRYPTED_PWD_FIELD as a,ENCRYPTED_CARD_NUMBER as h,DEDICATED_CARD_COMPONENTS as l,CVC_POLICY_REQUIRED as p,DATE_POLICY_REQUIRED as c}from"../lib/constants.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as f}from"../../../../core/Errors/utils.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";function F(s,t,e){return t in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}class C extends s{componentDidMount(){this.props.rootNode&&this.setRootNode(this.props.rootNode);const s=t(this.rootNode),i=s.reduce(e,{});this.setState({valid:i}),s.forEach((s=>{this.numCharsInField[s]=0})),this.numDateFields=s.filter((s=>s.match(/Expiry/))).length,s.length?(this.destroy(),this.initializeCSF(this.rootNode)):this.handleOnNoDataRequired()}componentDidUpdate(){this.checkForKCPFields()}componentWillUnmount(){this.csf=null,clearTimeout(this.csfLoadFailTimeout),clearTimeout(this.csfConfigFailTimeout)}initializeCSF(s){let t=this.props.loadingContext;const e={rootNode:s,type:this.props.type,clientKey:this.props.clientKey,cardGroupTypes:this.props.brands,autoFocus:this.props.autoFocus,trimTrailingSeparator:this.props.trimTrailingSeparator,loadingContext:t,keypadFix:this.props.keypadFix,showWarnings:this.props.showWarnings,iframeUIConfig:{sfStyles:this.props.styles},i18n:this.props.i18n,callbacks:{onLoad:this.handleOnLoad,onConfigSuccess:this.handleOnConfigSuccess,onFieldValid:this.handleOnFieldValid,onAllValid:this.handleOnAllValid,onBrand:this.handleOnBrand,onError:this.handleOnError,onFocus:this.handleFocus,onBinValue:this.props.onBinValue,onAutoComplete:this.handleOnAutoComplete,onAdditionalSFConfig:this.props.onAdditionalSFConfig,onAdditionalSFRemoved:this.props.onAdditionalSFRemoved,onTouchstartIOS:this.handleOnTouchstartIOS,onKeyPressed:this.handleKeyPressed},isKCP:this.state.hasKoreanFields,legacyInputMode:this.props.legacyInputMode,minimumExpiryDate:this.props.minimumExpiryDate,implementationType:this.props.implementationType||"components",forceCompat:this.props.forceCompat,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,shouldDisableIOSArrowKeys:!!this.props.disableIOSArrowKeys,placeholders:this.props.placeholders??{},showContextualElement:this.props.showContextualElement};this.csf=n(e),this.csfLoadFailTimeout=setTimeout((()=>{"ready"!==this.state.status&&(this.setState({status:"csfLoadFailure"}),this.props.onError(new u("ERROR","secured field iframes have failed to load")))}),this.csfLoadFailTimeoutMS)}checkForKCPFields(){let s=!1;if(this.props.koreanAuthenticationRequired&&(s=this.issuingCountryCode?"kr"===this.issuingCountryCode:"kr"===this.props.countryCode),this.state.hasKoreanFields&&!s){const s=s=>({data:{...s.data,[a]:void 0},valid:{...s.valid,[a]:!1},errors:{...s.errors,[a]:!1},hasKoreanFields:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.removeSecuredField(a),this.csf.setKCPStatus(!1)}if(!this.state.hasKoreanFields&&s){const s=s=>({valid:{...s.valid,[a]:!1},hasKoreanFields:!0,isSfpValid:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.addSecuredField(a),this.csf.setKCPStatus(!0)}}getChildContext(){return{i18n:this.props.i18n}}handleUnsupportedCard(s){const t=!!s.error;return t&&this.setState({detectedUnsupportedBrands:s.detectedBrands}),s.rootNode=this.rootNode,this.handleOnError(s,t),this.csf&&this.csf.hasUnsupportedCard(h,s.error),t}setFocusOn(s){this.csf&&this.csf.setFocusOnFrame(s)}updateStyles(s){this.csf&&this.csf.updateStyles(s)}sfIsOptionalOrHidden(s){return this.csf.sfIsOptionalOrHidden(s)}destroy(){this.csf&&this.csf.destroy()}showValidation(){const{numDateFields:s,state:t}=this;Object.keys(t.valid).reduce(i(s,t),[]).forEach((s=>{const e=o(s,this.rootNode,t);this.handleOnError(e,!!t.detectedUnsupportedBrands),this.csf&&this.csf.isValidated&&this.csf.isValidated(s,e.error)}))}mapErrorsToValidationRuleResult(){return Object.keys(this.state.errors).reduce(((s,t)=>{const e=this.state.errors[t];return s[t]=e?{isValid:!1,errorMessage:f(e,m),errorI18n:this.props.i18n.get(e),error:e,rootNode:this.rootNode,...this.state.detectedUnsupportedBrands&&{detectedBrands:this.state.detectedUnsupportedBrands}}:null,s}),{})}processBinLookupResponse(s,t){if(this.state.detectedUnsupportedBrands&&(this.setState((s=>({errors:{...s.errors,[h]:!1},detectedUnsupportedBrands:null}))),this.csf&&s)){const s={type:"card",fieldType:"encryptedCardNumber",error:""};this.handleUnsupportedCard(s)}this.issuingCountryCode=s?.issuingCountryCode?.toLowerCase();const e=t?.brand,i=e&&l.includes(t.brand);i&&this.setState(t,(()=>{this.props.onChange(this.state)})),this.csf&&this.csf.brandsFromBinLookup(s,i?t:null)}render(s,t){return s.render({setRootNode:this.setRootNode,setFocusOn:this.setFocusOn},t)}constructor(s){super(s),F(this,"csfLoadFailTimeout",void 0),F(this,"csfLoadFailTimeoutMS",void 0),F(this,"csfConfigFailTimeout",void 0),F(this,"csfConfigFailTimeoutMS",void 0),F(this,"numCharsInField",void 0),F(this,"rootNode",void 0),F(this,"numDateFields",void 0),F(this,"csf",void 0),F(this,"handleOnLoad",void 0),F(this,"handleOnConfigSuccess",void 0),F(this,"handleOnFieldValid",void 0),F(this,"handleOnAllValid",void 0),F(this,"handleOnBrand",void 0),F(this,"handleFocus",void 0),F(this,"handleOnError",void 0),F(this,"handleOnAutoComplete",void 0),F(this,"handleOnNoDataRequired",void 0),F(this,"handleOnTouchstartIOS",void 0),F(this,"handleKeyPressed",void 0),F(this,"state",void 0),F(this,"props",void 0),F(this,"issuingCountryCode",void 0),F(this,"setRootNode",(s=>{this.rootNode=s}));const t={status:"loading",brand:s.type,errors:{},valid:{},data:{},cvcPolicy:p,expiryDatePolicy:c,isSfpValid:!1,hasKoreanFields:s.hasKoreanFields};this.state=t,this.csfLoadFailTimeout=null,this.csfLoadFailTimeoutMS=3e4,this.csfConfigFailTimeout=null,this.csfConfigFailTimeoutMS=15e3,this.numCharsInField={},this.handleOnLoad=r.handleOnLoad.bind(this),this.handleOnConfigSuccess=r.handleOnConfigSuccess.bind(this),this.handleOnFieldValid=r.handleOnFieldValid.bind(this),this.handleOnAllValid=r.handleOnAllValid.bind(this),this.handleOnBrand=r.handleOnBrand.bind(this),this.handleFocus=r.handleFocus.bind(this),this.handleOnError=r.handleOnError.bind(this),this.handleOnNoDataRequired=r.handleOnNoDataRequired.bind(this),this.handleOnAutoComplete=r.handleOnAutoComplete.bind(this),this.handleOnTouchstartIOS=r.handleOnTouchstartIOS.bind(this),this.handleKeyPressed=r.handleKeyPressed.bind(this),this.processBinLookupResponse=this.processBinLookupResponse.bind(this),this.setFocusOn=this.setFocusOn.bind(this),this.updateStyles=this.updateStyles.bind(this),this.handleUnsupportedCard=this.handleUnsupportedCard.bind(this),this.showValidation=this.showValidation.bind(this),this.destroy=this.destroy.bind(this)}}F(C,"defaultProps",d);export{C as default};
|
|
2
2
|
//# sourceMappingURL=SecuredFieldsProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuredFieldsProvider.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProvider.ts"],"sourcesContent":["import { Component } from 'preact';\nimport { getErrorObject, getFields, getErrorReducer, validFieldsReducer } from './SFPUtils';\nimport initCSF from '../lib/CSF';\nimport handlers from './SecuredFieldsProviderHandlers';\nimport defaultProps from './defaultProps';\nimport { SFPProps, SFPState, SingleBrandResetObject } from './types';\nimport {\n StylesObject,\n CbObjOnError,\n CbObjOnFocus,\n CbObjOnBrand,\n CbObjOnAllValid,\n CbObjOnFieldValid,\n CbObjOnAutoComplete,\n CbObjOnConfigSuccess,\n CbObjOnLoad,\n SFKeyPressObj\n} from '../lib/types';\nimport { CSFReturnObject, CSFSetupObject } from '../lib/CSF/types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, DEDICATED_CARD_COMPONENTS, ENCRYPTED_CARD_NUMBER, ENCRYPTED_PWD_FIELD } from '../lib/constants';\nimport { BinLookupResponse } from '../../../Card/types';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\nimport { SFStateErrorObj } from '../../../Card/components/CardInput/types';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\n\n/**\n * SecuredFieldsProvider:\n * Initialises & handles the client-side part of SecuredFields\n */\nclass SecuredFieldsProvider extends Component<SFPProps, SFPState> {\n private csfLoadFailTimeout: number;\n private csfLoadFailTimeoutMS: number;\n private csfConfigFailTimeout: number;\n private csfConfigFailTimeoutMS: number;\n private numCharsInField: object;\n private rootNode;\n private numDateFields: number;\n private csf: CSFReturnObject;\n private handleOnLoad: (obj: CbObjOnLoad) => void;\n private handleOnConfigSuccess: (obj: CbObjOnConfigSuccess) => void;\n private handleOnFieldValid: (obj: CbObjOnFieldValid) => void;\n private handleOnAllValid: (obj: CbObjOnAllValid) => void;\n private handleOnBrand: (obj: CbObjOnBrand) => void;\n private handleFocus: (obj: CbObjOnFocus) => void;\n private handleOnError: (obj: CbObjOnError, hasUnsupportedCard?: boolean) => void;\n private handleOnAutoComplete: (obj: CbObjOnAutoComplete) => void;\n private handleOnNoDataRequired: () => void;\n private handleOnTouchstartIOS: (obj) => void;\n private handleKeyPressed: (obj: SFKeyPressObj) => void;\n public state: SFPState;\n public props;\n private issuingCountryCode;\n\n constructor(props: SFPProps) {\n super(props);\n\n const stateObj: SFPState = {\n status: 'loading',\n brand: props.type,\n errors: {},\n valid: {},\n data: {},\n cvcPolicy: CVC_POLICY_REQUIRED,\n expiryDatePolicy: DATE_POLICY_REQUIRED,\n isSfpValid: false,\n hasKoreanFields: props.hasKoreanFields\n };\n this.state = stateObj;\n\n this.csfLoadFailTimeout = null;\n this.csfLoadFailTimeoutMS = 30000;\n\n this.csfConfigFailTimeout = null;\n this.csfConfigFailTimeoutMS = 15000;\n\n this.numCharsInField = {};\n\n // Handlers\n this.handleOnLoad = handlers.handleOnLoad.bind(this);\n this.handleOnConfigSuccess = handlers.handleOnConfigSuccess.bind(this);\n this.handleOnFieldValid = handlers.handleOnFieldValid.bind(this);\n this.handleOnAllValid = handlers.handleOnAllValid.bind(this);\n this.handleOnBrand = handlers.handleOnBrand.bind(this);\n this.handleFocus = handlers.handleFocus.bind(this);\n this.handleOnError = handlers.handleOnError.bind(this);\n this.handleOnNoDataRequired = handlers.handleOnNoDataRequired.bind(this);\n this.handleOnAutoComplete = handlers.handleOnAutoComplete.bind(this);\n this.handleOnTouchstartIOS = handlers.handleOnTouchstartIOS.bind(this); // Only called when iOS detected\n this.handleKeyPressed = handlers.handleKeyPressed.bind(this);\n\n this.processBinLookupResponse = this.processBinLookupResponse.bind(this);\n\n // Bindings for functions exposed to users of this component: SecuredFields & CardInput\n this.setFocusOn = this.setFocusOn.bind(this);\n this.updateStyles = this.updateStyles.bind(this);\n this.handleUnsupportedCard = this.handleUnsupportedCard.bind(this);\n this.showValidation = this.showValidation.bind(this);\n this.destroy = this.destroy.bind(this);\n }\n\n public static defaultProps = defaultProps;\n\n public componentDidMount(): void {\n // When SFP instantiated through SecuredFieldsInput c.f. CardInput\n if (this.props.rootNode) {\n this.setRootNode(this.props.rootNode);\n }\n\n // Find encryptedFields and map them to the values we use to store valid states\n const fields = getFields(this.rootNode);\n const valid = fields.reduce(validFieldsReducer, {});\n\n this.setState({ valid });\n\n // Populate numCharsInField object\n fields.forEach(field => {\n this.numCharsInField[field] = 0;\n });\n\n // Store how many dateFields we are dealing with visually\n this.numDateFields = fields.filter(f => f.match(/Expiry/)).length;\n\n if (fields.length) {\n this.destroy(); // TODO test if this solves the React double render problem.\n this.initializeCSF(this.rootNode);\n } else {\n this.handleOnNoDataRequired();\n }\n }\n\n public componentDidUpdate() {\n this.checkForKCPFields();\n }\n\n public componentWillUnmount(): void {\n this.csf = null;\n clearTimeout(this.csfLoadFailTimeout);\n clearTimeout(this.csfConfigFailTimeout);\n }\n\n private initializeCSF(root: HTMLElement): void {\n let loadingContext = this.props.loadingContext;\n\n // For loading securedFields from local server during development\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n loadingContext = process.env.__SF_ENV__;\n }\n\n // TODO\n // if(!this.props.keypadFix){\n // send analytics action because to know if anyone *ever* sets this config prop\n // }\n\n const csfSetupObj: CSFSetupObject = {\n rootNode: root,\n type: this.props.type,\n clientKey: this.props.clientKey,\n cardGroupTypes: this.props.brands,\n autoFocus: this.props.autoFocus,\n trimTrailingSeparator: this.props.trimTrailingSeparator,\n loadingContext,\n keypadFix: this.props.keypadFix,\n showWarnings: this.props.showWarnings,\n iframeUIConfig: {\n sfStyles: this.props.styles\n },\n i18n: this.props.i18n,\n callbacks: {\n onLoad: this.handleOnLoad,\n onConfigSuccess: this.handleOnConfigSuccess,\n onFieldValid: this.handleOnFieldValid,\n onAllValid: this.handleOnAllValid,\n onBrand: this.handleOnBrand,\n onError: this.handleOnError,\n onFocus: this.handleFocus,\n onBinValue: this.props.onBinValue,\n onAutoComplete: this.handleOnAutoComplete,\n onAdditionalSFConfig: this.props.onAdditionalSFConfig,\n onAdditionalSFRemoved: this.props.onAdditionalSFRemoved,\n onTouchstartIOS: this.handleOnTouchstartIOS,\n onKeyPressed: this.handleKeyPressed\n },\n isKCP: this.state.hasKoreanFields,\n legacyInputMode: this.props.legacyInputMode,\n minimumExpiryDate: this.props.minimumExpiryDate,\n implementationType: this.props.implementationType || 'components', // to distinguish between 'regular' and 'custom' card component\n forceCompat: this.props.forceCompat,\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n shouldDisableIOSArrowKeys: !!this.props.disableIOSArrowKeys, // convert whether function has been defined into a boolean\n placeholders: this.props.placeholders ?? {},\n showContextualElement: this.props.showContextualElement\n };\n\n this.csf = initCSF(csfSetupObj);\n\n /**\n * Expect to at least have had the handleOnLoad callback called within this time\n * - if this hasn't happened then something has happened to interrupt the loading of the securedFields\n * So we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n // @ts-ignore - timout 'type' is a number\n this.csfLoadFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfLoadFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured field iframes have failed to load'));\n }\n }, this.csfLoadFailTimeoutMS);\n }\n\n private checkForKCPFields() {\n let needsKoreanFields = false;\n if (this.props.koreanAuthenticationRequired) {\n needsKoreanFields = this.issuingCountryCode ? this.issuingCountryCode === 'kr' : this.props.countryCode === 'kr';\n }\n\n // Was korean, now isn't - hide password field\n if (this.state.hasKoreanFields && !needsKoreanFields) {\n // Clear any stored data\n const setRemovedFieldState = prevState => ({\n data: { ...prevState.data, [ENCRYPTED_PWD_FIELD]: undefined },\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n errors: { ...prevState.errors, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: false\n });\n\n this.setState(setRemovedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.removeSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(false);\n }\n\n // Wasn't korean, now is - show password field\n if (!this.state.hasKoreanFields && needsKoreanFields) {\n const setAddedFieldState = prevState => ({\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: true,\n isSfpValid: false\n });\n\n this.setState(setAddedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.addSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(true);\n }\n }\n\n public getChildContext(): object {\n return { i18n: this.props.i18n };\n }\n\n public handleUnsupportedCard(errObj: CbObjOnError): boolean {\n const hasUnsupportedCard = !!errObj.error;\n\n // Store the brand(s) we detected and which we don't support\n if (hasUnsupportedCard) {\n this.setState({ detectedUnsupportedBrands: errObj.detectedBrands });\n }\n\n errObj.rootNode = this.rootNode; // Needed for CustomCard\n this.handleOnError(errObj, hasUnsupportedCard);\n // Inform CSF that the number field has an unsupportedCard error (or that it has been cleared)\n if (this.csf) {\n this.csf.hasUnsupportedCard(ENCRYPTED_CARD_NUMBER, errObj.error);\n }\n return hasUnsupportedCard;\n }\n\n public setFocusOn(frame: string): void {\n if (this.csf) this.csf.setFocusOnFrame(frame);\n }\n\n public updateStyles(stylesObj: StylesObject): void {\n if (this.csf) this.csf.updateStyles(stylesObj);\n }\n\n public sfIsOptionalOrHidden(fieldType: string): boolean {\n return this.csf.sfIsOptionalOrHidden(fieldType);\n }\n\n public destroy(): void {\n if (this.csf) this.csf.destroy();\n }\n\n public showValidation(): void {\n const { numDateFields, state }: SecuredFieldsProvider = this;\n\n Object.keys(state.valid)\n .reduce(getErrorReducer(numDateFields, state), [])\n .forEach(field => {\n // For each detected error pass an error object to the handler (calls error callback & sets state)\n const errorObj: CbObjOnError = getErrorObject(field, this.rootNode, state);\n this.handleOnError(errorObj, !!state.detectedUnsupportedBrands);\n // Inform the secured-fields instance of which fields have been found to have errors\n if (this.csf && this.csf.isValidated) {\n this.csf.isValidated(field, errorObj.error);\n }\n });\n }\n\n /**\n * Map SF errors to ValidationRuleResult-like objects, for CardInput component\n */\n public mapErrorsToValidationRuleResult(): SFStateErrorObj {\n const fieldNames: string[] = Object.keys(this.state.errors);\n\n const sfStateErrorsObj = fieldNames.reduce((acc, fieldName) => {\n const errorCode = this.state.errors[fieldName];\n if (errorCode) {\n acc[fieldName] = {\n isValid: false,\n errorMessage: getErrorMessageFromCode(errorCode, SF_ErrorCodes), // this is the human-readable, untranslated, explanation of the error that will exist on the error object in card.state.errors\n // For v5 the object found in state.errors should also contain the additional properties that used to be sent to the onError callback\n // namely: translation, errorCode, a ref to rootNode &, in the case of failed binLookup, an array of the detectedBrands\n errorI18n: this.props.i18n.get(errorCode),\n error: errorCode,\n rootNode: this.rootNode,\n ...(this.state.detectedUnsupportedBrands && { detectedBrands: this.state.detectedUnsupportedBrands })\n };\n } else {\n acc[fieldName] = null;\n }\n return acc;\n }, {});\n return sfStateErrorsObj;\n }\n\n public processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void {\n // If we were dealing with an unsupported card & now we have a valid /binLookup response (or a response triggering a reset of the UI),\n // - reset state to clear the error & the stored unsupportedBrands and, in the case of a valid /binLookup response, inform CSF (via handleUnsupportedCard)\n // (Scenario: from an unsupportedCard state the shopper has pasted another number long enough to trigger a /binLookup)\n if (this.state.detectedUnsupportedBrands) {\n this.setState(prevState => ({\n errors: { ...prevState.errors, [ENCRYPTED_CARD_NUMBER]: false },\n detectedUnsupportedBrands: null\n }));\n\n // If we have some sort of binLookupResponse object then this isn't the reset caused by digits dropping below a threshold\n // - so call handleUnsupportedCard to clear the error\n if (this.csf && binLookupResponse) {\n const errObj: CbObjOnError = {\n type: 'card',\n fieldType: 'encryptedCardNumber',\n error: ''\n };\n this.handleUnsupportedCard(errObj);\n }\n }\n\n this.issuingCountryCode = binLookupResponse?.issuingCountryCode?.toLowerCase();\n\n const hasBrandedResetObj = resetObject?.brand;\n\n /**\n * Are we dealing with a \"dedicated\" card scenario i.e a card component created as: checkout.create('bcmc') but which can accept multiple brands\n * - in which case we will need to reset brand and pass on the resetObj to CSF\n */\n const mustResetDedicatedBrand = hasBrandedResetObj && DEDICATED_CARD_COMPONENTS.includes(resetObject.brand);\n\n if (mustResetDedicatedBrand) {\n // resetObject.brand will be the value of the brand whose logo we want to reshow in the UI\n this.setState(resetObject, () => {\n this.props.onChange(this.state);\n });\n }\n\n /**\n * Scenarios:\n *\n * - RESET (binLookupResponse === null): The number of digits in number field has dropped below threshold for BIN lookup\n * - RESULT (binLookupResponse.supportedBrands.length === 1): binLookup has found a result so inform CSF\n *\n * In the RESET scenario, for \"dedicated\" card components we also need to pass on the resetObject since this contains information about\n * the brand that CSF needs to reset to, internally.\n */\n if (this.csf) this.csf.brandsFromBinLookup(binLookupResponse, mustResetDedicatedBrand ? resetObject : null);\n }\n\n private setRootNode = (input: HTMLElement): void => {\n this.rootNode = input;\n };\n\n public render(props, state) {\n return props.render({ setRootNode: this.setRootNode, setFocusOn: this.setFocusOn }, state);\n }\n}\n\nexport default SecuredFieldsProvider;\n"],"names":["SecuredFieldsProvider","Component","csfLoadFailTimeout","csfLoadFailTimeoutMS","csfConfigFailTimeout","csfConfigFailTimeoutMS","numCharsInField","rootNode","numDateFields","csf","handleOnLoad","handleOnConfigSuccess","handleOnFieldValid","handleOnAllValid","handleOnBrand","handleFocus","handleOnError","handleOnAutoComplete","handleOnNoDataRequired","handleOnTouchstartIOS","handleKeyPressed","state","props","issuingCountryCode","constructor","super","stateObj","status","brand","type","errors","valid","data","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","isSfpValid","hasKoreanFields","this","handlers","bind","processBinLookupResponse","setFocusOn","updateStyles","handleUnsupportedCard","showValidation","destroy","static","defaultProps","componentDidMount","setRootNode","fields","getFields","reduce","validFieldsReducer","setState","forEach","field","filter","f","match","length","initializeCSF","componentDidUpdate","checkForKCPFields","componentWillUnmount","clearTimeout","root","loadingContext","csfSetupObj","clientKey","cardGroupTypes","brands","autoFocus","trimTrailingSeparator","keypadFix","showWarnings","iframeUIConfig","sfStyles","styles","i18n","callbacks","onLoad","onConfigSuccess","onFieldValid","onAllValid","onBrand","onError","onFocus","onBinValue","onAutoComplete","onAdditionalSFConfig","onAdditionalSFRemoved","onTouchstartIOS","onKeyPressed","isKCP","legacyInputMode","minimumExpiryDate","implementationType","forceCompat","maskSecurityCode","exposeExpiryDate","shouldDisableIOSArrowKeys","disableIOSArrowKeys","placeholders","showContextualElement","initCSF","setTimeout","AdyenCheckoutError","needsKoreanFields","koreanAuthenticationRequired","countryCode","setRemovedFieldState","prevState","ENCRYPTED_PWD_FIELD","undefined","onChange","removeSecuredField","setKCPStatus","setAddedFieldState","addSecuredField","getChildContext","errObj","hasUnsupportedCard","error","detectedUnsupportedBrands","detectedBrands","ENCRYPTED_CARD_NUMBER","frame","setFocusOnFrame","stylesObj","sfIsOptionalOrHidden","fieldType","Object","keys","getErrorReducer","errorObj","getErrorObject","isValidated","mapErrorsToValidationRuleResult","acc","fieldName","errorCode","isValid","errorMessage","getErrorMessageFromCode","SF_ErrorCodes","errorI18n","get","binLookupResponse","resetObject","toLowerCase","hasBrandedResetObj","mustResetDedicatedBrand","DEDICATED_CARD_COMPONENTS","includes","brandsFromBinLookup","input","render"],"mappings":"8pBA8BA,MAAMA,UAA8BC,EACxBC,mBACAC,qBACAC,qBACAC,uBACAC,gBACAC,SACAC,cACAC,IACAC,aACAC,sBACAC,mBACAC,iBACAC,cACAC,YACAC,cACAC,qBACAC,uBACAC,sBACAC,iBACDC,MACAC,MACCC,mBAERC,WAAAA,CAAYF,GACRG,MAAMH,GAEN,MAAMI,EAAqB,CACvBC,OAAQ,UACRC,MAAON,EAAMO,KACbC,OAAQ,CAAC,EACTC,MAAO,CAAC,EACRC,KAAM,CAAC,EACPC,UAAWC,EACXC,iBAAkBC,EAClBC,YAAY,EACZC,gBAAiBhB,EAAMgB,iBAE3BC,KAAKlB,MAAQK,EAEba,KAAKrC,mBAAqB,KAC1BqC,KAAKpC,qBAAuB,IAE5BoC,KAAKnC,qBAAuB,KAC5BmC,KAAKlC,uBAAyB,KAE9BkC,KAAKjC,gBAAkB,GAGvBiC,KAAK7B,aAAe8B,EAAS9B,aAAa+B,KAAKF,MAC/CA,KAAK5B,sBAAwB6B,EAAS7B,sBAAsB8B,KAAKF,MACjEA,KAAK3B,mBAAqB4B,EAAS5B,mBAAmB6B,KAAKF,MAC3DA,KAAK1B,iBAAmB2B,EAAS3B,iBAAiB4B,KAAKF,MACvDA,KAAKzB,cAAgB0B,EAAS1B,cAAc2B,KAAKF,MACjDA,KAAKxB,YAAcyB,EAASzB,YAAY0B,KAAKF,MAC7CA,KAAKvB,cAAgBwB,EAASxB,cAAcyB,KAAKF,MACjDA,KAAKrB,uBAAyBsB,EAAStB,uBAAuBuB,KAAKF,MACnEA,KAAKtB,qBAAuBuB,EAASvB,qBAAqBwB,KAAKF,MAC/DA,KAAKpB,sBAAwBqB,EAASrB,sBAAsBsB,K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GAAa3H,MAMlC8H,EAA0BD,GAAsBE,EAA0BC,SAASL,EAAY3H,OAEjG8H,GAEAnH,KAAKiB,SAAS+F,GAAa,KACvBhH,KAAKjB,MAAM+F,SAAS9E,KAAKlB,MAAK,IAalCkB,KAAK9B,KAAK8B,KAAK9B,IAAIoJ,oBAAoBP,EAAmBI,EAA0BH,EAAc,KAC1G,CAEQpG,YAAe2G,IACnBvH,KAAKhC,SAAWuJ,CAAAA,EAGbC,MAAAA,CAAOzI,EAAOD,GACjB,OAAOC,EAAMyI,OAAO,CAAE5G,YAAaZ,KAAKY,YAAaR,WAAYJ,KAAKI,YAActB,EACxF"}
|
|
1
|
+
{"version":3,"file":"SecuredFieldsProvider.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProvider.ts"],"sourcesContent":["import { Component } from 'preact';\nimport { getErrorObject, getFields, getErrorReducer, validFieldsReducer } from './SFPUtils';\nimport initCSF from '../lib/CSF';\nimport handlers from './SecuredFieldsProviderHandlers';\nimport defaultProps from './defaultProps';\nimport { SFPProps, SFPState, SingleBrandResetObject } from './types';\nimport {\n StylesObject,\n CbObjOnError,\n CbObjOnFocus,\n CbObjOnBrand,\n CbObjOnAllValid,\n CbObjOnFieldValid,\n CbObjOnAutoComplete,\n CbObjOnConfigSuccess,\n CbObjOnLoad,\n SFKeyPressObj\n} from '../lib/types';\nimport { CSFReturnObject, CSFSetupObject } from '../lib/CSF/types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, DEDICATED_CARD_COMPONENTS, ENCRYPTED_CARD_NUMBER, ENCRYPTED_PWD_FIELD } from '../lib/constants';\nimport { BinLookupResponse } from '../../../Card/types';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\nimport { SFStateErrorObj } from '../../../Card/components/CardInput/types';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\n\n/**\n * SecuredFieldsProvider:\n * Initialises & handles the client-side part of SecuredFields\n */\nclass SecuredFieldsProvider extends Component<SFPProps, SFPState> {\n private csfLoadFailTimeout: number;\n private csfLoadFailTimeoutMS: number;\n private csfConfigFailTimeout: number;\n private csfConfigFailTimeoutMS: number;\n private numCharsInField: object;\n private rootNode;\n private numDateFields: number;\n private csf: CSFReturnObject;\n private handleOnLoad: (obj: CbObjOnLoad) => void;\n private handleOnConfigSuccess: (obj: CbObjOnConfigSuccess) => void;\n private handleOnFieldValid: (obj: CbObjOnFieldValid) => void;\n private handleOnAllValid: (obj: CbObjOnAllValid) => void;\n private handleOnBrand: (obj: CbObjOnBrand) => void;\n private handleFocus: (obj: CbObjOnFocus) => void;\n private handleOnError: (obj: CbObjOnError, hasUnsupportedCard?: boolean) => void;\n private handleOnAutoComplete: (obj: CbObjOnAutoComplete) => void;\n private handleOnNoDataRequired: () => void;\n private handleOnTouchstartIOS: (obj) => void;\n private handleKeyPressed: (obj: SFKeyPressObj) => void;\n public state: SFPState;\n public props;\n private issuingCountryCode;\n\n constructor(props: SFPProps) {\n super(props);\n\n const stateObj: SFPState = {\n status: 'loading',\n brand: props.type,\n errors: {},\n valid: {},\n data: {},\n cvcPolicy: CVC_POLICY_REQUIRED,\n expiryDatePolicy: DATE_POLICY_REQUIRED,\n isSfpValid: false,\n hasKoreanFields: props.hasKoreanFields\n };\n this.state = stateObj;\n\n this.csfLoadFailTimeout = null;\n this.csfLoadFailTimeoutMS = 30000;\n\n this.csfConfigFailTimeout = null;\n this.csfConfigFailTimeoutMS = 15000;\n\n this.numCharsInField = {};\n\n // Handlers\n this.handleOnLoad = handlers.handleOnLoad.bind(this);\n this.handleOnConfigSuccess = handlers.handleOnConfigSuccess.bind(this);\n this.handleOnFieldValid = handlers.handleOnFieldValid.bind(this);\n this.handleOnAllValid = handlers.handleOnAllValid.bind(this);\n this.handleOnBrand = handlers.handleOnBrand.bind(this);\n this.handleFocus = handlers.handleFocus.bind(this);\n this.handleOnError = handlers.handleOnError.bind(this);\n this.handleOnNoDataRequired = handlers.handleOnNoDataRequired.bind(this);\n this.handleOnAutoComplete = handlers.handleOnAutoComplete.bind(this);\n this.handleOnTouchstartIOS = handlers.handleOnTouchstartIOS.bind(this); // Only called when iOS detected\n this.handleKeyPressed = handlers.handleKeyPressed.bind(this);\n\n this.processBinLookupResponse = this.processBinLookupResponse.bind(this);\n\n // Bindings for functions exposed to users of this component: SecuredFields & CardInput\n this.setFocusOn = this.setFocusOn.bind(this);\n this.updateStyles = this.updateStyles.bind(this);\n this.handleUnsupportedCard = this.handleUnsupportedCard.bind(this);\n this.showValidation = this.showValidation.bind(this);\n this.destroy = this.destroy.bind(this);\n }\n\n public static defaultProps = defaultProps;\n\n public componentDidMount(): void {\n // When SFP instantiated through SecuredFieldsInput c.f. CardInput\n if (this.props.rootNode) {\n this.setRootNode(this.props.rootNode);\n }\n\n // Find encryptedFields and map them to the values we use to store valid states\n const fields = getFields(this.rootNode);\n const valid = fields.reduce(validFieldsReducer, {});\n\n this.setState({ valid });\n\n // Populate numCharsInField object\n fields.forEach(field => {\n this.numCharsInField[field] = 0;\n });\n\n // Store how many dateFields we are dealing with visually\n this.numDateFields = fields.filter(f => f.match(/Expiry/)).length;\n\n if (fields.length) {\n this.destroy(); // TODO test if this solves the React double render problem.\n this.initializeCSF(this.rootNode);\n } else {\n this.handleOnNoDataRequired();\n }\n }\n\n public componentDidUpdate() {\n this.checkForKCPFields();\n }\n\n public componentWillUnmount(): void {\n this.csf = null;\n clearTimeout(this.csfLoadFailTimeout);\n clearTimeout(this.csfConfigFailTimeout);\n }\n\n private initializeCSF(root: HTMLElement): void {\n let loadingContext = this.props.loadingContext;\n\n // For loading securedFields from local server during development\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n loadingContext = process.env.__SF_ENV__;\n }\n\n // TODO\n // if(!this.props.keypadFix){\n // send analytics action because to know if anyone *ever* sets this config prop\n // }\n\n const csfSetupObj: CSFSetupObject = {\n rootNode: root,\n type: this.props.type,\n clientKey: this.props.clientKey,\n cardGroupTypes: this.props.brands,\n autoFocus: this.props.autoFocus,\n trimTrailingSeparator: this.props.trimTrailingSeparator,\n loadingContext,\n keypadFix: this.props.keypadFix,\n showWarnings: this.props.showWarnings,\n iframeUIConfig: {\n sfStyles: this.props.styles\n },\n i18n: this.props.i18n,\n callbacks: {\n onLoad: this.handleOnLoad,\n onConfigSuccess: this.handleOnConfigSuccess,\n onFieldValid: this.handleOnFieldValid,\n onAllValid: this.handleOnAllValid,\n onBrand: this.handleOnBrand,\n onError: this.handleOnError,\n onFocus: this.handleFocus,\n onBinValue: this.props.onBinValue,\n onAutoComplete: this.handleOnAutoComplete,\n onAdditionalSFConfig: this.props.onAdditionalSFConfig,\n onAdditionalSFRemoved: this.props.onAdditionalSFRemoved,\n onTouchstartIOS: this.handleOnTouchstartIOS,\n onKeyPressed: this.handleKeyPressed\n },\n isKCP: this.state.hasKoreanFields,\n legacyInputMode: this.props.legacyInputMode,\n minimumExpiryDate: this.props.minimumExpiryDate,\n implementationType: this.props.implementationType || 'components', // to distinguish between 'regular' and 'custom' card component\n forceCompat: this.props.forceCompat,\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n shouldDisableIOSArrowKeys: !!this.props.disableIOSArrowKeys, // convert whether function has been defined into a boolean\n placeholders: this.props.placeholders ?? {},\n showContextualElement: this.props.showContextualElement\n };\n\n this.csf = initCSF(csfSetupObj);\n\n /**\n * Expect to at least have had the handleOnLoad callback called within this time\n * - if this hasn't happened then something has happened to interrupt the loading of the securedFields\n * So we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n // @ts-ignore - timout 'type' is a number\n this.csfLoadFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfLoadFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured field iframes have failed to load'));\n }\n }, this.csfLoadFailTimeoutMS);\n }\n\n private checkForKCPFields() {\n let needsKoreanFields = false;\n if (this.props.koreanAuthenticationRequired) {\n needsKoreanFields = this.issuingCountryCode ? this.issuingCountryCode === 'kr' : this.props.countryCode === 'kr';\n }\n\n // Was korean, now isn't - hide password field\n if (this.state.hasKoreanFields && !needsKoreanFields) {\n // Clear any stored data\n const setRemovedFieldState = prevState => ({\n data: { ...prevState.data, [ENCRYPTED_PWD_FIELD]: undefined },\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n errors: { ...prevState.errors, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: false\n });\n\n this.setState(setRemovedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.removeSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(false);\n }\n\n // Wasn't korean, now is - show password field\n if (!this.state.hasKoreanFields && needsKoreanFields) {\n const setAddedFieldState = prevState => ({\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: true,\n isSfpValid: false\n });\n\n this.setState(setAddedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.addSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(true);\n }\n }\n\n public getChildContext(): object {\n return { i18n: this.props.i18n };\n }\n\n public handleUnsupportedCard(errObj: CbObjOnError): boolean {\n const hasUnsupportedCard = !!errObj.error;\n\n // Store the brand(s) we detected and which we don't support\n if (hasUnsupportedCard) {\n this.setState({ detectedUnsupportedBrands: errObj.detectedBrands });\n }\n\n errObj.rootNode = this.rootNode; // Needed for CustomCard\n this.handleOnError(errObj, hasUnsupportedCard);\n // Inform CSF that the number field has an unsupportedCard error (or that it has been cleared)\n if (this.csf) {\n this.csf.hasUnsupportedCard(ENCRYPTED_CARD_NUMBER, errObj.error);\n }\n return hasUnsupportedCard;\n }\n\n public setFocusOn(frame: string): void {\n if (this.csf) this.csf.setFocusOnFrame(frame);\n }\n\n public updateStyles(stylesObj: StylesObject): void {\n if (this.csf) this.csf.updateStyles(stylesObj);\n }\n\n public sfIsOptionalOrHidden(fieldType: string): boolean {\n return this.csf.sfIsOptionalOrHidden(fieldType);\n }\n\n public destroy(): void {\n if (this.csf) this.csf.destroy();\n }\n\n public showValidation(): void {\n const { numDateFields, state }: SecuredFieldsProvider = this;\n\n Object.keys(state.valid)\n .reduce(getErrorReducer(numDateFields, state), [])\n .forEach(field => {\n // For each detected error pass an error object to the handler (calls error callback & sets state)\n const errorObj: CbObjOnError = getErrorObject(field, this.rootNode, state);\n this.handleOnError(errorObj, !!state.detectedUnsupportedBrands);\n // Inform the secured-fields instance of which fields have been found to have errors\n if (this.csf && this.csf.isValidated) {\n this.csf.isValidated(field, errorObj.error);\n }\n });\n }\n\n /**\n * Map SF errors to ValidationRuleResult-like objects, for CardInput component\n */\n public mapErrorsToValidationRuleResult(): SFStateErrorObj {\n const fieldNames: string[] = Object.keys(this.state.errors);\n\n const sfStateErrorsObj = fieldNames.reduce((acc, fieldName) => {\n const errorCode = this.state.errors[fieldName];\n if (errorCode) {\n acc[fieldName] = {\n isValid: false,\n errorMessage: getErrorMessageFromCode(errorCode, SF_ErrorCodes), // this is the human-readable, untranslated, explanation of the error that will exist on the error object in card.state.errors\n // For v5 the object found in state.errors should also contain the additional properties that used to be sent to the onError callback\n // namely: translation, errorCode, a ref to rootNode &, in the case of failed binLookup, an array of the detectedBrands\n errorI18n: this.props.i18n.get(errorCode),\n error: errorCode,\n rootNode: this.rootNode,\n ...(this.state.detectedUnsupportedBrands && { detectedBrands: this.state.detectedUnsupportedBrands })\n };\n } else {\n acc[fieldName] = null;\n }\n return acc;\n }, {});\n return sfStateErrorsObj;\n }\n\n public processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void {\n // If we were dealing with an unsupported card & now we have a valid /binLookup response (or a response triggering a reset of the UI),\n // - reset state to clear the error & the stored unsupportedBrands and, in the case of a valid /binLookup response, inform CSF (via handleUnsupportedCard)\n // (Scenario: from an unsupportedCard state the shopper has pasted another number long enough to trigger a /binLookup)\n if (this.state.detectedUnsupportedBrands) {\n this.setState(prevState => ({\n errors: { ...prevState.errors, [ENCRYPTED_CARD_NUMBER]: false },\n detectedUnsupportedBrands: null\n }));\n\n // If we have some sort of binLookupResponse object then this isn't the reset caused by digits dropping below a threshold\n // - so call handleUnsupportedCard to clear the error\n if (this.csf && binLookupResponse) {\n const errObj: CbObjOnError = {\n type: 'card',\n fieldType: 'encryptedCardNumber',\n error: ''\n };\n this.handleUnsupportedCard(errObj);\n }\n }\n\n this.issuingCountryCode = binLookupResponse?.issuingCountryCode?.toLowerCase();\n\n const hasBrandedResetObj = resetObject?.brand;\n\n /**\n * Are we dealing with a \"dedicated\" card scenario i.e a card component created as: checkout.create('bcmc') but which can accept multiple brands\n * - in which case we will need to reset brand and pass on the resetObj to CSF\n */\n const mustResetDedicatedBrand = hasBrandedResetObj && DEDICATED_CARD_COMPONENTS.includes(resetObject.brand);\n\n if (mustResetDedicatedBrand) {\n // resetObject.brand will be the value of the brand whose logo we want to reshow in the UI\n this.setState(resetObject, () => {\n this.props.onChange(this.state);\n });\n }\n\n /**\n * Scenarios:\n *\n * - RESET (binLookupResponse === null): The number of digits in number field has dropped below threshold for BIN lookup\n * - RESULT (binLookupResponse.supportedBrands.length === 1): binLookup has found a result so inform CSF\n *\n * In the RESET scenario, for \"dedicated\" card components we also need to pass on the resetObject since this contains information about\n * the brand that CSF needs to reset to, internally.\n */\n if (this.csf) this.csf.brandsFromBinLookup(binLookupResponse, mustResetDedicatedBrand ? resetObject : null);\n }\n\n private setRootNode = (input: HTMLElement): void => {\n this.rootNode = input;\n };\n\n public render(props, state) {\n return props.render({ setRootNode: this.setRootNode, setFocusOn: this.setFocusOn }, state);\n }\n}\n\nexport default SecuredFieldsProvider;\n"],"names":["SecuredFieldsProvider","Component","componentDidMount","this","props","rootNode","setRootNode","fields","getFields","valid","reduce","validFieldsReducer","setState","forEach","field","numCharsInField","numDateFields","filter","f","match","length","destroy","initializeCSF","handleOnNoDataRequired","componentDidUpdate","checkForKCPFields","componentWillUnmount","csf","clearTimeout","csfLoadFailTimeout","csfConfigFailTimeout","root","loadingContext","csfSetupObj","type","clientKey","cardGroupTypes","brands","autoFocus","trimTrailingSeparator","keypadFix","showWarnings","iframeUIConfig","sfStyles","styles","i18n","callbacks","onLoad","handleOnLoad","onConfigSuccess","handleOnConfigSuccess","onFieldValid","handleOnFieldValid","onAllValid","handleOnAllValid","onBrand","handleOnBrand","onError","handleOnError","onFocus","handleFocus","onBinValue","onAutoComplete","handleOnAutoComplete","onAdditionalSFConfig","onAdditionalSFRemoved","onTouchstartIOS","handleOnTouchstartIOS","onKeyPressed","handleKeyPressed","isKCP","state","hasKoreanFields","legacyInputMode","minimumExpiryDate","implementationType","forceCompat","maskSecurityCode","exposeExpiryDate","shouldDisableIOSArrowKeys","disableIOSArrowKeys","placeholders","showContextualElement","initCSF","setTimeout","status","AdyenCheckoutError","csfLoadFailTimeoutMS","needsKoreanFields","koreanAuthenticationRequired","issuingCountryCode","countryCode","setRemovedFieldState","prevState","data","ENCRYPTED_PWD_FIELD","undefined","errors","onChange","removeSecuredField","setKCPStatus","setAddedFieldState","isSfpValid","addSecuredField","getChildContext","handleUnsupportedCard","errObj","hasUnsupportedCard","error","detectedUnsupportedBrands","detectedBrands","ENCRYPTED_CARD_NUMBER","setFocusOn","frame","setFocusOnFrame","updateStyles","stylesObj","sfIsOptionalOrHidden","fieldType","showValidation","Object","keys","getErrorReducer","errorObj","getErrorObject","isValidated","mapErrorsToValidationRuleResult","acc","fieldName","errorCode","isValid","errorMessage","getErrorMessageFromCode","SF_ErrorCodes","errorI18n","get","processBinLookupResponse","binLookupResponse","resetObject","toLowerCase","hasBrandedResetObj","brand","mustResetDedicatedBrand","DEDICATED_CARD_COMPONENTS","includes","brandsFromBinLookup","render","constructor","super","_define_property","csfConfigFailTimeoutMS","input","stateObj","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","handlers","bind","defaultProps"],"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EAASzG,mBAAmB0G,KAAK3J,MAC3DA,KAAKmD,iBAAmBuG,EAASvG,iBAAiBwG,KAAK3J,MACvDA,KAAKqD,cAAgBqG,EAASrG,cAAcsG,KAAK3J,MACjDA,KAAKyD,YAAciG,EAASjG,YAAYkG,KAAK3J,MAC7CA,KAAKuD,cAAgBmG,EAASnG,cAAcoG,KAAK3J,MACjDA,KAAKoB,uBAAyBsI,EAAStI,uBAAuBuI,KAAK3J,MACnEA,KAAK4D,qBAAuB8F,EAAS9F,qBAAqB+F,KAAK3J,MAC/DA,KAAKgE,sBAAwB0F,EAAS1F,sBAAsB2F,KAAK3J,MACjEA,KAAKkE,iBAAmBwF,EAASxF,iBAAiByF,KAAK3J,MAEvDA,KAAKqI,yBAA2BrI,KAAKqI,yBAAyBsB,KAAK3J,MAGnEA,KAAK6G,WAAa7G,KAAK6G,WAAW8C,KAAK3J,MACvCA,KAAKgH,aAAehH,KAAKgH,aAAa2C,KAAK3J,MAC3CA,KAAKsG,sBAAwBtG,KAAKsG,sBAAsBqD,KAAK3J,MAC7DA,KAAKoH,eAAiBpH,KAAKoH,eAAeuC,KAAK3J,MAC/CA,KAAKkB,QAAUlB,KAAKkB,QAAQyI,KAAK3J,KACrC,EAEAkJ,EAvEErJ,EAuEY+J,eAAeA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class e{callbacks
|
|
1
|
+
function i(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}class e{constructor(e){i(this,"callbacks",void 0),i(this,"config",void 0),i(this,"props",void 0),i(this,"state",void 0),i(this,"validateForm",void 0),i(this,"handleBrandFromBinLookup",void 0),i(this,"callbacksHandler",void 0),i(this,"configHandler",void 0),i(this,"createCardSecuredFields",void 0),i(this,"createNonCardSecuredFields",void 0),i(this,"createSecuredFields",void 0),i(this,"destroySecuredFields",void 0),i(this,"handleIOSTouchEvents",void 0),i(this,"destroyTouchendListener",void 0),i(this,"destroyTouchstartListener",void 0),i(this,"handleBinValue",void 0),i(this,"handleEncryption",void 0),i(this,"handleFocus",void 0),i(this,"handleIframeConfigFeedback",void 0),i(this,"handleValidation",void 0),i(this,"handleSFShiftTab",void 0),i(this,"handleShiftTab",void 0),i(this,"isConfigured",void 0),i(this,"postMessageToAllIframes",void 0),i(this,"processAutoComplete",void 0),i(this,"processBrand",void 0),i(this,"sendBrandToCardSF",void 0),i(this,"sendExpiryDatePolicyToSF",void 0),i(this,"setFocusOnFrame",void 0),i(this,"setupSecuredField",void 0),i(this,"touchendListener",void 0),i(this,"touchstartListener",void 0),i(this,"hasGenuineTouchEvents",void 0),i(this,"encryptedAttrName",void 0),i(this,"hasRedundantCVCField",void 0),i(this,"isSingleBrandedCard",void 0),i(this,"securityCode",void 0),this.props=e,this.state={},this.config={},this.callbacks={}}}export{e as default};
|
|
2
2
|
//# sourceMappingURL=AbstractCSF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractCSF.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/CSF/AbstractCSF.ts"],"sourcesContent":["import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject } from './types';\nimport { SFFeedbackObj, SendBrandObject, SendExpiryDateObject, CVCPolicyType, DatePolicyType, SFFieldType } from '../types';\nimport { createSecuredFields } from './extensions/createSecuredFields';\nimport processBrand from './partials/processBrand';\nimport handleBrandFromBinLookup from './extensions/handleBrandFromBinLookup';\n\nabstract class AbstractCSF {\n // Set in CSF\n protected callbacks: CSFCallbacksConfig;\n protected config: CSFConfigObject;\n protected props: CSFSetupObject;\n protected state: CSFStateObject;\n protected validateForm: () => void;\n protected handleBrandFromBinLookup: typeof handleBrandFromBinLookup;\n protected callbacksHandler: (callbacksObj: object) => void;\n protected configHandler: (props: CSFSetupObject) => void;\n protected createCardSecuredFields: (securedFields: HTMLElement[], cvcPolicy: CVCPolicyType, expiryDatePolicy: DatePolicyType) => Promise<any>;\n protected createNonCardSecuredFields: (securedFields: HTMLElement[]) => Promise<any>;\n protected createSecuredFields: typeof createSecuredFields;\n protected destroySecuredFields: () => void;\n protected handleIOSTouchEvents: () => void;\n protected destroyTouchendListener: () => void;\n protected destroyTouchstartListener: () => void;\n protected handleBinValue: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleEncryption: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleFocus: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleIframeConfigFeedback: (pFeedbackObj) => boolean;\n protected handleValidation: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleSFShiftTab: (fieldType: string) => void;\n protected handleShiftTab: (fieldType: string) => void;\n protected isConfigured: () => void;\n protected postMessageToAllIframes: (pDataObj: object) => void;\n protected processAutoComplete: (pFeedbackObj: SFFeedbackObj) => void;\n protected processBrand: typeof processBrand;\n protected sendBrandToCardSF: (brandObj: SendBrandObject) => void;\n protected sendExpiryDatePolicyToSF: (dateObj: SendExpiryDateObject) => void;\n protected setFocusOnFrame: (pFieldType: SFFieldType, doLog?: boolean) => void;\n protected setupSecuredField: (pItem: HTMLElement) => void;\n protected touchendListener: (e: Event) => void;\n protected touchstartListener: () => void;\n protected hasGenuineTouchEvents: boolean;\n // Set in createSecuredFields\n protected encryptedAttrName: string;\n protected hasRedundantCVCField: boolean;\n protected isSingleBrandedCard: boolean;\n protected securityCode: string;\n // --\n protected constructor(setupObj: CSFSetupObject) {\n this.props = setupObj;\n this.state = {} as any as CSFStateObject;\n\n // Initialise storage objects\n this.config = {} as any as CSFConfigObject; // {} as ConfigObject fails in linting\n this.callbacks = {} as any as CSFCallbacksConfig;\n }\n}\nexport default AbstractCSF;\n"],"names":["AbstractCSF","callbacks","config","props","state","validateForm","handleBrandFromBinLookup","callbacksHandler","configHandler","createCardSecuredFields","createNonCardSecuredFields","createSecuredFields","destroySecuredFields","handleIOSTouchEvents","destroyTouchendListener","destroyTouchstartListener","handleBinValue","handleEncryption","handleFocus","handleIframeConfigFeedback","handleValidation","handleSFShiftTab","handleShiftTab","isConfigured","postMessageToAllIframes","processAutoComplete","processBrand","sendBrandToCardSF","sendExpiryDatePolicyToSF","setFocusOnFrame","setupSecuredField","touchendListener","touchstartListener","hasGenuineTouchEvents","encryptedAttrName","hasRedundantCVCField","isSingleBrandedCard","securityCode"
|
|
1
|
+
{"version":3,"file":"AbstractCSF.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/CSF/AbstractCSF.ts"],"sourcesContent":["import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject } from './types';\nimport { SFFeedbackObj, SendBrandObject, SendExpiryDateObject, CVCPolicyType, DatePolicyType, SFFieldType } from '../types';\nimport { createSecuredFields } from './extensions/createSecuredFields';\nimport processBrand from './partials/processBrand';\nimport handleBrandFromBinLookup from './extensions/handleBrandFromBinLookup';\n\nabstract class AbstractCSF {\n // Set in CSF\n protected callbacks: CSFCallbacksConfig;\n protected config: CSFConfigObject;\n protected props: CSFSetupObject;\n protected state: CSFStateObject;\n protected validateForm: () => void;\n protected handleBrandFromBinLookup: typeof handleBrandFromBinLookup;\n protected callbacksHandler: (callbacksObj: object) => void;\n protected configHandler: (props: CSFSetupObject) => void;\n protected createCardSecuredFields: (securedFields: HTMLElement[], cvcPolicy: CVCPolicyType, expiryDatePolicy: DatePolicyType) => Promise<any>;\n protected createNonCardSecuredFields: (securedFields: HTMLElement[]) => Promise<any>;\n protected createSecuredFields: typeof createSecuredFields;\n protected destroySecuredFields: () => void;\n protected handleIOSTouchEvents: () => void;\n protected destroyTouchendListener: () => void;\n protected destroyTouchstartListener: () => void;\n protected handleBinValue: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleEncryption: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleFocus: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleIframeConfigFeedback: (pFeedbackObj) => boolean;\n protected handleValidation: (pFeedbackObj: SFFeedbackObj) => void;\n protected handleSFShiftTab: (fieldType: string) => void;\n protected handleShiftTab: (fieldType: string) => void;\n protected isConfigured: () => void;\n protected postMessageToAllIframes: (pDataObj: object) => void;\n protected processAutoComplete: (pFeedbackObj: SFFeedbackObj) => void;\n protected processBrand: typeof processBrand;\n protected sendBrandToCardSF: (brandObj: SendBrandObject) => void;\n protected sendExpiryDatePolicyToSF: (dateObj: SendExpiryDateObject) => void;\n protected setFocusOnFrame: (pFieldType: SFFieldType, doLog?: boolean) => void;\n protected setupSecuredField: (pItem: HTMLElement) => void;\n protected touchendListener: (e: Event) => void;\n protected touchstartListener: () => void;\n protected hasGenuineTouchEvents: boolean;\n // Set in createSecuredFields\n protected encryptedAttrName: string;\n protected hasRedundantCVCField: boolean;\n protected isSingleBrandedCard: boolean;\n protected securityCode: string;\n // --\n protected constructor(setupObj: CSFSetupObject) {\n this.props = setupObj;\n this.state = {} as any as CSFStateObject;\n\n // Initialise storage objects\n this.config = {} as any as CSFConfigObject; // {} as ConfigObject fails in linting\n this.callbacks = {} as any as CSFCallbacksConfig;\n }\n}\nexport default AbstractCSF;\n"],"names":["AbstractCSF","constructor","setupObj","_define_property","this","callbacks","config","props","state","validateForm","handleBrandFromBinLookup","callbacksHandler","configHandler","createCardSecuredFields","createNonCardSecuredFields","createSecuredFields","destroySecuredFields","handleIOSTouchEvents","destroyTouchendListener","destroyTouchstartListener","handleBinValue","handleEncryption","handleFocus","handleIframeConfigFeedback","handleValidation","handleSFShiftTab","handleShiftTab","isConfigured","postMessageToAllIframes","processAutoComplete","processBrand","sendBrandToCardSF","sendExpiryDatePolicyToSF","setFocusOnFrame","setupSecuredField","touchendListener","touchstartListener","hasGenuineTouchEvents","encryptedAttrName","hasRedundantCVCField","isSingleBrandedCard","securityCode"],"mappings":"wHAMA,MAAeA,EAyCX,WAAAC,CAAsBC,GAvCtBC,EAAAC,KAAUC,iBAAV,GACAF,EAAAC,KAAUE,cAAV,GACAH,EAAAC,KAAUG,aAAV,GACAJ,EAAAC,KAAUI,aAAV,GACAL,EAAAC,KAAUK,oBAAV,GACAN,EAAAC,KAAUM,gCAAV,GACAP,EAAAC,KAAUO,wBAAV,GACAR,EAAAC,KAAUQ,qBAAV,GACAT,EAAAC,KAAUS,+BAAV,GACAV,EAAAC,KAAUU,kCAAV,GACAX,EAAAC,KAAUW,2BAAV,GACAZ,EAAAC,KAAUY,4BAAV,GACAb,EAAAC,KAAUa,4BAAV,GACAd,EAAAC,KAAUc,+BAAV,GACAf,EAAAC,KAAUe,iCAAV,GACAhB,EAAAC,KAAUgB,sBAAV,GACAjB,EAAAC,KAAUiB,wBAAV,GACAlB,EAAAC,KAAUkB,mBAAV,GACAnB,EAAAC,KAAUmB,kCAAV,GACApB,EAAAC,KAAUoB,wBAAV,GACArB,EAAAC,KAAUqB,wBAAV,GACAtB,EAAAC,KAAUsB,sBAAV,GACAvB,EAAAC,KAAUuB,oBAAV,GACAxB,EAAAC,KAAUwB,+BAAV,GACAzB,EAAAC,KAAUyB,2BAAV,GACA1B,EAAAC,KAAU0B,oBAAV,GACA3B,EAAAC,KAAU2B,yBAAV,GACA5B,EAAAC,KAAU4B,gCAAV,GACA7B,EAAAC,KAAU6B,uBAAV,GACA9B,EAAAC,KAAU8B,yBAAV,GACA/B,EAAAC,KAAU+B,wBAAV,GACAhC,EAAAC,KAAUgC,0BAAV,GACAjC,EAAAC,KAAUiC,6BAAV,GAEAlC,EAAAC,KAAUkC,yBAAV,GACAnC,EAAAC,KAAUmC,4BAAV,GACApC,EAAAC,KAAUoC,2BAAV,GACArC,EAAAC,KAAUqC,oBAAV,GAGIrC,KAAKG,MAAQL,EACbE,KAAKI,MAAQ,GAGbJ,KAAKE,OAAS,GACdF,KAAKC,UAAY,EACrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./AbstractCSF.js";import{handleConfig as s}from"./extensions/handleConfig.js";import{configureCallbacks as t}from"./extensions/configureCallbacks.js";import{handleValidation as i}from"./extensions/handleValidation.js";import{handleEncryption as r}from"./extensions/handleEncryption.js";import{createSecuredFields as o,createNonCardSecuredFields as a,createCardSecuredFields as n,setupSecuredField as d}from"./extensions/createSecuredFields.js";import h from"./extensions/handleIOSTouchEvents.js";import l from"./extensions/handleTab.js";import c,{sendBrandToCardSF as u,sendExpiryDatePolicyToSF as p}from"./extensions/handleBrandFromBinLookup.js";import{setFocusOnFrame as m}from"./partials/setFocusOnFrame.js";import{postMessageToAllIframes as f}from"./partials/postMessageToAllIframes.js";import F from"./partials/processBrand.js";import{processAutoComplete as y}from"./partials/processAutoComplete.js";import{handleFocus as C}from"./partials/handleFocus.js";import{handleIframeConfigFeedback as g}from"./partials/handleIframeConfigFeedback.js";import{isConfigured as S}from"./partials/isConfigured.js";import b from"./partials/validateForm.js";import{handleBinValue as j}from"./partials/handleBinValue.js";import{destroySecuredFields as T}from"./utils/destroySecuredFields.js";import I from"./utils/iframes/postMessageToIframe.js";import k from"./utils/iframes/getIframeContentWin.js";import{warn as O}from"../utilities/logger.js";import{selectOne as x}from"../utilities/dom.js";import{on as v}from"../../../../../utils/listenerUtils.js";import{partial as L}from"../utilities/commonUtils.js";import{hasOwnProperty as B}from"../../../../../utils/hasOwnProperty.js";import K from"./utils/userAgent.js";const P=(e="You cannot use secured fields")=>{O(`${e} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`)};class V extends e{
|
|
1
|
+
import e from"./AbstractCSF.js";import{handleConfig as s}from"./extensions/handleConfig.js";import{configureCallbacks as t}from"./extensions/configureCallbacks.js";import{handleValidation as i}from"./extensions/handleValidation.js";import{handleEncryption as r}from"./extensions/handleEncryption.js";import{createSecuredFields as o,createNonCardSecuredFields as a,createCardSecuredFields as n,setupSecuredField as d}from"./extensions/createSecuredFields.js";import h from"./extensions/handleIOSTouchEvents.js";import l from"./extensions/handleTab.js";import c,{sendBrandToCardSF as u,sendExpiryDatePolicyToSF as p}from"./extensions/handleBrandFromBinLookup.js";import{setFocusOnFrame as m}from"./partials/setFocusOnFrame.js";import{postMessageToAllIframes as f}from"./partials/postMessageToAllIframes.js";import F from"./partials/processBrand.js";import{processAutoComplete as y}from"./partials/processAutoComplete.js";import{handleFocus as C}from"./partials/handleFocus.js";import{handleIframeConfigFeedback as g}from"./partials/handleIframeConfigFeedback.js";import{isConfigured as S}from"./partials/isConfigured.js";import b from"./partials/validateForm.js";import{handleBinValue as j}from"./partials/handleBinValue.js";import{destroySecuredFields as T}from"./utils/destroySecuredFields.js";import I from"./utils/iframes/postMessageToIframe.js";import k from"./utils/iframes/getIframeContentWin.js";import{warn as O}from"../utilities/logger.js";import{selectOne as x}from"../utilities/dom.js";import{on as v}from"../../../../../utils/listenerUtils.js";import{partial as L}from"../utilities/commonUtils.js";import{hasOwnProperty as B}from"../../../../../utils/hasOwnProperty.js";import K from"./utils/userAgent.js";const P=(e="You cannot use secured fields")=>{O(`${e} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`)};class V extends e{init(){this.configHandler(this.props),this.callbacksHandler(this.props.callbacks);const e=this.createSecuredFields();this.state.numIframes=this.state.originalNumIframes=e,this.state.isKCP=!!this.props.isKCP,K.__IS_IOS&&this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents=!1,v(document,"touchstart",this.touchstartListener))}createReturnObject(){return{updateStyles:e=>{this.state.isConfigured?this.postMessageToAllIframes({styleObject:e}):O("You cannot update the secured fields styling - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.")},setFocusOnFrame:e=>{this.state.isConfigured?this.setFocusOnFrame(e):P("You cannot set focus on any secured field")},isValidated:(e,s)=>{if(this.state.isConfigured){if(B(this.state.securedFields,e)){this.state.securedFields[e].hasError=!0,""===this.state.securedFields[e].errorType&&(this.state.securedFields[e].errorType="isValidated");const t={txVariant:this.state.type,fieldType:e,externalValidation:!0,code:s,numKey:this.state.securedFields[e].numKey};I(t,k(this.state,e),this.config.loadingContext)}}else P("You cannot set validated on any secured field")},hasUnsupportedCard:(e,s)=>{if(this.state.isConfigured){if(B(this.state.securedFields,e)){this.state.securedFields[e].hasError=!!s,this.state.securedFields[e].errorType=s;const t={txVariant:this.state.type,fieldType:e,unsupportedCard:!!s,code:s,numKey:this.state.securedFields[e].numKey};I(t,k(this.state,e),this.config.loadingContext)}}else P("You cannot set hasUnsupportedCard on any secured field")},destroy:()=>{this.state.isConfigured?this.destroySecuredFields():P("You cannot destroy secured fields")},brandsFromBinLookup:(e,s)=>{if(!this.config.isCreditCardType)return null;this.state.isConfigured?this.handleBrandFromBinLookup(e,s):P("You cannot set pass brands to secured fields")},addSecuredField:e=>{const s=x(this.props.rootNode,`[data-cse="${e}"]`);s&&(this.state.numIframes+=1,this.setupSecuredField(s))},removeSecuredField:e=>{if(this.state.securedFields[e]){this.state.securedFields[e].destroy(),delete this.state.securedFields[e],this.state.numIframes-=1,this.state.iframeCount-=1;const s={additionalIframeRemoved:!0,fieldType:e,type:this.state.type};this.callbacks.onAdditionalSFRemoved(s)}},setKCPStatus:e=>{this.state.isKCP=e},sfIsOptionalOrHidden:e=>this.state.securedFields[e].isOptionalOrHidden()}}constructor(e){super(e),this.state={type:this.props.type,brand:"card"!==this.props.type?{brand:this.props.type,cvcPolicy:"required"}:{brand:null,cvcPolicy:"required"},allValid:void 0,numIframes:0,originalNumIframes:0,iframeCount:0,iframeConfigCount:0,isConfigured:!1,hasSeparateDateFields:!1,currentFocusObject:null,registerFieldForIos:!1,securedFields:{},isKCP:!1};const I={csfState:this.state,csfConfig:this.config,csfProps:this.props,csfCallbacks:this.callbacks};this.configHandler=s,this.callbacksHandler=t,this.validateForm=L(b,I),this.isConfigured=L(S,I,this.validateForm),this.handleIframeConfigFeedback=L(g,I,this.isConfigured),this.processBrand=L(F,I),this.handleValidation=i,this.handleEncryption=r,this.createSecuredFields=o,this.createNonCardSecuredFields=a,this.createCardSecuredFields=n,this.setupSecuredField=d,this.postMessageToAllIframes=L(f,I),this.handleIOSTouchEvents=h.handleTouchend.bind(this),this.touchendListener=h.touchendListener.bind(this),this.destroyTouchendListener=h.destroyTouchendListener.bind(this),this.touchstartListener=h.touchstartListener.bind(this),this.destroyTouchstartListener=h.destroyTouchstartListener.bind(this),this.setFocusOnFrame=L(m,I),this.handleFocus=L(C,I,this.handleIOSTouchEvents),this.handleSFShiftTab=l.handleSFShiftTab,this.handleShiftTab=l.handleShiftTab,this.destroySecuredFields=T,this.processAutoComplete=L(y,I),this.handleBinValue=L(j,I),this.handleBrandFromBinLookup=c,this.sendBrandToCardSF=u,this.sendExpiryDatePolicyToSF=p,this.init()}}export{V as default};
|
|
2
2
|
//# sourceMappingURL=CSF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSF.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/CSF/CSF.ts"],"sourcesContent":["import AbstractCSF from './AbstractCSF';\nimport { CSFReturnObject, CSFSetupObject, CSFStateObject, CSFThisObject } from './types';\nimport { StylesObject, CbObjOnAdditionalSF, SFFieldType } from '../types';\nimport { BinLookupResponse } from '../../../../Card/types';\nimport { handleConfig } from './extensions/handleConfig';\nimport { configureCallbacks } from './extensions/configureCallbacks';\nimport { handleValidation } from './extensions/handleValidation';\nimport { handleEncryption } from './extensions/handleEncryption';\nimport { createSecuredFields, createNonCardSecuredFields, createCardSecuredFields, setupSecuredField } from './extensions/createSecuredFields';\nimport handleIOSTouchEvents from './extensions/handleIOSTouchEvents';\nimport handleTab from './extensions/handleTab';\nimport handleBrandFromBinLookup, { sendBrandToCardSF, sendExpiryDatePolicyToSF } from './extensions/handleBrandFromBinLookup';\nimport { setFocusOnFrame } from './partials/setFocusOnFrame';\nimport { postMessageToAllIframes } from './partials/postMessageToAllIframes';\nimport processBrand from './partials/processBrand';\nimport { processAutoComplete } from './partials/processAutoComplete';\nimport { handleFocus } from './partials/handleFocus';\nimport { handleIframeConfigFeedback } from './partials/handleIframeConfigFeedback';\nimport { isConfigured } from './partials/isConfigured';\nimport validateForm from './partials/validateForm';\nimport { handleBinValue } from './partials/handleBinValue';\nimport { destroySecuredFields } from './utils/destroySecuredFields';\nimport postMessageToIframe from './utils/iframes/postMessageToIframe';\nimport getIframeContentWin from './utils/iframes/getIframeContentWin';\nimport * as logger from '../utilities/logger';\nimport { selectOne } from '../utilities/dom';\nimport { on } from '../../../../../utils/listenerUtils';\nimport { partial } from '../utilities/commonUtils';\nimport { hasOwnProperty } from '../../../../../utils/hasOwnProperty';\nimport ua from './utils/userAgent';\nimport { SingleBrandResetObject } from '../../SFP/types';\n\nconst notConfiguredWarning = (str = 'You cannot use secured fields') => {\n logger.warn(`${str} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`);\n};\n\nclass CSF extends AbstractCSF {\n // --\n constructor(setupObj: CSFSetupObject) {\n /**\n * Initialises:\n * - this.props = setupObj: CSFSetupObject\n *\n * and empty objects for:\n * - this.config: CSFConfigObject (populated in handleConfig.ts)\n * - this.callbacks: CSFCallbacksConfig (populated in configureCallbacks.ts\n * - this.state: CSFStateObject (populated below)\n */\n super(setupObj);\n\n this.state = {\n /**\n * For generic card will always be 'card'.\n * For non-generic card will be hardcoded to a particular txVariant e.g. 'mc' or 'visa'\n * For other types of SecuredField will be the passed type e.g. 'ach' or 'giftcard'\n */\n type: this.props.type,\n /**\n * For generic card will change as shopper types\n * For non-generic card will be fixed\n */\n brand: this.props.type !== 'card' ? { brand: this.props.type, cvcPolicy: 'required' } : { brand: null, cvcPolicy: 'required' },\n allValid: undefined,\n numIframes: 0,\n originalNumIframes: 0,\n iframeCount: 0,\n iframeConfigCount: 0,\n isConfigured: false,\n hasSeparateDateFields: false,\n currentFocusObject: null,\n registerFieldForIos: false,\n securedFields: {},\n isKCP: false\n } as CSFStateObject;\n\n // Create object of references to properties on 'this', that can be used to set up the partials\n const thisObj: CSFThisObject = { csfState: this.state, csfConfig: this.config, csfProps: this.props, csfCallbacks: this.callbacks };\n\n // Setup 'this' references\n this.configHandler = handleConfig;\n\n this.callbacksHandler = configureCallbacks;\n\n this.validateForm = partial(validateForm, thisObj);\n\n this.isConfigured = partial(isConfigured, thisObj, this.validateForm);\n this.handleIframeConfigFeedback = partial(handleIframeConfigFeedback, thisObj, this.isConfigured);\n\n this.processBrand = partial(processBrand, thisObj);\n\n this.handleValidation = handleValidation;\n this.handleEncryption = handleEncryption;\n\n this.createSecuredFields = createSecuredFields;\n this.createNonCardSecuredFields = createNonCardSecuredFields;\n this.createCardSecuredFields = createCardSecuredFields;\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.setupSecuredField = setupSecuredField;\n\n this.postMessageToAllIframes = partial(postMessageToAllIframes, thisObj);\n\n this.handleIOSTouchEvents = handleIOSTouchEvents.handleTouchend.bind(this);\n this.touchendListener = handleIOSTouchEvents.touchendListener.bind(this);\n this.destroyTouchendListener = handleIOSTouchEvents.destroyTouchendListener.bind(this);\n this.touchstartListener = handleIOSTouchEvents.touchstartListener.bind(this);\n this.destroyTouchstartListener = handleIOSTouchEvents.destroyTouchstartListener.bind(this);\n\n this.setFocusOnFrame = partial(setFocusOnFrame, thisObj);\n this.handleFocus = partial(handleFocus, thisObj, this.handleIOSTouchEvents);\n\n this.handleSFShiftTab = handleTab.handleSFShiftTab;\n this.handleShiftTab = handleTab.handleShiftTab;\n\n this.destroySecuredFields = destroySecuredFields;\n\n this.processAutoComplete = partial(processAutoComplete, thisObj);\n\n this.handleBinValue = partial(handleBinValue, thisObj);\n\n this.handleBrandFromBinLookup = handleBrandFromBinLookup;\n this.sendBrandToCardSF = sendBrandToCardSF;\n this.sendExpiryDatePolicyToSF = sendExpiryDatePolicyToSF;\n\n // Populate config & callbacks objects & create securedFields\n this.init();\n }\n\n private init(): void {\n this.configHandler(this.props);\n this.callbacksHandler(this.props.callbacks);\n\n /**\n * Create all the securedFields\n */\n const numIframes: number = this.createSecuredFields();\n\n this.state.numIframes = this.state.originalNumIframes = numIframes;\n\n this.state.isKCP = !!this.props.isKCP;\n\n /**\n * Add touchstart listener\n * re. Disabling arrow keys in iOS\n */\n if (ua.__IS_IOS && this.props.shouldDisableIOSArrowKeys) {\n this.hasGenuineTouchEvents = false;\n on(document, 'touchstart', this.touchstartListener);\n }\n }\n\n // Expose functions that can be called on the CSF instance\n public createReturnObject(): CSFReturnObject {\n // --\n const returnObj: CSFReturnObject = {\n // --\n updateStyles: (pStyleObject: StylesObject): void => {\n if (this.state.isConfigured) {\n this.postMessageToAllIframes({ styleObject: pStyleObject });\n } else {\n logger.warn(\n 'You cannot update the secured fields styling ' +\n \"- they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.\"\n );\n }\n },\n setFocusOnFrame: (pFieldType: SFFieldType): void => {\n if (this.state.isConfigured) {\n this.setFocusOnFrame(pFieldType);\n // Comment in a quick way to test destroying secured fields (also see comment in destroySecuredFields)\n // this.destroySecuredFields();\n } else {\n notConfiguredWarning('You cannot set focus on any secured field');\n }\n },\n // For component based implementation - if showValidation function is called on the component use this\n // function as a way to notify the CSF that a field is in error\n isValidated: (pFieldType: SFFieldType, code: string): void => {\n if (this.state.isConfigured) {\n if (hasOwnProperty(this.state.securedFields, pFieldType)) {\n this.state.securedFields[pFieldType].hasError = true;\n\n // If there's not already an errorType, set one\n // NOTE: fixes issue in Components where you first validate and then start typing a maestro number\n // - w/o this and the corresponding fix in the SecuredField class the maestro PM will never register as valid\n if (this.state.securedFields[pFieldType].errorType === '') {\n this.state.securedFields[pFieldType].errorType = 'isValidated';\n }\n\n // Inform iframe\n const dataObj: object = {\n txVariant: this.state.type,\n fieldType: pFieldType,\n externalValidation: true,\n code,\n numKey: this.state.securedFields[pFieldType].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, pFieldType), this.config.loadingContext);\n }\n } else {\n notConfiguredWarning('You cannot set validated on any secured field');\n }\n },\n hasUnsupportedCard: (pFieldType: SFFieldType, code: string): void => {\n if (this.state.isConfigured) {\n if (hasOwnProperty(this.state.securedFields, pFieldType)) {\n //\n this.state.securedFields[pFieldType].hasError = !!code;\n this.state.securedFields[pFieldType].errorType = code;\n\n // Inform iframe\n const dataObj: object = {\n txVariant: this.state.type,\n fieldType: pFieldType,\n unsupportedCard: !!code,\n code,\n numKey: this.state.securedFields[pFieldType].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, pFieldType), this.config.loadingContext);\n }\n } else {\n notConfiguredWarning('You cannot set hasUnsupportedCard on any secured field');\n }\n },\n destroy: (): void => {\n if (this.state.isConfigured) {\n this.destroySecuredFields();\n } else {\n notConfiguredWarning('You cannot destroy secured fields');\n }\n },\n brandsFromBinLookup: (binLookupResponse: BinLookupResponse, resetObj: SingleBrandResetObject): void => {\n if (!this.config.isCreditCardType) return null;\n\n if (this.state.isConfigured) {\n this.handleBrandFromBinLookup(binLookupResponse, resetObj);\n } else {\n notConfiguredWarning('You cannot set pass brands to secured fields');\n }\n },\n addSecuredField: (pFieldType: SFFieldType): void => {\n const securedField: HTMLElement = selectOne(this.props.rootNode, `[data-cse=\"${pFieldType}\"]`);\n if (securedField) {\n this.state.numIframes += 1;\n this.setupSecuredField(securedField);\n }\n },\n removeSecuredField: (pFieldType: SFFieldType): void => {\n if (this.state.securedFields[pFieldType]) {\n this.state.securedFields[pFieldType].destroy();\n delete this.state.securedFields[pFieldType];\n this.state.numIframes -= 1;\n this.state.iframeCount -= 1;\n\n const callbackObj: CbObjOnAdditionalSF = { additionalIframeRemoved: true, fieldType: pFieldType, type: this.state.type };\n this.callbacks.onAdditionalSFRemoved(callbackObj);\n }\n },\n setKCPStatus: (isKCP: boolean): void => {\n this.state.isKCP = isKCP;\n },\n sfIsOptionalOrHidden: (fieldType: string): boolean => {\n return this.state.securedFields[fieldType].isOptionalOrHidden();\n }\n };\n\n return returnObj;\n }\n}\n\nexport default CSF;\n"],"names":["notConfiguredWarning","str","logger","CSF","AbstractCSF","constructor","setupObj","super","this","state","type","props","brand","cvcPolicy","allValid","undefined","numIframes","originalNumIframes","iframeCount","iframeConfigCount","isConfigured","hasSeparateDateFields","currentFocusObject","registerFieldForIos","securedFields","isKCP","thisObj","csfState","csfConfig","config","csfProps","csfCallbacks","callbacks","configHandler","handleConfig","callbacksHandler","configureCallbacks","validateForm","partial","handleIframeConfigFeedback","processBrand","handleValidation","handleEncryption","createSecuredFields","createNonCardSecuredFields","createCardSecuredFields","setupSecuredField","postMessageToAllIframes","handleIOSTouchEvents","handleTouchend","bind","touchendListener","destroyTouchendListener","touchstartListener","destroyTouchstartListener","setFocusOnFrame","handleFocus","handleSFShiftTab","handleTab","handleShiftTab","destroySecuredFields","processAutoComplete","handleBinValue","handleBrandFromBinLookup","sendBrandToCardSF","sendExpiryDatePolicyToSF","init","ua","__IS_IOS","shouldDisableIOSArrowKeys","hasGenuineTouchEvents","on","document","createReturnObject","updateStyles","pStyleObject","styleObject","pFieldType","isValidated","code","hasOwnProperty","hasError","errorType","dataObj","txVariant","fieldType","externalValidation","numKey","postMessageToIframe","getIframeContentWin","loadingContext","hasUnsupportedCard","unsupportedCard","destroy","brandsFromBinLookup","binLookupResponse","resetObj","isCreditCardType","addSecuredField","securedField","selectOne","rootNode","removeSecuredField","callbackObj","additionalIframeRemoved","onAdditionalSFRemoved","setKCPStatus","sfIsOptionalOrHidden","isOptionalOrHidden"],"mappings":"qrDAgCA,MAAMA,EAAuB,CAACC,EAAM,mCAChCC,EAAY,GAAGD,sGAAuG,EAG1H,MAAME,UAAYC,EAEdC,WAAAA,CAAYC,GAURC,MAAMD,GAENE,KAAKC,MAAQ,CAMTC,KAAMF,KAAKG,MAAMD,KAKjBE,MAA2B,SAApBJ,KAAKG,MAAMD,KAAkB,CAAEE,MAAOJ,KAAKG,MAAMD,KAAMG,UAAW,YAAe,CAAED,MAAO,KAAMC,UAAW,YAClHC,cAAUC,EACVC,WAAY,EACZC,mBAAoB,EACpBC,YAAa,EACbC,kBAAmB,EACnBC,cAAc,EACdC,uBAAuB,EACvBC,mBAAoB,KACpBC,qBAAqB,EACrBC,cAAe,CAAC,EAChBC,OAAO,GAIX,MAAMC,EAAyB,CAAEC,SAAUnB,KAAKC,MAAOmB,UAAWpB,KAAKqB,OAAQC,SAAUtB,KAAKG,MAAOoB,aAAcvB,KAAKwB,WAGxHxB,KAA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D,GAAYU,QAEjDC,EAAoBL,EAASM,EAAoBjF,KAAKC,MAAOoE,GAAarE,KAAKqB,OAAO6D,eAC1F,OAEA1F,EAAqB,yDACzB,EAEJ6F,QAAS,KACDrF,KAAKC,MAAMW,aACXZ,KAAKoD,uBAEL5D,EAAqB,oCACzB,EAEJ8F,oBAAqB,CAACC,EAAsCC,KACxD,IAAKxF,KAAKqB,OAAOoE,iBAAkB,OAAO,KAEtCzF,KAAKC,MAAMW,aACXZ,KAAKuD,yBAAyBgC,EAAmBC,GAEjDhG,EAAqB,+CACzB,EAEJkG,gBAAkBrB,IACd,MAAMsB,EAA4BC,EAAU5F,KAAKG,MAAM0F,SAAU,cAAcxB,OAC3EsB,IACA3F,KAAKC,MAAMO,YAAc,EACzBR,KAAKsC,kBAAkBqD,GAC3B,EAEJG,mBAAqBzB,IACjB,GAAIrE,KAAKC,MAAMe,cAAcqD,GAAa,CACtCrE,KAAKC,MAAMe,cAAcqD,GAAYgB,iBAC9BrF,KAAKC,MAAMe,cAAcqD,GAChCrE,KAAKC,MAAMO,YAAc,EACzBR,KAAKC,MAAMS,aAAe,EAE1B,MAAMqF,EAAmC,CAAEC,yBAAyB,EAAMnB,UAAWR,EAAYnE,KAAMF,KAAKC,MAAMC,MAClHF,KAAKwB,UAAUyE,sBAAsBF,EACzC,GAEJG,aAAejF,IACXjB,KAAKC,MAAMgB,MAAQA,CAAAA,EAEvBkF,qBAAuBtB,GACZ7E,KAAKC,MAAMe,cAAc6D,GAAWuB,qBAKvD"}
|
|
1
|
+
{"version":3,"file":"CSF.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/CSF/CSF.ts"],"sourcesContent":["import AbstractCSF from './AbstractCSF';\nimport { CSFReturnObject, CSFSetupObject, CSFStateObject, CSFThisObject } from './types';\nimport { StylesObject, CbObjOnAdditionalSF, SFFieldType } from '../types';\nimport { BinLookupResponse } from '../../../../Card/types';\nimport { handleConfig } from './extensions/handleConfig';\nimport { configureCallbacks } from './extensions/configureCallbacks';\nimport { handleValidation } from './extensions/handleValidation';\nimport { handleEncryption } from './extensions/handleEncryption';\nimport { createSecuredFields, createNonCardSecuredFields, createCardSecuredFields, setupSecuredField } from './extensions/createSecuredFields';\nimport handleIOSTouchEvents from './extensions/handleIOSTouchEvents';\nimport handleTab from './extensions/handleTab';\nimport handleBrandFromBinLookup, { sendBrandToCardSF, sendExpiryDatePolicyToSF } from './extensions/handleBrandFromBinLookup';\nimport { setFocusOnFrame } from './partials/setFocusOnFrame';\nimport { postMessageToAllIframes } from './partials/postMessageToAllIframes';\nimport processBrand from './partials/processBrand';\nimport { processAutoComplete } from './partials/processAutoComplete';\nimport { handleFocus } from './partials/handleFocus';\nimport { handleIframeConfigFeedback } from './partials/handleIframeConfigFeedback';\nimport { isConfigured } from './partials/isConfigured';\nimport validateForm from './partials/validateForm';\nimport { handleBinValue } from './partials/handleBinValue';\nimport { destroySecuredFields } from './utils/destroySecuredFields';\nimport postMessageToIframe from './utils/iframes/postMessageToIframe';\nimport getIframeContentWin from './utils/iframes/getIframeContentWin';\nimport * as logger from '../utilities/logger';\nimport { selectOne } from '../utilities/dom';\nimport { on } from '../../../../../utils/listenerUtils';\nimport { partial } from '../utilities/commonUtils';\nimport { hasOwnProperty } from '../../../../../utils/hasOwnProperty';\nimport ua from './utils/userAgent';\nimport { SingleBrandResetObject } from '../../SFP/types';\n\nconst notConfiguredWarning = (str = 'You cannot use secured fields') => {\n logger.warn(`${str} - they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.`);\n};\n\nclass CSF extends AbstractCSF {\n // --\n constructor(setupObj: CSFSetupObject) {\n /**\n * Initialises:\n * - this.props = setupObj: CSFSetupObject\n *\n * and empty objects for:\n * - this.config: CSFConfigObject (populated in handleConfig.ts)\n * - this.callbacks: CSFCallbacksConfig (populated in configureCallbacks.ts\n * - this.state: CSFStateObject (populated below)\n */\n super(setupObj);\n\n this.state = {\n /**\n * For generic card will always be 'card'.\n * For non-generic card will be hardcoded to a particular txVariant e.g. 'mc' or 'visa'\n * For other types of SecuredField will be the passed type e.g. 'ach' or 'giftcard'\n */\n type: this.props.type,\n /**\n * For generic card will change as shopper types\n * For non-generic card will be fixed\n */\n brand: this.props.type !== 'card' ? { brand: this.props.type, cvcPolicy: 'required' } : { brand: null, cvcPolicy: 'required' },\n allValid: undefined,\n numIframes: 0,\n originalNumIframes: 0,\n iframeCount: 0,\n iframeConfigCount: 0,\n isConfigured: false,\n hasSeparateDateFields: false,\n currentFocusObject: null,\n registerFieldForIos: false,\n securedFields: {},\n isKCP: false\n } as CSFStateObject;\n\n // Create object of references to properties on 'this', that can be used to set up the partials\n const thisObj: CSFThisObject = { csfState: this.state, csfConfig: this.config, csfProps: this.props, csfCallbacks: this.callbacks };\n\n // Setup 'this' references\n this.configHandler = handleConfig;\n\n this.callbacksHandler = configureCallbacks;\n\n this.validateForm = partial(validateForm, thisObj);\n\n this.isConfigured = partial(isConfigured, thisObj, this.validateForm);\n this.handleIframeConfigFeedback = partial(handleIframeConfigFeedback, thisObj, this.isConfigured);\n\n this.processBrand = partial(processBrand, thisObj);\n\n this.handleValidation = handleValidation;\n this.handleEncryption = handleEncryption;\n\n this.createSecuredFields = createSecuredFields;\n this.createNonCardSecuredFields = createNonCardSecuredFields;\n this.createCardSecuredFields = createCardSecuredFields;\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.setupSecuredField = setupSecuredField;\n\n this.postMessageToAllIframes = partial(postMessageToAllIframes, thisObj);\n\n this.handleIOSTouchEvents = handleIOSTouchEvents.handleTouchend.bind(this);\n this.touchendListener = handleIOSTouchEvents.touchendListener.bind(this);\n this.destroyTouchendListener = handleIOSTouchEvents.destroyTouchendListener.bind(this);\n this.touchstartListener = handleIOSTouchEvents.touchstartListener.bind(this);\n this.destroyTouchstartListener = handleIOSTouchEvents.destroyTouchstartListener.bind(this);\n\n this.setFocusOnFrame = partial(setFocusOnFrame, thisObj);\n this.handleFocus = partial(handleFocus, thisObj, this.handleIOSTouchEvents);\n\n this.handleSFShiftTab = handleTab.handleSFShiftTab;\n this.handleShiftTab = handleTab.handleShiftTab;\n\n this.destroySecuredFields = destroySecuredFields;\n\n this.processAutoComplete = partial(processAutoComplete, thisObj);\n\n this.handleBinValue = partial(handleBinValue, thisObj);\n\n this.handleBrandFromBinLookup = handleBrandFromBinLookup;\n this.sendBrandToCardSF = sendBrandToCardSF;\n this.sendExpiryDatePolicyToSF = sendExpiryDatePolicyToSF;\n\n // Populate config & callbacks objects & create securedFields\n this.init();\n }\n\n private init(): void {\n this.configHandler(this.props);\n this.callbacksHandler(this.props.callbacks);\n\n /**\n * Create all the securedFields\n */\n const numIframes: number = this.createSecuredFields();\n\n this.state.numIframes = this.state.originalNumIframes = numIframes;\n\n this.state.isKCP = !!this.props.isKCP;\n\n /**\n * Add touchstart listener\n * re. Disabling arrow keys in iOS\n */\n if (ua.__IS_IOS && this.props.shouldDisableIOSArrowKeys) {\n this.hasGenuineTouchEvents = false;\n on(document, 'touchstart', this.touchstartListener);\n }\n }\n\n // Expose functions that can be called on the CSF instance\n public createReturnObject(): CSFReturnObject {\n // --\n const returnObj: CSFReturnObject = {\n // --\n updateStyles: (pStyleObject: StylesObject): void => {\n if (this.state.isConfigured) {\n this.postMessageToAllIframes({ styleObject: pStyleObject });\n } else {\n logger.warn(\n 'You cannot update the secured fields styling ' +\n \"- they are not yet configured. Use the 'onConfigSuccess' callback to know when this has happened.\"\n );\n }\n },\n setFocusOnFrame: (pFieldType: SFFieldType): void => {\n if (this.state.isConfigured) {\n this.setFocusOnFrame(pFieldType);\n // Comment in a quick way to test destroying secured fields (also see comment in destroySecuredFields)\n // this.destroySecuredFields();\n } else {\n notConfiguredWarning('You cannot set focus on any secured field');\n }\n },\n // For component based implementation - if showValidation function is called on the component use this\n // function as a way to notify the CSF that a field is in error\n isValidated: (pFieldType: SFFieldType, code: string): void => {\n if (this.state.isConfigured) {\n if (hasOwnProperty(this.state.securedFields, pFieldType)) {\n this.state.securedFields[pFieldType].hasError = true;\n\n // If there's not already an errorType, set one\n // NOTE: fixes issue in Components where you first validate and then start typing a maestro number\n // - w/o this and the corresponding fix in the SecuredField class the maestro PM will never register as valid\n if (this.state.securedFields[pFieldType].errorType === '') {\n this.state.securedFields[pFieldType].errorType = 'isValidated';\n }\n\n // Inform iframe\n const dataObj: object = {\n txVariant: this.state.type,\n fieldType: pFieldType,\n externalValidation: true,\n code,\n numKey: this.state.securedFields[pFieldType].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, pFieldType), this.config.loadingContext);\n }\n } else {\n notConfiguredWarning('You cannot set validated on any secured field');\n }\n },\n hasUnsupportedCard: (pFieldType: SFFieldType, code: string): void => {\n if (this.state.isConfigured) {\n if (hasOwnProperty(this.state.securedFields, pFieldType)) {\n //\n this.state.securedFields[pFieldType].hasError = !!code;\n this.state.securedFields[pFieldType].errorType = code;\n\n // Inform iframe\n const dataObj: object = {\n txVariant: this.state.type,\n fieldType: pFieldType,\n unsupportedCard: !!code,\n code,\n numKey: this.state.securedFields[pFieldType].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, pFieldType), this.config.loadingContext);\n }\n } else {\n notConfiguredWarning('You cannot set hasUnsupportedCard on any secured field');\n }\n },\n destroy: (): void => {\n if (this.state.isConfigured) {\n this.destroySecuredFields();\n } else {\n notConfiguredWarning('You cannot destroy secured fields');\n }\n },\n brandsFromBinLookup: (binLookupResponse: BinLookupResponse, resetObj: SingleBrandResetObject): void => {\n if (!this.config.isCreditCardType) return null;\n\n if (this.state.isConfigured) {\n this.handleBrandFromBinLookup(binLookupResponse, resetObj);\n } else {\n notConfiguredWarning('You cannot set pass brands to secured fields');\n }\n },\n addSecuredField: (pFieldType: SFFieldType): void => {\n const securedField: HTMLElement = selectOne(this.props.rootNode, `[data-cse=\"${pFieldType}\"]`);\n if (securedField) {\n this.state.numIframes += 1;\n this.setupSecuredField(securedField);\n }\n },\n removeSecuredField: (pFieldType: SFFieldType): void => {\n if (this.state.securedFields[pFieldType]) {\n this.state.securedFields[pFieldType].destroy();\n delete this.state.securedFields[pFieldType];\n this.state.numIframes -= 1;\n this.state.iframeCount -= 1;\n\n const callbackObj: CbObjOnAdditionalSF = { additionalIframeRemoved: true, fieldType: pFieldType, type: this.state.type };\n this.callbacks.onAdditionalSFRemoved(callbackObj);\n }\n },\n setKCPStatus: (isKCP: boolean): void => {\n this.state.isKCP = isKCP;\n },\n sfIsOptionalOrHidden: (fieldType: string): boolean => {\n return this.state.securedFields[fieldType].isOptionalOrHidden();\n }\n };\n\n return returnObj;\n }\n}\n\nexport default CSF;\n"],"names":["notConfiguredWarning","str","logger","CSF","AbstractCSF","init","this","configHandler","props","callbacksHandler","callbacks","numIframes","createSecuredFields","state","originalNumIframes","isKCP","ua","__IS_IOS","shouldDisableIOSArrowKeys","hasGenuineTouchEvents","on","document","touchstartListener","createReturnObject","updateStyles","pStyleObject","isConfigured","postMessageToAllIframes","styleObject","setFocusOnFrame","pFieldType","isValidated","code","hasOwnProperty","securedFields","hasError","errorType","dataObj","txVariant","type","fieldType","externalValidation","numKey","postMessageToIframe","getIframeContentWin","config","loadingContext","hasUnsupportedCard","unsupportedCard","destroy","destroySecuredFields","brandsFromBinLookup","binLookupResponse","resetObj","isCreditCardType","handleBrandFromBinLookup","addSecuredField","securedField","selectOne","rootNode","setupSecuredField","removeSecuredField","iframeCount","callbackObj","additionalIframeRemoved","onAdditionalSFRemoved","setKCPStatus","sfIsOptionalOrHidden","isOptionalOrHidden","constructor","setupObj","super","brand","cvcPolicy","allValid","undefined","iframeConfigCount","hasSeparateDateFields","currentFocusObject","registerFieldForIos","thisObj","csfState","csfConfig","csfProps","csfCallbacks","handleConfig","configureCallbacks","validateForm","partial","handleIframeConfigFeedback","processBrand","handleValidation","handleEncryption","createNonCardSecuredFields","createCardSecuredFields","handleIOSTouchEvents","handleTouchend","bind","touchendListener","destroyTouchendListener","destroyTouchstartListener","handleFocus","handleSFShiftTab","handleTab","handleShiftTab","processAutoComplete","handleBinValue","sendBrandToCard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,EAAQa,EAAarB,EAAS1E,KAAKyF,sBAEtDzF,KAAKgG,iBAAmBC,EAAUD,iBAClChG,KAAKkG,eAAiBD,EAAUC,eAEhClG,KAAK4C,qBAAuBA,EAE5B5C,KAAKmG,oBAAsBjB,EAAQiB,EAAqBzB,GAExD1E,KAAKoG,eAAiBlB,EAAQkB,EAAgB1B,GAE9C1E,KAAKiD,yBAA2BA,EAChCjD,KAAKqG,kBAAoBA,EACzBrG,KAAKsG,yBAA2BA,EAGhCtG,KAAKD,MACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class
|
|
1
|
+
function i(i,o,t){return o in i?Object.defineProperty(i,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[o]=t,i}class o{constructor(){i(this,"sfConfig",void 0),i(this,"loadingContext",void 0),i(this,"holderEl",void 0),i(this,"iframeRef",void 0),i(this,"loadToConfigTimeout",void 0),i(this,"_isValid",void 0),i(this,"_iframeContentWindow",void 0),i(this,"_numKey",void 0),i(this,"_isEncrypted",void 0),i(this,"_hasError",void 0),i(this,"_errorType",void 0),i(this,"_cvcPolicy",void 0),i(this,"_expiryDatePolicy",void 0),i(this,"_iframeOnLoadListener",void 0),i(this,"_postMessageListener",void 0),i(this,"onIframeLoadedCallback",void 0),i(this,"onConfigCallback",void 0),i(this,"onEncryptionCallback",void 0),i(this,"onValidationCallback",void 0),i(this,"onFocusCallback",void 0),i(this,"onBinValueCallback",void 0),i(this,"onTouchstartCallback",void 0),i(this,"onShiftTabCallback",void 0),i(this,"onAutoCompleteCallback",void 0),i(this,"onKeyPressedCallback",void 0),this.sfConfig={}}}export{o as default};
|
|
2
2
|
//# sourceMappingURL=AbstractSecuredField.js.map
|
package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractSecuredField.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.ts"],"sourcesContent":["import {\n CVCPolicyType,\n DatePolicyType,\n RtnType_callbackFn,\n RtnType_noParamVoidFn,\n RtnType_postMessageListener,\n SecuredFieldCommonProps\n} from '../types';\n\nabstract class AbstractSecuredField {\n public sfConfig: SecuredFieldCommonProps; // could be protected but needs to be public for tests to run\n protected loadingContext: string;\n protected holderEl: HTMLElement;\n protected iframeRef: HTMLElement;\n public loadToConfigTimeout: number;\n // From getters/setters with the same name\n protected _isValid: boolean;\n protected _iframeContentWindow: Window;\n protected _numKey: number;\n protected _isEncrypted: boolean;\n protected _hasError: boolean;\n protected _errorType: string;\n protected _cvcPolicy: CVCPolicyType;\n protected _expiryDatePolicy: DatePolicyType;\n protected _iframeOnLoadListener: RtnType_noParamVoidFn;\n protected _postMessageListener: RtnType_postMessageListener;\n // Callback fns assigned via public functions\n protected onIframeLoadedCallback: RtnType_noParamVoidFn;\n protected onConfigCallback: RtnType_callbackFn;\n protected onEncryptionCallback: RtnType_callbackFn;\n protected onValidationCallback: RtnType_callbackFn;\n protected onFocusCallback: RtnType_callbackFn;\n protected onBinValueCallback: RtnType_callbackFn;\n protected onTouchstartCallback: RtnType_callbackFn;\n protected onShiftTabCallback: RtnType_callbackFn;\n protected onAutoCompleteCallback: RtnType_callbackFn;\n protected onKeyPressedCallback: RtnType_callbackFn;\n\n protected constructor() {\n this.sfConfig = {} as any as SecuredFieldCommonProps;\n }\n}\n\nexport default AbstractSecuredField;\n"],"names":["AbstractSecuredField","sfConfig","loadingContext","holderEl","iframeRef","loadToConfigTimeout","_isValid","_iframeContentWindow","_numKey","_isEncrypted","_hasError","_errorType","_cvcPolicy","_expiryDatePolicy","_iframeOnLoadListener","_postMessageListener","onIframeLoadedCallback","onConfigCallback","onEncryptionCallback","onValidationCallback","onFocusCallback","onBinValueCallback","onTouchstartCallback","onShiftTabCallback","onAutoCompleteCallback","onKeyPressedCallback"
|
|
1
|
+
{"version":3,"file":"AbstractSecuredField.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.ts"],"sourcesContent":["import {\n CVCPolicyType,\n DatePolicyType,\n RtnType_callbackFn,\n RtnType_noParamVoidFn,\n RtnType_postMessageListener,\n SecuredFieldCommonProps\n} from '../types';\n\nabstract class AbstractSecuredField {\n public sfConfig: SecuredFieldCommonProps; // could be protected but needs to be public for tests to run\n protected loadingContext: string;\n protected holderEl: HTMLElement;\n protected iframeRef: HTMLElement;\n public loadToConfigTimeout: number;\n // From getters/setters with the same name\n protected _isValid: boolean;\n protected _iframeContentWindow: Window;\n protected _numKey: number;\n protected _isEncrypted: boolean;\n protected _hasError: boolean;\n protected _errorType: string;\n protected _cvcPolicy: CVCPolicyType;\n protected _expiryDatePolicy: DatePolicyType;\n protected _iframeOnLoadListener: RtnType_noParamVoidFn;\n protected _postMessageListener: RtnType_postMessageListener;\n // Callback fns assigned via public functions\n protected onIframeLoadedCallback: RtnType_noParamVoidFn;\n protected onConfigCallback: RtnType_callbackFn;\n protected onEncryptionCallback: RtnType_callbackFn;\n protected onValidationCallback: RtnType_callbackFn;\n protected onFocusCallback: RtnType_callbackFn;\n protected onBinValueCallback: RtnType_callbackFn;\n protected onTouchstartCallback: RtnType_callbackFn;\n protected onShiftTabCallback: RtnType_callbackFn;\n protected onAutoCompleteCallback: RtnType_callbackFn;\n protected onKeyPressedCallback: RtnType_callbackFn;\n\n protected constructor() {\n this.sfConfig = {} as any as SecuredFieldCommonProps;\n }\n}\n\nexport default AbstractSecuredField;\n"],"names":["AbstractSecuredField","constructor","_define_property","sfConfig","this","loadingContext","holderEl","iframeRef","loadToConfigTimeout","_isValid","_iframeContentWindow","_numKey","_isEncrypted","_hasError","_errorType","_cvcPolicy","_expiryDatePolicy","_iframeOnLoadListener","_postMessageListener","onIframeLoadedCallback","onConfigCallback","onEncryptionCallback","onValidationCallback","onFocusCallback","onBinValueCallback","onTouchstartCallback","onShiftTabCallback","onAutoCompleteCallback","onKeyPressedCallback"],"mappings":"wHASA,MAAeA,EA6BX,WAAAC,GA5BAC,EAAOC,KAAAA,gBAAP,GACAD,EAAAE,KAAUC,sBAAV,GACAH,EAAAE,KAAUE,gBAAV,GACAJ,EAAAE,KAAUG,iBAAV,GACAL,EAAAE,KAAOI,2BAAP,GAEAN,EAAAE,KAAUK,gBAAV,GACAP,EAAAE,KAAUM,4BAAV,GACAR,EAAAE,KAAUO,eAAV,GACAT,EAAAE,KAAUQ,oBAAV,GACAV,EAAAE,KAAUS,iBAAV,GACAX,EAAAE,KAAUU,kBAAV,GACAZ,EAAAE,KAAUW,kBAAV,GACAb,EAAAE,KAAUY,yBAAV,GACAd,EAAAE,KAAUa,6BAAV,GACAf,EAAAE,KAAUc,4BAAV,GAEAhB,EAAAE,KAAUe,8BAAV,GACAjB,EAAAE,KAAUgB,wBAAV,GACAlB,EAAAE,KAAUiB,4BAAV,GACAnB,EAAAE,KAAUkB,4BAAV,GACApB,EAAAE,KAAUmB,uBAAV,GACArB,EAAAE,KAAUoB,0BAAV,GACAtB,EAAAE,KAAUqB,4BAAV,GACAvB,EAAAE,KAAUsB,0BAAV,GACAxB,EAAAE,KAAUuB,8BAAV,GACAzB,EAAAE,KAAUwB,4BAAV,GAGIxB,KAAKD,SAAW,EACpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{log as e,warn as i}from"../utilities/logger.js";import s from"./utils/createIframe.js";import{selectOne as t,removeAllChildren as r}from"../utilities/dom.js";import{on as o,off as n}from"../../../../../utils/listenerUtils.js";import a from"../CSF/utils/iframes/postMessageToIframe.js";import{originCheckPassed as l,isWebpackPostMsg as h,isChromeVoxPostMsg as f}from"../CSF/utils/iframes/postMessageValidation.js";import{ENCRYPTED_EXPIRY_DATE as c,ENCRYPTED_EXPIRY_MONTH as d,ENCRYPTED_EXPIRY_YEAR as u,DATE_POLICY_OPTIONAL as m,DATE_POLICY_HIDDEN as p,ENCRYPTED_SECURITY_CODE as g,CVC_POLICY_OPTIONAL as C,CVC_POLICY_HIDDEN as y}from"../constants.js";import{generateRandomNumber as b}from"../utilities/commonUtils.js";import L from"./AbstractSecuredField.js";import{reject as E}from"../../../../../utils/commonUtils.js";import{processAriaConfig as w}from"./utils/processAriaConfig.js";import{processPlaceholders as T}from"./utils/processPlaceholders.js";import{hasOwnProperty as k}from"../../../../../utils/hasOwnProperty.js";class P extends L{
|
|
1
|
+
import{log as e,warn as i}from"../utilities/logger.js";import s from"./utils/createIframe.js";import{selectOne as t,removeAllChildren as r}from"../utilities/dom.js";import{on as o,off as n}from"../../../../../utils/listenerUtils.js";import a from"../CSF/utils/iframes/postMessageToIframe.js";import{originCheckPassed as l,isWebpackPostMsg as h,isChromeVoxPostMsg as f}from"../CSF/utils/iframes/postMessageValidation.js";import{ENCRYPTED_EXPIRY_DATE as c,ENCRYPTED_EXPIRY_MONTH as d,ENCRYPTED_EXPIRY_YEAR as u,DATE_POLICY_OPTIONAL as m,DATE_POLICY_HIDDEN as p,ENCRYPTED_SECURITY_CODE as g,CVC_POLICY_OPTIONAL as C,CVC_POLICY_HIDDEN as y}from"../constants.js";import{generateRandomNumber as b}from"../utilities/commonUtils.js";import L from"./AbstractSecuredField.js";import{reject as E}from"../../../../../utils/commonUtils.js";import{processAriaConfig as w}from"./utils/processAriaConfig.js";import{processPlaceholders as T}from"./utils/processPlaceholders.js";import{hasOwnProperty as k}from"../../../../../utils/hasOwnProperty.js";class P extends L{init(e,i,r,n){const a=w(this.sfConfig.txVariant,this.sfConfig.fieldType,e,n);this.sfConfig.iframeUIConfig.ariaConfig=a,this.sfConfig.iframeUIConfig.placeholders=T(this.sfConfig.txVariant,this.sfConfig.fieldType,r);const l={src:i,title:a[this.sfConfig.fieldType].iframeTitle,policy:"origin"},h=s(l);this.holderEl.appendChild(h);const f=t(this.holderEl,".js-iframe");return f&&(this.iframeContentWindow=f.contentWindow,this.iframeOnLoadListener=this.iframeOnLoadListenerFn,o(f,"load",this.iframeOnLoadListener,!1)),this.iframeRef=f,this}iframeOnLoadListenerFn(){this.postMessageListener=this.postMessageListenerFn,o(window,"message",this.postMessageListener,!1);const e={...this.sfConfig,numKey:this.numKey};window._b$dl&&console.log("### SecuredField:::: onIframeLoaded:: created configObj=",e),a(e,this.iframeContentWindow,this.loadingContext),this.onIframeLoadedCallback()}postMessageListenerFn(s){if(!l(s,this.loadingContext,this.sfConfig.showWarnings))return;let t;try{t=JSON.parse(s.data)}catch(i){return h(s)?void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK")):f(s)?void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX")):void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=",s.data))}if(k(t,"action")&&k(t,"numKey"))if(this.numKey===t.numKey)switch(t.action){case"encryption":this.isValid=!0,this.onEncryptionCallback(t);break;case"config":window._b$dl&&console.log("### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback",t.fieldType),this.onConfigCallback(t);break;case"focus":this.onFocusCallback(t);break;case"binValue":this.onBinValueCallback(t);break;case"touch":this.onTouchstartCallback(t);break;case"shifttab":this.onShiftTabCallback(t);break;case"autoComplete":this.onAutoCompleteCallback(t);break;case"enterKeyPressed":this.onKeyPressedCallback(t);break;default:this.isValid=!1,this.onValidationCallback(t)}else this.sfConfig.showWarnings&&i("WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)");else this.sfConfig.showWarnings&&i("WARNING SecuredField :: postMessage listener for iframe :: data mismatch!")}destroy(){n(window,"message",this.postMessageListener,!1),n(this.iframeRef,"load",this.iframeOnLoadListener,!1),this.iframeContentWindow=null,r(this.holderEl)}isOptionalOrHidden(){if(this.sfConfig.fieldType===c||this.sfConfig.fieldType===d||this.sfConfig.fieldType===u)switch(this.expiryDatePolicy){case p:return!0;case m:return!this.hasError;default:return!1}if(this.sfConfig.fieldType===g)switch(this.cvcPolicy){case y:return!0;case C:return!this.hasError;default:return!1}return!1}onIframeLoaded(e){return this.onIframeLoadedCallback=e,this}onEncryption(e){return this.onEncryptionCallback=e,this}onValidation(e){return this.onValidationCallback=e,this}onConfig(e){return this.onConfigCallback=e,this}onFocus(e){return this.onFocusCallback=e,this}onBinValue(e){return this.onBinValueCallback=e,this}onTouchstart(e){return this.onTouchstartCallback=e,this}onShiftTab(e){return this.onShiftTabCallback=e,this}onAutoComplete(e){return this.onAutoCompleteCallback=e,this}onKeyPressed(e){return this.onKeyPressedCallback=e,this}get errorType(){return this._errorType}set errorType(e){this._errorType=e}get hasError(){return this._hasError}set hasError(e){this._hasError=e}get isValid(){if(this.sfConfig.fieldType===g)switch(this.cvcPolicy){case y:return!0;case C:return!this.hasError;default:return this._isValid}if(this.sfConfig.fieldType===c||this.sfConfig.fieldType===d||this.sfConfig.fieldType===u)switch(this.expiryDatePolicy){case p:return!0;case m:return!this.hasError;default:return this._isValid}return this._isValid}set isValid(e){this._isValid=e}get cvcPolicy(){return this._cvcPolicy}set cvcPolicy(e){this.sfConfig.fieldType===g&&e!==this.cvcPolicy&&(this._cvcPolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get expiryDatePolicy(){return this._expiryDatePolicy}set expiryDatePolicy(e){this.sfConfig.fieldType!==c&&this.sfConfig.fieldType!==d&&this.sfConfig.fieldType!==u||e!==this.expiryDatePolicy&&(this._expiryDatePolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get iframeContentWindow(){return this._iframeContentWindow}set iframeContentWindow(e){this._iframeContentWindow=e}get isEncrypted(){return this._isEncrypted}set isEncrypted(e){this._isEncrypted=e}get numKey(){return this._numKey}set numKey(e){this._numKey=e}get iframeOnLoadListener(){return this._iframeOnLoadListener}set iframeOnLoadListener(e){this._iframeOnLoadListener=e.bind(this)}get postMessageListener(){return this._postMessageListener}set postMessageListener(e){this._postMessageListener=e.bind(this)}constructor(e,i){super();const s=E(["loadingContext","holderEl","iframeSrc","showContextualElement","placeholders"]).from(e);this.sfConfig={...s,iframeUIConfig:{...s.iframeUIConfig}};const{iframeSrc:t,placeholders:r,showContextualElement:o}=e;return this.loadingContext=e.loadingContext,this.holderEl=e.holderEl,this.isValid=!1,this.iframeContentWindow=null,this.numKey=b(),this.isEncrypted=!1,this.hasError=!1,this.errorType="",this.cvcPolicy=e.cvcPolicy,this.expiryDatePolicy=e.expiryDatePolicy,this.init(i,t,r,o)}}export{P as default};
|
|
2
2
|
//# sourceMappingURL=SecuredField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuredField.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/securedField/SecuredField.ts"],"sourcesContent":["import * as logger from '../utilities/logger';\nimport createIframe from './utils/createIframe';\nimport { removeAllChildren, selectOne } from '../utilities/dom';\nimport { off, on } from '../../../../../utils/listenerUtils';\nimport postMessageToIframe from '../CSF/utils/iframes/postMessageToIframe';\nimport { isChromeVoxPostMsg, isWebpackPostMsg, originCheckPassed } from '../CSF/utils/iframes/postMessageValidation';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE\n} from '../constants';\nimport { generateRandomNumber } from '../utilities/commonUtils';\nimport { CVCPolicyType, DatePolicyType, RtnType_callbackFn, RtnType_noParamVoidFn, RtnType_postMessageListener, SFFeedbackObj } from '../types';\nimport AbstractSecuredField from './AbstractSecuredField';\nimport { AriaConfig, IframeConfigObject, SecuredFieldSetupObject, SecuredFieldCommonProps } from '../types';\nimport { reject } from '../../../../../utils/commonUtils';\nimport { processAriaConfig } from './utils/processAriaConfig';\nimport { processPlaceholders } from './utils/processPlaceholders';\nimport Language from '../../../../../language/Language';\nimport { hasOwnProperty } from '../../../../../utils/hasOwnProperty';\nimport { Placeholders } from '../../SFP/types';\nimport './SecuredField.scss';\n\nconst logPostMsg = false;\nconst doLog = false;\n\nclass SecuredField extends AbstractSecuredField {\n constructor(pSetupObj: SecuredFieldSetupObject, i18n: Language) {\n super();\n\n /**\n * List of props to exclude from being set on this.sfConfig.\n * These props are only required for internal purposes. They do not get sent to the iframe\n */\n const deltaPropsArr: string[] = ['loadingContext', 'holderEl', 'iframeSrc', 'showContextualElement', 'placeholders'];\n\n /**\n * List of props from setup object that will be set on this.sfConfig\n * These props will all end up being sent to the iframe\n */\n const configVarsFromSetUpObj = reject(deltaPropsArr).from(pSetupObj);\n\n // Copy passed setup object values to this.sfConfig\n this.sfConfig = {\n // ...this.sfConfig, // Do we need to do this? Pretty sure we don't\n ...configVarsFromSetUpObj,\n // Break references on iframeUIConfig object so we can overwrite its properties in each securedField instance\n iframeUIConfig: { ...configVarsFromSetUpObj.iframeUIConfig }\n } as SecuredFieldCommonProps;\n\n /**\n * Extract values only needed for init\n */\n const { iframeSrc, placeholders, showContextualElement } = pSetupObj;\n\n /**\n * Store those passed setup object values that are needed in multiple functions\n */\n this.loadingContext = pSetupObj.loadingContext;\n this.holderEl = pSetupObj.holderEl;\n\n /**\n * Initiate other values on 'this' through setters\n */\n this.isValid = false;\n this.iframeContentWindow = null;\n this.numKey = generateRandomNumber();\n this.isEncrypted = false;\n this.hasError = false;\n this.errorType = '';\n this.cvcPolicy = pSetupObj.cvcPolicy;\n this.expiryDatePolicy = pSetupObj.expiryDatePolicy;\n\n if (process.env.NODE_ENV === 'development' && doLog) {\n logger.log(\n '### SecuredField::constructor:: this.sfConfig.fieldType=',\n this.sfConfig.fieldType,\n 'isValid=',\n this._isValid,\n 'numKey=',\n this.numKey\n );\n logger.log('\\n');\n }\n\n return this.init(i18n, iframeSrc, placeholders, showContextualElement);\n }\n\n init(i18n: Language, iframeSrc: string, placeholders: Placeholders, showContextualElement: boolean): SecuredField {\n /**\n * Ensure all fields have a related ariaConfig object containing, at minimum, an iframeTitle property and a (translated) errors object\n */\n const processedAriaConfig: AriaConfig = processAriaConfig(this.sfConfig.txVariant, this.sfConfig.fieldType, i18n, showContextualElement);\n // Set result back onto config object\n this.sfConfig.iframeUIConfig.ariaConfig = processedAriaConfig;\n\n // Set result back onto config object\n this.sfConfig.iframeUIConfig.placeholders = processPlaceholders(this.sfConfig.txVariant, this.sfConfig.fieldType, placeholders);\n\n /**\n * Configure, create & reference iframe and add load listener\n */\n const iframeConfig = {\n src: iframeSrc,\n title: processedAriaConfig[this.sfConfig.fieldType].iframeTitle,\n policy: 'origin'\n };\n\n const iframeEl: HTMLIFrameElement = createIframe(iframeConfig);\n\n // Place the iframe into the holder\n this.holderEl.appendChild(iframeEl);\n\n // Now examine the holder to get an actual DOM node\n const iframe: HTMLIFrameElement = selectOne(this.holderEl, '.js-iframe');\n\n if (iframe) {\n this.iframeContentWindow = iframe.contentWindow;\n\n // Create reference to bound fn (see getters/setters for binding)\n this.iframeOnLoadListener = this.iframeOnLoadListenerFn;\n\n on(iframe, 'load', this.iframeOnLoadListener, false);\n }\n\n this.iframeRef = iframe;\n\n return this;\n }\n\n iframeOnLoadListenerFn(): void {\n // Create reference to bound fn (see getters/setters for binding)\n this.postMessageListener = this.postMessageListenerFn;\n\n // Add general listener for 'message' EVENT - the event that 'powers' postMessage\n on(window, 'message', this.postMessageListener, false);\n\n // Create and send config object to iframe\n const configObj: IframeConfigObject = {\n ...this.sfConfig,\n numKey: this.numKey\n };\n\n if (window._b$dl) console.log('### SecuredField:::: onIframeLoaded:: created configObj=', configObj);\n\n postMessageToIframe(configObj, this.iframeContentWindow, this.loadingContext);\n //--\n\n // Callback to say iframe loaded\n this.onIframeLoadedCallback();\n }\n\n postMessageListenerFn(event: MessageEvent): void {\n // Check message is from expected domain\n if (!originCheckPassed(event, this.loadingContext, this.sfConfig.showWarnings)) {\n return;\n }\n\n // TODO - for debugging purposes this would always be useful to see\n // logger.log('\\n',this.sfConfig.fieldType,'### CSF SecuredField::postMessageListener:: event.data=',event.data);\n\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log(\n '\\n###CSF SecuredField::postMessageListener:: DOMAIN & ORIGIN MATCH, NO WEBPACK WEIRDNESS fieldType=',\n this.sfConfig.fieldType,\n 'txVariant=',\n this.sfConfig.txVariant,\n 'this.numKey=',\n this.numKey\n );\n }\n\n // PARSE DATA OBJECT (thus testing if it is a JSON string) - OR TRY & WORK OUT WHY THE PARSING FAILED\n let feedbackObj: SFFeedbackObj;\n\n try {\n feedbackObj = JSON.parse(event.data);\n } catch (e) {\n // Was the message generated by webpack?\n if (isWebpackPostMsg(event)) {\n if (this.sfConfig.showWarnings) logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK');\n return;\n }\n\n // Was the message generated by ChromeVox?\n if (isChromeVoxPostMsg(event)) {\n if (this.sfConfig.showWarnings) logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX');\n return;\n }\n\n if (this.sfConfig.showWarnings)\n logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=', event.data);\n return;\n }\n\n // CHECK FOR EXPECTED PROPS\n const hasMainProps: boolean = hasOwnProperty(feedbackObj, 'action') && hasOwnProperty(feedbackObj, 'numKey');\n\n if (!hasMainProps) {\n if (this.sfConfig.showWarnings) logger.warn('WARNING SecuredField :: postMessage listener for iframe :: data mismatch!');\n return;\n }\n\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log('### SecuredField::postMessageListener:: feedbackObj.numKey=', feedbackObj.numKey);\n }\n\n if (this.numKey !== feedbackObj.numKey) {\n if (this.sfConfig.showWarnings) {\n logger.warn(\n 'WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)'\n );\n }\n return;\n }\n\n // VALIDATION CHECKS PASSED - DECIDE ON COURSE OF ACTION\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log(\n '### SecuredField::postMessageListener:: numkeys match PROCEED WITH POST MESSAGE PROCESSING fieldType=',\n this.sfConfig.fieldType,\n 'txVariant=',\n this.sfConfig.txVariant\n );\n }\n\n switch (feedbackObj.action) {\n case 'encryption':\n this.isValid = true;\n this.onEncryptionCallback(feedbackObj);\n break;\n\n case 'config':\n if (window._b$dl)\n console.log('### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback', feedbackObj.fieldType);\n this.onConfigCallback(feedbackObj);\n break;\n\n case 'focus':\n this.onFocusCallback(feedbackObj);\n\n // HORRIBLE HORRIBLE HACK to get round bug in TestCafe - see comment on 3rd test in packages/e2e/tests/cards/branding/branding.test.js\n if (process.env.NODE_ENV === 'development' && window.location.origin.indexOf('3024') > -1) {\n if (window['testCafeForceClick'] === true) {\n window['testCafeForceClick'] = false;\n this.onTouchstartCallback(feedbackObj);\n }\n }\n break;\n\n case 'binValue':\n this.onBinValueCallback(feedbackObj);\n break;\n\n // iOS ONLY - RE. iOS BUGS AROUND BLUR AND FOCUS EVENTS\n case 'touch':\n this.onTouchstartCallback(feedbackObj);\n break;\n\n // Only happens for Firefox & IE <= 11\n case 'shifttab':\n this.onShiftTabCallback(feedbackObj);\n break;\n\n case 'autoComplete':\n this.onAutoCompleteCallback(feedbackObj);\n break;\n\n case 'enterKeyPressed':\n this.onKeyPressedCallback(feedbackObj);\n break;\n\n /**\n * Validate, because action =\n *\n * 'brand'\n * 'delete'\n * 'luhnCheck'\n * //'incomplete field' (an error that follows from a focus (blur) event)\n * 'incorrectly filled field' (an error that follows from a focus (blur) event) // NEW\n * 'numberKeyPressed' (or date-, month-, year-, cvc-, pin-, or iban- KeyPressed)\n * - since we have no \"error\" action \"...KeyPressed\" is the action type on most error events (other than \"incomplete field\" or \"luhnCheck\")\n * and often these error events representing the clearing of an existing error\n */\n default:\n // If we're validation handling (& not encryption handling) field must be invalid\n this.isValid = false;\n this.onValidationCallback(feedbackObj);\n }\n }\n\n destroy(): void {\n off(window, 'message', this.postMessageListener, false);\n off(this.iframeRef, 'load', this.iframeOnLoadListener, false);\n this.iframeContentWindow = null;\n removeAllChildren(this.holderEl);\n }\n\n /**\n * Returns whether the securedField is hidden OR whether it is optional and not in error\n */\n isOptionalOrHidden(): boolean {\n if (\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_DATE ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_MONTH ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_YEAR\n ) {\n switch (this.expiryDatePolicy) {\n case DATE_POLICY_HIDDEN:\n return true;\n case DATE_POLICY_OPTIONAL:\n return !this.hasError;\n default:\n return false;\n }\n }\n\n if (this.sfConfig.fieldType === ENCRYPTED_SECURITY_CODE) {\n switch (this.cvcPolicy) {\n case CVC_POLICY_HIDDEN:\n return true;\n case CVC_POLICY_OPTIONAL:\n return !this.hasError;\n default:\n return false;\n }\n }\n\n // Any other type of securedField is not optional & can't be hidden\n return false;\n }\n\n // /////// ALLOCATE CALLBACKS /////////\n onIframeLoaded(callbackFn: RtnType_noParamVoidFn): SecuredField {\n this.onIframeLoadedCallback = callbackFn;\n return this;\n }\n\n onEncryption(callbackFn: RtnType_callbackFn): SecuredField {\n this.onEncryptionCallback = callbackFn;\n return this;\n }\n\n onValidation(callbackFn: RtnType_callbackFn): SecuredField {\n this.onValidationCallback = callbackFn;\n return this;\n }\n\n onConfig(callbackFn: RtnType_callbackFn): SecuredField {\n this.onConfigCallback = callbackFn;\n return this;\n }\n\n onFocus(callbackFn: RtnType_callbackFn): SecuredField {\n this.onFocusCallback = callbackFn;\n return this;\n }\n\n onBinValue(callbackFn: RtnType_callbackFn): SecuredField {\n this.onBinValueCallback = callbackFn;\n return this;\n }\n\n onTouchstart(callbackFn: RtnType_callbackFn): SecuredField {\n this.onTouchstartCallback = callbackFn;\n return this;\n }\n\n onShiftTab(callbackFn: RtnType_callbackFn): SecuredField {\n this.onShiftTabCallback = callbackFn;\n return this;\n }\n\n onAutoComplete(callbackFn: RtnType_callbackFn): SecuredField {\n this.onAutoCompleteCallback = callbackFn;\n return this;\n }\n\n onKeyPressed(callbackFn: RtnType_callbackFn): SecuredField {\n this.onKeyPressedCallback = callbackFn;\n return this;\n }\n //------------------------------------\n\n // ///////////// GETTERS/SETTERS //////////////\n\n get errorType(): string {\n return this._errorType;\n }\n set errorType(value: string) {\n this._errorType = value;\n }\n\n get hasError(): boolean {\n return this._hasError;\n }\n set hasError(value: boolean) {\n this._hasError = value;\n }\n\n get isValid(): boolean {\n if (this.sfConfig.fieldType === ENCRYPTED_SECURITY_CODE) {\n switch (this.cvcPolicy) {\n case CVC_POLICY_HIDDEN:\n // If cvc is hidden then the field is always valid\n return true;\n case CVC_POLICY_OPTIONAL:\n // If cvc is optional then the field is always valid UNLESS it has an error\n return !this.hasError;\n default:\n return this._isValid;\n }\n }\n\n if (\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_DATE ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_MONTH ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_YEAR\n ) {\n switch (this.expiryDatePolicy) {\n case DATE_POLICY_HIDDEN:\n // If date is hidden then the field is always valid\n return true;\n case DATE_POLICY_OPTIONAL:\n // If date is optional then the field is always valid UNLESS it has an error\n return !this.hasError;\n default:\n return this._isValid;\n }\n }\n\n return this._isValid;\n }\n set isValid(value: boolean) {\n this._isValid = value;\n }\n\n get cvcPolicy(): CVCPolicyType {\n return this._cvcPolicy;\n }\n\n set cvcPolicy(value: CVCPolicyType) {\n // Only set if this is a CVC field\n if (this.sfConfig.fieldType !== ENCRYPTED_SECURITY_CODE) return;\n\n // Only set if value has changed\n if (value === this.cvcPolicy) return;\n\n if (process.env.NODE_ENV === 'development' && doLog) logger.log(this.sfConfig.fieldType, '### SecuredField::cvcPolicy:: value=', value);\n\n this._cvcPolicy = value;\n\n // If the field has changed status (required <--> not required) AND it's error state was due to an isValidated call\n // NOTE: fixes issue in Components where you first validate and then start typing a maestro number\n // - w/o this and the fix in CSF the maestro PM will never register as valid\n if (this.hasError && this.errorType === 'isValidated') {\n this.hasError = false;\n }\n }\n\n get expiryDatePolicy(): DatePolicyType {\n return this._expiryDatePolicy;\n }\n\n set expiryDatePolicy(value: DatePolicyType) {\n // Only set if this is a date field type of securedField\n if (\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_DATE &&\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_MONTH &&\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_YEAR\n )\n return;\n\n // Only set if value has changed\n if (value === this.expiryDatePolicy) return;\n\n if (process.env.NODE_ENV === 'development' && doLog) logger.log(this.sfConfig.fieldType, '### SecuredField:expiryDatePolicy:: value=', value);\n\n this._expiryDatePolicy = value;\n\n // If the field has changed status (required <--> not required) AND it's error state was due to an isValidated call\n if (this.hasError && this.errorType === 'isValidated') {\n this.hasError = false;\n }\n }\n\n get iframeContentWindow(): Window {\n return this._iframeContentWindow;\n }\n set iframeContentWindow(value: Window) {\n this._iframeContentWindow = value;\n }\n\n get isEncrypted(): boolean {\n return this._isEncrypted;\n }\n set isEncrypted(value: boolean) {\n this._isEncrypted = value;\n }\n\n get numKey(): number {\n return this._numKey;\n }\n set numKey(value: number) {\n this._numKey = value;\n }\n\n // Internal use - way to create listener refs that we can add/remove\n get iframeOnLoadListener(): RtnType_noParamVoidFn {\n return this._iframeOnLoadListener;\n }\n set iframeOnLoadListener(value: RtnType_noParamVoidFn) {\n this._iframeOnLoadListener = value.bind(this);\n }\n\n get postMessageListener(): RtnType_postMessageListener {\n return this._postMessageListener;\n }\n set postMessageListener(value: RtnType_postMessageListener) {\n this._postMessageListener = value.bind(this);\n }\n}\n\nexport default SecuredField;\n"],"names":["SecuredField","AbstractSecuredField","constructor","pSetupObj","i18n","super","configVarsFromSetUpObj","reject","from","this","sfConfig","iframeUIConfig","iframeSrc","placeholders","showContextualElement","loadingContext","holderEl","isValid","iframeContentWindow","numKey","generateRandomNumber","isEncrypted","hasError","errorType","cvcPolicy","expiryDatePolicy","init","processedAriaConfig","processAriaConfig","txVariant","fieldType","ariaConfig","processPlaceholders","iframeConfig","src","title","iframeTitle","policy","iframeEl","createIframe","appendChild","iframe","selectOne","contentWindow","iframeOnLoadListener","iframeOnLoadListenerFn","on","iframeRef","postMessageListener","postMessageListenerFn","window","configObj","_b$dl","console","log","postMessageToIframe","onIframeLoadedCallback","event","originCheckPassed","showWarnings","feedbackObj","JSON","parse","data","e","isWebpackPostMsg","logger","isChromeVoxPostMsg","hasOwnProperty","action","onEncryptionCallback","onConfigCallback","onFocusCallback","onBinValueCallback","onTouchstartCallback","onShiftTabCallback","onAutoCompleteCallback","onKeyPressedCallback","onValidationCallback","destroy","off","removeAllChildren","isOptionalOrHidden","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","ENCRYPTED_SECURITY_CODE","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","onIframeLoaded","callbackFn","onEncryption","onValidation","onConfig","onFocus","onBinValue","onTouchstart","onShiftTab","onAutoComplete","onKeyPressed","_errorType","value","_hasError","_isValid","_cvcPolicy","_expiryDatePolicy","_iframeContentWindow","_isEncrypted","_numKey","_iframeOnLoadListener","bind","_postMessageListener"],"mappings":"ygCA+BA,MAAMA,UAAqBC,EACvBC,WAAAA,CAAYC,EAAoCC,GAC5CC,QAMA,MAMMC,EAAyBC,EANC,CAAC,iBAAkB,WAAY,YAAa,wBAAyB,iBAMhDC,KAAKL,GAG1DM,KAAKC,SAAW,IAETJ,EAEHK,eAAgB,IAAKL,EAAuBK,iBAMhD,MAAMC,UAAEA,EAASC,aAAEA,EAAYC,sBAAEA,GAA0BX,EAgC3D,OA3BAM,KAAKM,eAAiBZ,EAAUY,eAChCN,KAAKO,SAAWb,EAAUa,SAK1BP,KAAKQ,SAAU,EACfR,KAAKS,oBAAsB,KAC3BT,KAAKU,OAASC,IACdX,KAAKY,aAAc,EACnBZ,KAAKa,UAAW,EAChBb,KAAKc,UAAY,GACjBd,KAAKe,UAAYrB,EAAU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,"file":"SecuredField.js","sources":["../../../../../../../src/components/internal/SecuredFields/lib/securedField/SecuredField.ts"],"sourcesContent":["import * as logger from '../utilities/logger';\nimport createIframe from './utils/createIframe';\nimport { removeAllChildren, selectOne } from '../utilities/dom';\nimport { off, on } from '../../../../../utils/listenerUtils';\nimport postMessageToIframe from '../CSF/utils/iframes/postMessageToIframe';\nimport { isChromeVoxPostMsg, isWebpackPostMsg, originCheckPassed } from '../CSF/utils/iframes/postMessageValidation';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE\n} from '../constants';\nimport { generateRandomNumber } from '../utilities/commonUtils';\nimport { CVCPolicyType, DatePolicyType, RtnType_callbackFn, RtnType_noParamVoidFn, RtnType_postMessageListener, SFFeedbackObj } from '../types';\nimport AbstractSecuredField from './AbstractSecuredField';\nimport { AriaConfig, IframeConfigObject, SecuredFieldSetupObject, SecuredFieldCommonProps } from '../types';\nimport { reject } from '../../../../../utils/commonUtils';\nimport { processAriaConfig } from './utils/processAriaConfig';\nimport { processPlaceholders } from './utils/processPlaceholders';\nimport Language from '../../../../../language/Language';\nimport { hasOwnProperty } from '../../../../../utils/hasOwnProperty';\nimport { Placeholders } from '../../SFP/types';\nimport './SecuredField.scss';\n\nconst logPostMsg = false;\nconst doLog = false;\n\nclass SecuredField extends AbstractSecuredField {\n constructor(pSetupObj: SecuredFieldSetupObject, i18n: Language) {\n super();\n\n /**\n * List of props to exclude from being set on this.sfConfig.\n * These props are only required for internal purposes. They do not get sent to the iframe\n */\n const deltaPropsArr: string[] = ['loadingContext', 'holderEl', 'iframeSrc', 'showContextualElement', 'placeholders'];\n\n /**\n * List of props from setup object that will be set on this.sfConfig\n * These props will all end up being sent to the iframe\n */\n const configVarsFromSetUpObj = reject(deltaPropsArr).from(pSetupObj);\n\n // Copy passed setup object values to this.sfConfig\n this.sfConfig = {\n // ...this.sfConfig, // Do we need to do this? Pretty sure we don't\n ...configVarsFromSetUpObj,\n // Break references on iframeUIConfig object so we can overwrite its properties in each securedField instance\n iframeUIConfig: { ...configVarsFromSetUpObj.iframeUIConfig }\n } as SecuredFieldCommonProps;\n\n /**\n * Extract values only needed for init\n */\n const { iframeSrc, placeholders, showContextualElement } = pSetupObj;\n\n /**\n * Store those passed setup object values that are needed in multiple functions\n */\n this.loadingContext = pSetupObj.loadingContext;\n this.holderEl = pSetupObj.holderEl;\n\n /**\n * Initiate other values on 'this' through setters\n */\n this.isValid = false;\n this.iframeContentWindow = null;\n this.numKey = generateRandomNumber();\n this.isEncrypted = false;\n this.hasError = false;\n this.errorType = '';\n this.cvcPolicy = pSetupObj.cvcPolicy;\n this.expiryDatePolicy = pSetupObj.expiryDatePolicy;\n\n if (process.env.NODE_ENV === 'development' && doLog) {\n logger.log(\n '### SecuredField::constructor:: this.sfConfig.fieldType=',\n this.sfConfig.fieldType,\n 'isValid=',\n this._isValid,\n 'numKey=',\n this.numKey\n );\n logger.log('\\n');\n }\n\n return this.init(i18n, iframeSrc, placeholders, showContextualElement);\n }\n\n init(i18n: Language, iframeSrc: string, placeholders: Placeholders, showContextualElement: boolean): SecuredField {\n /**\n * Ensure all fields have a related ariaConfig object containing, at minimum, an iframeTitle property and a (translated) errors object\n */\n const processedAriaConfig: AriaConfig = processAriaConfig(this.sfConfig.txVariant, this.sfConfig.fieldType, i18n, showContextualElement);\n // Set result back onto config object\n this.sfConfig.iframeUIConfig.ariaConfig = processedAriaConfig;\n\n // Set result back onto config object\n this.sfConfig.iframeUIConfig.placeholders = processPlaceholders(this.sfConfig.txVariant, this.sfConfig.fieldType, placeholders);\n\n /**\n * Configure, create & reference iframe and add load listener\n */\n const iframeConfig = {\n src: iframeSrc,\n title: processedAriaConfig[this.sfConfig.fieldType].iframeTitle,\n policy: 'origin'\n };\n\n const iframeEl: HTMLIFrameElement = createIframe(iframeConfig);\n\n // Place the iframe into the holder\n this.holderEl.appendChild(iframeEl);\n\n // Now examine the holder to get an actual DOM node\n const iframe: HTMLIFrameElement = selectOne(this.holderEl, '.js-iframe');\n\n if (iframe) {\n this.iframeContentWindow = iframe.contentWindow;\n\n // Create reference to bound fn (see getters/setters for binding)\n this.iframeOnLoadListener = this.iframeOnLoadListenerFn;\n\n on(iframe, 'load', this.iframeOnLoadListener, false);\n }\n\n this.iframeRef = iframe;\n\n return this;\n }\n\n iframeOnLoadListenerFn(): void {\n // Create reference to bound fn (see getters/setters for binding)\n this.postMessageListener = this.postMessageListenerFn;\n\n // Add general listener for 'message' EVENT - the event that 'powers' postMessage\n on(window, 'message', this.postMessageListener, false);\n\n // Create and send config object to iframe\n const configObj: IframeConfigObject = {\n ...this.sfConfig,\n numKey: this.numKey\n };\n\n if (window._b$dl) console.log('### SecuredField:::: onIframeLoaded:: created configObj=', configObj);\n\n postMessageToIframe(configObj, this.iframeContentWindow, this.loadingContext);\n //--\n\n // Callback to say iframe loaded\n this.onIframeLoadedCallback();\n }\n\n postMessageListenerFn(event: MessageEvent): void {\n // Check message is from expected domain\n if (!originCheckPassed(event, this.loadingContext, this.sfConfig.showWarnings)) {\n return;\n }\n\n // TODO - for debugging purposes this would always be useful to see\n // logger.log('\\n',this.sfConfig.fieldType,'### CSF SecuredField::postMessageListener:: event.data=',event.data);\n\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log(\n '\\n###CSF SecuredField::postMessageListener:: DOMAIN & ORIGIN MATCH, NO WEBPACK WEIRDNESS fieldType=',\n this.sfConfig.fieldType,\n 'txVariant=',\n this.sfConfig.txVariant,\n 'this.numKey=',\n this.numKey\n );\n }\n\n // PARSE DATA OBJECT (thus testing if it is a JSON string) - OR TRY & WORK OUT WHY THE PARSING FAILED\n let feedbackObj: SFFeedbackObj;\n\n try {\n feedbackObj = JSON.parse(event.data);\n } catch (e) {\n // Was the message generated by webpack?\n if (isWebpackPostMsg(event)) {\n if (this.sfConfig.showWarnings) logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK');\n return;\n }\n\n // Was the message generated by ChromeVox?\n if (isChromeVoxPostMsg(event)) {\n if (this.sfConfig.showWarnings) logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX');\n return;\n }\n\n if (this.sfConfig.showWarnings)\n logger.log('### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=', event.data);\n return;\n }\n\n // CHECK FOR EXPECTED PROPS\n const hasMainProps: boolean = hasOwnProperty(feedbackObj, 'action') && hasOwnProperty(feedbackObj, 'numKey');\n\n if (!hasMainProps) {\n if (this.sfConfig.showWarnings) logger.warn('WARNING SecuredField :: postMessage listener for iframe :: data mismatch!');\n return;\n }\n\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log('### SecuredField::postMessageListener:: feedbackObj.numKey=', feedbackObj.numKey);\n }\n\n if (this.numKey !== feedbackObj.numKey) {\n if (this.sfConfig.showWarnings) {\n logger.warn(\n 'WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)'\n );\n }\n return;\n }\n\n // VALIDATION CHECKS PASSED - DECIDE ON COURSE OF ACTION\n if (process.env.NODE_ENV === 'development' && logPostMsg) {\n logger.log(\n '### SecuredField::postMessageListener:: numkeys match PROCEED WITH POST MESSAGE PROCESSING fieldType=',\n this.sfConfig.fieldType,\n 'txVariant=',\n this.sfConfig.txVariant\n );\n }\n\n switch (feedbackObj.action) {\n case 'encryption':\n this.isValid = true;\n this.onEncryptionCallback(feedbackObj);\n break;\n\n case 'config':\n if (window._b$dl)\n console.log('### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback', feedbackObj.fieldType);\n this.onConfigCallback(feedbackObj);\n break;\n\n case 'focus':\n this.onFocusCallback(feedbackObj);\n\n // HORRIBLE HORRIBLE HACK to get round bug in TestCafe - see comment on 3rd test in packages/e2e/tests/cards/branding/branding.test.js\n if (process.env.NODE_ENV === 'development' && window.location.origin.indexOf('3024') > -1) {\n if (window['testCafeForceClick'] === true) {\n window['testCafeForceClick'] = false;\n this.onTouchstartCallback(feedbackObj);\n }\n }\n break;\n\n case 'binValue':\n this.onBinValueCallback(feedbackObj);\n break;\n\n // iOS ONLY - RE. iOS BUGS AROUND BLUR AND FOCUS EVENTS\n case 'touch':\n this.onTouchstartCallback(feedbackObj);\n break;\n\n // Only happens for Firefox & IE <= 11\n case 'shifttab':\n this.onShiftTabCallback(feedbackObj);\n break;\n\n case 'autoComplete':\n this.onAutoCompleteCallback(feedbackObj);\n break;\n\n case 'enterKeyPressed':\n this.onKeyPressedCallback(feedbackObj);\n break;\n\n /**\n * Validate, because action =\n *\n * 'brand'\n * 'delete'\n * 'luhnCheck'\n * //'incomplete field' (an error that follows from a focus (blur) event)\n * 'incorrectly filled field' (an error that follows from a focus (blur) event) // NEW\n * 'numberKeyPressed' (or date-, month-, year-, cvc-, pin-, or iban- KeyPressed)\n * - since we have no \"error\" action \"...KeyPressed\" is the action type on most error events (other than \"incomplete field\" or \"luhnCheck\")\n * and often these error events representing the clearing of an existing error\n */\n default:\n // If we're validation handling (& not encryption handling) field must be invalid\n this.isValid = false;\n this.onValidationCallback(feedbackObj);\n }\n }\n\n destroy(): void {\n off(window, 'message', this.postMessageListener, false);\n off(this.iframeRef, 'load', this.iframeOnLoadListener, false);\n this.iframeContentWindow = null;\n removeAllChildren(this.holderEl);\n }\n\n /**\n * Returns whether the securedField is hidden OR whether it is optional and not in error\n */\n isOptionalOrHidden(): boolean {\n if (\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_DATE ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_MONTH ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_YEAR\n ) {\n switch (this.expiryDatePolicy) {\n case DATE_POLICY_HIDDEN:\n return true;\n case DATE_POLICY_OPTIONAL:\n return !this.hasError;\n default:\n return false;\n }\n }\n\n if (this.sfConfig.fieldType === ENCRYPTED_SECURITY_CODE) {\n switch (this.cvcPolicy) {\n case CVC_POLICY_HIDDEN:\n return true;\n case CVC_POLICY_OPTIONAL:\n return !this.hasError;\n default:\n return false;\n }\n }\n\n // Any other type of securedField is not optional & can't be hidden\n return false;\n }\n\n // /////// ALLOCATE CALLBACKS /////////\n onIframeLoaded(callbackFn: RtnType_noParamVoidFn): SecuredField {\n this.onIframeLoadedCallback = callbackFn;\n return this;\n }\n\n onEncryption(callbackFn: RtnType_callbackFn): SecuredField {\n this.onEncryptionCallback = callbackFn;\n return this;\n }\n\n onValidation(callbackFn: RtnType_callbackFn): SecuredField {\n this.onValidationCallback = callbackFn;\n return this;\n }\n\n onConfig(callbackFn: RtnType_callbackFn): SecuredField {\n this.onConfigCallback = callbackFn;\n return this;\n }\n\n onFocus(callbackFn: RtnType_callbackFn): SecuredField {\n this.onFocusCallback = callbackFn;\n return this;\n }\n\n onBinValue(callbackFn: RtnType_callbackFn): SecuredField {\n this.onBinValueCallback = callbackFn;\n return this;\n }\n\n onTouchstart(callbackFn: RtnType_callbackFn): SecuredField {\n this.onTouchstartCallback = callbackFn;\n return this;\n }\n\n onShiftTab(callbackFn: RtnType_callbackFn): SecuredField {\n this.onShiftTabCallback = callbackFn;\n return this;\n }\n\n onAutoComplete(callbackFn: RtnType_callbackFn): SecuredField {\n this.onAutoCompleteCallback = callbackFn;\n return this;\n }\n\n onKeyPressed(callbackFn: RtnType_callbackFn): SecuredField {\n this.onKeyPressedCallback = callbackFn;\n return this;\n }\n //------------------------------------\n\n // ///////////// GETTERS/SETTERS //////////////\n\n get errorType(): string {\n return this._errorType;\n }\n set errorType(value: string) {\n this._errorType = value;\n }\n\n get hasError(): boolean {\n return this._hasError;\n }\n set hasError(value: boolean) {\n this._hasError = value;\n }\n\n get isValid(): boolean {\n if (this.sfConfig.fieldType === ENCRYPTED_SECURITY_CODE) {\n switch (this.cvcPolicy) {\n case CVC_POLICY_HIDDEN:\n // If cvc is hidden then the field is always valid\n return true;\n case CVC_POLICY_OPTIONAL:\n // If cvc is optional then the field is always valid UNLESS it has an error\n return !this.hasError;\n default:\n return this._isValid;\n }\n }\n\n if (\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_DATE ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_MONTH ||\n this.sfConfig.fieldType === ENCRYPTED_EXPIRY_YEAR\n ) {\n switch (this.expiryDatePolicy) {\n case DATE_POLICY_HIDDEN:\n // If date is hidden then the field is always valid\n return true;\n case DATE_POLICY_OPTIONAL:\n // If date is optional then the field is always valid UNLESS it has an error\n return !this.hasError;\n default:\n return this._isValid;\n }\n }\n\n return this._isValid;\n }\n set isValid(value: boolean) {\n this._isValid = value;\n }\n\n get cvcPolicy(): CVCPolicyType {\n return this._cvcPolicy;\n }\n\n set cvcPolicy(value: CVCPolicyType) {\n // Only set if this is a CVC field\n if (this.sfConfig.fieldType !== ENCRYPTED_SECURITY_CODE) return;\n\n // Only set if value has changed\n if (value === this.cvcPolicy) return;\n\n if (process.env.NODE_ENV === 'development' && doLog) logger.log(this.sfConfig.fieldType, '### SecuredField::cvcPolicy:: value=', value);\n\n this._cvcPolicy = value;\n\n // If the field has changed status (required <--> not required) AND it's error state was due to an isValidated call\n // NOTE: fixes issue in Components where you first validate and then start typing a maestro number\n // - w/o this and the fix in CSF the maestro PM will never register as valid\n if (this.hasError && this.errorType === 'isValidated') {\n this.hasError = false;\n }\n }\n\n get expiryDatePolicy(): DatePolicyType {\n return this._expiryDatePolicy;\n }\n\n set expiryDatePolicy(value: DatePolicyType) {\n // Only set if this is a date field type of securedField\n if (\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_DATE &&\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_MONTH &&\n this.sfConfig.fieldType !== ENCRYPTED_EXPIRY_YEAR\n )\n return;\n\n // Only set if value has changed\n if (value === this.expiryDatePolicy) return;\n\n if (process.env.NODE_ENV === 'development' && doLog) logger.log(this.sfConfig.fieldType, '### SecuredField:expiryDatePolicy:: value=', value);\n\n this._expiryDatePolicy = value;\n\n // If the field has changed status (required <--> not required) AND it's error state was due to an isValidated call\n if (this.hasError && this.errorType === 'isValidated') {\n this.hasError = false;\n }\n }\n\n get iframeContentWindow(): Window {\n return this._iframeContentWindow;\n }\n set iframeContentWindow(value: Window) {\n this._iframeContentWindow = value;\n }\n\n get isEncrypted(): boolean {\n return this._isEncrypted;\n }\n set isEncrypted(value: boolean) {\n this._isEncrypted = value;\n }\n\n get numKey(): number {\n return this._numKey;\n }\n set numKey(value: number) {\n this._numKey = value;\n }\n\n // Internal use - way to create listener refs that we can add/remove\n get iframeOnLoadListener(): RtnType_noParamVoidFn {\n return this._iframeOnLoadListener;\n }\n set iframeOnLoadListener(value: RtnType_noParamVoidFn) {\n this._iframeOnLoadListener = value.bind(this);\n }\n\n get postMessageListener(): RtnType_postMessageListener {\n return this._postMessageListener;\n }\n set postMessageListener(value: RtnType_postMessageListener) {\n this._postMessageListener = value.bind(this);\n }\n}\n\nexport default SecuredField;\n"],"names":["SecuredField","AbstractSecuredField","init","i18n","iframeSrc","placeholders","showContextualElement","processedAriaConfig","processAriaConfig","this","sfConfig","txVariant","fieldType","iframeUIConfig","ariaConfig","processPlaceholders","iframeConfig","src","title","iframeTitle","policy","iframeEl","createIframe","holderEl","appendChild","iframe","selectOne","iframeContentWindow","contentWindow","iframeOnLoadListener","iframeOnLoadListenerFn","on","iframeRef","postMessageListener","postMessageListenerFn","window","configObj","numKey","_b$dl","console","log","postMessageToIframe","loadingContext","onIframeLoadedCallback","event","originCheckPassed","showWarnings","feedbackObj","JSON","parse","data","e","isWebpackPostMsg","logger","isChromeVoxPostMsg","hasOwnProperty","action","isValid","onEncryptionCallback","onConfigCallback","onFocusCallback","onBinValueCallback","onTouchstartCallback","onShiftTabCallback","onAutoCompleteCallback","onKeyPressedCallback","onValidationCallback","destroy","off","removeAllChildren","isOptionalOrHidden","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","expiryDatePolicy","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","hasError","ENCRYPTED_SECURITY_CODE","cvcPolicy","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","onIframeLoaded","callbackFn","onEncryption","onValidation","onConfig","onFocus","onBinValue","onTouchstart","onShiftTab","onAutoComplete","onKeyPressed","errorType","_errorType","value","_hasError","_isValid","_cvcPolicy","_expiryDatePolicy","_iframeContentWindow","isEncrypted","_isEncrypted","_numKey","_iframeOnLoadListener","bind","_postMessageListener","constructor","pSetupObj","super","configVarsFromSetUpObj","reject","from","generateRandomNumber"],"mappings":"ygCA+BA,MAAMA,UAAqBC,EA8DvBC,IAAAA,CAAKC,EAAgBC,EAAmBC,EAA4BC,GAIhE,MAAMC,EAAkCC,EAAkBC,KAAKC,SAASC,UAAWF,KAAKC,SAASE,UAAWT,EAAMG,GAElHG,KAAKC,SAASG,eAAeC,WAAaP,EAG1CE,KAAKC,SAASG,eAAeR,aAAeU,EAAoBN,KAAKC,SAASC,UAAWF,KAAKC,SAASE,UAAWP,GAKlH,MAAMW,EAAe,CACjBC,IAAKb,EACLc,MAAOX,EAAoBE,KAAKC,SAASE,WAAWO,YACpDC,OAAQ,UAGNC,EAA8BC,EAAaN,GAGjDP,KAAKc,SAASC,YAAYH,GAG1B,MAAMI,EAA4BC,EAAUjB,KAAKc,SAAU,cAa3D,OAXIE,IACAhB,KAAKkB,oBAAsBF,EAAOG,cAGlCnB,KAAKoB,qBAAuBpB,KAAKqB,uBAEjCC,EAAGN,EAAQ,OAAQhB,KAAKoB,sBAAsB,IAGlDpB,KAAKuB,UAAYP,EAEVhB,IACX,CAEAqB,sBAAAA,GAEIrB,KAAKwB,oBAAsBxB,KAAKyB,sBAGhCH,EAAGI,OAAQ,UAAW1B,KAAKwB,qBAAqB,GAGhD,MAAMG,EAAgC,IAC/B3B,KAAKC,SACR2B,OAAQ5B,KAAK4B,Q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AI1D,GACA,OAAO5B,KAAK8F,OAChB,CACA,UAAIlE,CAAO0D,GACPtF,KAAK8F,QAAUR,CACnB,CAGA,wBAAIlE,GACA,OAAOpB,KAAK+F,qBAChB,CACA,wBAAI3E,CAAqBkE,GACrBtF,KAAK+F,sBAAwBT,EAAMU,KAAKhG,KAC5C,CAEA,uBAAIwB,GACA,OAAOxB,KAAKiG,oBAChB,CACA,uBAAIzE,CAAoB8D,GACpBtF,KAAKiG,qBAAuBX,EAAMU,KAAKhG,KAC3C,CA7eAkG,WAAAA,CAAYC,EAAoCzG,GAC5C0G,QAMA,MAMMC,EAAyBC,EANC,CAAC,iBAAkB,WAAY,YAAa,wBAAyB,iBAMhDC,KAAKJ,GAG1DnG,KAAKC,SAAW,IAEToG,EAEHjG,eAAgB,IAAKiG,EAAuBjG,iBAMhD,MAAMT,UAAEA,EAASC,aAAEA,EAAYC,sBAAEA,GAA0BsG,EAgC3D,OA3BAnG,KAAKiC,eAAiBkE,EAAUlE,eAChCjC,KAAKc,SAAWqF,EAAUrF,SAK1Bd,KAAKgD,SAAU,EACfhD,KAAKkB,oBAAsB,KAC3BlB,KAAK4B,OAAS4E,IACdxG,KAAK4F,aAAc,EACnB5F,KAAKoE,UAAW,EAChBpE,KAAKoF,UAAY,GACjBpF,KAAKsE,UAAY6B,EAAU7B,UAC3BtE,KAAKiE,iBAAmBkC,EAAUlC,iBAc3BjE,KAAKP,KAAKC,EAAMC,EAAWC,EAAcC,EACpD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";const t=({instructions:t})=>t&&0!==t.length?e("div",{className:"adyen-checkout-timeline"},e("ol",{className:"adyen-checkout-timeline__items"},t.map(((t,i)=>e("li",{className:"adyen-checkout-timeline-item",key:i},e("div",{className:"adyen-checkout-timeline-item__row"},e("div",{"aria-hidden":"true",className:"adyen-checkout-timeline-item__marker"},e("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("path",{fill:"#00112C",d:"M5.5 3.25C4.25736 3.25 3.25 4.25736 3.25 5.5V10.5C3.25 11.7426 4.25736 12.75 5.5 12.75H10.5C11.7426 12.75 12.75 11.7426 12.75 10.5V5.5C12.75 4.25736 11.7426 3.25 10.5 3.25H5.5Z"})),e("div",{className:"adyen-checkout-timeline-item__separator"})),e("div",{className:"adyen-checkout-timeline-item__content"},e("div",{className:"adyen-checkout-timeline-item__title"},t)))))))):null;export{t as Timeline};
|
|
2
|
+
//# sourceMappingURL=Timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.js","sources":["../../../../../src/components/internal/Timeline/Timeline.tsx"],"sourcesContent":["import { h } from 'preact';\nimport './Timeline.scss';\n\ninterface Timeline {\n instructions: string[];\n}\n\nconst Timeline = ({ instructions }: Timeline) => {\n if (!instructions || instructions.length === 0) {\n return null;\n }\n\n return (\n <div className=\"adyen-checkout-timeline\">\n <ol className=\"adyen-checkout-timeline__items\">\n {instructions.map((value, index) => (\n <li className=\"adyen-checkout-timeline-item\" key={index}>\n <div className=\"adyen-checkout-timeline-item__row\">\n <div aria-hidden=\"true\" className=\"adyen-checkout-timeline-item__marker\">\n <svg role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\">\n <path\n fill=\"#00112C\"\n d=\"M5.5 3.25C4.25736 3.25 3.25 4.25736 3.25 5.5V10.5C3.25 11.7426 4.25736 12.75 5.5 12.75H10.5C11.7426 12.75 12.75 11.7426 12.75 10.5V5.5C12.75 4.25736 11.7426 3.25 10.5 3.25H5.5Z\"\n ></path>\n </svg>\n <div className=\"adyen-checkout-timeline-item__separator\"></div>\n </div>\n <div className=\"adyen-checkout-timeline-item__content\">\n <div className=\"adyen-checkout-timeline-item__title\">{value}</div>\n </div>\n </div>\n </li>\n ))}\n </ol>\n </div>\n );\n};\n\nexport { Timeline };\n"],"names":["Timeline","instructions","length","h","div","className","ol","map","value","index","li","key","aria-hidden","svg","role","xmlns","width","height","fill","path","d"],"mappings":"wEAOA,MAAMA,EAAW,EAAGC,kBACXA,GAAwC,IAAxBA,EAAaC,OAK9BC,EAACC,MAAAA,CAAIC,UAAU,2BACXF,EAACG,KAAAA,CAAGD,UAAU,kCACTJ,EAAaM,KAAI,CAACC,EAAOC,IACtBN,EAACO,KAAAA,CAAGL,UAAU,+BAA+BM,IAAKF,GAC9CN,EAACC,MAAAA,CAAIC,UAAU,qCACXF,EAACC,MAAAA,CAAIQ,cAAY,OAAOP,UAAU,wCAC9BF,EAACU,MAAAA,CAAIC,KAAK,MAAMC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,KAAKC,KAAK,QAC3Ef,EAACgB,OAAAA,CACGD,KAAK,UACLE,EAAE,sLAGVjB,EAACC,MAAAA,CAAIC,UAAU,6CAEnBF,EAACC,MAAAA,CAAIC,UAAU,yCACXF,EAACC,MAAAA,CAAIC,UAAU,uCAAuCG,UAnBvE"}
|