@adyen/adyen-web 6.31.1 → 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/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +178 -152
- 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/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.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/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.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +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.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/constants.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/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 +178 -152
- package/dist/es/index.js +1 -1
- package/dist/es/utils/getOrigin.js +1 -1
- 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/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.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/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.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +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.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/constants.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/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/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
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,eAAI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/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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AAc,CAACC,EAASC,KACnBzC,KAAKL,MAAMsE,wBAAwBzB,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 +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 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,CAA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AAApC,KAAOD,kBAAmBoD,IACtBnD,KAAK0C,SAAS,CAAEnD,aAAc4D,OA1GlCf,EAbE7D,EAaY6E,eAAe,CACzBrB,aAAa,EACbsB,oBAAoB,EACpBhC,SAAU,OACVC,QAAS,OACTyB,OAAQ,OACRjB,sBAAuBwB"}
|
|
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,EAAO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AAe,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 +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,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,MAAMC,qBAAEA,EAAoBC,eAAEA,EAAcC,eAAEA,EAAcC,gBAAEA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uBoG,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,MAAMC,qBAAEA,EAAoBC,eAAEA,EAAcC,eAAEA,EAAcC,gBAAEA,GAAoBzB,KAAK0B,OACjFC,UAAEA,GAAc3B,KAAKS,MAE3B,MAAO,CACHmB,cAAe,CACX9B,KAAME,KAAKF,KACXwB,uBACAC,oBACII,GAAa,CAAEE,QAAS,YAEhCC,YAAa9B,KAAK8B,YAClBC,SAAUC,QAAUA,OAAOC,SAASF,UAChCP,GAAkB,CAAEA,qBACpBC,GAAmB,CAA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A,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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getDecimalAmount as e}from"../../utils/amount-util.js";import
|
|
1
|
+
import{getDecimalAmount as e}from"../../utils/amount-util.js";import r from"./config.js";function t({allowedAuthMethods:e,allowedCardNetworks:t,existingPaymentMethodRequired:a=!1}){return{apiVersion:r.API_VERSION,apiVersionMinor:r.API_VERSION_MINOR,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:e,allowedCardNetworks:t},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{}}}],existingPaymentMethodRequired:a}}function a({amount:r,countryCode:t="US",totalPriceStatus:a="FINAL",...i}){const n=String(e(r.value,r.currency));return{countryCode:t,currencyCode:r.currency,totalPrice:n,totalPriceStatus:a,...i.transactionInfo}}function i({configuration:e,...t},i){return{apiVersion:r.API_VERSION,apiVersionMinor:r.API_VERSION_MINOR,transactionInfo:a({countryCode:i,...t}),merchantInfo:{merchantId:e.merchantId,merchantName:e.merchantName,...e.merchantOrigin?{merchantOrigin:e.merchantOrigin}:{},...e.authJwt?{authJwt:e.authJwt}:{}},allowedPaymentMethods:[{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:r.GATEWAY,gatewayMerchantId:e.gatewayMerchantId}},parameters:{allowedAuthMethods:t.allowedAuthMethods,allowedCardNetworks:t.allowedCardNetworks,assuranceDetailsRequired:t.assuranceDetailsRequired,allowPrepaidCards:t.allowPrepaidCards,allowCreditCards:t.allowCreditCards,allowedIssuerCountryCodes:t.allowedIssuerCountryCodes,blockedIssuerCountryCodes:t.blockedIssuerCountryCodes,billingAddressRequired:t.billingAddressRequired,billingAddressParameters:t.billingAddressParameters}}],emailRequired:t.emailRequired,shippingAddressRequired:t.shippingAddressRequired,shippingAddressParameters:t.shippingAddressParameters,shippingOptionRequired:t.shippingOptionRequired,shippingOptionParameters:t.shippingOptionParameters,callbackIntents:t.callbackIntents}}export{a as getTransactionInfo,i as initiatePaymentRequest,t as isReadyToPayRequest};
|
|
2
2
|
//# sourceMappingURL=requests.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sources":["../../../../src/components/GooglePay/requests.ts"],"sourcesContent":["import { getDecimalAmount } from '../../utils/amount-util';\nimport config from './config';\nimport { GooglePaymentDataRequest, GooglePayConfiguration } from './types';\n\n/**\n * Configure your site's support for payment methods supported by the Google Pay API.\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#IsReadyToPayRequest|isReadyToPayRequest}\n * @returns Google Pay API version, payment methods supported by the site\n */\nexport function isReadyToPayRequest({\n allowedAuthMethods,\n allowedCardNetworks,\n existingPaymentMethodRequired = false\n}: Pick<\n GooglePayConfiguration,\n 'allowedAuthMethods' | 'allowedCardNetworks' | 'existingPaymentMethodRequired'\n>): google.payments.api.IsReadyToPayRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n allowedPaymentMethods: [\n {\n type: 'CARD',\n parameters: {\n allowedAuthMethods,\n allowedCardNetworks\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {}\n }\n }\n ],\n existingPaymentMethodRequired\n };\n}\n\n/**\n * Provide Google Pay API with a payment amount, currency, and amount status\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#TransactionInfo|TransactionInfo}\n * @returns transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n */\nexport function getTransactionInfo({\n amount,\n countryCode = 'US',\n totalPriceStatus = 'FINAL',\n ...props\n}: GooglePayConfiguration): google.payments.api.TransactionInfo {\n const formattedPrice = String(getDecimalAmount(amount.value, amount.currency));\n\n return {\n countryCode,\n currencyCode: amount.currency,\n totalPrice: formattedPrice,\n totalPriceStatus: totalPriceStatus,\n ...props.transactionInfo\n };\n}\n\nexport function initiatePaymentRequest({ configuration, ...props }: GooglePayConfiguration, countryCode: string): GooglePaymentDataRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n transactionInfo: getTransactionInfo({ countryCode, ...props }),\n merchantInfo: {\n merchantId: configuration.merchantId,\n merchantName: configuration.merchantName,\n ...(configuration.merchantOrigin ? { merchantOrigin: configuration.merchantOrigin } : {}),\n ...(configuration.authJwt ? { authJwt: configuration.authJwt } : {})\n },\n allowedPaymentMethods: [\n {\n type: 'CARD',\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n gateway: config.GATEWAY,\n gatewayMerchantId: configuration.gatewayMerchantId\n }\n },\n parameters: {\n allowedAuthMethods: props.allowedAuthMethods,\n allowedCardNetworks: props.allowedCardNetworks,\n assuranceDetailsRequired: props.assuranceDetailsRequired,\n allowPrepaidCards: props.allowPrepaidCards,\n allowCreditCards: props.allowCreditCards,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressParameters: props.billingAddressParameters\n }\n }\n ],\n emailRequired: props.emailRequired,\n shippingAddressRequired: props.shippingAddressRequired,\n shippingAddressParameters: props.shippingAddressParameters,\n shippingOptionRequired: props.shippingOptionRequired,\n shippingOptionParameters: props.shippingOptionParameters,\n callbackIntents: props.callbackIntents\n };\n}\n"],"names":["isReadyToPayRequest","allowedAuthMethods","allowedCardNetworks","existingPaymentMethodRequired","apiVersion","config","API_VERSION","apiVersionMinor","API_VERSION_MINOR","allowedPaymentMethods","type","parameters","tokenizationSpecification","getTransactionInfo","amount","countryCode","totalPriceStatus","props","formattedPrice","String","getDecimalAmount","value","currency","currencyCode","totalPrice","transactionInfo","initiatePaymentRequest","configuration","merchantInfo","merchantId","merchantName","merchantOrigin","authJwt","gateway","GATEWAY","gatewayMerchantId","assuranceDetailsRequired","allowPrepaidCards","allowCreditCards","billingAddressRequired","billingAddressParameters","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters","callbackIntents"],"mappings":"yFAUO,SAASA,GAAoBC,mBAChCA,EAAkBC,oBAClBA,EAAmBC,8BACnBA,GAAgC,IAKhC,MAAO,CACHC,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBC,sBAAuB,CACnB,CACIC,KAAM,OACNC,WAAY,CACRV,qBACAC,uBAEJU,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CAAA,KAIxBR,gCAER,CAQO,SAASU,GAAmBC,OAC/BA,EAAMC,YACNA,EAAc,KAAIC,iBAClBA,EAAmB,WAChBC,IAEH,MAAMC,EAAiBC,OAAOC,EAAiBN,EAAOO,MAAOP,EAAOQ,WAEpE,MAAO,CACHP,cACAQ,aAAcT,EAAOQ,SACrBE,WAAYN,EACZF,iBAAkBA,KACfC,EAAMQ,gBAEjB,CAEO,SAASC,GAAuBC,cAAEA,KAAkBV,GAAiCF,GACxF,MAAO,CACHX,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBiB,gBAAiBZ,EAAmB,CAAEE,iBAAgBE,IACtDW,aAAc,CACVC,WAAYF,EAAcE,WAC1BC,aAAcH,EAAcG,gBACxBH,EAAcI,eAAiB,CAAEA,eAAgBJ,EAAcI,gBAAmB,CAAA,KAClFJ,EAAcK,QAAU,CAAEA,QAASL,EAAcK,SAAY,CAAA,GAErEvB,sBAAuB,CACnB,CACIC,KAAM,OACNE,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CACRsB,QAAS5B,EAAO6B,QAChBC,kBAAmBR,EAAcQ,oBAGzCxB,WAAY,CACRV,mBAAoBgB,EAAMhB,mBAC1BC,oBAAqBe,EAAMf,oBAC3BkC,yBAA0BnB,EAAMmB,yBAChCC,kBAAmBpB,EAAMoB,kBACzBC,iBAAkBrB,EAAMqB,iBACxBC,
|
|
1
|
+
{"version":3,"file":"requests.js","sources":["../../../../src/components/GooglePay/requests.ts"],"sourcesContent":["import { getDecimalAmount } from '../../utils/amount-util';\nimport config from './config';\nimport { GooglePaymentDataRequest, GooglePayConfiguration } from './types';\n\n/**\n * Configure your site's support for payment methods supported by the Google Pay API.\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#IsReadyToPayRequest|isReadyToPayRequest}\n * @returns Google Pay API version, payment methods supported by the site\n */\nexport function isReadyToPayRequest({\n allowedAuthMethods,\n allowedCardNetworks,\n existingPaymentMethodRequired = false\n}: Pick<\n GooglePayConfiguration,\n 'allowedAuthMethods' | 'allowedCardNetworks' | 'existingPaymentMethodRequired'\n>): google.payments.api.IsReadyToPayRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n allowedPaymentMethods: [\n {\n type: 'CARD',\n parameters: {\n allowedAuthMethods,\n allowedCardNetworks\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {}\n }\n }\n ],\n existingPaymentMethodRequired\n };\n}\n\n/**\n * Provide Google Pay API with a payment amount, currency, and amount status\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#TransactionInfo|TransactionInfo}\n * @returns transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n */\nexport function getTransactionInfo({\n amount,\n countryCode = 'US',\n totalPriceStatus = 'FINAL',\n ...props\n}: GooglePayConfiguration): google.payments.api.TransactionInfo {\n const formattedPrice = String(getDecimalAmount(amount.value, amount.currency));\n\n return {\n countryCode,\n currencyCode: amount.currency,\n totalPrice: formattedPrice,\n totalPriceStatus: totalPriceStatus,\n ...props.transactionInfo\n };\n}\n\nexport function initiatePaymentRequest({ configuration, ...props }: GooglePayConfiguration, countryCode: string): GooglePaymentDataRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n transactionInfo: getTransactionInfo({ countryCode, ...props }),\n merchantInfo: {\n merchantId: configuration.merchantId,\n merchantName: configuration.merchantName,\n ...(configuration.merchantOrigin ? { merchantOrigin: configuration.merchantOrigin } : {}),\n ...(configuration.authJwt ? { authJwt: configuration.authJwt } : {})\n },\n allowedPaymentMethods: [\n {\n type: 'CARD',\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n gateway: config.GATEWAY,\n gatewayMerchantId: configuration.gatewayMerchantId\n }\n },\n parameters: {\n allowedAuthMethods: props.allowedAuthMethods,\n allowedCardNetworks: props.allowedCardNetworks,\n assuranceDetailsRequired: props.assuranceDetailsRequired,\n allowPrepaidCards: props.allowPrepaidCards,\n allowCreditCards: props.allowCreditCards,\n allowedIssuerCountryCodes: props.allowedIssuerCountryCodes,\n blockedIssuerCountryCodes: props.blockedIssuerCountryCodes,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressParameters: props.billingAddressParameters\n }\n }\n ],\n emailRequired: props.emailRequired,\n shippingAddressRequired: props.shippingAddressRequired,\n shippingAddressParameters: props.shippingAddressParameters,\n shippingOptionRequired: props.shippingOptionRequired,\n shippingOptionParameters: props.shippingOptionParameters,\n callbackIntents: props.callbackIntents\n };\n}\n"],"names":["isReadyToPayRequest","allowedAuthMethods","allowedCardNetworks","existingPaymentMethodRequired","apiVersion","config","API_VERSION","apiVersionMinor","API_VERSION_MINOR","allowedPaymentMethods","type","parameters","tokenizationSpecification","getTransactionInfo","amount","countryCode","totalPriceStatus","props","formattedPrice","String","getDecimalAmount","value","currency","currencyCode","totalPrice","transactionInfo","initiatePaymentRequest","configuration","merchantInfo","merchantId","merchantName","merchantOrigin","authJwt","gateway","GATEWAY","gatewayMerchantId","assuranceDetailsRequired","allowPrepaidCards","allowCreditCards","allowedIssuerCountryCodes","blockedIssuerCountryCodes","billingAddressRequired","billingAddressParameters","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters","callbackIntents"],"mappings":"yFAUO,SAASA,GAAoBC,mBAChCA,EAAkBC,oBAClBA,EAAmBC,8BACnBA,GAAgC,IAKhC,MAAO,CACHC,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBC,sBAAuB,CACnB,CACIC,KAAM,OACNC,WAAY,CACRV,qBACAC,uBAEJU,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CAAA,KAIxBR,gCAER,CAQO,SAASU,GAAmBC,OAC/BA,EAAMC,YACNA,EAAc,KAAIC,iBAClBA,EAAmB,WAChBC,IAEH,MAAMC,EAAiBC,OAAOC,EAAiBN,EAAOO,MAAOP,EAAOQ,WAEpE,MAAO,CACHP,cACAQ,aAAcT,EAAOQ,SACrBE,WAAYN,EACZF,iBAAkBA,KACfC,EAAMQ,gBAEjB,CAEO,SAASC,GAAuBC,cAAEA,KAAkBV,GAAiCF,GACxF,MAAO,CACHX,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBiB,gBAAiBZ,EAAmB,CAAEE,iBAAgBE,IACtDW,aAAc,CACVC,WAAYF,EAAcE,WAC1BC,aAAcH,EAAcG,gBACxBH,EAAcI,eAAiB,CAAEA,eAAgBJ,EAAcI,gBAAmB,CAAA,KAClFJ,EAAcK,QAAU,CAAEA,QAASL,EAAcK,SAAY,CAAA,GAErEvB,sBAAuB,CACnB,CACIC,KAAM,OACNE,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CACRsB,QAAS5B,EAAO6B,QAChBC,kBAAmBR,EAAcQ,oBAGzCxB,WAAY,CACRV,mBAAoBgB,EAAMhB,mBAC1BC,oBAAqBe,EAAMf,oBAC3BkC,yBAA0BnB,EAAMmB,yBAChCC,kBAAmBpB,EAAMoB,kBACzBC,iBAAkBrB,EAAMqB,iBACxBC,0BAA2BtB,EAAMsB,0BACjCC,0BAA2BvB,EAAMuB,0BACjCC,uBAAwBxB,EAAMwB,uBAC9BC,yBAA0BzB,EAAMyB,4BAI5CC,cAAe1B,EAAM0B,cACrBC,wBAAyB3B,EAAM2B,wBAC/BC,0BAA2B5B,EAAM4B,0BACjCC,uBAAwB7B,EAAM6B,uBAC9BC,yBAA0B9B,EAAM8B,yBAChCC,gBAAiB/B,EAAM+B,gBAE/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t="PRODUCTION"){switch(t){case"beta":case"test":return"TEST";default:return"PRODUCTION"}}function e(t,e){if(t)return{postalCode:t.postalCode,country:t.countryCode,street:[t.address1,t.address2,t.address3].join(" ").trim(),houseNumberOrName:"ZZ",city:t.locality||"",...t.administrativeArea&&{stateOrProvince:t.administrativeArea},...e&&{firstName:t.name}}}const r=["en","ar","bg","ca","cs","da","de","el","es","et","fi","fr","hr","id","it","ja","ko","ms","nl","no","pl","pt","ru","sk","sl","sr","sv","th","tr","uk","zh"];function s(t=""){const e=t.toLowerCase().substring(0,2);return r.includes(e)?e:null}export{e as formatGooglePayContactToAdyenAddressFormat,s as getGooglePayLocale,t as resolveEnvironment};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/GooglePay/utils.ts"],"sourcesContent":["import { AddressData } from '../../types/global-types';\n\n/**\n
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/GooglePay/utils.ts"],"sourcesContent":["import { AddressData } from '../../types/global-types';\n\n/**\n * Use same logic as Environment.ts where fallback is live (production)\n */\nexport function resolveEnvironment(env = 'PRODUCTION'): google.payments.api.Environment {\n switch (env) {\n case 'beta':\n case 'test':\n return 'TEST';\n default:\n return 'PRODUCTION';\n }\n}\n\n/**\n * This function formats Google Pay contact format to Adyen address format\n *\n * Setting 'houseNumberOrName' to ZZ won't affect the AVS check, and it will make the algorithm take the\n * house number from the 'street' property.\n */\nexport function formatGooglePayContactToAdyenAddressFormat(\n paymentContact?: Partial<google.payments.api.Address>,\n isDeliveryAddress?: boolean\n): AddressData | undefined {\n if (!paymentContact) {\n return;\n }\n\n return {\n postalCode: paymentContact.postalCode,\n country: paymentContact.countryCode,\n street: [paymentContact.address1, paymentContact.address2, paymentContact.address3].join(' ').trim(),\n houseNumberOrName: 'ZZ',\n city: paymentContact.locality || '',\n ...(paymentContact.administrativeArea && { stateOrProvince: paymentContact.administrativeArea }),\n ...(isDeliveryAddress && {\n firstName: paymentContact.name\n })\n };\n}\n\nconst supportedLocales = [\n 'en',\n 'ar',\n 'bg',\n 'ca',\n 'cs',\n 'da',\n 'de',\n 'el',\n 'es',\n 'et',\n 'fi',\n 'fr',\n 'hr',\n 'id',\n 'it',\n 'ja',\n 'ko',\n 'ms',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'ru',\n 'sk',\n 'sl',\n 'sr',\n 'sv',\n 'th',\n 'tr',\n 'uk',\n 'zh'\n];\n\nexport function getGooglePayLocale(locale = '') {\n const twoLetterLocale = locale.toLowerCase().substring(0, 2);\n return supportedLocales.includes(twoLetterLocale) ? twoLetterLocale : null;\n}\n"],"names":["resolveEnvironment","env","formatGooglePayContactToAdyenAddressFormat","paymentContact","isDeliveryAddress","postalCode","country","countryCode","street","address1","address2","address3","join","trim","houseNumberOrName","city","locality","administrativeArea","stateOrProvince","firstName","name","supportedLocales","getGooglePayLocale","locale","twoLetterLocale","toLowerCase","substring","includes"],"mappings":"AAKO,SAASA,EAAmBC,EAAM,cACrC,OAAQA,GACJ,IAAK,OACL,IAAK,OACD,MAAO,OACX,QACI,MAAO,aAEnB,CAQO,SAASC,EACZC,EACAC,GAEA,GAAKD,EAIL,MAAO,CACHE,WAAYF,EAAeE,WAC3BC,QAASH,EAAeI,YACxBC,OAAQ,CAACL,EAAeM,SAAUN,EAAeO,SAAUP,EAAeQ,UAAUC,KAAK,KAAKC,OAC9FC,kBAAmB,KACnBC,KAAMZ,EAAea,UAAY,MAC7Bb,EAAec,oBAAsB,CAAEC,gBAAiBf,EAAec,uBACvEb,GAAqB,CACrBe,UAAWhB,EAAeiB,MAGtC,CAEA,MAAMC,EAAmB,CACrB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MAGG,SAASC,EAAmBC,EAAS,IACxC,MAAMC,EAAkBD,EAAOE,cAAcC,UAAU,EAAG,GAC1D,OAAOL,EAAiBM,SAASH,GAAmBA,EAAkB,IAC1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KlarnaPayments.js","sources":["../../../../src/components/Klarna/KlarnaPayments.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PayButton from '../internal/PayButton';\nimport { KlarnaContainer } from './components/KlarnaContainer/KlarnaContainer';\nimport { TxVariants } from '../tx-variants';\nimport type { KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration } from './types';\nimport type { ICore } from '../../core/types';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\n\nclass KlarnaPayments extends UIElement<KlarnaConfiguration> {\n public static type = TxVariants.klarna;\n public static txVariants = [TxVariants.klarna, TxVariants.klarna_account, TxVariants.klarna_paynow, TxVariants.klarna_b2b];\n\n public componentRef: KlarnaComponentRef;\n\n protected static defaultProps = {\n useKlarnaWidget: false\n };\n\n constructor(checkout: ICore, props?: KlarnaConfiguration) {\n super(checkout, props);\n\n this.onComplete = this.onComplete.bind(this);\n this.updateWithAction = this.updateWithAction.bind(this);\n this.submit = this.submit.bind(this);\n this.onLoaded = this.onLoaded.bind(this);\n }\n get isValid() {\n return true;\n }\n\n protected formatData() {\n return {\n paymentMethod: {\n type: this.type,\n ...(this.props.useKlarnaWidget ? { subtype: 'sdk' } : {})\n }\n };\n }\n\n public payButton = (props: PayButtonProps) => {\n return <PayButton onClick={this.submit} {...props} />;\n };\n\n public override handleAction(action: KlarnaAction, props = {}): UIElement | null {\n if (action.type === 'sdk') {\n this.updateWithAction(action);\n return;\n }\n return super.handleAction(action, props);\n }\n\n updateWithAction(action: KlarnaAction): void {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n this.componentRef.setAction(action);\n }\n\n private onLoaded() {\n // When action/widget is loaded, set the 'drop-in' back to ready\n this.setElementStatus('ready');\n }\n\n public override activate() {\n this.componentRef.reinitializeWidget();\n }\n\n protected onComplete(details: KlarnaAdditionalDetailsData): void {\n this.handleAdditionalDetails(details);\n }\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <KlarnaContainer\n {...this.props}\n setComponentRef={this.setComponentRef}\n displayName={this.displayName}\n onComplete={this.onComplete}\n onError={this.props.onError}\n payButton={this.payButton}\n onLoaded={this.onLoaded}\n showPayButton={this.props.showPayButton}\n onActionHandled={this.onActionHandled}\n type={this.props.type}\n />\n );\n }\n}\n\nexport default KlarnaPayments;\n"],"names":["KlarnaPayments","UIElement","isValid","formatData","paymentMethod","type","this","props","useKlarnaWidget","subtype","handleAction","action","super","updateWithAction","paymentMethodType","Error","componentRef","setAction","onLoaded","setElementStatus","activate","reinitializeWidget","onComplete","details","handleAdditionalDetails","componentToRender","h","KlarnaContainer","setComponentRef","displayName","onError","payButton","showPayButton","onActionHandled","constructor","checkout","_define_property","PayButton","onClick","submit","bind","TxVariants","klarna","txVariants","klarna_account","klarna_paynow","klarna_b2b","defaultProps"],"mappings":"+aASA,MAAMA,UAAuBC,EAkBzB,WAAIC,GACA,OAAO,CACX,CAEUC,UAAAA,GACN,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,QACPC,KAAKC,MAAMC,gBAAkB,CAAEC,QAAS,OAAU,CAAA,GAGlE,CAMgBC,YAAAA,CAAaC,EAAsBJ,EAAQ,IACvD,GAAoB,QAAhBI,EAAON,KAIX,OAAOO,MAAMF,aAAaC,EAAQJ,GAH9BD,KAAKO,iBAAiBF,EAI9B,CAEAE,gBAAAA,CAAiBF,GACb,GAAIA,EAAOG,oBAAsBR,KAAKD,KAAM,MAAM,IAAIU,MAAM,kBAC5DT,KAAKU,aAAaC,UAAUN,EAChC,CAEQO,QAAAA,GAEJZ,KAAKa,iBAAiB,QAC1B,CAEgBC,QAAAA,GACZd,KAAKU,aAAaK,oBACtB,CAEUC,UAAAA,CAAWC,GACjBjB,KAAKkB,wBAAwBD,EACjC,CAEmBE,iBAAAA,GACf,OACIC,EAACC,EAAAA,IACOrB,KAAKC,MACTqB,gBAAiBtB,KAAKsB,gBACtBC,YAAavB,KAAKuB,YAClBP,WAAYhB,KAAKgB,WACjBQ,QAASxB,KAAKC,MAAMuB,QACpBC,UAAWzB,KAAKyB,UAChBb,SAAUZ,KAAKY,SACfc,cAAe1B,KAAKC,MAAMyB,cAC1BC,gBAAiB3B,KAAK2B,gBACtB5B,KAAMC,KAAKC,MAAMF,MAG7B,CAlEA,WAAA6B,CAAYC,EAAiB5B,GACzBK,MAAMuB,EAAU5B,GAPpB6B,EAAA9B,KAAOU,oBAAP,GA2BAoB,EAAA9B,KAAOyB,YAAaxB,GACTmB,EAACW,EAAAA,CAAUC,QAAShC,KAAKiC,UAAYhC,KAnB5CD,KAAKgB,WAAahB,KAAKgB,WAAWkB,KAAKlC,MACvCA,KAAKO,iBAAmBP,KAAKO,iBAAiB2B,KAAKlC,MACnDA,KAAKiC,OAASjC,KAAKiC,OAAOC,KAAKlC,MAC/BA,KAAKY,SAAWZ,KAAKY,SAASsB,KAAKlC,KACvC,EAhBA8B,EADEpC,
|
|
1
|
+
{"version":3,"file":"KlarnaPayments.js","sources":["../../../../src/components/Klarna/KlarnaPayments.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PayButton from '../internal/PayButton';\nimport { KlarnaContainer } from './components/KlarnaContainer/KlarnaContainer';\nimport { TxVariants } from '../tx-variants';\nimport type { KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration } from './types';\nimport type { ICore } from '../../core/types';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\n\nclass KlarnaPayments extends UIElement<KlarnaConfiguration> {\n public static readonly type = TxVariants.klarna;\n public static readonly txVariants = [TxVariants.klarna, TxVariants.klarna_account, TxVariants.klarna_paynow, TxVariants.klarna_b2b];\n\n public componentRef: KlarnaComponentRef;\n\n protected static readonly defaultProps = {\n useKlarnaWidget: false\n };\n\n constructor(checkout: ICore, props?: KlarnaConfiguration) {\n super(checkout, props);\n\n this.onComplete = this.onComplete.bind(this);\n this.updateWithAction = this.updateWithAction.bind(this);\n this.submit = this.submit.bind(this);\n this.onLoaded = this.onLoaded.bind(this);\n }\n get isValid() {\n return true;\n }\n\n protected formatData() {\n return {\n paymentMethod: {\n type: this.type,\n ...(this.props.useKlarnaWidget ? { subtype: 'sdk' } : {})\n }\n };\n }\n\n public payButton = (props: PayButtonProps) => {\n return <PayButton onClick={this.submit} {...props} />;\n };\n\n public override handleAction(action: KlarnaAction, props = {}): UIElement | null {\n if (action.type === 'sdk') {\n this.updateWithAction(action);\n return;\n }\n return super.handleAction(action, props);\n }\n\n updateWithAction(action: KlarnaAction): void {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n this.componentRef.setAction(action);\n }\n\n private onLoaded() {\n // When action/widget is loaded, set the 'drop-in' back to ready\n this.setElementStatus('ready');\n }\n\n public override activate() {\n this.componentRef.reinitializeWidget();\n }\n\n protected onComplete(details: KlarnaAdditionalDetailsData): void {\n this.handleAdditionalDetails(details);\n }\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <KlarnaContainer\n {...this.props}\n setComponentRef={this.setComponentRef}\n displayName={this.displayName}\n onComplete={this.onComplete}\n onError={this.props.onError}\n payButton={this.payButton}\n onLoaded={this.onLoaded}\n showPayButton={this.props.showPayButton}\n onActionHandled={this.onActionHandled}\n type={this.props.type}\n />\n );\n }\n}\n\nexport default KlarnaPayments;\n"],"names":["KlarnaPayments","UIElement","isValid","formatData","paymentMethod","type","this","props","useKlarnaWidget","subtype","handleAction","action","super","updateWithAction","paymentMethodType","Error","componentRef","setAction","onLoaded","setElementStatus","activate","reinitializeWidget","onComplete","details","handleAdditionalDetails","componentToRender","h","KlarnaContainer","setComponentRef","displayName","onError","payButton","showPayButton","onActionHandled","constructor","checkout","_define_property","PayButton","onClick","submit","bind","TxVariants","klarna","txVariants","klarna_account","klarna_paynow","klarna_b2b","defaultProps"],"mappings":"+aASA,MAAMA,UAAuBC,EAkBzB,WAAIC,GACA,OAAO,CACX,CAEUC,UAAAA,GACN,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,QACPC,KAAKC,MAAMC,gBAAkB,CAAEC,QAAS,OAAU,CAAA,GAGlE,CAMgBC,YAAAA,CAAaC,EAAsBJ,EAAQ,IACvD,GAAoB,QAAhBI,EAAON,KAIX,OAAOO,MAAMF,aAAaC,EAAQJ,GAH9BD,KAA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KlarnaContainer/KlarnaContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { KlarnaWidget } from '../KlarnaWidget/KlarnaWidget';\nimport type { ComponentMethodsRef, UIElementStatus } from '../../../internal/UIElement/types';\nimport type { ActionHandledReturnObject } from '../../../../types/global-types';\nimport type { AdyenCheckoutError, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef } from '../../../../types';\nimport { PayButtonProps } from '../../../internal/PayButton/PayButton';\n\ninterface KlarnaContainerProps {\n setComponentRef: (ref: ComponentMethodsRef) => void;\n displayName: string;\n showPayButton: boolean;\n type: string;\n onComplete(state: KlarnaAdditionalDetailsData): void;\n onError(error: AdyenCheckoutError): void;\n payButton(props: PayButtonProps): h.JSX.Element;\n onLoaded(): void;\n onActionHandled(actionHandled: ActionHandledReturnObject): void;\n}\n\nexport function KlarnaContainer({ setComponentRef, ...props }: KlarnaContainerProps) {\n const [widgetInitializationTime, setWidgetInitializationTime] = useState<number>(null);\n const [action, setAction] = useState<KlarnaAction>();\n const [status, setStatus] = useState('ready');\n const klarnaRef = useRef<KlarnaComponentRef>({\n setAction: (action: KlarnaAction) => {\n setAction(action);\n setWidgetInitializationTime(new Date().getTime());\n },\n setStatus: (status: UIElementStatus) => setStatus(status),\n reinitializeWidget: () => {\n setWidgetInitializationTime(new Date().getTime());\n }\n });\n\n useEffect(() => {\n setComponentRef(klarnaRef.current);\n }, [setComponentRef]);\n\n if (action?.sdkData) {\n return (\n <KlarnaWidget\n widgetInitializationTime={widgetInitializationTime}\n sdkData={action.sdkData}\n paymentMethodType={action.paymentMethodType}\n paymentData={action.paymentData}\n payButton={props.payButton}\n onComplete={props.onComplete}\n onError={props.onError}\n onLoaded={() => {\n props.onActionHandled?.({ componentType: props.type, actionDescription: 'sdk-loaded', originalAction: action });\n props.onLoaded();\n }}\n />\n );\n }\n\n if (props.showPayButton) {\n return props.payButton({\n ...props,\n status,\n disabled: status === 'loading',\n classNameModifiers: ['standalone'],\n label: `${this.props.i18n.get('continueTo')} ${props.displayName}`\n });\n }\n\n return null;\n}\n"],"names":["KlarnaContainer","setComponentRef","props","widgetInitializationTime","setWidgetInitializationTime","useState","action","setAction","status","setStatus","klarnaRef","useRef","Date","getTime","reinitializeWidget","useEffect","current","sdkData","h","KlarnaWidget","paymentMethodType","paymentData","payButton","onComplete","onError","onLoaded","onActionHandled","componentType","type","actionDescription","originalAction","showPayButton","disabled","classNameModifiers","label","this","i18n","get","displayName"],"mappings":"gPAoBO,SAASA,GAAgBC,gBAAEA,KAAoBC,IAClD,MAAOC,EAA0BC,GAA+BC,EAAiB,OAC1EC,EAAQC,GAAaF,KACrBG,EAAQC,GAAaJ,EAAS,SAC/BK,EAAYC,EAA2B,CACzCJ,UAAYD,IACRC,EAAUD,GACVF,GAA4B,IAAIQ,MAAOC,YAE3CJ,UAAYD,GAA4BC,EAAUD,GAClDM,mBAAoB,KAChBV,GAA4B,IAAIQ,MAAOC,cAQ/C,OAJAE,EAAU,KACNd,EAAgBS,EAAUM,UAC3B,CAACf,IAEAK,GAAQW,QAEJC,EAACC,EAAAA,CACGhB,yBAA0BA,EAC1Bc,QAASX,EAAOW,QAChBG,kBAAmBd,EAAOc,kBAC1BC,YAAaf,EAAOe,YACpBC,UAAWpB,EAAMoB,UACjBC,WAAYrB,EAAMqB,WAClBC,QAAStB,EAAMsB,QACfC,SAAU,KACNvB,EAAMwB,kBAAkB,CAAEC,cAAezB,EAAM0B,KAAMC,kBAAmB,aAAcC,eAAgBxB,IACtGJ,EAAMuB,cAMlBvB,EAAM6B,cACC7B,EAAMoB,UAAU,IAChBpB,EACHM,SACAwB,SAAqB,YAAXxB,EACVyB,mBAAoB,CAAC,cACrBC,MAAO,GAAGC,KAAKjC,MAAMkC,KAAKC,IAAI,iBAAiBnC,EAAMoC,gBAItD,IACX"}
|
|
1
|
+
{"version":3,"file":"KlarnaContainer.js","sources":["../../../../../../src/components/Klarna/components/KlarnaContainer/KlarnaContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { KlarnaWidget } from '../KlarnaWidget/KlarnaWidget';\nimport type { ComponentMethodsRef, UIElementStatus } from '../../../internal/UIElement/types';\nimport type { ActionHandledReturnObject } from '../../../../types/global-types';\nimport type { AdyenCheckoutError, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef } from '../../../../types';\nimport { PayButtonProps } from '../../../internal/PayButton/PayButton';\n\ninterface KlarnaContainerProps {\n setComponentRef: (ref: ComponentMethodsRef) => void;\n displayName: string;\n showPayButton: boolean;\n type: string;\n onComplete(state: KlarnaAdditionalDetailsData): void;\n onError(error: AdyenCheckoutError): void;\n payButton(props: PayButtonProps): h.JSX.Element;\n onLoaded(): void;\n onActionHandled(actionHandled: ActionHandledReturnObject): void;\n}\n\nexport function KlarnaContainer({ setComponentRef, ...props }: Readonly<KlarnaContainerProps>) {\n const [widgetInitializationTime, setWidgetInitializationTime] = useState<number>(null);\n const [action, setAction] = useState<KlarnaAction>();\n const [status, setStatus] = useState('ready');\n const klarnaRef = useRef<KlarnaComponentRef>({\n setAction: (action: KlarnaAction) => {\n setAction(action);\n setWidgetInitializationTime(new Date().getTime());\n },\n setStatus: (status: UIElementStatus) => setStatus(status),\n reinitializeWidget: () => {\n setWidgetInitializationTime(new Date().getTime());\n }\n });\n\n useEffect(() => {\n setComponentRef(klarnaRef.current);\n }, [setComponentRef]);\n\n if (action?.sdkData) {\n return (\n <KlarnaWidget\n widgetInitializationTime={widgetInitializationTime}\n sdkData={action.sdkData}\n paymentMethodType={action.paymentMethodType}\n paymentData={action.paymentData}\n payButton={props.payButton}\n onComplete={props.onComplete}\n onError={props.onError}\n onLoaded={() => {\n props.onActionHandled?.({ componentType: props.type, actionDescription: 'sdk-loaded', originalAction: action });\n props.onLoaded();\n }}\n />\n );\n }\n\n if (props.showPayButton) {\n return props.payButton({\n ...props,\n status,\n disabled: status === 'loading',\n classNameModifiers: ['standalone'],\n label: `${this.props.i18n.get('continueTo')} ${props.displayName}`\n });\n }\n\n return null;\n}\n"],"names":["KlarnaContainer","setComponentRef","props","widgetInitializationTime","setWidgetInitializationTime","useState","action","setAction","status","setStatus","klarnaRef","useRef","Date","getTime","reinitializeWidget","useEffect","current","sdkData","h","KlarnaWidget","paymentMethodType","paymentData","payButton","onComplete","onError","onLoaded","onActionHandled","componentType","type","actionDescription","originalAction","showPayButton","disabled","classNameModifiers","label","this","i18n","get","displayName"],"mappings":"gPAoBO,SAASA,GAAgBC,gBAAEA,KAAoBC,IAClD,MAAOC,EAA0BC,GAA+BC,EAAiB,OAC1EC,EAAQC,GAAaF,KACrBG,EAAQC,GAAaJ,EAAS,SAC/BK,EAAYC,EAA2B,CACzCJ,UAAYD,IACRC,EAAUD,GACVF,GAA4B,IAAIQ,MAAOC,YAE3CJ,UAAYD,GAA4BC,EAAUD,GAClDM,mBAAoB,KAChBV,GAA4B,IAAIQ,MAAOC,cAQ/C,OAJAE,EAAU,KACNd,EAAgBS,EAAUM,UAC3B,CAACf,IAEAK,GAAQW,QAEJC,EAACC,EAAAA,CACGhB,yBAA0BA,EAC1Bc,QAASX,EAAOW,QAChBG,kBAAmBd,EAAOc,kBAC1BC,YAAaf,EAAOe,YACpBC,UAAWpB,EAAMoB,UACjBC,WAAYrB,EAAMqB,WAClBC,QAAStB,EAAMsB,QACfC,SAAU,KACNvB,EAAMwB,kBAAkB,CAAEC,cAAezB,EAAM0B,KAAMC,kBAAmB,aAAcC,eAAgBxB,IACtGJ,EAAMuB,cAMlBvB,EAAM6B,cACC7B,EAAMoB,UAAU,IAChBpB,EACHM,SACAwB,SAAqB,YAAXxB,EACVyB,mBAAoB,CAAC,cACrBC,MAAO,GAAGC,KAAKjC,MAAMkC,KAAKC,IAAI,iBAAiBnC,EAAMoC,gBAItD,IACX"}
|