@adyen/adyen-web 6.31.0 → 6.32.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 +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +265 -224
- package/dist/es/components/ANCV/ANCV.js.map +1 -1
- package/dist/es/components/ANCV/components/ANCVInput.js.map +1 -1
- package/dist/es/components/Ach/Ach.js.map +1 -1
- package/dist/es/components/Ach/components/AccountTypeSelector.js.map +1 -1
- package/dist/es/components/Ach/components/AchComponent.js.map +1 -1
- package/dist/es/components/Address/Address.js.map +1 -1
- package/dist/es/components/Affirm/Affirm.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPayB2B.js.map +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es/components/AmazonPay/components/ChangePaymentDetailsButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es/components/ApplePay/utils/payment-request.js +1 -1
- package/dist/es/components/Atome/Atome.js.map +1 -1
- package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
- package/dist/es/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es/components/Blik/Blik.js.map +1 -1
- package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
- package/dist/es/components/Boleto/Boleto.js.map +1 -1
- package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js.map +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/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardHolderName.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/DataSfSpan.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/handlers.js +1 -1
- package/dist/es/components/Card/components/CardInput/handlers.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es/components/Card/components/ClickToPayHolder.js.map +1 -1
- package/dist/es/components/Card/components/ClickToPayWrapper.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/InfoModal.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/USOnlyPhoneInput.js.map +1 -1
- package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es/components/ClickToPay/ClickToPay.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es/components/Doku/Doku.js.map +1 -1
- package/dist/es/components/Doku/components/DokuVoucherResult/DokuVoucherResult.js.map +1 -1
- package/dist/es/components/Donation/Donation.js.map +1 -1
- package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
- package/dist/es/components/Donation/components/CampaignInfo.js.map +1 -1
- package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es/components/Donation/components/Roundup.js.map +1 -1
- package/dist/es/components/Dotpay/index.js.map +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es/components/Dropin/Dropin.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinSuccessState.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodBrands/PaymentMethodBrands.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodDetails.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es/components/DuitNow/DuitNow.js.map +1 -1
- package/dist/es/components/EPS/index.js.map +1 -1
- package/dist/es/components/Econtext/Econtext.js.map +1 -1
- package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay6x.js.map +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/Giftcard/components/GiftcardFields.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es/components/Giftcard/components/useSRPanelForGiftcardErrors.js +1 -1
- package/dist/es/components/Giftcard/components/useSRPanelForGiftcardErrors.js.map +1 -1
- package/dist/es/components/Giropay/Giropay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es/components/GooglePay/requests.js +1 -1
- package/dist/es/components/GooglePay/requests.js.map +1 -1
- package/dist/es/components/GooglePay/utils.js +1 -1
- package/dist/es/components/GooglePay/utils.js.map +1 -1
- package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
- package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
- package/dist/es/components/MBWay/MBWay.js.map +1 -1
- package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingMY.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingTH.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingVN.js.map +1 -1
- package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es/components/Multibanco/components/MultibancoVoucherResult/MultibancoVoucherResult.js.map +1 -1
- package/dist/es/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es/components/OnlineBankingFI/OnlineBankingFI.js.map +1 -1
- package/dist/es/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
- package/dist/es/components/PayByBank/PayByBank.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es/components/PayMe/PayMe.js.map +1 -1
- package/dist/es/components/PayNow/PayNow.js.map +1 -1
- package/dist/es/components/PayPal/Paypal.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es/components/PayPalFastlane/components/FaslaneCardBrandIcon.js.map +1 -1
- package/dist/es/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
- package/dist/es/components/PayTo/PayTo.js.map +1 -1
- package/dist/es/components/PayTo/components/BSBInput.js.map +1 -1
- package/dist/es/components/PayTo/components/IdentifierSelector.js.map +1 -1
- package/dist/es/components/PayTo/components/MandateSummary.js.map +1 -1
- package/dist/es/components/PayTo/components/PayIDInput.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -1
- package/dist/es/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es/components/Pix/Pix.js.map +1 -1
- package/dist/es/components/Pix/components/PixInput/PixInput.js.map +1 -1
- package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
- package/dist/es/components/PromptPay/PromptPay.js.map +1 -1
- package/dist/es/components/RatePay/RatePay.js.map +1 -1
- package/dist/es/components/RatePay/RatePayDirectDebit.js.map +1 -1
- package/dist/es/components/Redirect/Redirect.js.map +1 -1
- package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
- package/dist/es/components/Riverty/Riverty.js.map +1 -1
- package/dist/es/components/Sepa/Sepa.js.map +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/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.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.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.map +1 -1
- package/dist/es/components/Trustly/Trustly.js.map +1 -1
- package/dist/es/components/Twint/Twint.js.map +1 -1
- package/dist/es/components/UPI/UPI.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es/components/UPI/components/UPIMandate/UPIMandate.js.map +1 -1
- package/dist/es/components/Vipps/Vipps.js.map +1 -1
- package/dist/es/components/WalletIN/index.js.map +1 -1
- package/dist/es/components/WeChat/WeChat.js.map +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
- package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
- package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es/components/internal/Await/Await.js.map +1 -1
- package/dist/es/components/internal/Await/components/AwaitFinalState.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/Brand/Brand.js.map +1 -1
- package/dist/es/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
- package/dist/es/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
- package/dist/es/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es/components/internal/Countdown/index.js.map +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputEmail.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputText.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es/components/internal/Img/Img.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es/components/internal/Link/Link.js.map +1 -1
- package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es/components/internal/PayButton/PayButton.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRCountdown.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRFinalState.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRImage.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRIntructions.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRProgressbar.js.map +1 -1
- package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.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/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.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/SecuredFields/lib/securedField/utils/createIframe.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/createIframe.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/utils.js +1 -1
- package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -1
- package/dist/es/components/internal/Spinner/Spinner.js.map +1 -1
- package/dist/es/components/internal/StoreDetails/StoreDetails.js.map +1 -1
- package/dist/es/components/internal/Timeline/Timeline.js.map +1 -1
- package/dist/es/components/internal/Timeline/TimelineWrapper.js.map +1 -1
- package/dist/es/components/internal/Toggle/Toggle.js.map +1 -1
- package/dist/es/components/internal/Tooltip/SingletonTooltipProvider.js.map +1 -1
- package/dist/es/components/internal/Tooltip/Tooltip.js.map +1 -1
- package/dist/es/components/internal/Tooltip/TooltipController.js.map +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/core/Analytics/Analytics.js +1 -1
- package/dist/es/core/Analytics/Analytics.js.map +1 -1
- package/dist/es/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es/core/Context/AmountProvider.js.map +1 -1
- package/dist/es/core/Context/CoreProvider.js.map +1 -1
- package/dist/es/core/Environment/Environment.js +1 -1
- package/dist/es/core/Environment/Environment.js.map +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es/core/Errors/SRMessages.js.map +1 -1
- package/dist/es/core/Errors/SRPanel.js.map +1 -1
- package/dist/es/core/Errors/SRPanelProvider.js.map +1 -1
- package/dist/es/core/Errors/utils.js +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.map +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js.map +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/external/preact/compat/dist/compat.js +1 -1
- package/dist/es/external/preact/compat/dist/compat.js.map +1 -1
- package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es/index.d.ts +265 -224
- package/dist/es/index.js +1 -1
- package/dist/es/utils/getOrigin.js +1 -1
- package/dist/es/utils/setFocus.js +1 -1
- package/dist/es/utils/setFocus.js.map +1 -1
- package/dist/es/utils/windowScrollTo.js +2 -0
- package/dist/es/utils/windowScrollTo.js.map +1 -0
- package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
- package/dist/es-legacy/components/ANCV/components/ANCVInput.js.map +1 -1
- package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AccountTypeSelector.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AchComponent.js.map +1 -1
- package/dist/es-legacy/components/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/ChangePaymentDetailsButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/utils/payment-request.js +1 -1
- package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
- package/dist/es-legacy/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
- package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
- package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
- package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
- package/dist/es-legacy/components/Card/Card.js +1 -1
- package/dist/es-legacy/components/Card/Card.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardHolderName.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/DataSfSpan.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/handlers.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/handlers.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es-legacy/components/Card/components/ClickToPayHolder.js.map +1 -1
- package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/InfoModal.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/USOnlyPhoneInput.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
- package/dist/es-legacy/components/Doku/components/DokuVoucherResult/DokuVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/CampaignInfo.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -1
- package/dist/es-legacy/components/Dotpay/index.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinSuccessState.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodBrands/PaymentMethodBrands.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodDetails.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es-legacy/components/DuitNow/DuitNow.js.map +1 -1
- package/dist/es-legacy/components/EPS/index.js.map +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
- package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/useSRPanelForGiftcardErrors.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/useSRPanelForGiftcardErrors.js.map +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/requests.js +1 -1
- package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/utils.js +1 -1
- package/dist/es-legacy/components/GooglePay/utils.js.map +1 -1
- package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingMY.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingTH.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingVN.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/components/MultibancoVoucherResult/MultibancoVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingFI/OnlineBankingFI.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -1
- package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es-legacy/components/PayMe/PayMe.js.map +1 -1
- package/dist/es-legacy/components/PayNow/PayNow.js.map +1 -1
- package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/components/FaslaneCardBrandIcon.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
- package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/MandateSummary.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayIDInput.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
- package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js.map +1 -1
- package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
- package/dist/es-legacy/components/PromptPay/PromptPay.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
- package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
- package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
- package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
- package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
- package/dist/es-legacy/components/Swish/Swish.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
- package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
- package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIMandate/UPIMandate.js.map +1 -1
- package/dist/es-legacy/components/Vipps/Vipps.js.map +1 -1
- package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
- package/dist/es-legacy/components/WeChat/WeChat.js.map +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es-legacy/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
- package/dist/es-legacy/components/internal/Await/components/AwaitFinalState.js.map +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es-legacy/components/internal/Brand/Brand.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
- package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es-legacy/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es-legacy/components/internal/Link/Link.js.map +1 -1
- package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRCountdown.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRFinalState.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRImage.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRIntructions.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRProgressbar.js.map +1 -1
- package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/createIframe.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/createIframe.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -1
- package/dist/es-legacy/components/internal/Spinner/Spinner.js.map +1 -1
- package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/Timeline/Timeline.js.map +1 -1
- package/dist/es-legacy/components/internal/Timeline/TimelineWrapper.js.map +1 -1
- package/dist/es-legacy/components/internal/Toggle/Toggle.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/SingletonTooltipProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/Tooltip.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/TooltipController.js.map +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es-legacy/core/Context/AmountProvider.js.map +1 -1
- package/dist/es-legacy/core/Context/CoreProvider.js.map +1 -1
- package/dist/es-legacy/core/Environment/Environment.js +1 -1
- package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
- package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRMessages.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRPanelProvider.js.map +1 -1
- package/dist/es-legacy/core/Errors/utils.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
- package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/core/core.js +1 -1
- package/dist/es-legacy/core/core.js.map +1 -1
- package/dist/es-legacy/external/preact/compat/dist/compat.js +1 -1
- package/dist/es-legacy/external/preact/compat/dist/compat.js.map +1 -1
- package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es-legacy/index.js +1 -1
- package/dist/es-legacy/utils/getOrigin.js +1 -1
- package/dist/es-legacy/utils/setFocus.js +1 -1
- package/dist/es-legacy/utils/setFocus.js.map +1 -1
- package/dist/es-legacy/utils/windowScrollTo.js +2 -0
- package/dist/es-legacy/utils/windowScrollTo.js.map +1 -0
- package/package.json +18 -19
- package/dist/es/utils/getProp.js +0 -2
- package/dist/es/utils/getProp.js.map +0 -1
- package/dist/es-legacy/utils/getProp.js +0 -2
- package/dist/es-legacy/utils/getProp.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentMethodList.js","sources":["../../../../../../src/components/Dropin/components/PaymentMethod/PaymentMethodList.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport
|
|
1
|
+
{"version":3,"file":"PaymentMethodList.js","sources":["../../../../../../src/components/Dropin/components/PaymentMethod/PaymentMethodList.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport UIElement from '../../../internal/UIElement/UIElement';\nimport { Order, OrderStatus } from '../../../../types/global-types';\nimport OrderPaymentMethods from './OrderPaymentMethods';\nimport { InstantPaymentMethods } from './InstantPaymentMethods';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { useBrandLogoConfiguration } from './useBrandLogoConfiguration';\nimport PaymentMethodsContainer, { PaymentMethodsContainerProps } from './PaymentMethodsContainer';\nimport { useEffect } from 'preact/hooks';\n\ninterface PaymentMethodListProps extends Omit<PaymentMethodsContainerProps, 'label' | 'classNameModifiers'> {\n instantPaymentMethods?: UIElement[];\n storedPaymentMethods?: UIElement[];\n openFirstStoredPaymentMethod?: boolean;\n openFirstPaymentMethod?: boolean;\n openPaymentMethod?: {\n type: string;\n };\n order?: Order;\n orderStatus?: OrderStatus;\n onOrderCancel?: (order) => void;\n}\n\nconst PaymentMethodList = ({\n paymentMethods,\n instantPaymentMethods,\n storedPaymentMethods,\n openFirstStoredPaymentMethod,\n openFirstPaymentMethod,\n openPaymentMethod,\n order,\n orderStatus = null,\n onOrderCancel,\n onSelect = () => {},\n ...rest\n}: Readonly<PaymentMethodListProps>) => {\n const { i18n } = useCoreContext();\n const brandLogoConfiguration = useBrandLogoConfiguration(paymentMethods);\n const hasInstantPaymentMethods = instantPaymentMethods?.length > 0;\n const hasStoredPaymentMethods = storedPaymentMethods?.length > 0;\n const pmListLabel = hasInstantPaymentMethods || hasStoredPaymentMethods ? i18n.get('paymentMethodsList.otherPayments.label') : '';\n\n useEffect(() => {\n if (openPaymentMethod?.type) {\n const paymentMethod = paymentMethods?.find(paymentMethod => paymentMethod.type === openPaymentMethod?.type);\n if (!paymentMethod) {\n console.warn(`Drop-in: payment method type \"${openPaymentMethod?.type}\" not found`);\n } else {\n onSelect(paymentMethod);\n return;\n }\n }\n\n // Open first PaymentMethodItem\n const firstStoredPayment = storedPaymentMethods?.[0];\n const firstNonStoredPayment = paymentMethods?.[0];\n\n if (firstStoredPayment || firstNonStoredPayment) {\n const shouldOpenFirstStored = openFirstStoredPaymentMethod && firstStoredPayment?.props?.oneClick === true;\n if (shouldOpenFirstStored) {\n onSelect(firstStoredPayment);\n return;\n }\n\n if (openFirstPaymentMethod) {\n onSelect(firstNonStoredPayment);\n }\n }\n }, [storedPaymentMethods, paymentMethods, openFirstStoredPaymentMethod, openFirstPaymentMethod, openPaymentMethod]);\n\n return (\n <Fragment>\n {orderStatus && (\n <OrderPaymentMethods\n order={order}\n orderStatus={orderStatus}\n onOrderCancel={onOrderCancel}\n brandLogoConfiguration={brandLogoConfiguration}\n />\n )}\n\n {hasInstantPaymentMethods && <InstantPaymentMethods paymentMethods={instantPaymentMethods} onSelect={onSelect} />}\n\n {hasStoredPaymentMethods && (\n <PaymentMethodsContainer\n {...rest}\n label={i18n.get('paymentMethodsList.storedPayments.label')}\n classNameModifiers={['storedPayments']}\n paymentMethods={storedPaymentMethods}\n onSelect={onSelect}\n ></PaymentMethodsContainer>\n )}\n\n {!!paymentMethods.length && (\n <PaymentMethodsContainer\n {...rest}\n label={pmListLabel}\n classNameModifiers={['otherPayments']}\n paymentMethods={paymentMethods}\n onSelect={onSelect}\n ></PaymentMethodsContainer>\n )}\n </Fragment>\n );\n};\n\nexport default PaymentMethodList;\n"],"names":["PaymentMethodList","paymentMethods","instantPaymentMethods","storedPaymentMethods","openFirstStoredPaymentMethod","openFirstPaymentMethod","openPaymentMethod","order","orderStatus","onOrderCancel","onSelect","rest","i18n","useCoreContext","brandLogoConfiguration","useBrandLogoConfiguration","hasInstantPaymentMethods","length","hasStoredPaymentMethods","pmListLabel","get","useEffect","type","paymentMethod","find","console","warn","firstStoredPayment","firstNonStoredPayment","props","oneClick","h","Fragment","OrderPaymentMethods","InstantPaymentMethods","PaymentMethodsContainer","label","classNameModifiers"],"mappings":"weAuBA,MAAMA,EAAoB,EACtBC,iBACAC,wBACAC,uBACAC,+BACAC,yBACAC,oBACAC,QACAC,cAAc,KACdC,gBACAC,WAAW,UACRC,MAEH,MAAMC,KAAEA,GAASC,IACXC,EAAyBC,EAA0Bd,GACnDe,EAA2Bd,GAAuBe,OAAS,EAC3DC,EAA0Bf,GAAsBc,OAAS,EACzDE,EAAcH,GAA4BE,EAA0BN,EAAKQ,IAAI,0CAA4C,GA8B/H,OA5BAC,EAAU,KACN,GAAIf,GAAmBgB,KAAM,CACzB,MAAMC,EAAgBtB,GAAgBuB,KAAKD,GAAiBA,EAAcD,OAAShB,GAAmBgB,MACtG,GAAKC,EAID,YADAb,EAASa,GAFTE,QAAQC,KAAK,iCAAiCpB,GAAmBgB,kBAKzE,CAGA,MAAMK,EAAqBxB,IAAuB,GAC5CyB,EAAwB3B,IAAiB,GAE/C,GAAI0B,GAAsBC,EAAuB,CAE7C,GAD8BxB,IAAwE,IAAxCuB,GAAoBE,OAAOC,SAGrF,YADApB,EAASiB,GAITtB,GACAK,EAASkB,EAEjB,GACD,CAACzB,EAAsBF,EAAgBG,EAA8BC,EAAwBC,IAG5FyB,EAACC,EAAAA,KACIxB,GACGuB,EAACE,EAAAA,CACG1B,MAAOA,EACPC,YAAaA,EACbC,cAAeA,EACfK,uBAAwBA,IAI/BE,GAA4Be,EAACG,EAAAA,CAAsBjC,eAAgBC,EAAuBQ,SAAUA,IAEpGQ,GACGa,EAACI,EAAAA,IACOxB,EACJyB,MAAOxB,EAAKQ,IAAI,2CAChBiB,mBAAoB,CAAC,kBACrBpC,eAAgBE,EAChBO,SAAUA,MAIfT,EAAegB,QACdc,EAACI,EAAAA,IACOxB,EACJyB,MAAOjB,EACPkB,mBAAoB,CAAC,iBACrBpC,eAAgBA,EAChBS,SAAUA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuitNow.js","sources":["../../../../src/components/DuitNow/DuitNow.ts"],"sourcesContent":["import QRLoaderContainer from '../helpers/QRLoaderContainer/QRLoaderContainer';\nimport { delay, countdownTime } from './config';\nimport { TxVariants } from '../tx-variants';\n\nclass DuitNowElement extends QRLoaderContainer {\n public static type = TxVariants.duitnow;\n\n formatProps(props) {\n return {\n delay,\n countdownTime,\n ...super.formatProps(props)\n };\n }\n}\n\nexport default DuitNowElement;\n"],"names":["DuitNowElement","QRLoaderContainer","formatProps","props","delay","countdownTime","super","type","TxVariants","duitnow"],"mappings":"uKAIA,MAAMA,UAAuBC,EAGzBC,WAAAA,CAAYC,GACR,MAAO,CACHC,QACAC,mBACGC,MAAMJ,YAAYC,GAE7B,cATEH,
|
|
1
|
+
{"version":3,"file":"DuitNow.js","sources":["../../../../src/components/DuitNow/DuitNow.ts"],"sourcesContent":["import QRLoaderContainer from '../helpers/QRLoaderContainer/QRLoaderContainer';\nimport { delay, countdownTime } from './config';\nimport { TxVariants } from '../tx-variants';\n\nclass DuitNowElement extends QRLoaderContainer {\n public static readonly type = TxVariants.duitnow;\n\n formatProps(props) {\n return {\n delay,\n countdownTime,\n ...super.formatProps(props)\n };\n }\n}\n\nexport default DuitNowElement;\n"],"names":["DuitNowElement","QRLoaderContainer","formatProps","props","delay","countdownTime","super","type","TxVariants","duitnow"],"mappings":"uKAIA,MAAMA,UAAuBC,EAGzBC,WAAAA,CAAYC,GACR,MAAO,CACHC,QACAC,mBACGC,MAAMJ,YAAYC,GAE7B,cATEH,IACqBO,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/EPS/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nclass EPSElement extends IssuerListContainer {\n public static type = TxVariants.eps;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: false\n };\n }\n}\n\nexport default EPSElement;\n"],"names":["EPSElement","IssuerListContainer","formatProps","props","super","showImage","type","TxVariants","eps"],"mappings":"oHAGA,MAAMA,UAAmBC,EAGrBC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EAEnB,cAREL,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/EPS/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nclass EPSElement extends IssuerListContainer {\n public static readonly type = TxVariants.eps;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: false\n };\n }\n}\n\nexport default EPSElement;\n"],"names":["EPSElement","IssuerListContainer","formatProps","props","super","showImage","type","TxVariants","eps"],"mappings":"oHAGA,MAAMA,UAAmBC,EAGrBC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EAEnB,cAREL,IACqBM,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Econtext.js","sources":["../../../../src/components/Econtext/Econtext.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport EcontextInput from './components/EcontextInput';\nimport EcontextVoucherResult from './components/EcontextVoucherResult';\nimport { TxVariants } from '../tx-variants';\nimport { EcontextConfiguration } from './types';\n\nexport class EcontextElement extends UIElement<EcontextConfiguration> {\n public static readonly type = TxVariants.econtext;\n public static readonly txVariants = [\n TxVariants.econtext,\n TxVariants.econtext_atm,\n TxVariants.econtext_online,\n TxVariants.econtext_seven_eleven,\n TxVariants.econtext_stores\n ];\n\n protected static defaultProps = {\n personalDetailsRequired: true\n };\n\n get isValid() {\n if (!this.props.personalDetailsRequired) {\n return true;\n }\n return !!this.state.isValid;\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n ...this.state.data,\n paymentMethod: {\n type: this.type\n }\n };\n }\n\n protected override componentToRender(): h.JSX.Element {\n return this.props.reference ? (\n <EcontextVoucherResult\n reference={this.props.reference}\n totalAmount={this.props.totalAmount}\n expiresAt={this.props.expiresAt}\n paymentMethodType={this.props.paymentMethodType}\n maskedTelephoneNumber={this.props.maskedTelephoneNumber}\n instructionsUrl={this.props.instructionsUrl}\n alternativeReference={this.props.alternativeReference}\n collectionInstitutionNumber={this.props.collectionInstitutionNumber}\n onActionHandled={this.onActionHandled}\n />\n ) : (\n <EcontextInput\n setComponentRef={this.setComponentRef}\n data={this.props.data}\n personalDetailsRequired={this.props.personalDetailsRequired}\n showPayButton={this.props.showPayButton}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n );\n }\n}\n\nexport default EcontextElement;\n"],"names":["EcontextElement","UIElement","isValid","this","props","personalDetailsRequired","state","formatData","data","paymentMethod","type","componentToRender","reference","h","EcontextVoucherResult","totalAmount","expiresAt","paymentMethodType","maskedTelephoneNumber","instructionsUrl","alternativeReference","collectionInstitutionNumber","onActionHandled","EcontextInput","setComponentRef","showPayButton","onChange","setState","onSubmit","submit","payButton","_define_property","TxVariants","econtext","txVariants","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","defaultProps"],"mappings":"ibAOO,MAAMA,UAAwBC,EAcjC,WAAIC,GACA,OAAKC,KAAKC,MAAMC,2BAGPF,KAAKG,MAAMJ,OACxB,CAKAK,UAAAA,GACI,MAAO,IACAJ,KAAKG,MAAME,KACdC,cAAe,CACXC,KAAMP,KAAKO,MAGvB,CAEmBC,iBAAAA,GACf,OAAOR,KAAKC,MAAMQ,UACdC,EAACC,EAAAA,CACGF,UAAWT,KAAKC,MAAMQ,UACtBG,YAAaZ,KAAKC,MAAMW,YACxBC,UAAWb,KAAKC,MAAMY,UACtBC,kBAAmBd,KAAKC,MAAMa,kBAC9BC,sBAAuBf,KAAKC,MAAMc,sBAClCC,gBAAiBhB,KAAKC,MAAMe,gBAC5BC,qBAAsBjB,KAAKC,MAAMgB,qBACjCC,4BAA6BlB,KAAKC,MAAMiB,4BACxCC,gBAAiBnB,KAAKmB,kBAG1BT,EAACU,EAAAA,CACGC,gBAAiBrB,KAAKqB,gBACtBhB,KAAML,KAAKC,MAAMI,KACjBH,wBAAyBF,KAAKC,MAAMC,wBACpCoB,cAAetB,KAAKC,MAAMqB,cAC1BC,SAAUvB,KAAKwB,SACfC,SAAUzB,KAAK0B,OACfC,UAAW3B,KAAK2B,WAG5B,EAxDAC,EADS/B,EACcU,OAAOsB,EAAWC,UACzCF,EAFS/B,EAEckC,aAAa,CAChCF,EAAWC,SACXD,EAAWG,aACXH,EAAWI,gBACXJ,EAAWK,sBACXL,EAAWM,kBAGfP,EAVS/B,
|
|
1
|
+
{"version":3,"file":"Econtext.js","sources":["../../../../src/components/Econtext/Econtext.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport EcontextInput from './components/EcontextInput';\nimport EcontextVoucherResult from './components/EcontextVoucherResult';\nimport { TxVariants } from '../tx-variants';\nimport { EcontextConfiguration } from './types';\n\nexport class EcontextElement extends UIElement<EcontextConfiguration> {\n public static readonly type = TxVariants.econtext;\n public static readonly txVariants = [\n TxVariants.econtext,\n TxVariants.econtext_atm,\n TxVariants.econtext_online,\n TxVariants.econtext_seven_eleven,\n TxVariants.econtext_stores\n ];\n\n protected static readonly defaultProps = {\n personalDetailsRequired: true\n };\n\n get isValid() {\n if (!this.props.personalDetailsRequired) {\n return true;\n }\n return !!this.state.isValid;\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n ...this.state.data,\n paymentMethod: {\n type: this.type\n }\n };\n }\n\n protected override componentToRender(): h.JSX.Element {\n return this.props.reference ? (\n <EcontextVoucherResult\n reference={this.props.reference}\n totalAmount={this.props.totalAmount}\n expiresAt={this.props.expiresAt}\n paymentMethodType={this.props.paymentMethodType}\n maskedTelephoneNumber={this.props.maskedTelephoneNumber}\n instructionsUrl={this.props.instructionsUrl}\n alternativeReference={this.props.alternativeReference}\n collectionInstitutionNumber={this.props.collectionInstitutionNumber}\n onActionHandled={this.onActionHandled}\n />\n ) : (\n <EcontextInput\n setComponentRef={this.setComponentRef}\n data={this.props.data}\n personalDetailsRequired={this.props.personalDetailsRequired}\n showPayButton={this.props.showPayButton}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n );\n }\n}\n\nexport default EcontextElement;\n"],"names":["EcontextElement","UIElement","isValid","this","props","personalDetailsRequired","state","formatData","data","paymentMethod","type","componentToRender","reference","h","EcontextVoucherResult","totalAmount","expiresAt","paymentMethodType","maskedTelephoneNumber","instructionsUrl","alternativeReference","collectionInstitutionNumber","onActionHandled","EcontextInput","setComponentRef","showPayButton","onChange","setState","onSubmit","submit","payButton","_define_property","TxVariants","econtext","txVariants","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","defaultProps"],"mappings":"ibAOO,MAAMA,UAAwBC,EAcjC,WAAIC,GACA,OAAKC,KAAKC,MAAMC,2BAGPF,KAAKG,MAAMJ,OACxB,CAKAK,UAAAA,GACI,MAAO,IACAJ,KAAKG,MAAME,KACdC,cAAe,CACXC,KAAMP,KAAKO,MAGvB,CAEmBC,iBAAAA,GACf,OAAOR,KAAKC,MAAMQ,UACdC,EAACC,EAAAA,CACGF,UAAWT,KAAKC,MAAMQ,UACtBG,YAAaZ,KAAKC,MAAMW,YACxBC,UAAWb,KAAKC,MAAMY,UACtBC,kBAAmBd,KAAKC,MAAMa,kBAC9BC,sBAAuBf,KAAKC,MAAMc,sBAClCC,gBAAiBhB,KAAKC,MAAMe,gBAC5BC,qBAAsBjB,KAAKC,MAAMgB,qBACjCC,4BAA6BlB,KAAKC,MAAMiB,4BACxCC,gBAAiBnB,KAAKmB,kBAG1BT,EAACU,EAAAA,CACGC,gBAAiBrB,KAAKqB,gBACtBhB,KAAML,KAAKC,MAAMI,KACjBH,wBAAyBF,KAAKC,MAAMC,wBACpCoB,cAAetB,KAAKC,MAAMqB,cAC1BC,SAAUvB,KAAKwB,SACfC,SAAUzB,KAAK0B,OACfC,UAAW3B,KAAK2B,WAG5B,EAxDAC,EADS/B,EACcU,OAAOsB,EAAWC,UACzCF,EAFS/B,EAEckC,aAAa,CAChCF,EAAWC,SACXD,EAAWG,aACXH,EAAWI,gBACXJ,EAAWK,sBACXL,EAAWM,kBAGfP,EAVS/B,EAUiBuC,eAAe,CACrClC,yBAAyB"}
|
package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcontextVoucherResult.js","sources":["../../../../../../src/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport Voucher from '../../../internal/Voucher';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { EcontextVoucherResultProps } from '../../types';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst EcontextVoucherResult = (props: EcontextVoucherResultProps) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { expiresAt, maskedTelephoneNumber, instructionsUrl, collectionInstitutionNumber, alternativeReference, reference } = props;\n\n const hasAlternativeReference = Boolean(alternativeReference);\n\n const alternativeReferenceDetails = useMemo(\n () => [\n { label: i18n.get('voucher.collectionInstitutionNumber'), value: collectionInstitutionNumber },\n { label: i18n.get('econtext.customerNumber'), value: reference },\n { label: i18n.get('econtext.confirmationNumber'), value: alternativeReference },\n { label: i18n.get('econtext.useBefore'), value: i18n.date(expiresAt) }\n ],\n [i18n, collectionInstitutionNumber, reference, alternativeReference, expiresAt]\n );\n\n const standardVoucherDetails = useMemo(\n () => [\n { label: i18n.get('voucher.collectionInstitutionNumber'), value: collectionInstitutionNumber },\n { label: i18n.get('voucher.expirationDate'), value: i18n.dateTime(expiresAt) },\n { label: i18n.get('voucher.telephoneNumber'), value: maskedTelephoneNumber }\n ],\n [i18n, collectionInstitutionNumber, expiresAt, maskedTelephoneNumber]\n );\n\n const voucherDetails = hasAlternativeReference ? alternativeReferenceDetails : standardVoucherDetails;\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({ props, i18n, introKey: 'voucher.introduction.econtext', getImage: getImage() })}\n instructionsUrl={instructionsUrl}\n paymentReferenceLabel={hasAlternativeReference ? i18n.get('econtext.paymentInformation') : undefined}\n voucherDetails={voucherDetails}\n copyBtn={!hasAlternativeReference}\n showReferenceValue={!hasAlternativeReference}\n />\n );\n};\n\nexport default EcontextVoucherResult;\n"],"names":["EcontextVoucherResult","props","i18n","useCoreContext","getImage","useImage","expiresAt","maskedTelephoneNumber","instructionsUrl","collectionInstitutionNumber","alternativeReference","reference","hasAlternativeReference","Boolean","alternativeReferenceDetails","useMemo","label","get","value","date","standardVoucherDetails","dateTime","voucherDetails","h","Voucher","extractCommonPropsForVoucher","introKey","paymentReferenceLabel","undefined","copyBtn","showReferenceValue"],"mappings":"yZASA,MAAMA,EAAyBC,IAC3B,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,UAAEA,EAASC,sBAAEA,EAAqBC,gBAAEA,EAAeC,4BAAEA,EAA2BC,qBAAEA,EAAoBC,UAAEA,GAAcV,EAEtHW,EAA0BC,QAAQH,GAElCI,EAA8BC,EAChC,IAAM,CACF,CAAEC,MAAOd,EAAKe,IAAI,uCAAwCC,MAAOT,GACjE,CAAEO,MAAOd,EAAKe,IAAI,2BAA4BC,MAAOP,GACrD,CAAEK,MAAOd,EAAKe,IAAI,+BAAgCC,MAAOR,GACzD,CAAEM,MAAOd,EAAKe,IAAI,sBAAuBC,MAAOhB,EAAKiB,KAAKb,KAE9D,CAACJ,EAAMO,EAA6BE,EAAWD,EAAsBJ,IAGnEc,EAAyBL,EAC3B,IAAM,CACF,CAAEC,MAAOd,EAAKe,IAAI,uCAAwCC,MAAOT,GACjE,CAAEO,MAAOd,EAAKe,IAAI,0BAA2BC,MAAOhB,EAAKmB,SAASf,IAClE,CAAEU,MAAOd,EAAKe,IAAI,2BAA4BC,MAAOX,IAEzD,CAACL,EAAMO,EAA6BH,EAAWC,IAG7Ce,EAAiBV,EAA0BE,EAA8BM,EAE/E,OACIG,EAACC,EAAAA,IACOC,EAA6B,CAAExB,QAAOC,OAAMwB,SAAU,gCAAiCtB,SAAUA,MACrGI,gBAAiBA,EACjBmB,sBAAuBf,EAA0BV,EAAKe,IAAI,oCAAiCW,EAC3FN,eAAgBA,EAChBO,SAAUjB,EACVkB,oBAAqBlB"}
|
|
1
|
+
{"version":3,"file":"EcontextVoucherResult.js","sources":["../../../../../../src/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport Voucher from '../../../internal/Voucher';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { EcontextVoucherResultProps } from '../../types';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst EcontextVoucherResult = (props: Readonly<EcontextVoucherResultProps>) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { expiresAt, maskedTelephoneNumber, instructionsUrl, collectionInstitutionNumber, alternativeReference, reference } = props;\n\n const hasAlternativeReference = Boolean(alternativeReference);\n\n const alternativeReferenceDetails = useMemo(\n () => [\n { label: i18n.get('voucher.collectionInstitutionNumber'), value: collectionInstitutionNumber },\n { label: i18n.get('econtext.customerNumber'), value: reference },\n { label: i18n.get('econtext.confirmationNumber'), value: alternativeReference },\n { label: i18n.get('econtext.useBefore'), value: i18n.date(expiresAt) }\n ],\n [i18n, collectionInstitutionNumber, reference, alternativeReference, expiresAt]\n );\n\n const standardVoucherDetails = useMemo(\n () => [\n { label: i18n.get('voucher.collectionInstitutionNumber'), value: collectionInstitutionNumber },\n { label: i18n.get('voucher.expirationDate'), value: i18n.dateTime(expiresAt) },\n { label: i18n.get('voucher.telephoneNumber'), value: maskedTelephoneNumber }\n ],\n [i18n, collectionInstitutionNumber, expiresAt, maskedTelephoneNumber]\n );\n\n const voucherDetails = hasAlternativeReference ? alternativeReferenceDetails : standardVoucherDetails;\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({ props, i18n, introKey: 'voucher.introduction.econtext', getImage: getImage() })}\n instructionsUrl={instructionsUrl}\n paymentReferenceLabel={hasAlternativeReference ? i18n.get('econtext.paymentInformation') : undefined}\n voucherDetails={voucherDetails}\n copyBtn={!hasAlternativeReference}\n showReferenceValue={!hasAlternativeReference}\n />\n );\n};\n\nexport default EcontextVoucherResult;\n"],"names":["EcontextVoucherResult","props","i18n","useCoreContext","getImage","useImage","expiresAt","maskedTelephoneNumber","instructionsUrl","collectionInstitutionNumber","alternativeReference","reference","hasAlternativeReference","Boolean","alternativeReferenceDetails","useMemo","label","get","value","date","standardVoucherDetails","dateTime","voucherDetails","h","Voucher","extractCommonPropsForVoucher","introKey","paymentReferenceLabel","undefined","copyBtn","showReferenceValue"],"mappings":"yZASA,MAAMA,EAAyBC,IAC3B,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,UAAEA,EAASC,sBAAEA,EAAqBC,gBAAEA,EAAeC,4BAAEA,EAA2BC,qBAAEA,EAAoBC,UAAEA,GAAcV,EAEtHW,EAA0BC,QAAQH,GAElCI,EAA8BC,EAChC,IAAM,CACF,CAAEC,MAAOd,EAAKe,IAAI,uCAAwCC,MAAOT,GACjE,CAAEO,MAAOd,EAAKe,IAAI,2BAA4BC,MAAOP,GACrD,CAAEK,MAAOd,EAAKe,IAAI,+BAAgCC,MAAOR,GACzD,CAAEM,MAAOd,EAAKe,IAAI,sBAAuBC,MAAOhB,EAAKiB,KAAKb,KAE9D,CAACJ,EAAMO,EAA6BE,EAAWD,EAAsBJ,IAGnEc,EAAyBL,EAC3B,IAAM,CACF,CAAEC,MAAOd,EAAKe,IAAI,uCAAwCC,MAAOT,GACjE,CAAEO,MAAOd,EAAKe,IAAI,0BAA2BC,MAAOhB,EAAKmB,SAASf,IAClE,CAAEU,MAAOd,EAAKe,IAAI,2BAA4BC,MAAOX,IAEzD,CAACL,EAAMO,EAA6BH,EAAWC,IAG7Ce,EAAiBV,EAA0BE,EAA8BM,EAE/E,OACIG,EAACC,EAAAA,IACOC,EAA6B,CAAExB,QAAOC,OAAMwB,SAAU,gCAAiCtB,SAAUA,MACrGI,gBAAiBA,EACjBmB,sBAAuBf,EAA0BV,EAAKe,IAAI,oCAAiCW,EAC3FN,eAAgBA,EAChBO,SAAUjB,EACVkB,oBAAqBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilyPay10x.js","sources":["../../../../src/components/FacilyPay/FacilyPay10x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay10x extends OpenInvoiceContainer {\n public static type = TxVariants.facilypay_10x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay10x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_10x"],"mappings":"sKAIe,MAAMA,UAAqBC,EAGtCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,
|
|
1
|
+
{"version":3,"file":"FacilyPay10x.js","sources":["../../../../src/components/FacilyPay/FacilyPay10x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay10x extends OpenInvoiceContainer {\n public static readonly type = TxVariants.facilypay_10x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay10x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_10x"],"mappings":"sKAIe,MAAMA,UAAqBC,EAGtCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,IACMQ,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilyPay12x.js","sources":["../../../../src/components/FacilyPay/FacilyPay12x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay12x extends OpenInvoiceContainer {\n public static type = TxVariants.facilypay_12x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay12x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_12x"],"mappings":"sKAIe,MAAMA,UAAqBC,EAGtCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,
|
|
1
|
+
{"version":3,"file":"FacilyPay12x.js","sources":["../../../../src/components/FacilyPay/FacilyPay12x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay12x extends OpenInvoiceContainer {\n public static readonly type = TxVariants.facilypay_12x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay12x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_12x"],"mappings":"sKAIe,MAAMA,UAAqBC,EAGtCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,IACMQ,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilyPay3x.js","sources":["../../../../src/components/FacilyPay/FacilyPay3x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay3x extends OpenInvoiceContainer {\n public static type = TxVariants.facilypay_3x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay3x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_3x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,
|
|
1
|
+
{"version":3,"file":"FacilyPay3x.js","sources":["../../../../src/components/FacilyPay/FacilyPay3x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay3x extends OpenInvoiceContainer {\n public static readonly type = TxVariants.facilypay_3x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay3x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_3x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,IACMQ,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilyPay4x.js","sources":["../../../../src/components/FacilyPay/FacilyPay4x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay4x extends OpenInvoiceContainer {\n public static type = TxVariants.facilypay_4x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay4x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_4x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,
|
|
1
|
+
{"version":3,"file":"FacilyPay4x.js","sources":["../../../../src/components/FacilyPay/FacilyPay4x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay4x extends OpenInvoiceContainer {\n public static readonly type = TxVariants.facilypay_4x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay4x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_4x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,IACMQ,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilyPay6x.js","sources":["../../../../src/components/FacilyPay/FacilyPay6x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay6x extends OpenInvoiceContainer {\n public static type = TxVariants.facilypay_6x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay6x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_6x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,
|
|
1
|
+
{"version":3,"file":"FacilyPay6x.js","sources":["../../../../src/components/FacilyPay/FacilyPay6x.ts"],"sourcesContent":["import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport { ALLOWED_COUNTRIES } from './config';\nimport { TxVariants } from '../tx-variants';\n\nexport default class FacilyPay6x extends OpenInvoiceContainer {\n public static readonly type = TxVariants.facilypay_6x;\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n allowedCountries: props.countryCode ? [props.countryCode] : ALLOWED_COUNTRIES\n };\n }\n}\n"],"names":["FacilyPay6x","OpenInvoiceContainer","formatProps","props","super","allowedCountries","countryCode","ALLOWED_COUNTRIES","type","TxVariants","facilypay_6x"],"mappings":"sKAIe,MAAMA,UAAoBC,EAGrCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,iBAAkBF,EAAMG,YAAc,CAACH,EAAMG,aAAeC,EAEpE,cARiBP,IACMQ,SAAOC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Giftcard.js","sources":["../../../../src/components/Giftcard/Giftcard.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport GiftcardComponent from './components/GiftcardComponent';\nimport PayButton from '../internal/PayButton';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { PaymentAmount } from '../../types/global-types';\nimport { GiftCardElementData, GiftCardConfiguration, balanceCheckResponseType, GiftCardBalanceCheckErrorType } from './types';\nimport { TxVariants } from '../tx-variants';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\n\nexport class GiftcardElement extends UIElement<GiftCardConfiguration> {\n public static type = TxVariants.giftcard;\n\n protected componentRef: GiftcardComponent | undefined;\n\n protected static defaultProps = {\n brandsConfiguration: {}\n };\n\n formatProps(props) {\n return {\n ...props?.configuration,\n ...props\n };\n }\n\n formatData(): GiftCardElementData {\n return {\n paymentMethod: {\n type: this.constructor['type'],\n brand: this.props.brand,\n encryptedCardNumber: this.state.data?.encryptedCardNumber,\n encryptedSecurityCode: this.state.data?.encryptedSecurityCode\n }\n };\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.brandsConfiguration[this.props.brand]?.icon || this.props.icon || this.resources.getImage()(this.props.brand);\n }\n\n get displayName() {\n return this.props.brandsConfiguration[this.props.brand]?.name || this.props.name;\n }\n\n private setBalanceCheckError(errorMessage: GiftCardBalanceCheckErrorType | null): void {\n this.componentRef?.setBalanceCheckErrors?.(errorMessage);\n }\n\n private handleBalanceCheck = (data: GiftCardElementData): Promise<balanceCheckResponseType> => {\n if (this.props.onBalanceCheck) {\n return new Promise((resolve, reject) => {\n void this.props.onBalanceCheck(resolve, reject, data);\n });\n }\n\n if (this.props.session) {\n return this.props.session.checkBalance(data);\n }\n };\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n void this.props.onOrderRequest(resolve, reject, data);\n });\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n public balanceCheck() {\n return this.onBalanceCheck();\n }\n\n private onBalanceCheck = (): void => {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n // skip balance check if no onBalanceCheck event has been defined\n const hasBalanceCheck = this.props.session || this.props.onBalanceCheck;\n if (!hasBalanceCheck) return super.submit();\n\n this.setStatus('loading');\n\n this.handleBalanceCheck(this.formatData())\n .then(({ balance, transactionLimit = {} as PaymentAmount }) => {\n // Clear any previous balance check errors on success\n this.setBalanceCheckError(null);\n\n // We still need to throw these errors, otherwise it would be a breaking changing\n if (!balance) throw new Error('card-error'); // card doesn't exist\n if (balance?.currency !== this.props.amount?.currency) throw new Error('currency-error');\n if (balance?.value <= 0) throw new Error('no-balance');\n\n if (this.props.amount.value > balance.value || this.props.amount.value > transactionLimit.value) {\n if (this.props.order) {\n return this.makeSubmitCall();\n }\n\n return this.onOrderRequest(this.data).then((order: { orderData: string; pspReference: string }) => {\n this.setState({ order: { orderData: order.orderData, pspReference: order.pspReference } });\n return this.makeSubmitCall();\n });\n } else {\n return this.handleOnRequiringConfirmation(balance, transactionLimit);\n }\n })\n .catch(error => {\n // Simply pass the raw error message to setBalanceCheckError\n this.setBalanceCheckError(error?.message);\n\n // Still call handleError for other side effects (analytics, onError callback)\n if (error instanceof AdyenCheckoutError) {\n this.handleError(error);\n } else {\n this.handleError(new AdyenCheckoutError('ERROR', error));\n }\n });\n };\n\n /**\n * Check if it should call onRequiringConfirmation\n */\n private handleOnRequiringConfirmation = (balance, transactionLimit): Promise<any> => {\n this.componentRef.setBalance({ balance, transactionLimit });\n this.setStatus('ready');\n\n // 1. if we show pay button we don't need to ask for confirmation\n if (this.props.showPayButton) {\n return;\n }\n // 2. there's no callback, we throw error\n if (!this.props.onRequiringConfirmation) {\n throw new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'onRequiringConfirmation must be provided');\n }\n // 3. success case if in case of custom pay button\n return (\n new Promise<void>((resolve, reject) => {\n void this.props.onRequiringConfirmation(resolve, reject);\n })\n //when this resolve passed to onRequiringConfirmation gets resolved make payments call\n .then(() => this.makeSubmitCall())\n //when it gets rejected handle cancellation\n .catch(() => {})\n );\n };\n\n public submit() {\n // for simplicity of the merchant we always only expose .submit()\n // however to make the actual payment call we call makeSubmitCall\n this.balanceCheck();\n }\n\n // this makes the payment, as .submit is used by the merchant to trigger the payButton action\n private makeSubmitCall() {\n super.submit();\n }\n\n // Giftcards override the regular payButton flow\n protected override payButton = (props: PayButtonProps) => {\n return <PayButton {...props} />;\n };\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <GiftcardComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n handleKeyPress={this.handleKeyPress}\n showPayButton={this.props.showPayButton}\n onChange={this.setState}\n makeBalanceCheck={() => this.onBalanceCheck()}\n makePayment={() => this.makeSubmitCall()}\n payButton={this.payButton}\n onSubmitAnalytics={this.submitAnalytics}\n />\n );\n }\n}\n\nexport default GiftcardElement;\n"],"names":["GiftcardElement","UIElement","formatProps","props","configuration","formatData","paymentMethod","type","this","constructor","brand","encryptedCardNumber","state","data","encryptedSecurityCode","isValid","icon","brandsConfiguration","resources","getImage","displayName","name","setBalanceCheckError","errorMessage","componentRef","setBalanceCheckErrors","balanceCheck","onBalanceCheck","submit","makeSubmitCall","super","componentToRender","h","GiftcardComponent","ref","handleKeyPress","showPayButton","onChange","setState","makeBalanceCheck","makePayment","payButton","onSubmitAnalytics","submitAnalytics","args","_define_property","handleBalanceCheck","Promise","resolve","reject","session","checkBalance","onOrderRequest","createOrder","showValidation","setStatus","then","balance","transactionLimit","Error","currency","amount","value","order","orderData","pspReference","handleOnRequiringConfirmation","catch","error","message","AdyenCheckoutError","handleError","setBalance","onRequiringConfirmation","PayButton","TxVariants","giftcard","defaultProps"],"mappings":"qcAUO,MAAMA,UAAwBC,EASjCC,WAAAA,CAAYC,GACR,MAAO,IACAA,GAAOC,iBACPD,EAEX,CAEAE,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKC,YAAY,KACvBC,MAAOF,KAAKL,MAAMO,MAClBC,oBAAqBH,KAAKI,MAAMC,MAAMF,oBACtCG,sBAAuBN,KAAKI,MAAMC,MAAMC,uBAGpD,CAEA,WAAIC,GACA,QAASP,KAAKI,MAAMG,OACxB,CAEA,QAAIC,GACA,OAAOR,KAAKL,MAAMc,oBAAoBT,KAAKL,MAAMO,QAAQM,MAAQR,KAAKL,MAAMa,MAAQR,KAAKU,UAAUC,UAAfX,CAA0BA,KAAKL,MAAMO,MAC7H,CAEA,eAAIU,GACA,OAAOZ,KAAKL,MAAMc,oBAAoBT,KAAKL,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KAAKc,qBAAqB,OAGrBmC,EAAS,MAAM,IAAIE,MAAM,cAC9B,GAAIF,GAASG,WAAapD,KAAKL,MAAM0D,QAAQD,SAAU,MAAM,IAAID,MAAM,kBACvE,GAAIF,GAASK,OAAS,EAAG,MAAM,IAAIH,MAAM,cAEzC,OAAInD,KAAKL,MAAM0D,OAAOC,MAAQL,EAAQK,OAAStD,KAAKL,MAAM0D,OAAOC,MAAQJ,EAAiBI,MAClFtD,KAAKL,MAAM4D,MACJvD,KAAKqB,iBAGTrB,KAAK4C,eAAe5C,KAAKK,MAAM2C,KAAMO,IACxCvD,KAAK8B,SAAS,CAAEyB,MAAO,CAAEC,UAAWD,EAAMC,UAAWC,aAAcF,EAAME,gBAClEzD,KAAKqB,mBAGTrB,KAAK0D,8BAA8BT,EAASC,KAG1DS,MAAMC,IAEH5D,KAAKc,qBAAqB8C,GAAOC,SAG7BD,aAAiBE,EACjB9D,KAAK+D,YAAYH,GAEjB5D,KAAK+D,YAAY,IAAID,EAAmB,QAASF,QAQjEvB,EAAArC,KAAQ0D,gCAAgC,CAACT,EAASC,KAK9C,GAJAlD,KAAKgB,aAAagD,WAAW,CAAEf,UAASC,qBACxClD,KAAK+C,UAAU,UAGX/C,KAAKL,MAAMiC,cAAf,CAIA,IAAK5B,KAAKL,MAAMsE,wBACZ,MAAM,IAAIH,EAAmB,uBAAwB,4CAGzD,OACI,IAAIvB,QAAc,CAACC,EAASC,KACnBzC,KAAKL,MAAMsE,wBAAwBzB,EAASC,KAGhDO,KAAK,IAAMhD,KAAKqB,kBAEhBsC,MAAM,OAbf,IA6BJtB,EAAArC,KAAmBiC,YAAatC,GACrB6B,EAAC0C,EAAcvE,KA5J1B0C,EADS7C,EACKO,OAAOoE,EAAWC,UAIhC/B,EALS7C,EAKQ6E,eAAe,CAC5B5D,oBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"Giftcard.js","sources":["../../../../src/components/Giftcard/Giftcard.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport GiftcardComponent from './components/GiftcardComponent';\nimport PayButton from '../internal/PayButton';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { PaymentAmount } from '../../types/global-types';\nimport { GiftCardElementData, GiftCardConfiguration, balanceCheckResponseType, GiftCardBalanceCheckErrorType } from './types';\nimport { TxVariants } from '../tx-variants';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\n\nexport class GiftcardElement extends UIElement<GiftCardConfiguration> {\n public static readonly type: TxVariants = TxVariants.giftcard;\n\n protected componentRef: GiftcardComponent | undefined;\n\n protected static readonly defaultProps = {\n brandsConfiguration: {}\n };\n\n formatProps(props) {\n return {\n ...props?.configuration,\n ...props\n };\n }\n\n formatData(): GiftCardElementData {\n return {\n paymentMethod: {\n type: this.constructor['type'],\n brand: this.props.brand,\n encryptedCardNumber: this.state.data?.encryptedCardNumber,\n encryptedSecurityCode: this.state.data?.encryptedSecurityCode\n }\n };\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.brandsConfiguration[this.props.brand]?.icon || this.props.icon || this.resources.getImage()(this.props.brand);\n }\n\n get displayName() {\n return this.props.brandsConfiguration[this.props.brand]?.name || this.props.name;\n }\n\n private setBalanceCheckError(errorMessage: GiftCardBalanceCheckErrorType | null): void {\n this.componentRef?.setBalanceCheckErrors?.(errorMessage);\n }\n\n private handleBalanceCheck = (data: GiftCardElementData): Promise<balanceCheckResponseType> => {\n if (this.props.onBalanceCheck) {\n return new Promise((resolve, reject) => {\n void this.props.onBalanceCheck(resolve, reject, data);\n });\n }\n\n if (this.props.session) {\n return this.props.session.checkBalance(data);\n }\n };\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n void this.props.onOrderRequest(resolve, reject, data);\n });\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n public balanceCheck() {\n return this.onBalanceCheck();\n }\n\n private onBalanceCheck = (): void => {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n // skip balance check if no onBalanceCheck event has been defined\n const hasBalanceCheck = this.props.session || this.props.onBalanceCheck;\n if (!hasBalanceCheck) return super.submit();\n\n this.setStatus('loading');\n\n this.handleBalanceCheck(this.formatData())\n .then(({ balance, transactionLimit = {} as PaymentAmount }) => {\n // Clear any previous balance check errors on success\n this.setBalanceCheckError(null);\n\n // We still need to throw these errors, otherwise it would be a breaking changing\n if (!balance) throw new Error('card-error'); // card doesn't exist\n if (balance?.currency !== this.props.amount?.currency) throw new Error('currency-error');\n if (balance?.value <= 0) throw new Error('no-balance');\n\n if (this.props.amount.value > balance.value || this.props.amount.value > transactionLimit.value) {\n if (this.props.order) {\n return this.makeSubmitCall();\n }\n\n return this.onOrderRequest(this.data).then((order: { orderData: string; pspReference: string }) => {\n this.setState({ order: { orderData: order.orderData, pspReference: order.pspReference } });\n return this.makeSubmitCall();\n });\n } else {\n return this.handleOnRequiringConfirmation(balance, transactionLimit);\n }\n })\n .catch(error => {\n // Simply pass the raw error message to setBalanceCheckError\n this.setBalanceCheckError(error?.message);\n\n // Still call handleError for other side effects (analytics, onError callback)\n if (error instanceof AdyenCheckoutError) {\n this.handleError(error);\n } else {\n this.handleError(new AdyenCheckoutError('ERROR', error));\n }\n });\n };\n\n /**\n * Check if it should call onRequiringConfirmation\n */\n private handleOnRequiringConfirmation = (balance, transactionLimit): Promise<any> => {\n this.componentRef.setBalance({ balance, transactionLimit });\n this.setStatus('ready');\n\n // 1. if we show pay button we don't need to ask for confirmation\n if (this.props.showPayButton) {\n return;\n }\n // 2. there's no callback, we throw error\n if (!this.props.onRequiringConfirmation) {\n throw new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'onRequiringConfirmation must be provided');\n }\n // 3. success case if in case of custom pay button\n return (\n new Promise<void>((resolve, reject) => {\n void this.props.onRequiringConfirmation(resolve, reject);\n })\n //when this resolve passed to onRequiringConfirmation gets resolved make payments call\n .then(() => this.makeSubmitCall())\n //when it gets rejected handle cancellation\n .catch(() => {})\n );\n };\n\n public submit() {\n // for simplicity of the merchant we always only expose .submit()\n // however to make the actual payment call we call makeSubmitCall\n this.balanceCheck();\n }\n\n // this makes the payment, as .submit is used by the merchant to trigger the payButton action\n private makeSubmitCall() {\n super.submit();\n }\n\n // Giftcards override the regular payButton flow\n protected override payButton = (props: PayButtonProps) => {\n return <PayButton {...props} />;\n };\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <GiftcardComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n handleKeyPress={this.handleKeyPress}\n showPayButton={this.props.showPayButton}\n onChange={this.setState}\n makeBalanceCheck={() => this.onBalanceCheck()}\n makePayment={() => this.makeSubmitCall()}\n payButton={this.payButton}\n onSubmitAnalytics={this.submitAnalytics}\n />\n );\n }\n}\n\nexport default GiftcardElement;\n"],"names":["GiftcardElement","UIElement","formatProps","props","configuration","formatData","paymentMethod","type","this","constructor","brand","encryptedCardNumber","state","data","encryptedSecurityCode","isValid","icon","brandsConfiguration","resources","getImage","displayName","name","setBalanceCheckError","errorMessage","componentRef","setBalanceCheckErrors","balanceCheck","onBalanceCheck","submit","makeSubmitCall","super","componentToRender","h","GiftcardComponent","ref","handleKeyPress","showPayButton","onChange","setState","makeBalanceCheck","makePayment","payButton","onSubmitAnalytics","submitAnalytics","args","_define_property","handleBalanceCheck","Promise","resolve","reject","session","checkBalance","onOrderRequest","createOrder","showValidation","setStatus","then","balance","transactionLimit","Error","currency","amount","value","order","orderData","pspReference","handleOnRequiringConfirmation","catch","error","message","AdyenCheckoutError","handleError","setBalance","onRequiringConfirmation","PayButton","TxVariants","giftcard","defaultProps"],"mappings":"qcAUO,MAAMA,UAAwBC,EASjCC,WAAAA,CAAYC,GACR,MAAO,IACAA,GAAOC,iBACPD,EAEX,CAEAE,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKC,YAAY,KACvBC,MAAOF,KAAKL,MAAMO,MAClBC,oBAAqBH,KAAKI,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BzB,EAASC,KAGhDO,KAAK,IAAMhD,KAAKqB,kBAEhBsC,MAAM,OAbf,IA6BJtB,EAAArC,KAAmBiC,YAAatC,GACrB6B,EAAC0C,EAAcvE,KA5J1B0C,EADS7C,EACcO,OAAmBoE,EAAWC,UAIrD/B,EALS7C,EAKiB6E,eAAe,CACrC5D,oBAAqB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import r from"../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import s from"../../internal/Alert/Alert.js";import a from"./GiftcardResult.js";import{useCoreContext as o}from"../../../core/Context/CoreProvider.js";import{GIFT_CARD as
|
|
1
|
+
import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import r from"../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import s from"../../internal/Alert/Alert.js";import a from"./GiftcardResult.js";import{useCoreContext as o}from"../../../core/Context/CoreProvider.js";import{GIFT_CARD as i}from"../../internal/SecuredFields/lib/constants.js";import{GiftCardFields as n}from"./GiftcardFields.js";import{useSRPanelForGiftcardErrors as c}from"./useSRPanelForGiftcardErrors.js";import{useAmount as l}from"../../../core/Context/AmountProvider.js";function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class u extends t{generateBalanceCheckErrors(t){const e={};return null===t||(e.encryptedCardNumber={isValid:!1,errorMessage:`error.giftcard.${t}`,error:t}),e}isBalanceCheckError(t){return["no-balance","card-error","currency-error"].includes(t)}render(t,{focusedElement:n,balance:d,transactionLimit:u,isValidating:p,transformedErrors:h}){const{i18n:m}=o(),{amount:f}=l();c({errors:h,isValidating:p,setIsValidating:this.setIsValidating,sfp:this.sfp});const g=u?.value<d?.value?u:d;if(g&&g?.value>=f?.value)return e(a,{balance:d,transactionLimit:u,makePayment:t.makePayment,status:this.state.status,makeBalanceCheck:t.makeBalanceCheck,showPayButton:this.props.showPayButton,payButton:this.props.payButton});const y=t=>t.errors.encryptedCardNumber?m.get(t.errors.encryptedCardNumber):h.encryptedCardNumber?m.get(h.encryptedCardNumber.errorMessage):null;return e("div",{className:"adyen-checkout__giftcard"},"error"===this.state.status&&e(s,{icon:"cross"},m.get("error.message.unknown")),e(r,{...this.props,ref:t=>{this.sfp=t},onChange:this.onChange,onFocus:this.handleFocus,onSubmitAnalytics:t.onSubmitAnalytics,type:i,componentType:t.type,render:({setRootNode:t,setFocusOn:e},r)=>this.props.fieldsLayoutComponent({i18n:m,pinRequired:this.props.pinRequired,focusedElement:n,getCardErrorMessage:y,setRootNode:t,setFocusOn:e,sfpState:r})}),this.props.showPayButton&&this.props.payButton({status:this.state.status,onClick:this.props.makeBalanceCheck,label:m.get("applyGiftcard")}))}constructor(...t){super(...t),d(this,"state",{status:"ready",data:{},balance:null,transactionLimit:null,focusedElement:!1,isValid:!1,sfpState:{},isValidating:!1,transformedErrors:{}}),d(this,"sfp",void 0),d(this,"mapErrorsToValidationObjects",()=>this.sfp?this.sfp.mapErrorsToValidationRuleResult():{}),d(this,"updateTransformedErrors",t=>{const e={...this.mapErrorsToValidationObjects(),...t};this.setState({transformedErrors:e})}),d(this,"onChange",t=>{this.setState({sfpState:t},()=>this.updateTransformedErrors()),this.props.onChange({data:t.data,isValid:t.isSfpValid})}),d(this,"handleFocus",t=>{this.setState({focusedElement:t.currentFocusObject});!0===t.focus?this.props.onFocus(t):this.props.onBlur(t)}),d(this,"setBalance",({balance:t,transactionLimit:e})=>{this.setState({balance:t,transactionLimit:e})}),d(this,"setBalanceCheckErrors",t=>{if(this.isBalanceCheckError(t)){const e=this.generateBalanceCheckErrors(t);this.updateTransformedErrors(e)}}),d(this,"showValidation",()=>{this.setState({isValidating:!0}),this.sfp?.showValidation()}),d(this,"setIsValidating",t=>{this.setState({isValidating:t})})}}d(u,"defaultProps",{pinRequired:!0,expiryDateRequired:!1,onChange:()=>{},onFocus:()=>{},onBlur:()=>{},fieldsLayoutComponent:n});export{u as default};
|
|
2
2
|
//# sourceMappingURL=GiftcardComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftcardComponent.js","sources":["../../../../../src/components/Giftcard/components/GiftcardComponent.tsx"],"sourcesContent":["import { Component, FunctionComponent, h } from 'preact';\nimport SecuredFieldsProvider from '../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Alert from '../../internal/Alert';\nimport GiftcardResult from './GiftcardResult';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { GIFT_CARD } from '../../internal/SecuredFields/lib/constants';\nimport { GiftCardFields } from './GiftcardFields';\nimport { GiftcardFieldsProps, Placeholders } from './types';\nimport { useSRPanelForGiftcardErrors } from './useSRPanelForGiftcardErrors';\nimport { GiftCardBalanceCheckErrorType } from '../types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport { useAmount } from '../../../core/Context/AmountProvider';\nimport type { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\n\ninterface GiftcardComponentProps {\n onChange: (state) => void;\n onFocus: (event) => void;\n onBlur: (event) => void;\n makeBalanceCheck: (event) => void;\n makePayment: (event) => void;\n showPayButton: boolean;\n payButton: (props: PayButtonProps) => h.JSX.Element;\n pinRequired: boolean;\n expiryDateRequired?: boolean;\n fieldsLayoutComponent: FunctionComponent<GiftcardFieldsProps>;\n placeholders?: Placeholders;\n handleKeyPress?: (o: KeyboardEvent) => void;\n onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;\n}\n\nclass Giftcard extends Component<GiftcardComponentProps> {\n public state = {\n status: 'ready',\n data: {},\n balance: null,\n transactionLimit: null,\n focusedElement: false,\n isValid: false,\n sfpState: {},\n isValidating: false,\n transformedErrors: {}\n };\n\n public static defaultProps = {\n pinRequired: true,\n expiryDateRequired: false,\n onChange: () => {},\n onFocus: () => {},\n onBlur: () => {},\n fieldsLayoutComponent: GiftCardFields\n };\n\n public sfp: SecuredFieldsProvider;\n\n /**\n * Maps string error codes from SecuredFields to validation rule objects\n */\n public mapErrorsToValidationObjects = () => {\n // Use the sfp reference to call mapErrorsToValidationRuleResult\n if (!this.sfp) return {};\n return this.sfp.mapErrorsToValidationRuleResult();\n };\n\n private updateTransformedErrors = (balanceCheckErrors?: Record<string, any>) => {\n const transformedErrors = this.mapErrorsToValidationObjects();\n\n const mergedErrors = { ...transformedErrors, ...balanceCheckErrors };\n\n this.setState({ transformedErrors: mergedErrors });\n };\n\n public onChange = sfpState => {\n this.setState({ sfpState }, () => this.updateTransformedErrors());\n\n this.props.onChange({\n data: sfpState.data,\n isValid: sfpState.isSfpValid\n });\n };\n\n public handleFocus = e => {\n this.setState({ focusedElement: e.currentFocusObject });\n\n const isFocused = e.focus === true;\n if (isFocused) {\n this.props.onFocus(e);\n } else {\n this.props.onBlur(e);\n }\n };\n\n public setBalance = ({ balance, transactionLimit }) => {\n this.setState({ balance, transactionLimit });\n };\n\n /**\n * Generates balance check errors in the same format as SFP errors\n * Compatible with the transformedErrors structure\n */\n private generateBalanceCheckErrors(errorType?: GiftCardBalanceCheckErrorType | null): Record<string, any> {\n const balanceCheckErrors: Record<string, any> = {};\n\n // This is the field that the error is associated with, only used for SR logic\n const fieldToAnnounce = 'encryptedCardNumber';\n\n // If errorType is null, clear errors\n if (errorType === null) {\n return balanceCheckErrors;\n }\n\n // Create error in the same format as SFP errors for consistency\n balanceCheckErrors[fieldToAnnounce] = {\n isValid: false,\n errorMessage: `error.giftcard.${errorType}`,\n error: errorType\n };\n\n return balanceCheckErrors;\n }\n\n /**\n * Checks if a status represents a balance check error\n */\n private isBalanceCheckError(status: string): boolean {\n return ['no-balance', 'card-error', 'currency-error'].includes(status);\n }\n\n /**\n * Method called by GiftcardElement to set balance check errors only\n */\n public setBalanceCheckErrors = (errorType: GiftCardBalanceCheckErrorType | null): void => {\n // Check if the errors should be displayed\n if (this.isBalanceCheckError(errorType)) {\n // Generate balance check errors in the style of useForm\n // This is usefull because then we can use the same logic for SF and balance check errors\n // Also we can use the same logic for SRPanel errors\n const balanceCheckErrors = this.generateBalanceCheckErrors(errorType);\n this.updateTransformedErrors(balanceCheckErrors);\n }\n };\n\n public showValidation = () => {\n this.setState({ isValidating: true });\n\n // Validate SecuredFields\n this.sfp?.showValidation();\n };\n\n render(props, { focusedElement, balance, transactionLimit, isValidating, transformedErrors }) {\n const { i18n } = useCoreContext();\n const { amount } = useAmount();\n\n // Handle SRPanel errors in render with transformed error objects\n useSRPanelForGiftcardErrors({\n errors: transformedErrors,\n isValidating,\n sfp: this.sfp\n });\n\n const transactionAmount = transactionLimit?.value < balance?.value ? transactionLimit : balance;\n const hasEnoughBalance = transactionAmount?.value >= amount?.value;\n\n if (transactionAmount && hasEnoughBalance) {\n return (\n <GiftcardResult\n balance={balance}\n transactionLimit={transactionLimit}\n makePayment={props.makePayment}\n status={this.state.status}\n makeBalanceCheck={props.makeBalanceCheck}\n showPayButton={this.props.showPayButton}\n payButton={this.props.payButton}\n />\n );\n }\n\n const getCardErrorMessage = sfpState => {\n if (sfpState.errors.encryptedCardNumber) return i18n.get(sfpState.errors.encryptedCardNumber);\n\n // This logic is a bit of a hack, but it's the only way to get the error message for balance check errors\n // In the future we should move this logic to useForm\n if (transformedErrors.encryptedCardNumber) {\n return i18n.get(transformedErrors.encryptedCardNumber.errorMessage);\n }\n\n return null;\n };\n\n return (\n <div className=\"adyen-checkout__giftcard\">\n {this.state.status === 'error' && <Alert icon={'cross'}>{i18n.get('error.message.unknown')}</Alert>}\n\n <SecuredFieldsProvider\n {...this.props}\n ref={ref => {\n this.sfp = ref;\n }}\n onChange={this.onChange}\n onFocus={this.handleFocus}\n onSubmitAnalytics={props.onSubmitAnalytics}\n type={GIFT_CARD}\n componentType={props.type}\n render={({ setRootNode, setFocusOn }, sfpState) =>\n this.props.fieldsLayoutComponent({\n i18n: i18n,\n pinRequired: this.props.pinRequired,\n focusedElement: focusedElement,\n getCardErrorMessage: getCardErrorMessage,\n setRootNode: setRootNode,\n setFocusOn: setFocusOn,\n sfpState: sfpState\n })\n }\n />\n\n {this.props.showPayButton &&\n this.props.payButton({\n status: this.state.status,\n onClick: this.props.makeBalanceCheck,\n label: i18n.get('applyGiftcard')\n })}\n </div>\n );\n }\n}\n\nexport default Giftcard;\n"],"names":["Giftcard","Component","generateBalanceCheckErrors","errorType","balanceCheckErrors","isValid","errorMessage","error","isBalanceCheckError","status","includes","render","props","focusedElement","balance","transactionLimit","isValidating","transformedErrors","i18n","useCoreContext","amount","useAmount","useSRPanelForGiftcardErrors","errors","sfp","this","transactionAmount","value","h","GiftcardResult","makePayment","state","makeBalanceCheck","showPayButton","payButton","getCardErrorMessage","sfpState","encryptedCardNumber","get","div","className","Alert","icon","SecuredFieldsProvider","ref","onChange","onFocus","handleFocus","onSubmitAnalytics","type","GIFT_CARD","componentType","setRootNode","setFocusOn","fieldsLayoutComponent","pinRequired","onClick","label","super","args","_define_property","data","mapErrorsToValidationObjects","mapErrorsToValidationRuleResult","updateTransformedErrors","mergedErrors","setState","isSfpValid","e","currentFocusObject","focus","onBlur","setBalance","setBalanceCheckErrors","showValidation","defaultProps","expiryDateRequired","GiftCardFields"],"mappings":"isBA8BA,MAAMA,UAAiBC,EAqEXC,0BAAAA,CAA2BC,GAC/B,MAAMC,EAA0C,CAAA,EAMhD,OAAkB,OAAdD,IAKJC,sBAAsC,CAClCC,SAAS,EACTC,aAAc,kBAAkBH,IAChCI,MAAOJ,IAPAC,CAWf,CAKQI,mBAAAA,CAAoBC,GACxB,MAAO,CAAC,aAAc,aAAc,kBAAkBC,SAASD,EACnE,CAuBAE,MAAAA,CAAOC,GAAOC,eAAEA,EAAcC,QAAEA,EAAOC,iBAAEA,EAAgBC,aAAEA,EAAYC,kBAAEA,IACrE,MAAMC,KAAEA,GAASC,KACXC,OAAEA,GAAWC,IAGnBC,EAA4B,CACxBC,OAAQN,EACRD,eACAQ,IAAKC,KAAKD,MAGd,MAAME,EAAoBX,GAAkBY,MAAQb,GAASa,MAAQZ,EAAmBD,EAGxF,GAA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AAA,IAYvB2C,EAAAnC,KAAOD,WAAP,GAKAoC,OAAOE,+BAA+B,IAE7BrC,KAAKD,IACHC,KAAKD,IAAIuC,kCADM,CAAA,GAI1BH,EAAAnC,KAAQuC,0BAA2B5D,IAC/B,MAEM6D,EAAe,IAFKxC,KAAKqC,kCAEiB1D,GAEhDqB,KAAKyC,SAAS,CAAEjD,kBAAmBgD,MAGvCL,EAAAnC,KAAOoB,WAAWT,IACdX,KAAKyC,SAAS,CAAE9B,YAAY,IAAMX,KAAKuC,2BAEvCvC,KAAKb,MAAMiC,SAAS,CAChBgB,KAAMzB,EAASyB,KACfxD,QAAS+B,EAAS+B,eAI1BP,EAAAnC,KAAOsB,cAAcqB,IACjB3C,KAAKyC,SAAS,CAAErD,eAAgBuD,EAAEC,sBAEJ,IAAZD,EAAEE,MAEhB7C,KAAKb,MAAMkC,QAAQsB,GAEnB3C,KAAKb,MAAM2D,OAAOH,KAI1BR,OAAOY,aAAa,EAAG1D,UAASC,uBAC5BU,KAAKyC,SAAS,CAAEpD,UAASC,uBAsC7B6C,EAAAnC,KAAOgD,wBAAyBtE,IAE5B,GAAIsB,KAAKjB,oBAAoBL,GAAY,CAIrC,MAAMC,EAAqBqB,KAAKvB,2BAA2BC,GAC3DsB,KAAKuC,wBAAwB5D,EACjC,IAGJwD,OAAOc,iBAAiB,KACpBjD,KAAKyC,SAAS,CAAElD,cAAc,IAG9BS,KAAKD,KAAKkD,oBAtGdd,EAbE5D,EAaY2E,eAAe,CACzBpB,aAAa,EACbqB,oBAAoB,EACpB/B,SAAU,OACVC,QAAS,OACTyB,OAAQ,OACRjB,sBAAuBuB"}
|
|
1
|
+
{"version":3,"file":"GiftcardComponent.js","sources":["../../../../../src/components/Giftcard/components/GiftcardComponent.tsx"],"sourcesContent":["import { Component, FunctionComponent, h } from 'preact';\nimport SecuredFieldsProvider from '../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Alert from '../../internal/Alert';\nimport GiftcardResult from './GiftcardResult';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { GIFT_CARD } from '../../internal/SecuredFields/lib/constants';\nimport { GiftCardFields } from './GiftcardFields';\nimport { GiftcardFieldsProps, Placeholders } from './types';\nimport { useSRPanelForGiftcardErrors } from './useSRPanelForGiftcardErrors';\nimport { GiftCardBalanceCheckErrorType } from '../types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport { useAmount } from '../../../core/Context/AmountProvider';\nimport type { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\n\ninterface GiftcardComponentProps {\n onChange: (state) => void;\n onFocus: (event) => void;\n onBlur: (event) => void;\n makeBalanceCheck: (event) => void;\n makePayment: (event) => void;\n showPayButton: boolean;\n payButton: (props: PayButtonProps) => h.JSX.Element;\n pinRequired: boolean;\n expiryDateRequired?: boolean;\n fieldsLayoutComponent: FunctionComponent<GiftcardFieldsProps>;\n placeholders?: Placeholders;\n handleKeyPress?: (o: KeyboardEvent) => void;\n onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;\n}\n\nclass Giftcard extends Component<Readonly<GiftcardComponentProps>> {\n public state = {\n status: 'ready',\n data: {},\n balance: null,\n transactionLimit: null,\n focusedElement: false,\n isValid: false,\n sfpState: {},\n isValidating: false,\n transformedErrors: {}\n };\n\n public static readonly defaultProps = {\n pinRequired: true,\n expiryDateRequired: false,\n onChange: () => {},\n onFocus: () => {},\n onBlur: () => {},\n fieldsLayoutComponent: GiftCardFields\n };\n\n public sfp: SecuredFieldsProvider;\n\n /**\n * Maps string error codes from SecuredFields to validation rule objects\n */\n public mapErrorsToValidationObjects = () => {\n // Use the sfp reference to call mapErrorsToValidationRuleResult\n if (!this.sfp) return {};\n return this.sfp.mapErrorsToValidationRuleResult();\n };\n\n private updateTransformedErrors = (balanceCheckErrors?: Record<string, any>) => {\n const transformedErrors = this.mapErrorsToValidationObjects();\n\n const mergedErrors = { ...transformedErrors, ...balanceCheckErrors };\n\n this.setState({ transformedErrors: mergedErrors });\n };\n\n public onChange = sfpState => {\n this.setState({ sfpState }, () => this.updateTransformedErrors());\n\n this.props.onChange({\n data: sfpState.data,\n isValid: sfpState.isSfpValid\n });\n };\n\n public handleFocus = e => {\n this.setState({ focusedElement: e.currentFocusObject });\n\n const isFocused = e.focus === true;\n if (isFocused) {\n this.props.onFocus(e);\n } else {\n this.props.onBlur(e);\n }\n };\n\n public setBalance = ({ balance, transactionLimit }) => {\n this.setState({ balance, transactionLimit });\n };\n\n /**\n * Generates balance check errors in the same format as SFP errors\n * Compatible with the transformedErrors structure\n */\n private generateBalanceCheckErrors(errorType?: GiftCardBalanceCheckErrorType | null): Record<string, any> {\n const balanceCheckErrors: Record<string, any> = {};\n\n // This is the field that the error is associated with, only used for SR logic\n const fieldToAnnounce = 'encryptedCardNumber';\n\n // If errorType is null, clear errors\n if (errorType === null) {\n return balanceCheckErrors;\n }\n\n // Create error in the same format as SFP errors for consistency\n balanceCheckErrors[fieldToAnnounce] = {\n isValid: false,\n errorMessage: `error.giftcard.${errorType}`,\n error: errorType\n };\n\n return balanceCheckErrors;\n }\n\n /**\n * Checks if a status represents a balance check error\n */\n private isBalanceCheckError(status: string): boolean {\n return ['no-balance', 'card-error', 'currency-error'].includes(status);\n }\n\n /**\n * Method called by GiftcardElement to set balance check errors only\n */\n public setBalanceCheckErrors = (errorType: GiftCardBalanceCheckErrorType | null): void => {\n // Check if the errors should be displayed\n if (this.isBalanceCheckError(errorType)) {\n // Generate balance check errors in the style of useForm\n // This is usefull because then we can use the same logic for SF and balance check errors\n // Also we can use the same logic for SRPanel errors\n const balanceCheckErrors = this.generateBalanceCheckErrors(errorType);\n this.updateTransformedErrors(balanceCheckErrors);\n }\n };\n\n public showValidation = () => {\n this.setState({ isValidating: true });\n\n // Validate SecuredFields\n this.sfp?.showValidation();\n };\n\n public setIsValidating = (val: boolean) => {\n this.setState({ isValidating: val });\n };\n\n render(props, { focusedElement, balance, transactionLimit, isValidating, transformedErrors }) {\n const { i18n } = useCoreContext();\n const { amount } = useAmount();\n\n // Handle SRPanel errors in render with transformed error objects\n useSRPanelForGiftcardErrors({\n errors: transformedErrors,\n isValidating,\n setIsValidating: this.setIsValidating,\n sfp: this.sfp\n });\n\n const transactionAmount = transactionLimit?.value < balance?.value ? transactionLimit : balance;\n const hasEnoughBalance = transactionAmount?.value >= amount?.value;\n\n if (transactionAmount && hasEnoughBalance) {\n return (\n <GiftcardResult\n balance={balance}\n transactionLimit={transactionLimit}\n makePayment={props.makePayment}\n status={this.state.status}\n makeBalanceCheck={props.makeBalanceCheck}\n showPayButton={this.props.showPayButton}\n payButton={this.props.payButton}\n />\n );\n }\n\n const getCardErrorMessage = sfpState => {\n if (sfpState.errors.encryptedCardNumber) return i18n.get(sfpState.errors.encryptedCardNumber);\n\n // This logic is a bit of a hack, but it's the only way to get the error message for balance check errors\n // In the future we should move this logic to useForm\n if (transformedErrors.encryptedCardNumber) {\n return i18n.get(transformedErrors.encryptedCardNumber.errorMessage);\n }\n\n return null;\n };\n\n return (\n <div className=\"adyen-checkout__giftcard\">\n {this.state.status === 'error' && <Alert icon={'cross'}>{i18n.get('error.message.unknown')}</Alert>}\n\n <SecuredFieldsProvider\n {...this.props}\n ref={ref => {\n this.sfp = ref;\n }}\n onChange={this.onChange}\n onFocus={this.handleFocus}\n onSubmitAnalytics={props.onSubmitAnalytics}\n type={GIFT_CARD}\n componentType={props.type}\n render={({ setRootNode, setFocusOn }, sfpState) =>\n this.props.fieldsLayoutComponent({\n i18n: i18n,\n pinRequired: this.props.pinRequired,\n focusedElement: focusedElement,\n getCardErrorMessage: getCardErrorMessage,\n setRootNode: setRootNode,\n setFocusOn: setFocusOn,\n sfpState: sfpState\n })\n }\n />\n\n {this.props.showPayButton &&\n this.props.payButton({\n status: this.state.status,\n onClick: this.props.makeBalanceCheck,\n label: i18n.get('applyGiftcard')\n })}\n </div>\n );\n }\n}\n\nexport default Giftcard;\n"],"names":["Giftcard","Component","generateBalanceCheckErrors","errorType","balanceCheckErrors","isValid","errorMessage","error","isBalanceCheckError","status","includes","render","props","focusedElement","balance","transactionLimit","isValidating","transformedErrors","i18n","useCoreContext","amount","useAmount","useSRPanelForGiftcardErrors","errors","setIsValidating","this","sfp","transactionAmount","value","h","GiftcardResult","makePayment","state","makeBalanceCheck","showPayButton","payButton","getCardErrorMessage","sfpState","encryptedCardNumber","get","div","className","Alert","icon","SecuredFieldsProvider","ref","onChange","onFocus","handleFocus","onSubmitAnalytics","type","GIFT_CARD","componentType","setRootNode","setFocusOn","fieldsLayoutComponent","pinRequired","onClick","label","super","args","_define_property","data","mapErrorsToValidationObjects","mapErrorsToValidationRuleResult","updateTransformedErrors","mergedErrors","setState","isSfpValid","e","currentFocusObject","focus","onBlur","setBalance","setBalanceCheckErrors","showValidation","val","defaultProps","expiryDateRequired","GiftCardFields"],"mappings":"isBA8BA,MAAMA,UAAiBC,EAqEXC,0BAAAA,CAA2BC,GAC/B,MAAMC,EAA0C,CAAA,EAMhD,OAAkB,OAAdD,IAKJC,sBAAsC,CAClCC,SAAS,EACTC,aAAc,kBAAkBH,IAChCI,MAAOJ,IAPAC,CAWf,CAKQI,mBAAAA,CAAoBC,GACxB,MAAO,CAAC,aAAc,aAAc,kBAAkBC,SAASD,EACnE,CA2BAE,MAAAA,CAAOC,GAAOC,eAAEA,EAAcC,QAAEA,EAAOC,iBAAEA,EAAgBC,aAAEA,EAAYC,kBAAEA,IACrE,MAAMC,KAAEA,GAASC,KACXC,OAAEA,GAAWC,IAGnBC,EAA4B,CACxBC,OAAQN,EACRD,eACAQ,gBAAiBC,KAAKD,gBACtBE,IAAKD,KAAKC,MAGd,MAAMC,EAAoBZ,GAAkBa,MAAQd,GAASc,MAAQb,EAAmBD,EAGxF,GAAIa,GAFqBA,GAAmBC,OAASR,GAAQQ,MAGzD,OACIC,EAACC,EAAAA,CACGhB,QAASA,EACTC,iBAAkBA,EAClBgB,YAAanB,EAAMmB,YACnBtB,OAAQgB,KAAKO,MAAMvB,OACnBwB,iBAAkBrB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AAe,IAFKzC,KAAKsC,kCAEiB3D,GAEhDqB,KAAK0C,SAAS,CAAElD,kBAAmBiD,MAGvCL,EAAApC,KAAOqB,WAAWT,IACdZ,KAAK0C,SAAS,CAAE9B,YAAY,IAAMZ,KAAKwC,2BAEvCxC,KAAKb,MAAMkC,SAAS,CAChBgB,KAAMzB,EAASyB,KACfzD,QAASgC,EAAS+B,eAI1BP,EAAApC,KAAOuB,cAAcqB,IACjB5C,KAAK0C,SAAS,CAAEtD,eAAgBwD,EAAEC,sBAEJ,IAAZD,EAAEE,MAEhB9C,KAAKb,MAAMmC,QAAQsB,GAEnB5C,KAAKb,MAAM4D,OAAOH,KAI1BR,OAAOY,aAAa,EAAG3D,UAASC,uBAC5BU,KAAK0C,SAAS,CAAErD,UAASC,uBAsC7B8C,EAAApC,KAAOiD,wBAAyBvE,IAE5B,GAAIsB,KAAKjB,oBAAoBL,GAAY,CAIrC,MAAMC,EAAqBqB,KAAKvB,2BAA2BC,GAC3DsB,KAAKwC,wBAAwB7D,EACjC,IAGJyD,OAAOc,iBAAiB,KACpBlD,KAAK0C,SAAS,CAAEnD,cAAc,IAG9BS,KAAKC,KAAKiD,mBAGdd,EAAApC,KAAOD,kBAAmBoD,IACtBnD,KAAK0C,SAAS,CAAEnD,aAAc4D,OA1GlCf,EAbE7D,EAaqB6E,eAAe,CAClCrB,aAAa,EACbsB,oBAAoB,EACpBhC,SAAU,OACVC,QAAS,OACTyB,OAAQ,OACRjB,sBAAuBwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftcardFields.js","sources":["../../../../../src/components/Giftcard/components/GiftcardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { GiftcardNumberField } from './GiftcardNumberField';\nimport { GiftcardPinField } from './GiftcardPinField';\nimport { GiftcardFieldsProps } from './types';\n\nexport const GiftCardFields = (props: GiftcardFieldsProps) => {\n const { setRootNode, pinRequired } = props;\n return (\n <div ref={setRootNode} className=\"adyen-checkout__field-wrapper\">\n <GiftcardNumberField {...props} classNameModifiers={pinRequired ? ['70'] : ['100']} />\n\n {pinRequired && <GiftcardPinField {...props} classNameModifiers={['30']} />}\n </div>\n );\n};\n"],"names":["GiftCardFields","props","setRootNode","pinRequired","h","div","ref","className","GiftcardNumberField","classNameModifiers","GiftcardPinField"],"mappings":"gMAKO,MAAMA,EAAkBC,IAC3B,MAAMC,YAAEA,EAAWC,YAAEA,GAAgBF,EACrC,OACIG,EAACC,MAAAA,CAAIC,IAAKJ,EAAaK,UAAU,iCAC7BH,EAACI,EAAAA,IAAwBP,EAAOQ,mBAAoBN,EAAc,CAAC,MAAQ,CAAC,SAE3EA,GAAeC,EAACM,EAAAA,IAAqBT,EAAOQ,mBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"GiftcardFields.js","sources":["../../../../../src/components/Giftcard/components/GiftcardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { GiftcardNumberField } from './GiftcardNumberField';\nimport { GiftcardPinField } from './GiftcardPinField';\nimport { GiftcardFieldsProps } from './types';\n\nexport const GiftCardFields = (props: Readonly<GiftcardFieldsProps>) => {\n const { setRootNode, pinRequired } = props;\n return (\n <div ref={setRootNode} className=\"adyen-checkout__field-wrapper\">\n <GiftcardNumberField {...props} classNameModifiers={pinRequired ? ['70'] : ['100']} />\n\n {pinRequired && <GiftcardPinField {...props} classNameModifiers={['30']} />}\n </div>\n );\n};\n"],"names":["GiftCardFields","props","setRootNode","pinRequired","h","div","ref","className","GiftcardNumberField","classNameModifiers","GiftcardPinField"],"mappings":"gMAKO,MAAMA,EAAkBC,IAC3B,MAAMC,YAAEA,EAAWC,YAAEA,GAAgBF,EACrC,OACIG,EAACC,MAAAA,CAAIC,IAAKJ,EAAaK,UAAU,iCAC7BH,EAACI,EAAAA,IAAwBP,EAAOQ,mBAAoBN,EAAc,CAAC,MAAQ,CAAC,SAE3EA,GAAeC,EAACM,EAAAA,IAAqBT,EAAOQ,mBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftcardNumberField.js","sources":["../../../../../src/components/Giftcard/components/GiftcardNumberField.tsx"],"sourcesContent":["import DataSfSpan from '../../Card/components/CardInput/components/DataSfSpan';\nimport classNames from 'classnames';\nimport Field from '../../internal/FormFields/Field';\nimport { h } from 'preact';\nimport { GiftcardFieldProps } from './types';\nimport { alternativeLabelContent } from '../../Card/components/CardInput/components/FieldLabelAlternative';\n\nexport const GiftcardNumberField = ({
|
|
1
|
+
{"version":3,"file":"GiftcardNumberField.js","sources":["../../../../../src/components/Giftcard/components/GiftcardNumberField.tsx"],"sourcesContent":["import DataSfSpan from '../../Card/components/CardInput/components/DataSfSpan';\nimport classNames from 'classnames';\nimport Field from '../../internal/FormFields/Field';\nimport { h } from 'preact';\nimport { GiftcardFieldProps } from './types';\nimport { alternativeLabelContent } from '../../Card/components/CardInput/components/FieldLabelAlternative';\n\nexport const GiftcardNumberField = ({\n i18n,\n classNameModifiers,\n sfpState,\n getCardErrorMessage,\n focusedElement,\n setFocusOn\n}: Readonly<GiftcardFieldProps>) => {\n return (\n <Field\n label={i18n.get('giftcard.cardNumber.label')}\n classNameModifiers={['number', ...classNameModifiers]}\n errorMessage={getCardErrorMessage(sfpState)}\n focused={focusedElement === 'encryptedCardNumber'}\n onFocusField={() => setFocusOn('encryptedCardNumber')}\n dir={'ltr'}\n name={'encryptedCardNumber'}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType=\"encryptedCardNumber\"\n data-info='{\"length\":\"15-32\", \"maskInterval\":4}'\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': getCardErrorMessage(sfpState),\n 'adyen-checkout__input--focus': focusedElement === 'encryptedCardNumber'\n })}\n />\n </Field>\n );\n};\n"],"names":["GiftcardNumberField","i18n","classNameModifiers","sfpState","getCardErrorMessage","focusedElement","setFocusOn","h","Field","label","get","errorMessage","focused","onFocusField","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","className","classNames"],"mappings":"gWAOO,MAAMA,EAAsB,EAC/BC,OACAC,qBACAC,WACAC,sBACAC,iBACAC,gBAGIC,EAACC,EAAAA,CACGC,MAAOR,EAAKS,IAAI,6BAChBR,mBAAoB,CAAC,YAAaA,GAClCS,aAAcP,EAAoBD,GAClCS,QAA4B,wBAAnBP,EACTQ,aAAc,IAAMP,EAAW,uBAC/BQ,IAAK,MACLC,KAAM,sBACNC,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BZ,EAACa,EAAAA,CACGC,mBAAmB,sBACnBC,YAAU,uCACVC,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCpB,EAAoBD,GACpD,+BAAmD,wBAAnBE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftcardPinField.js","sources":["../../../../../src/components/Giftcard/components/GiftcardPinField.tsx"],"sourcesContent":["import DataSfSpan from '../../Card/components/CardInput/components/DataSfSpan';\nimport classNames from 'classnames';\nimport Field from '../../internal/FormFields/Field';\nimport { h } from 'preact';\nimport { GiftcardFieldProps } from './types';\nimport { alternativeLabelContent } from '../../Card/components/CardInput/components/FieldLabelAlternative';\n\nexport const GiftcardPinField = ({\n i18n,\n classNameModifiers,\n sfpState,\n focusedElement,\n setFocusOn,\n label = i18n.get('creditCard.pin.label')\n}: GiftcardFieldProps) => {\n return (\n <Field\n label={label}\n classNameModifiers={['pin', ...classNameModifiers]}\n errorMessage={sfpState.errors.encryptedSecurityCode && i18n.get(sfpState.errors.encryptedSecurityCode)}\n focused={focusedElement === 'encryptedSecurityCode'}\n onFocusField={() => setFocusOn('encryptedSecurityCode')}\n dir={'ltr'}\n name={'encryptedSecurityCode'}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType=\"encryptedSecurityCode\"\n data-info='{\"length\":\"3-10\", \"maskInterval\": 0}'\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': sfpState.errors.encryptedSecurityCode,\n 'adyen-checkout__input--focus': focusedElement === 'encryptedSecurityCode'\n })}\n />\n </Field>\n );\n};\n"],"names":["GiftcardPinField","i18n","classNameModifiers","sfpState","focusedElement","setFocusOn","label","get","h","Field","errorMessage","errors","encryptedSecurityCode","focused","onFocusField","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","className","classNames"],"mappings":"sWAOaA,EAAmB,EAC5BC,OACAC,qBACAC,WACAC,iBACAC,aACAC,QAAQL,EAAKM,IAAI,2BAGbC,EAACC,EAAAA,CACGH,MAAOA,EACPJ,mBAAoB,CAAC,SAAUA,GAC/BQ,aAAcP,EAASQ,OAAOC,uBAAyBX,EAAKM,IAAIJ,EAASQ,OAAOC,uBAChFC,QAA4B,0BAAnBT,EACTU,aAAc,IAAMT,EAAW,yBAC/BU,IAAK,MACLC,KAAM,wBACNC,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BZ,EAACa,EAAAA,CACGC,mBAAmB,wBACnBC,YAAU,uCACVC,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCtB,EAASQ,OAAOC,sBAChD,+BAAmD,0BAAnBR"}
|
|
1
|
+
{"version":3,"file":"GiftcardPinField.js","sources":["../../../../../src/components/Giftcard/components/GiftcardPinField.tsx"],"sourcesContent":["import DataSfSpan from '../../Card/components/CardInput/components/DataSfSpan';\nimport classNames from 'classnames';\nimport Field from '../../internal/FormFields/Field';\nimport { h } from 'preact';\nimport { GiftcardFieldProps } from './types';\nimport { alternativeLabelContent } from '../../Card/components/CardInput/components/FieldLabelAlternative';\n\nexport const GiftcardPinField = ({\n i18n,\n classNameModifiers,\n sfpState,\n focusedElement,\n setFocusOn,\n label = i18n.get('creditCard.pin.label')\n}: Readonly<GiftcardFieldProps>) => {\n return (\n <Field\n label={label}\n classNameModifiers={['pin', ...classNameModifiers]}\n errorMessage={sfpState.errors.encryptedSecurityCode && i18n.get(sfpState.errors.encryptedSecurityCode)}\n focused={focusedElement === 'encryptedSecurityCode'}\n onFocusField={() => setFocusOn('encryptedSecurityCode')}\n dir={'ltr'}\n name={'encryptedSecurityCode'}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType=\"encryptedSecurityCode\"\n data-info='{\"length\":\"3-10\", \"maskInterval\": 0}'\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': sfpState.errors.encryptedSecurityCode,\n 'adyen-checkout__input--focus': focusedElement === 'encryptedSecurityCode'\n })}\n />\n </Field>\n );\n};\n"],"names":["GiftcardPinField","i18n","classNameModifiers","sfpState","focusedElement","setFocusOn","label","get","h","Field","errorMessage","errors","encryptedSecurityCode","focused","onFocusField","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","className","classNames"],"mappings":"sWAOaA,EAAmB,EAC5BC,OACAC,qBACAC,WACAC,iBACAC,aACAC,QAAQL,EAAKM,IAAI,2BAGbC,EAACC,EAAAA,CACGH,MAAOA,EACPJ,mBAAoB,CAAC,SAAUA,GAC/BQ,aAAcP,EAASQ,OAAOC,uBAAyBX,EAAKM,IAAIJ,EAASQ,OAAOC,uBAChFC,QAA4B,0BAAnBT,EACTU,aAAc,IAAMT,EAAW,yBAC/BU,IAAK,MACLC,KAAM,wBACNC,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BZ,EAACa,EAAAA,CACGC,mBAAmB,wBACnBC,YAAU,uCACVC,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCtB,EAASQ,OAAOC,sBAChD,+BAAmD,0BAAnBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftcardResult.js","sources":["../../../../../src/components/Giftcard/components/GiftcardResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport './GiftcardResult.scss';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { PaymentAmount } from '../../../types/global-types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport { useAmount } from '../../../core/Context/AmountProvider';\n\ninterface GiftcardResultProps {\n balance: PaymentAmount;\n transactionLimit: PaymentAmount;\n status: string;\n makePayment: () => void;\n makeBalanceCheck: () => void;\n showPayButton: boolean;\n payButton(props: PayButtonProps): h.JSX.Element;\n}\n\nfunction GiftcardResult({ balance, transactionLimit, status, makePayment, showPayButton, payButton }: GiftcardResultProps) {\n const { i18n } = useCoreContext();\n const { amount } = useAmount();\n\n // Calculate the transaction amount based on balance and transaction limit\n const transactionAmount = amount.value > transactionLimit?.value ? transactionLimit : amount;\n const remainingBalance = balance?.value - transactionAmount?.value;\n\n return (\n <div className=\"adyen-checkout__giftcard-result\">\n <ul className=\"adyen-checkout__giftcard-result__balance\">\n <li className=\"adyen-checkout__giftcard-result__balance__item\">\n <span className=\"adyen-checkout__giftcard-result__balance__title\">{i18n.get('giftcardBalance')}</span>\n <span className=\"adyen-checkout__giftcard-result__balance__value adyen-checkout__giftcard-result__balance__value--amount\">\n {i18n.amount(balance.value, balance.currency)}\n </span>\n </li>\n {transactionLimit && transactionLimit.value && (\n <li className=\"adyen-checkout__giftcard-result__balance__item\">\n <span className=\"adyen-checkout__giftcard-result__balance__title adyen-checkout__giftcard-result__balance__title--transactionLimit\">\n {i18n.get('giftcardTransactionLimit', {\n values: { amount: i18n.amount(transactionLimit.value, transactionLimit.currency) }\n })}\n </span>\n </li>\n )}\n </ul>\n\n {showPayButton &&\n payButton({\n customAmount: transactionAmount,\n status: status,\n onClick: makePayment\n })}\n\n <p className=\"adyen-checkout__giftcard-result__remaining-balance\">\n {i18n.get('partialPayment.remainingBalance', {\n values: { amount: i18n.amount(remainingBalance, balance.currency) }\n })}\n </p>\n </div>\n );\n}\n\nexport default GiftcardResult;\n"],"names":["GiftcardResult","balance","transactionLimit","status","makePayment","showPayButton","payButton","i18n","useCoreContext","amount","useAmount","transactionAmount","value","remainingBalance","h","div","className","ul","li","span","get","currency","values","customAmount","onClick","p"],"mappings":"mNAiBA,SAASA,GAAeC,QAAEA,EAAOC,iBAAEA,EAAgBC,OAAEA,EAAMC,YAAEA,EAAWC,cAAEA,EAAaC,UAAEA,IACrF,MAAMC,KAAEA,GAASC,KACXC,OAAEA,GAAWC,IAGbC,EAAoBF,EAAOG,MAAQV,GAAkBU,MAAQV,EAAmBO,EAChFI,EAAmBZ,GAASW,MAAQD,GAAmBC,MAE7D,OACIE,EAACC,MAAAA,CAAIC,UAAU,mCACXF,EAACG,KAAAA,CAAGD,UAAU,4CACVF,EAACI,KAAAA,CAAGF,UAAU,kDACVF,EAACK,OAAAA,CAAKH,UAAU,mDAAmDT,EAAKa,IAAI,oBAC5EN,EAACK,OAAAA,CAAKH,UAAU,2GACXT,EAAKE,OAAOR,EAAQW,MAAOX,EAAQoB,YAG3CnB,GAAoBA,EAAiBU,OAClCE,EAACI,KAAAA,CAAGF,UAAU,kDACVF,EAACK,OAAAA,CAAKH,UAAU,qHACXT,EAAKa,IAAI,2BAA4B,CAClCE,OAAQ,CAAEb,OAAQF,EAAKE,OAAOP,EAAiBU,MAAOV,EAAiBmB,gBAO1FhB,GACGC,EAAU,CACNiB,aAAcZ,EACdR,OAAQA,EACRqB,QAASpB,IAGjBU,EAACW,IAAAA,CAAET,UAAU,sDACRT,EAAKa,IAAI,kCAAmC,CACzCE,OAAQ,CAAEb,OAAQF,EAAKE,OAAOI,EAAkBZ,EAAQoB,cAK5E"}
|
|
1
|
+
{"version":3,"file":"GiftcardResult.js","sources":["../../../../../src/components/Giftcard/components/GiftcardResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport './GiftcardResult.scss';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { PaymentAmount } from '../../../types/global-types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport { useAmount } from '../../../core/Context/AmountProvider';\n\ninterface GiftcardResultProps {\n balance: PaymentAmount;\n transactionLimit: PaymentAmount;\n status: string;\n makePayment: () => void;\n makeBalanceCheck: () => void;\n showPayButton: boolean;\n payButton(props: PayButtonProps): h.JSX.Element;\n}\n\nfunction GiftcardResult({ balance, transactionLimit, status, makePayment, showPayButton, payButton }: Readonly<GiftcardResultProps>) {\n const { i18n } = useCoreContext();\n const { amount } = useAmount();\n\n // Calculate the transaction amount based on balance and transaction limit\n const transactionAmount = amount.value > transactionLimit?.value ? transactionLimit : amount;\n const remainingBalance = balance?.value - transactionAmount?.value;\n\n return (\n <div className=\"adyen-checkout__giftcard-result\">\n <ul className=\"adyen-checkout__giftcard-result__balance\">\n <li className=\"adyen-checkout__giftcard-result__balance__item\">\n <span className=\"adyen-checkout__giftcard-result__balance__title\">{i18n.get('giftcardBalance')}</span>\n <span className=\"adyen-checkout__giftcard-result__balance__value adyen-checkout__giftcard-result__balance__value--amount\">\n {i18n.amount(balance.value, balance.currency)}\n </span>\n </li>\n {transactionLimit && transactionLimit.value && (\n <li className=\"adyen-checkout__giftcard-result__balance__item\">\n <span className=\"adyen-checkout__giftcard-result__balance__title adyen-checkout__giftcard-result__balance__title--transactionLimit\">\n {i18n.get('giftcardTransactionLimit', {\n values: { amount: i18n.amount(transactionLimit.value, transactionLimit.currency) }\n })}\n </span>\n </li>\n )}\n </ul>\n\n {showPayButton &&\n payButton({\n customAmount: transactionAmount,\n status: status,\n onClick: makePayment\n })}\n\n <p className=\"adyen-checkout__giftcard-result__remaining-balance\">\n {i18n.get('partialPayment.remainingBalance', {\n values: { amount: i18n.amount(remainingBalance, balance.currency) }\n })}\n </p>\n </div>\n );\n}\n\nexport default GiftcardResult;\n"],"names":["GiftcardResult","balance","transactionLimit","status","makePayment","showPayButton","payButton","i18n","useCoreContext","amount","useAmount","transactionAmount","value","remainingBalance","h","div","className","ul","li","span","get","currency","values","customAmount","onClick","p"],"mappings":"mNAiBA,SAASA,GAAeC,QAAEA,EAAOC,iBAAEA,EAAgBC,OAAEA,EAAMC,YAAEA,EAAWC,cAAEA,EAAaC,UAAEA,IACrF,MAAMC,KAAEA,GAASC,KACXC,OAAEA,GAAWC,IAGbC,EAAoBF,EAAOG,MAAQV,GAAkBU,MAAQV,EAAmBO,EAChFI,EAAmBZ,GAASW,MAAQD,GAAmBC,MAE7D,OACIE,EAACC,MAAAA,CAAIC,UAAU,mCACXF,EAACG,KAAAA,CAAGD,UAAU,4CACVF,EAACI,KAAAA,CAAGF,UAAU,kDACVF,EAACK,OAAAA,CAAKH,UAAU,mDAAmDT,EAAKa,IAAI,oBAC5EN,EAACK,OAAAA,CAAKH,UAAU,2GACXT,EAAKE,OAAOR,EAAQW,MAAOX,EAAQoB,YAG3CnB,GAAoBA,EAAiBU,OAClCE,EAACI,KAAAA,CAAGF,UAAU,kDACVF,EAACK,OAAAA,CAAKH,UAAU,qHACXT,EAAKa,IAAI,2BAA4B,CAClCE,OAAQ,CAAEb,OAAQF,EAAKE,OAAOP,EAAiBU,MAAOV,EAAiBmB,gBAO1FhB,GACGC,EAAU,CACNiB,aAAcZ,EACdR,OAAQA,EACRqB,QAASpB,IAGjBU,EAACW,IAAAA,CAAET,UAAU,sDACRT,EAAKa,IAAI,kCAAmC,CACzCE,OAAQ,CAAEb,OAAQF,EAAKE,OAAOI,EAAkBZ,EAAQoB,cAK5E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{useState as e,useEffect as s}from"../../../external/preact/hooks/dist/hooks.js";import r from"../../../core/Errors/useSRPanelContext.js";import{usePrevious as o}from"../../../utils/hookUtils.js";import{ERROR_ACTION_BLUR_SCENARIO as t,ERROR_ACTION_FOCUS_FIELD as i}from"../../../core/Errors/constants.js";import{getArrayDifferences as a}from"../../../utils/arrayUtils.js";import c from"../../internal/SecuredFields/lib/CSF/utils/userAgent.js";import{windowScrollTo as l}from"../../../utils/windowScrollTo.js";const n=({errors:n,isValidating:u,setIsValidating:d,sfp:m})=>{const[f,S]=e(null),p=o(f),{setSRMessagesFromObjects:y,setSRMessagesFromStrings:g,clearSRPanel:j,shouldMoveFocusSR:F}=r(),h=["encryptedCardNumber","encryptedExpiryDate","encryptedSecurityCode"];s(()=>{try{const e=y?.({}),s=e?.({errors:n,isValidating:u,layout:h}),r=s?.currentErrorsSortedByLayout;switch(S(r),s?.action){case i:if(F&&u){if(c.__IS_IOS){const e=m?.getRootNode(),r=e?.querySelector(`[data-id="${s?.fieldToFocus}"]`);l(r)}m?.setFocusOn(s?.fieldToFocus)}setTimeout(()=>{d(!1)},300);break;case t:{const e=a(r,p,"field"),s=e?.[0];if(s){const e=!0?s.errorMessage:null;g(e)}else j();break}}}catch(e){}},[n])};export{n as useSRPanelForGiftcardErrors};
|
|
2
2
|
//# sourceMappingURL=useSRPanelForGiftcardErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSRPanelForGiftcardErrors.js","sources":["../../../../../src/components/Giftcard/components/useSRPanelForGiftcardErrors.ts"],"sourcesContent":["import { useEffect, useState } from 'preact/hooks';\nimport { SetSRMessagesReturnObject } from '../../../core/Errors/types';\nimport useSRPanelContext from '../../../core/Errors/useSRPanelContext';\nimport { usePrevious } from '../../../utils/hookUtils';\nimport { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD } from '../../../core/Errors/constants';\nimport { getArrayDifferences } from '../../../utils/arrayUtils';\nimport { SetSRMessagesReturnFn } from '../../../core/Errors/SRPanelProvider';\nimport SecuredFieldsProvider from '../../internal/SecuredFields/SFP/SecuredFieldsProvider';\n\n/**\n * Interface for transformed error objects returned from mapErrorsToValidationRuleResult\n */\ninterface TransformedError {\n isValid: boolean;\n errorMessage: string;\n errorI18n: string;\n error: string;\n rootNode: HTMLElement;\n}\n\n/**\n * Interface for errors object with transformed error entries\n */\ninterface TransformedErrorsObj {\n [key: string]: TransformedError | null;\n}\n\n/**\n * Props interface for the error handling hook\n */\ninterface UseSRPanelForGiftcardErrorsProps {\n errors: TransformedErrorsObj;\n isValidating: boolean;\n sfp: SecuredFieldsProvider;\n}\n\n/**\n * Interface for sorted error objects used for comparison\n */\ninterface SortedErrorObject {\n field: string;\n errorMessage: string;\n}\n\n/**\n * Custom hook for handling gift card component errors and screen reader announcements\n *\n * This hook manages both visual and screen reader error announcements for the gift card component,\n * handling both blur-based validation errors and form-wide validation errors.\n */\nconst useSRPanelForGiftcardErrors = ({ errors, isValidating, sfp }: UseSRPanelForGiftcardErrorsProps) => {\n // Track sorted list of errors for comparison with previous state\n const [sortedErrorList, setSortedErrorList] = useState<SortedErrorObject[]>(null);\n // Track previous error list for detecting changes\n const previousSortedErrors = usePrevious(sortedErrorList);\n\n // Get SRPanel context for managing screen reader messages\n const { setSRMessagesFromObjects, setSRMessagesFromStrings, clearSRPanel, shouldMoveFocusSR } = useSRPanelContext();\n\n // Fixed layout array defining the order of fields for error sorting\n // Assume fields in this order, and adds encryptedExpiryDate for MealVoucher, this is ignored in giftcard\n const layout = ['encryptedCardNumber', 'encryptedExpiryDate', 'encryptedSecurityCode'];\n\n useEffect(() => {\n try {\n // Create a partial function for setting SR messages with fixed configuration\n const setMessages: SetSRMessagesReturnFn = setSRMessagesFromObjects?.({});\n // Set messages with current errors and layout\n\n // Unlike Card SR Panel, isValidating is a boolean\n const srPanelResp: SetSRMessagesReturnObject = setMessages?.({\n errors,\n isValidating,\n layout\n });\n\n // Store the sorted list of errors for comparison\n const currentErrorsSortedByLayout = srPanelResp?.currentErrorsSortedByLayout;\n setSortedErrorList(currentErrorsSortedByLayout);\n\n // Handle different error scenarios based on the action type\n switch (srPanelResp?.action) {\n case ERROR_ACTION_FOCUS_FIELD:\n // When a field needs to be focused due to validation error\n if (shouldMoveFocusSR) {\n sfp?.setFocusOn(srPanelResp?.fieldToFocus);\n }\n // Remove 'showValidation' mode - allowing time for collation of all the fields in error whilst it is 'showValidation' mode (some errors come in a second render pass)\n setTimeout(() => {\n
|
|
1
|
+
{"version":3,"file":"useSRPanelForGiftcardErrors.js","sources":["../../../../../src/components/Giftcard/components/useSRPanelForGiftcardErrors.ts"],"sourcesContent":["import { useEffect, useState } from 'preact/hooks';\nimport { SetSRMessagesReturnObject } from '../../../core/Errors/types';\nimport useSRPanelContext from '../../../core/Errors/useSRPanelContext';\nimport { usePrevious } from '../../../utils/hookUtils';\nimport { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD } from '../../../core/Errors/constants';\nimport { getArrayDifferences } from '../../../utils/arrayUtils';\nimport { SetSRMessagesReturnFn } from '../../../core/Errors/SRPanelProvider';\nimport SecuredFieldsProvider from '../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport ua from '../../internal/SecuredFields/lib/CSF/utils/userAgent';\nimport { windowScrollTo } from '../../../utils/windowScrollTo';\n\n/**\n * Interface for transformed error objects returned from mapErrorsToValidationRuleResult\n */\ninterface TransformedError {\n isValid: boolean;\n errorMessage: string;\n errorI18n: string;\n error: string;\n rootNode: HTMLElement;\n}\n\n/**\n * Interface for errors object with transformed error entries\n */\ninterface TransformedErrorsObj {\n [key: string]: TransformedError | null;\n}\n\n/**\n * Props interface for the error handling hook\n */\ninterface UseSRPanelForGiftcardErrorsProps {\n errors: TransformedErrorsObj;\n isValidating: boolean;\n setIsValidating: (val: boolean) => void;\n sfp: SecuredFieldsProvider;\n}\n\n/**\n * Interface for sorted error objects used for comparison\n */\ninterface SortedErrorObject {\n field: string;\n errorMessage: string;\n}\n\n/**\n * Custom hook for handling gift card component errors and screen reader announcements\n *\n * This hook manages both visual and screen reader error announcements for the gift card component,\n * handling both blur-based validation errors and form-wide validation errors.\n */\nconst useSRPanelForGiftcardErrors = ({ errors, isValidating, setIsValidating, sfp }: UseSRPanelForGiftcardErrorsProps) => {\n // Track sorted list of errors for comparison with previous state\n const [sortedErrorList, setSortedErrorList] = useState<SortedErrorObject[]>(null);\n // Track previous error list for detecting changes\n const previousSortedErrors = usePrevious(sortedErrorList);\n\n // Get SRPanel context for managing screen reader messages\n const { setSRMessagesFromObjects, setSRMessagesFromStrings, clearSRPanel, shouldMoveFocusSR } = useSRPanelContext();\n\n // Fixed layout array defining the order of fields for error sorting\n // Assume fields in this order, and adds encryptedExpiryDate for MealVoucher, this is ignored in giftcard\n const layout = ['encryptedCardNumber', 'encryptedExpiryDate', 'encryptedSecurityCode'];\n\n useEffect(() => {\n try {\n // Create a partial function for setting SR messages with fixed configuration\n const setMessages: SetSRMessagesReturnFn = setSRMessagesFromObjects?.({});\n // Set messages with current errors and layout\n\n // Unlike Card SR Panel, isValidating is a boolean\n const srPanelResp: SetSRMessagesReturnObject = setMessages?.({\n errors,\n isValidating,\n layout\n });\n\n // Store the sorted list of errors for comparison\n const currentErrorsSortedByLayout = srPanelResp?.currentErrorsSortedByLayout;\n setSortedErrorList(currentErrorsSortedByLayout);\n\n // Handle different error scenarios based on the action type\n switch (srPanelResp?.action) {\n case ERROR_ACTION_FOCUS_FIELD:\n // When a field needs to be focused due to validation error\n if (shouldMoveFocusSR && isValidating) {\n // Fix for iOS scrolling issues: can't programmatically set focus on a cross-origin element on iOS, so we scroll to it's label instead, so at least the element is in view\n if (ua.__IS_IOS) {\n const rootNode = sfp?.getRootNode();\n const elementToScrollTo: HTMLElement = rootNode?.querySelector(`[data-id=\"${srPanelResp?.fieldToFocus}\"]`);\n windowScrollTo(elementToScrollTo);\n }\n\n sfp?.setFocusOn(srPanelResp?.fieldToFocus);\n }\n // Remove 'showValidation' mode - allowing time for collation of all the fields in error whilst it is 'showValidation' mode (some errors come in a second render pass)\n setTimeout(() => {\n // Need to reset isValidating on the *state* of the Giftcard component (which is where isValidating comes from),\n // - otherwise it remains true and any subsequent click, *anywhere* in the UI, will trigger a second \"focus field\" event\n setIsValidating(false);\n }, 300);\n break;\n\n case ERROR_ACTION_BLUR_SCENARIO: {\n // Handle blur-based validation errors\n const difference = getArrayDifferences(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n const latestErrorMsg = difference?.[0];\n\n if (latestErrorMsg) {\n // Only announce blur-based errors to screen reader\n const isBlurBasedError = true;\n const latestSRError = isBlurBasedError ? latestErrorMsg.errorMessage : null;\n setSRMessagesFromStrings(latestSRError);\n } else {\n // Clear SR panel if there are no more errors\n clearSRPanel();\n }\n break;\n }\n }\n } catch (_) {\n // Fail silently - we don't want to break the component if SRPanel fails\n }\n }, [errors]);\n};\n\n// Export all interfaces and the hook\nexport type { TransformedError, TransformedErrorsObj };\n\nexport { useSRPanelForGiftcardErrors };\n"],"names":["useSRPanelForGiftcardErrors","errors","isValidating","setIsValidating","sfp","sortedErrorList","setSortedErrorList","useState","previousSortedErrors","usePrevious","setSRMessagesFromObjects","setSRMessagesFromStrings","clearSRPanel","shouldMoveFocusSR","useSRPanelContext","layout","useEffect","setMessages","srPanelResp","currentErrorsSortedByLayout","action","ERROR_ACTION_FOCUS_FIELD","ua","__IS_IOS","rootNode","getRootNode","elementToScrollTo","querySelector","fieldToFocus","windowScrollTo","setFocusOn","setTimeout","ERROR_ACTION_BLUR_SCENARIO","difference","getArrayDifferences","latestErrorMsg","latestSRError","errorMessage","_"],"mappings":"mgBAqDA,MAAMA,EAA8B,EAAGC,SAAQC,eAAcC,kBAAiBC,UAE1E,MAAOC,EAAiBC,GAAsBC,EAA8B,MAEtEC,EAAuBC,EAAYJ,IAGnCK,yBAAEA,EAAwBC,yBAAEA,EAAwBC,aAAEA,EAAYC,kBAAEA,GAAsBC,IAI1FC,EAAS,CAAC,sBAAuB,sBAAuB,yBAE9DC,EAAU,KACN,IAEI,MAAMC,EAAqCP,IAA2B,IAIhEQ,EAAyCD,IAAc,CACzDhB,SACAC,eACAa,WAIEI,EAA8BD,GAAaC,4BAIjD,OAHAb,EAAmBa,GAGXD,GAAaE,QACjB,KAAKC,EAED,GAAIR,GAAqBX,EAAc,CAEnC,GAAIoB,EAAGC,SAAU,CACb,MAAMC,EAAWpB,GAAKqB,cAChBC,EAAiCF,GAAUG,cAAc,aAAaT,GAAaU,kBACzFC,EAAeH,EACnB,CAEAtB,GAAK0B,WAAWZ,GAAaU,aACjC,CAEAG,WAAW,KAGP5B,GAAgB,IACjB,KACH,MAEJ,KAAK6B,EAA4B,CAE7B,MAAMC,EAAaC,EAAoBf,EAA6BX,EAAsB,SACpF2B,EAAiBF,IAAa,GAEpC,GAAIE,EAAgB,CAEhB,MACMC,GADmB,EACgBD,EAAeE,aAAe,KACvE1B,EAAyByB,EAC7B,MAEIxB,IAEJ,KACJ,EAER,CAAE,MAAO0B,GAET,GACD,CAACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Giropay.js","sources":["../../../../src/components/Giropay/Giropay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport RedirectElement from '../Redirect';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\n\nclass GiropayElement extends RedirectElement {\n public static type = TxVariants.giropay;\n\n get displayName() {\n return this.props.name || this.constructor['type'];\n }\n\n protected override componentToRender(): h.JSX.Element {\n if (this.props.showPayButton) {\n return (\n <RedirectButton\n {...this.props}\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n );\n }\n\n return null;\n }\n}\n\nexport default GiropayElement;\n"],"names":["GiropayElement","RedirectElement","displayName","this","props","name","constructor","componentToRender","showPayButton","h","RedirectButton","onSubmit","submit","payButton","ref","componentRef","type","TxVariants","giropay"],"mappings":"uNAKA,MAAMA,UAAuBC,EAGzB,
|
|
1
|
+
{"version":3,"file":"Giropay.js","sources":["../../../../src/components/Giropay/Giropay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport RedirectElement from '../Redirect';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\n\nclass GiropayElement extends RedirectElement {\n public static override readonly type: TxVariants = TxVariants.giropay;\n\n public override get displayName() {\n return this.props.name || this.constructor['type'];\n }\n\n protected override componentToRender(): h.JSX.Element {\n if (this.props.showPayButton) {\n return (\n <RedirectButton\n {...this.props}\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n );\n }\n\n return null;\n }\n}\n\nexport default GiropayElement;\n"],"names":["GiropayElement","RedirectElement","displayName","this","props","name","constructor","componentToRender","showPayButton","h","RedirectButton","onSubmit","submit","payButton","ref","componentRef","type","TxVariants","giropay"],"mappings":"uNAKA,MAAMA,UAAuBC,EAGzB,eAAoBC,GAChB,OAAOC,KAAKC,MAAMC,MAAQF,KAAKG,YAAY,IAC/C,CAEmBC,iBAAAA,GACf,OAAIJ,KAAKC,MAAMI,cAEPC,EAACC,EAAAA,IACOP,KAAKC,MACTI,cAAeL,KAAKC,MAAMI,cAC1BH,KAAMF,KAAKD,YACXS,SAAUR,KAAKS,OACfC,UAAWV,KAAKU,UAChBC,IAAKA,IACDX,KAAKY,aAAeD,KAM7B,IACX,cAxBEd,IAC8BgB,SAAmBC,EAAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GooglePay.js","sources":["../../../../src/components/GooglePay/GooglePay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport GooglePayService from './GooglePayService';\nimport GooglePayButton from './components/GooglePayButton';\nimport defaultProps from './defaultProps';\nimport { formatGooglePayContactToAdyenAddressFormat, getGooglePayLocale } from './utils';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { TxVariants } from '../tx-variants';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nimport type { AddressData, BrowserInfo, RawPaymentMethod, PaymentResponseData, RawPaymentResponse } from '../../types/global-types';\nimport type { GooglePayConfiguration } from './types';\nimport type { ICore } from '../../core/types';\nimport { AnalyticsInfoEvent, InfoEventType, UiTarget } from '../../core/Analytics/events/AnalyticsInfoEvent';\nimport { mapGooglePayBrands } from './utils/map-adyen-brands-to-googlepay-brands';\n\nconst DEFAULT_ALLOWED_CARD_NETWORKS: google.payments.api.CardNetwork[] = ['AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'];\n\nclass GooglePay extends UIElement<GooglePayConfiguration> {\n public static type = TxVariants.googlepay;\n public static txVariants = [TxVariants.googlepay, TxVariants.paywithgoogle];\n public static defaultProps = defaultProps;\n\n protected readonly googlePay;\n\n constructor(checkout: ICore, props?: GooglePayConfiguration) {\n super(checkout, props);\n this.handleAuthorization = this.handleAuthorization.bind(this);\n this.showGooglePayPaymentSheet = this.showGooglePayPaymentSheet.bind(this);\n\n const { isExpress, paymentDataCallbacks } = this.props;\n\n if (isExpress === false && paymentDataCallbacks?.onPaymentDataChanged) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'GooglePay - You must set \"isExpress\" flag to \"true\" in order to use \"onPaymentDataChanged\" callback'\n );\n }\n\n if (!this.props.configuration.merchantId) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'GooglePay - Missing merchantId. Please ensure that it is correctly configured in your customer area.'\n );\n }\n\n this.googlePay = new GooglePayService(this.props.environment, this.analytics, {\n ...(isExpress && paymentDataCallbacks?.onPaymentDataChanged && { onPaymentDataChanged: paymentDataCallbacks.onPaymentDataChanged }),\n onPaymentAuthorized: this.onPaymentAuthorized\n });\n }\n\n /**\n * Google Pay requires custom logic due to supporting two Tx variants that lead to the same payment method.\n * If the merchant creates a standalone Google Pay component, we need to verify if the payment method is available using both tx variants\n *\n * @param type\n * @param paymentMethodId - Unique internal payment method ID\n * @returns\n */\n protected override getPaymentMethodFromPaymentMethodsResponse(type?: string, paymentMethodId?: string): RawPaymentMethod {\n if (paymentMethodId) return this.core.paymentMethodsResponse.findById(paymentMethodId);\n\n return (\n this.core.paymentMethodsResponse.find(type || this.constructor['type']) || this.core.paymentMethodsResponse.find(TxVariants.paywithgoogle)\n );\n }\n\n protected override formatProps(props: GooglePayConfiguration): GooglePayConfiguration {\n const buttonSizeMode = props.buttonSizeMode ?? (props.isDropin ? 'fill' : 'static');\n const buttonLocale = getGooglePayLocale(props.buttonLocale ?? props.i18n?.locale);\n\n const callbackIntents: google.payments.api.CallbackIntent[] = [...props.callbackIntents, 'PAYMENT_AUTHORIZATION'];\n\n const allowedCardNetworks = this.createAllowedCardNetworksValues({\n allowedCardNetworks: props.allowedCardNetworks,\n brands: props.brands\n });\n\n return {\n ...props,\n allowedCardNetworks,\n configuration: props.configuration,\n buttonSizeMode,\n buttonLocale,\n callbackIntents\n };\n }\n\n /**\n * Formats the component data output\n */\n protected override formatData() {\n const { googlePayCardNetwork, googlePayToken, billingAddress, deliveryAddress } = this.state;\n const { isExpress } = this.props;\n\n return {\n paymentMethod: {\n type: this.type,\n googlePayCardNetwork,\n googlePayToken,\n ...(isExpress && { subtype: 'express' })\n },\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n };\n }\n\n /**\n * Generate the 'allowedCardNetworks' value used by Google Pay\n *\n * If the 'allowedCardNetworks' is defined in the Component configuration, it will be used. Otherwise we fallback\n * to use the 'brands' returned by the backoffice. It can be that 'brands' is not returned, which in this case we\n * set default values\n *\n * @param {object} brandsConfig\n * @param brandsConfig.allowedCardNetworks - Brands set in the component config\n * @param brandsConfig.brands - Brands returned by backend\n * @private\n */\n private createAllowedCardNetworksValues({\n allowedCardNetworks,\n brands\n }: {\n allowedCardNetworks?: google.payments.api.CardNetwork[];\n brands?: string[];\n }): google.payments.api.CardNetwork[] {\n if (allowedCardNetworks?.length > 0) return allowedCardNetworks;\n if (brands?.length > 0) return mapGooglePayBrands(brands);\n\n return DEFAULT_ALLOWED_CARD_NETWORKS;\n }\n\n protected override beforeRender(configSetByMerchant?: GooglePayConfiguration) {\n // We don't send 'rendered' events when rendering actions\n if (configSetByMerchant?.originalAction) {\n return;\n }\n\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.rendered,\n component: this.type,\n configData: { ...configSetByMerchant, showPayButton: this.props.showPayButton },\n ...(configSetByMerchant?.isExpress && { isExpress: configSetByMerchant.isExpress }),\n ...(configSetByMerchant?.expressPage && { expressPage: configSetByMerchant.expressPage })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n /**\n * Displays the Google Pay payment sheet overlay\n */\n private showGooglePayPaymentSheet() {\n this.googlePay.initiatePayment(this.props, this.core.options.countryCode).catch((error: google.payments.api.PaymentsError) => {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n this.handleError(new AdyenCheckoutError(error.statusCode === 'CANCELED' ? 'CANCEL' : 'ERROR', error.toString(), { cause: error }));\n });\n }\n\n public override submit = () => {\n if (this.props.isInstantPayment) {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.selected,\n target: UiTarget.instantPaymentButton\n });\n\n this.submitAnalytics(event);\n }\n\n new Promise<void>((resolve, reject) => this.props.onClick(resolve, reject)).then(this.showGooglePayPaymentSheet).catch(() => {\n // Swallow exception triggered by onClick reject\n });\n };\n\n /**\n * Method called when the payment is authorized in the payment sheet\n *\n * @see https://developers.google.com/pay/api/web/reference/client#onPaymentAuthorized\n **/\n private onPaymentAuthorized = async (paymentData: google.payments.api.PaymentData): Promise<google.payments.api.PaymentAuthorizationResult> => {\n const billingAddress: AddressData = formatGooglePayContactToAdyenAddressFormat(paymentData.paymentMethodData.info.billingAddress);\n const deliveryAddress: AddressData = formatGooglePayContactToAdyenAddressFormat(paymentData.shippingAddress, true);\n\n this.setState({\n authorizedEvent: paymentData,\n googlePayToken: paymentData.paymentMethodData.tokenizationData.token,\n googlePayCardNetwork: paymentData.paymentMethodData.info.cardNetwork,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<google.payments.api.PaymentAuthorizationResult>(resolve => {\n this.handleAuthorization()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((paymentResponse: PaymentResponseData) => {\n resolve({ transactionState: 'SUCCESS' });\n return paymentResponse;\n })\n .then(paymentResponse => {\n this.handleResponse(paymentResponse);\n })\n .catch((paymentResponse?: RawPaymentResponse) => {\n this.setElementStatus('ready');\n\n const googlePayError = paymentResponse?.error?.googlePayError;\n const fallbackMessage = this.props.i18n.get('error.subtitle.payment');\n\n const error: google.payments.api.PaymentDataError =\n typeof googlePayError === 'string' || undefined\n ? {\n intent: 'PAYMENT_AUTHORIZATION',\n reason: 'OTHER_ERROR',\n message: (googlePayError as string) || fallbackMessage\n }\n : {\n intent: googlePayError?.intent || 'PAYMENT_AUTHORIZATION',\n reason: googlePayError?.reason || 'OTHER_ERROR',\n message: googlePayError?.message || fallbackMessage\n };\n\n resolve({\n transactionState: 'ERROR',\n error\n });\n\n const responseWithError = {\n ...paymentResponse,\n error: {\n googlePayError: error\n }\n };\n\n this.handleFailedResult(responseWithError);\n });\n });\n };\n\n /**\n * Call the 'onAuthorized' callback if available.\n * Must be resolved/reject for the payment flow to continue\n */\n private async handleAuthorization(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!this.props.onAuthorized) {\n resolve();\n }\n\n const { authorizedEvent, billingAddress, deliveryAddress } = this.state;\n\n this.props.onAuthorized(\n {\n authorizedEvent,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n );\n }).catch((error?: google.payments.api.PaymentDataError | string) => {\n // Format error in a way that the 'catch' of the 'onPaymentAuthorize' block accepts it\n const data = { error: { googlePayError: error } };\n return Promise.reject(data);\n });\n }\n\n public get isValid(): boolean {\n return true;\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from the Google Pay API.\n */\n public override async isAvailable(): Promise<void> {\n return this.isReadyToPay()\n .then(response => {\n if (!response.result) {\n throw new AdyenCheckoutError('ERROR', 'GooglePay is not available');\n }\n\n if (response.paymentMethodPresent === false) {\n throw new AdyenCheckoutError('ERROR', 'GooglePay - No paymentMethodPresent');\n }\n\n return Promise.resolve();\n })\n .catch(error => {\n return Promise.reject(error);\n });\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from the Google Pay API.\n */\n public isReadyToPay = (): Promise<google.payments.api.IsReadyToPayResponse> => {\n return this.googlePay.isReadyToPay(this.props);\n };\n\n /**\n * Use this method to prefetch a PaymentDataRequest configuration to improve loadPaymentData execution time on later user interaction. No value is returned.\n */\n public prefetch = (): void => {\n return this.googlePay.prefetchPaymentData(this.props, this.core.options.countryCode);\n };\n\n get browserInfo(): BrowserInfo {\n return collectBrowserInfo();\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()('googlepay');\n }\n\n protected override componentToRender(): h.JSX.Element {\n if (this.props.showPayButton) {\n return (\n <GooglePayButton\n buttonColor={this.props.buttonColor}\n buttonType={this.props.buttonType}\n buttonSizeMode={this.props.buttonSizeMode}\n buttonLocale={this.props.buttonLocale}\n buttonRootNode={this.props.buttonRootNode}\n buttonRadius={this.props.buttonRadius}\n paymentsClient={this.googlePay.paymentsClient}\n onClick={this.submit}\n />\n );\n }\n\n return null;\n }\n}\n\nexport default GooglePay;\n"],"names":["DEFAULT_ALLOWED_CARD_NETWORKS","GooglePay","UIElement","getPaymentMethodFromPaymentMethodsResponse","type","paymentMethodId","this","core","paymentMethodsResponse","findById","find","constructor","TxVariants","paywithgoogle","formatProps","props","buttonSizeMode","isDropin","buttonLocale","getGooglePayLocale","i18n","locale","callbackIntents","allowedCardNetworks","createAllowedCardNetworksValues","brands","configuration","formatData","googlePayCardNetwork","googlePayToken","billingAddress","deliveryAddress","state","isExpress","paymentMethod","subtype","browserInfo","origin","window","location","length","mapGooglePayBrands","beforeRender","configSetByMerchant","originalAction","event","AnalyticsInfoEvent","InfoEventType","rendered","component","configData","showPayButton","expressPage","analytics","sendAnalytics","showGooglePayPaymentSheet","googlePay","initiatePayment","options","countryCode","catch","error","handleError","AdyenCheckoutError","statusCode","toString","cause","handleAuthorization","Promise","resolve","reject","onAuthorized","authorizedEvent","data","googlePayError","isValid","isAvailable","isReadyToPay","then","response","result","paymentMethodPresent","collectBrowserInfo","icon","resources","getImage","componentToRender","h","GooglePayButton","buttonColor","buttonType","buttonRootNode","buttonRadius","paymentsClient","onClick","submit","checkout","super","_define_property","isInstantPayment","selected","target","UiTarget","instantPaymentButton","submitAnalytics","onPaymentAuthorized","async","paymentData","formatGooglePayContactToAdyenAddressFormat","paymentMethodData","info","shippingAddress","setState","tokenizationData","token","cardNetwork","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","paymentResponse","transactionState","handleResponse","setElementStatus","fallbackMessage","get","intent","reason","message","responseWithError","handleFailedResult","prefetch","prefetchPaymentData","bind","paymentDataCallbacks","onPaymentDataChanged","merchantId","GooglePayService","environment","googlepay","txVariants","defaultProps"],"mappings":"64BAiBA,MAAMA,EAAmE,CAAC,OAAQ,WAAY,MAAO,aAAc,QAEnH,MAAMC,UAAkBC,EA0CpB,0CAAAC,CAA8DC,EAAeC,GACzE,OAAIA,EAAwBC,KAAKC,KAAKC,uBAAuBC,SAASJ,GAGlEC,KAAKC,KAAKC,uBAAuBE,KAAKN,GAAQE,KAAKK,YAAY,OAAYL,KAAKC,KAAKC,uBAAuBE,KAAKE,EAAWC,cAEpI,CAEmBC,WAAAA,CAAYC,GAC3B,MAAMC,EAAiBD,EAAMC,iBAAmBD,EAAME,SAAW,OAAS,UACpEC,EAAeC,EAAmBJ,EAAMG,cAAg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,KAAKS,QAM5CmF,OAAOgC,WAAW,IACP5H,KAAKkD,UAAU2E,oBAAoB7H,KAAKS,MAAOT,KAAKC,KAAKmD,QAAQC,cAvRxErD,KAAK6D,oBAAsB7D,KAAK6D,oBAAoBiE,KAAK9H,MACzDA,KAAKiD,0BAA4BjD,KAAKiD,0BAA0B6E,KAAK9H,MAErE,MAAM2B,UAAEA,EAASoG,qBAAEA,GAAyB/H,KAAKS,MAEjD,IAAkB,IAAdkB,GAAuBoG,GAAsBC,qBAC7C,MAAM,IAAIvE,EACN,uBACA,uGAIR,IAAKzD,KAAKS,MAAMW,cAAc6G,WAC1B,MAAM,IAAIxE,EACN,uBACA,wGAIRzD,KAAKkD,UAAY,IAAIgF,EAAiBlI,KAAKS,MAAM0H,YAAanI,KAAK+C,UAAW,IACtEpB,GAAaoG,GAAsBC,sBAAwB,CAAEA,qBAAsBD,EAAqBC,sBAC5G7B,oBAAqBnG,KAAKmG,qBAElC,EA/BAP,EADEjG,EACYG,OAAOQ,EAAW8H,WAChCxC,EAFEjG,EAEY0I,aAAa,CAAC/H,EAAW8H,UAAW9H,EAAWC,gBAC7DqF,EAHEjG,EAGY2I,eAAeA"}
|
|
1
|
+
{"version":3,"file":"GooglePay.js","sources":["../../../../src/components/GooglePay/GooglePay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport GooglePayService from './GooglePayService';\nimport GooglePayButton from './components/GooglePayButton';\nimport defaultProps from './defaultProps';\nimport { formatGooglePayContactToAdyenAddressFormat, getGooglePayLocale } from './utils';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { TxVariants } from '../tx-variants';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nimport type { AddressData, BrowserInfo, RawPaymentMethod, PaymentResponseData, RawPaymentResponse } from '../../types/global-types';\nimport type { GooglePayConfiguration } from './types';\nimport type { ICore } from '../../core/types';\nimport { AnalyticsInfoEvent, InfoEventType, UiTarget } from '../../core/Analytics/events/AnalyticsInfoEvent';\nimport { mapGooglePayBrands } from './utils/map-adyen-brands-to-googlepay-brands';\n\nconst DEFAULT_ALLOWED_CARD_NETWORKS: google.payments.api.CardNetwork[] = ['AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'];\n\nclass GooglePay extends UIElement<GooglePayConfiguration> {\n public static readonly type = TxVariants.googlepay;\n public static readonly txVariants = [TxVariants.googlepay, TxVariants.paywithgoogle];\n public static readonly defaultProps = defaultProps;\n\n protected readonly googlePay;\n\n constructor(checkout: ICore, props?: GooglePayConfiguration) {\n super(checkout, props);\n this.handleAuthorization = this.handleAuthorization.bind(this);\n this.showGooglePayPaymentSheet = this.showGooglePayPaymentSheet.bind(this);\n\n const { isExpress, paymentDataCallbacks } = this.props;\n\n if (isExpress === false && paymentDataCallbacks?.onPaymentDataChanged) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'GooglePay - You must set \"isExpress\" flag to \"true\" in order to use \"onPaymentDataChanged\" callback'\n );\n }\n\n if (!this.props.configuration.merchantId) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'GooglePay - Missing merchantId. Please ensure that it is correctly configured in your customer area.'\n );\n }\n\n this.googlePay = new GooglePayService(this.props.environment, this.analytics, {\n ...(isExpress && paymentDataCallbacks?.onPaymentDataChanged && { onPaymentDataChanged: paymentDataCallbacks.onPaymentDataChanged }),\n onPaymentAuthorized: this.onPaymentAuthorized\n });\n }\n\n /**\n * Google Pay requires custom logic due to supporting two Tx variants that lead to the same payment method.\n * If the merchant creates a standalone Google Pay component, we need to verify if the payment method is available using both tx variants\n *\n * @param type\n * @param paymentMethodId - Unique internal payment method ID\n * @returns\n */\n protected override getPaymentMethodFromPaymentMethodsResponse(type?: string, paymentMethodId?: string): RawPaymentMethod {\n if (paymentMethodId) return this.core.paymentMethodsResponse.findById(paymentMethodId);\n\n return (\n this.core.paymentMethodsResponse.find(type || this.constructor['type']) || this.core.paymentMethodsResponse.find(TxVariants.paywithgoogle)\n );\n }\n\n protected override formatProps(props: GooglePayConfiguration): GooglePayConfiguration {\n const buttonSizeMode = props.buttonSizeMode ?? (props.isDropin ? 'fill' : 'static');\n const buttonLocale = getGooglePayLocale(props.buttonLocale ?? props.i18n?.locale);\n\n const callbackIntents: google.payments.api.CallbackIntent[] = [...props.callbackIntents, 'PAYMENT_AUTHORIZATION'];\n\n const allowedCardNetworks = this.createAllowedCardNetworksValues({\n allowedCardNetworks: props.allowedCardNetworks,\n brands: props.brands\n });\n\n return {\n ...props,\n allowedCardNetworks,\n configuration: props.configuration,\n buttonSizeMode,\n buttonLocale,\n callbackIntents\n };\n }\n\n /**\n * Formats the component data output\n */\n protected override formatData() {\n const { googlePayCardNetwork, googlePayToken, billingAddress, deliveryAddress } = this.state;\n const { isExpress } = this.props;\n\n return {\n paymentMethod: {\n type: this.type,\n googlePayCardNetwork,\n googlePayToken,\n ...(isExpress && { subtype: 'express' })\n },\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n };\n }\n\n /**\n * Generate the 'allowedCardNetworks' value used by Google Pay\n *\n * If the 'allowedCardNetworks' is defined in the Component configuration, it will be used. Otherwise we fallback\n * to use the 'brands' returned by the backoffice. It can be that 'brands' is not returned, which in this case we\n * set default values\n *\n * @param {object} brandsConfig\n * @param brandsConfig.allowedCardNetworks - Brands set in the component config\n * @param brandsConfig.brands - Brands returned by backend\n * @private\n */\n private createAllowedCardNetworksValues({\n allowedCardNetworks,\n brands\n }: {\n allowedCardNetworks?: google.payments.api.CardNetwork[];\n brands?: string[];\n }): google.payments.api.CardNetwork[] {\n if (allowedCardNetworks?.length > 0) return allowedCardNetworks;\n if (brands?.length > 0) return mapGooglePayBrands(brands);\n\n return DEFAULT_ALLOWED_CARD_NETWORKS;\n }\n\n protected override beforeRender(configSetByMerchant?: GooglePayConfiguration) {\n // We don't send 'rendered' events when rendering actions\n if (configSetByMerchant?.originalAction) {\n return;\n }\n\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.rendered,\n component: this.type,\n configData: { ...configSetByMerchant, showPayButton: this.props.showPayButton },\n ...(configSetByMerchant?.isExpress && { isExpress: configSetByMerchant.isExpress }),\n ...(configSetByMerchant?.expressPage && { expressPage: configSetByMerchant.expressPage })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n /**\n * Displays the Google Pay payment sheet overlay\n */\n private showGooglePayPaymentSheet() {\n this.googlePay.initiatePayment(this.props, this.core.options.countryCode).catch((error: google.payments.api.PaymentsError) => {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n this.handleError(new AdyenCheckoutError(error.statusCode === 'CANCELED' ? 'CANCEL' : 'ERROR', error.toString(), { cause: error }));\n });\n }\n\n public override submit = () => {\n if (this.props.isInstantPayment) {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.selected,\n target: UiTarget.instantPaymentButton\n });\n\n this.submitAnalytics(event);\n }\n\n new Promise<void>((resolve, reject) => this.props.onClick(resolve, reject)).then(this.showGooglePayPaymentSheet).catch(() => {\n // Swallow exception triggered by onClick reject\n });\n };\n\n /**\n * Method called when the payment is authorized in the payment sheet\n *\n * @see https://developers.google.com/pay/api/web/reference/client#onPaymentAuthorized\n **/\n private onPaymentAuthorized = async (paymentData: google.payments.api.PaymentData): Promise<google.payments.api.PaymentAuthorizationResult> => {\n const billingAddress: AddressData = formatGooglePayContactToAdyenAddressFormat(paymentData.paymentMethodData.info.billingAddress);\n const deliveryAddress: AddressData = formatGooglePayContactToAdyenAddressFormat(paymentData.shippingAddress, true);\n\n this.setState({\n authorizedEvent: paymentData,\n googlePayToken: paymentData.paymentMethodData.tokenizationData.token,\n googlePayCardNetwork: paymentData.paymentMethodData.info.cardNetwork,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<google.payments.api.PaymentAuthorizationResult>(resolve => {\n this.handleAuthorization()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((paymentResponse: PaymentResponseData) => {\n resolve({ transactionState: 'SUCCESS' });\n return paymentResponse;\n })\n .then(paymentResponse => {\n this.handleResponse(paymentResponse);\n })\n .catch((paymentResponse?: RawPaymentResponse) => {\n this.setElementStatus('ready');\n\n const googlePayError = paymentResponse?.error?.googlePayError;\n const fallbackMessage = this.props.i18n.get('error.subtitle.payment');\n\n const error: google.payments.api.PaymentDataError =\n typeof googlePayError === 'string' || undefined\n ? {\n intent: 'PAYMENT_AUTHORIZATION',\n reason: 'OTHER_ERROR',\n message: (googlePayError as string) || fallbackMessage\n }\n : {\n intent: googlePayError?.intent || 'PAYMENT_AUTHORIZATION',\n reason: googlePayError?.reason || 'OTHER_ERROR',\n message: googlePayError?.message || fallbackMessage\n };\n\n resolve({\n transactionState: 'ERROR',\n error\n });\n\n const responseWithError = {\n ...paymentResponse,\n error: {\n googlePayError: error\n }\n };\n\n this.handleFailedResult(responseWithError);\n });\n });\n };\n\n /**\n * Call the 'onAuthorized' callback if available.\n * Must be resolved/reject for the payment flow to continue\n */\n private async handleAuthorization(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!this.props.onAuthorized) {\n resolve();\n }\n\n const { authorizedEvent, billingAddress, deliveryAddress } = this.state;\n\n this.props.onAuthorized(\n {\n authorizedEvent,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n );\n }).catch((error?: google.payments.api.PaymentDataError | string) => {\n // Format error in a way that the 'catch' of the 'onPaymentAuthorize' block accepts it\n const data = { error: { googlePayError: error } };\n return Promise.reject(data);\n });\n }\n\n public get isValid(): boolean {\n return true;\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from the Google Pay API.\n */\n public override async isAvailable(): Promise<void> {\n return this.isReadyToPay()\n .then(response => {\n if (!response.result) {\n throw new AdyenCheckoutError('ERROR', 'GooglePay is not available');\n }\n\n if (response.paymentMethodPresent === false) {\n throw new AdyenCheckoutError('ERROR', 'GooglePay - No paymentMethodPresent');\n }\n\n return Promise.resolve();\n })\n .catch(error => {\n return Promise.reject(error);\n });\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from the Google Pay API.\n */\n public isReadyToPay = (): Promise<google.payments.api.IsReadyToPayResponse> => {\n return this.googlePay.isReadyToPay(this.props);\n };\n\n /**\n * Use this method to prefetch a PaymentDataRequest configuration to improve loadPaymentData execution time on later user interaction. No value is returned.\n */\n public prefetch = (): void => {\n return this.googlePay.prefetchPaymentData(this.props, this.core.options.countryCode);\n };\n\n get browserInfo(): BrowserInfo {\n return collectBrowserInfo();\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()('googlepay');\n }\n\n protected override componentToRender(): h.JSX.Element {\n if (this.props.showPayButton) {\n return (\n <GooglePayButton\n buttonColor={this.props.buttonColor}\n buttonType={this.props.buttonType}\n buttonSizeMode={this.props.buttonSizeMode}\n buttonLocale={this.props.buttonLocale}\n buttonRootNode={this.props.buttonRootNode}\n buttonRadius={this.props.buttonRadius}\n paymentsClient={this.googlePay.paymentsClient}\n onClick={this.submit}\n />\n );\n }\n\n return null;\n }\n}\n\nexport default GooglePay;\n"],"names":["DEFAULT_ALLOWED_CARD_NETWORKS","GooglePay","UIElement","getPaymentMethodFromPaymentMethodsResponse","type","paymentMethodId","this","core","paymentMethodsResponse","findById","find","constructor","TxVariants","paywithgoogle","formatProps","props","buttonSizeMode","isDropin","buttonLocale","getGooglePayLocale","i18n","locale","callbackIntents","allowedCardNetworks","createAllowedCardNetworksValues","brands","configuration","formatData","googlePayCardNetwork","googlePayToken","billingAddress","deliveryAddress","state","isExpress","paymentMethod","subtype","browserInfo","origin","window","location","length","mapGooglePayBrands","beforeRender","configSetByMerchant","originalAction","event","AnalyticsInfoEvent","InfoEventType","rendered","component","configData","showPayButton","expressPage","analytics","sendAnalytics","showGooglePayPaymentSheet","googlePay","initiatePayment","options","countryCode","catch","error","handleError","AdyenCheckoutError","statusCode","toString","cause","handleAuthorization","Promise","resolve","reject","onAuthorized","authorizedEvent","data","googlePayError","isValid","isAvailable","isReadyToPay","then","response","result","paymentMethodPresent","collectBrowserInfo","icon","resources","getImage","componentToRender","h","GooglePayButton","buttonColor","buttonType","buttonRootNode","buttonRadius","paymentsClient","onClick","submit","checkout","super","_define_property","isInstantPayment","selected","target","UiTarget","instantPaymentButton","submitAnalytics","onPaymentAuthorized","async","paymentData","formatGooglePayContactToAdyenAddressFormat","paymentMethodData","info","shippingAddress","setState","tokenizationData","token","cardNetwork","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","paymentResponse","transactionState","handleResponse","setElementStatus","fallbackMessage","get","intent","reason","message","responseWithError","handleFailedResult","prefetch","prefetchPaymentData","bind","paymentDataCallbacks","onPaymentDataChanged","merchantId","GooglePayService","environment","googlepay","txVariants","defaultProps"],"mappings":"64BAiBA,MAAMA,EAAmE,CAAC,OAAQ,WAAY,MAAO,aAAc,QAEnH,MAAMC,UAAkBC,EA0CpB,0CAAAC,CAA8DC,EAAeC,GACzE,OAAIA,EAAwBC,KAAKC,KAAKC,uBAAuBC,SAASJ,GAGlEC,KAAKC,KAAKC,uBAAuBE,KAAKN,GAAQE,KAAKK,YAAY,OAAYL,KAAKC,KAAKC,uBAAuBE,KAAKE,EAAWC,cAEpI,CAEmBC,WAAAA,CAAYC,GAC3B,MAAMC,EAAiBD,EAAMC,iBAAmBD,EAAME,SAAW,OAAS,UACpEC,EAAeC,EAAmBJ,EAAMG,cAAgBH,EAAMK,MAAMC,QAEpEC,EAAwD,IAAIP,EAAMO,gBAAiB,yBAEnFC,EAAsBjB,KAAKkB,gCAAgC,CAC7DD,oBAAqBR,EAAMQ,oBAC3BE,OAAQV,EAAMU,SAGlB,MAAO,IACAV,EACHQ,sBACAG,cAAeX,EAAMW,cACrBV,iBACAE,eACAI,kBAER,CAKA,UAAAK,GACI,M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EAASoG,qBAAEA,GAAyB/H,KAAKS,MAEjD,IAAkB,IAAdkB,GAAuBoG,GAAsBC,qBAC7C,MAAM,IAAIvE,EACN,uBACA,uGAIR,IAAKzD,KAAKS,MAAMW,cAAc6G,WAC1B,MAAM,IAAIxE,EACN,uBACA,wGAIRzD,KAAKkD,UAAY,IAAIgF,EAAiBlI,KAAKS,MAAM0H,YAAanI,KAAK+C,UAAW,IACtEpB,GAAaoG,GAAsBC,sBAAwB,CAAEA,qBAAsBD,EAAqBC,sBAC5G7B,oBAAqBnG,KAAKmG,qBAElC,EA/BAP,EADEjG,EACqBG,OAAOQ,EAAW8H,WACzCxC,EAFEjG,EAEqB0I,aAAa,CAAC/H,EAAW8H,UAAW9H,EAAWC,gBACtEqF,EAHEjG,EAGqB2I,eAAeA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GooglePayButton.js","sources":["../../../../../src/components/GooglePay/components/GooglePayButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport './GooglePayButton.scss';\n\ninterface GooglePayButtonProps {\n buttonColor: google.payments.api.ButtonColor;\n buttonType: google.payments.api.ButtonType;\n buttonSizeMode: google.payments.api.ButtonSizeMode;\n buttonLocale: string;\n buttonRadius?: number;\n buttonRootNode?: HTMLDocument | ShadowRoot;\n paymentsClient: Promise<google.payments.api.PaymentsClient>;\n onClick: (e: Event) => void;\n}\n\nconst GooglePayButton = (props: GooglePayButtonProps) => {\n const googlePayWrapperRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n const { onClick, buttonRadius, buttonColor, buttonType, buttonLocale, buttonSizeMode, buttonRootNode, paymentsClient } = props;\n\n void paymentsClient\n .then(client =>\n client.createButton({\n onClick,\n buttonType,\n buttonColor,\n buttonLocale,\n buttonSizeMode,\n buttonRootNode,\n ...(buttonRadius !== undefined && { buttonRadius })\n })\n )\n .then(googlePayButton => {\n if (googlePayWrapperRef.current) {\n googlePayWrapperRef.current.appendChild(googlePayButton);\n }\n });\n }, [props.buttonColor, props.buttonType, props.buttonLocale, props.buttonSizeMode, props.buttonRootNode, props.paymentsClient]);\n\n return <div data-testid=\"googlepay-button-container\" className={'adyen-checkout__paywithgoogle'} ref={googlePayWrapperRef} />;\n};\n\nexport default GooglePayButton;\n"],"names":["GooglePayButton","props","googlePayWrapperRef","useRef","undefined","useEffect","onClick","buttonRadius","buttonColor","buttonType","buttonLocale","buttonSizeMode","buttonRootNode","paymentsClient","then","client","createButton","googlePayButton","current","appendChild","h","div","data-testid","className","ref"],"mappings":"6JAeA,MAAMA,EAAmBC,IACrB,MAAMC,EAAsBC,OAAmCC,GAwB/D,OAtBAC,EAAU,KACN,MAAMC,QAAEA,EAAOC,aAAEA,EAAYC,YAAEA,EAAWC,WAAEA,EAAUC,aAAEA,EAAYC,eAAEA,EAAcC,eAAEA,EAAcC,eAAEA,GAAmBZ,EAEpHY,EACAC,KAAKC,GACFA,EAAOC,aAAa,CAChBV,UACAG,aACAD,cACAE,eACAC,iBACAC,yBACqBR,IAAjBG,GAA8B,CAAEA,mBAG3CO,KAAKG,IACEf,EAAoBgB,SACpBhB,EAAoBgB,QAAQC,YAAYF,MAGrD,CAAChB,EAAMO,YAAaP,EAAMQ,WAAYR,EAAMS,aAAcT,EAAMU,eAAgBV,EAAMW,eAAgBX,EAAMY,iBAExGO,EAACC,MAAAA,CAAIC,cAAY,6BAA6BC,UAAW,gCAAiCC,IAAKtB"}
|
|
1
|
+
{"version":3,"file":"GooglePayButton.js","sources":["../../../../../src/components/GooglePay/components/GooglePayButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport './GooglePayButton.scss';\n\ninterface GooglePayButtonProps {\n buttonColor: google.payments.api.ButtonColor;\n buttonType: google.payments.api.ButtonType;\n buttonSizeMode: google.payments.api.ButtonSizeMode;\n buttonLocale: string;\n buttonRadius?: number;\n buttonRootNode?: HTMLDocument | ShadowRoot;\n paymentsClient: Promise<google.payments.api.PaymentsClient>;\n onClick: (e: Event) => void;\n}\n\nconst GooglePayButton = (props: Readonly<GooglePayButtonProps>) => {\n const googlePayWrapperRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n const { onClick, buttonRadius, buttonColor, buttonType, buttonLocale, buttonSizeMode, buttonRootNode, paymentsClient } = props;\n\n void paymentsClient\n .then(client =>\n client.createButton({\n onClick,\n buttonType,\n buttonColor,\n buttonLocale,\n buttonSizeMode,\n buttonRootNode,\n ...(buttonRadius !== undefined && { buttonRadius })\n })\n )\n .then(googlePayButton => {\n if (googlePayWrapperRef.current) {\n googlePayWrapperRef.current.appendChild(googlePayButton);\n }\n });\n }, [props.buttonColor, props.buttonType, props.buttonLocale, props.buttonSizeMode, props.buttonRootNode, props.paymentsClient]);\n\n return <div data-testid=\"googlepay-button-container\" className={'adyen-checkout__paywithgoogle'} ref={googlePayWrapperRef} />;\n};\n\nexport default GooglePayButton;\n"],"names":["GooglePayButton","props","googlePayWrapperRef","useRef","undefined","useEffect","onClick","buttonRadius","buttonColor","buttonType","buttonLocale","buttonSizeMode","buttonRootNode","paymentsClient","then","client","createButton","googlePayButton","current","appendChild","h","div","data-testid","className","ref"],"mappings":"6JAeA,MAAMA,EAAmBC,IACrB,MAAMC,EAAsBC,OAAmCC,GAwB/D,OAtBAC,EAAU,KACN,MAAMC,QAAEA,EAAOC,aAAEA,EAAYC,YAAEA,EAAWC,WAAEA,EAAUC,aAAEA,EAAYC,eAAEA,EAAcC,eAAEA,EAAcC,eAAEA,GAAmBZ,EAEpHY,EACAC,KAAKC,GACFA,EAAOC,aAAa,CAChBV,UACAG,aACAD,cACAE,eACAC,iBACAC,yBACqBR,IAAjBG,GAA8B,CAAEA,mBAG3CO,KAAKG,IACEf,EAAoBgB,SACpBhB,EAAoBgB,QAAQC,YAAYF,MAGrD,CAAChB,EAAMO,YAAaP,EAAMQ,WAAYR,EAAMS,aAAcT,EAAMU,eAAgBV,EAAMW,eAAgBX,EAAMY,iBAExGO,EAACC,MAAAA,CAAIC,cAAY,6BAA6BC,UAAW,gCAAiCC,IAAKtB"}
|