@adyen/adyen-web 6.8.0 → 6.10.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/adyen.css +21 -17
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +265 -71
- package/dist/es/_virtual/index.js +1 -1
- package/dist/es/_virtual/index2.js +2 -0
- package/dist/es/_virtual/index2.js.map +1 -0
- package/dist/es/adyen.css +21 -17
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/components/Ach/components/AchInput/AchInput.js +1 -1
- package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
- package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
- package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePay.js +1 -1
- package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es/components/ApplePay/defaultProps.js +1 -1
- package/dist/es/components/ApplePay/defaultProps.js.map +1 -1
- package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js +2 -0
- package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -0
- package/dist/es/components/ApplePay/services/ApplePayService.js.map +1 -0
- package/dist/es/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js +2 -0
- package/dist/es/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js.map +1 -0
- package/dist/es/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js +2 -0
- package/dist/es/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js.map +1 -0
- package/dist/es/components/ApplePay/utils/payment-request.js +2 -0
- package/dist/es/components/ApplePay/utils/payment-request.js.map +1 -0
- package/dist/es/components/ApplePay/utils/resolve-supported-version.js +2 -0
- package/dist/es/components/ApplePay/utils/resolve-supported-version.js.map +1 -0
- package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
- package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es/components/Boleto/Boleto.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 +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 +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 +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 +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 +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodName.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodName.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es/components/Giftcard/Giftcard.js +1 -1
- package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardResult.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/MBWay/MBWay.js +1 -1
- package/dist/es/components/MBWay/MBWay.js.map +1 -1
- package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
- package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es/components/PayTo/PayTo.js +2 -0
- package/dist/es/components/PayTo/PayTo.js.map +1 -0
- package/dist/es/components/PayTo/components/BSBInput.js +2 -0
- package/dist/es/components/PayTo/components/BSBInput.js.map +1 -0
- package/dist/es/components/PayTo/components/IdentifierSelector.js +2 -0
- package/dist/es/components/PayTo/components/IdentifierSelector.js.map +1 -0
- package/dist/es/components/PayTo/components/MandateSummary.js +2 -0
- package/dist/es/components/PayTo/components/MandateSummary.js.map +1 -0
- package/dist/es/components/PayTo/components/PayIDInput.js +2 -0
- package/dist/es/components/PayTo/components/PayIDInput.js.map +1 -0
- package/dist/es/components/PayTo/components/PayToComponent.js +2 -0
- package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -0
- package/dist/es/components/PayTo/components/PayToInstructions.js +2 -0
- package/dist/es/components/PayTo/components/PayToInstructions.js.map +1 -0
- package/dist/es/components/PayTo/components/PayToNameFields.js +2 -0
- package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -0
- package/dist/es/components/PayTo/components/PayToPhone.js +2 -0
- package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -0
- package/dist/es/components/PayTo/components/validate.js +2 -0
- package/dist/es/components/PayTo/components/validate.js.map +1 -0
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es/components/components-name-map.js +1 -1
- package/dist/es/components/components-name-map.js.map +1 -1
- package/dist/es/components/index.js +1 -1
- package/dist/es/components/internal/Alert/Alert.js +1 -1
- package/dist/es/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es/components/internal/Await/Await.js +1 -1
- package/dist/es/components/internal/Await/Await.js.map +1 -1
- package/dist/es/components/internal/Button/Button.js +1 -1
- package/dist/es/components/internal/Button/Button.js.map +1 -1
- package/dist/es/components/internal/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/es/components/internal/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
- package/dist/es/components/internal/ContentSeparator/ContentSeparator.js +1 -1
- package/dist/es/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es/components/internal/DetailsTable/DetailsTable.js +2 -0
- package/dist/es/components/internal/DetailsTable/DetailsTable.js.map +1 -0
- package/dist/es/components/internal/ExpandButton/ExpandButton.js +1 -1
- package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -1
- package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
- package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
- package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
- package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js +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 +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es/components/internal/Icon/Icon.js +1 -1
- package/dist/es/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es/components/internal/Img/Img.js +1 -1
- package/dist/es/components/internal/Img/Img.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js +1 -1
- package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js +2 -0
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -0
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +2 -0
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -0
- package/dist/es/components/internal/PhoneInput/validate.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es/components/internal/SendCopyToEmail/SendCopyToEmail.js +1 -1
- package/dist/es/components/internal/SendCopyToEmail/SendCopyToEmail.js.map +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/components/internal/Voucher/Voucher.js +1 -1
- package/dist/es/components/internal/Voucher/Voucher.js.map +1 -1
- package/dist/es/components/tx-variants.js +1 -1
- package/dist/es/components/tx-variants.js.map +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/filters.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
- package/dist/es/core/Services/analytics/collect-id.js +1 -1
- package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/core/utils.js +1 -1
- package/dist/es/core/utils.js.map +1 -1
- package/dist/es/external/classnames/index.js +2 -2
- package/dist/es/external/classnames/index.js.map +1 -1
- package/dist/es/index.d.ts +265 -71
- package/dist/es/index.js +1 -1
- package/dist/es/utils/Validator/ValidationRuleResult.js.map +1 -1
- package/dist/es/utils/Validator/Validator.js.map +1 -1
- package/dist/es/utils/inIframe.js +2 -0
- package/dist/es/utils/inIframe.js.map +1 -0
- package/dist/es-legacy/_virtual/index.js +1 -1
- package/dist/es-legacy/_virtual/index2.js +2 -0
- package/dist/es-legacy/_virtual/index2.js.map +1 -0
- package/dist/es-legacy/adyen.css +21 -17
- package/dist/es-legacy/adyen.css.map +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js +1 -1
- package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/defaultProps.js +1 -1
- package/dist/es-legacy/components/ApplePay/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js +2 -0
- package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -0
- package/dist/es-legacy/components/ApplePay/services/ApplePayService.js.map +1 -0
- package/dist/es-legacy/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js +2 -0
- package/dist/es-legacy/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js.map +1 -0
- package/dist/es-legacy/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js +2 -0
- package/dist/es-legacy/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js.map +1 -0
- package/dist/es-legacy/components/ApplePay/utils/payment-request.js +2 -0
- package/dist/es-legacy/components/ApplePay/utils/payment-request.js.map +1 -0
- package/dist/es-legacy/components/ApplePay/utils/resolve-supported-version.js +2 -0
- package/dist/es-legacy/components/ApplePay/utils/resolve-supported-version.js.map +1 -0
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es-legacy/components/Boleto/Boleto.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 +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 +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 +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 +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 +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/CardNumber.js +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/ExpirationDate.js +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/KCPAuthentication.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js +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 +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/Dropin/components/PaymentMethod/PaymentMethodName.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodName.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es-legacy/components/PayTo/PayTo.js +2 -0
- package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/BSBInput.js +2 -0
- package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js +2 -0
- package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/MandateSummary.js +2 -0
- package/dist/es-legacy/components/PayTo/components/MandateSummary.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/PayIDInput.js +2 -0
- package/dist/es-legacy/components/PayTo/components/PayIDInput.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/PayToComponent.js +2 -0
- package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/PayToInstructions.js +2 -0
- package/dist/es-legacy/components/PayTo/components/PayToInstructions.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/PayToNameFields.js +2 -0
- package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/PayToPhone.js +2 -0
- package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -0
- package/dist/es-legacy/components/PayTo/components/validate.js +2 -0
- package/dist/es-legacy/components/PayTo/components/validate.js.map +1 -0
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +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 +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es-legacy/components/components-name-map.js +1 -1
- package/dist/es-legacy/components/components-name-map.js.map +1 -1
- package/dist/es-legacy/components/index.js +1 -1
- package/dist/es-legacy/components/internal/Alert/Alert.js +1 -1
- package/dist/es-legacy/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/Button.js +1 -1
- package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
- package/dist/es-legacy/components/internal/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/es-legacy/components/internal/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js +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/CtPSingleCard/CtPSingleCard.js +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/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +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/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js +1 -1
- package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es-legacy/components/internal/DetailsTable/DetailsTable.js +2 -0
- package/dist/es-legacy/components/internal/DetailsTable/DetailsTable.js.map +1 -0
- package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +1 -1
- package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +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 +1 -1
- package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js +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 +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 +1 -1
- package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es-legacy/components/internal/Icon/Icon.js +1 -1
- package/dist/es-legacy/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es-legacy/components/internal/Img/Img.js +1 -1
- package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js +1 -1
- package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +2 -0
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -0
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +2 -0
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -0
- package/dist/es-legacy/components/internal/PhoneInput/validate.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es-legacy/components/internal/SendCopyToEmail/SendCopyToEmail.js +1 -1
- package/dist/es-legacy/components/internal/SendCopyToEmail/SendCopyToEmail.js.map +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es-legacy/components/internal/Voucher/Voucher.js +1 -1
- package/dist/es-legacy/components/internal/Voucher/Voucher.js.map +1 -1
- package/dist/es-legacy/components/tx-variants.js +1 -1
- package/dist/es-legacy/components/tx-variants.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js.map +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/core/utils.js +1 -1
- package/dist/es-legacy/core/utils.js.map +1 -1
- package/dist/es-legacy/external/classnames/index.js +2 -2
- package/dist/es-legacy/external/classnames/index.js.map +1 -1
- package/dist/es-legacy/index.js +1 -1
- package/dist/es-legacy/utils/Validator/ValidationRuleResult.js.map +1 -1
- package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
- package/dist/es-legacy/utils/inIframe.js +2 -0
- package/dist/es-legacy/utils/inIframe.js.map +1 -0
- package/package.json +29 -23
- package/styles/adyen.css +21 -17
- package/dist/es/components/ApplePay/ApplePayService.js.map +0 -1
- package/dist/es/components/ApplePay/config.js +0 -2
- package/dist/es/components/ApplePay/config.js.map +0 -1
- package/dist/es/components/ApplePay/payment-request.js +0 -2
- package/dist/es/components/ApplePay/payment-request.js.map +0 -1
- package/dist/es/components/ApplePay/utils.js +0 -2
- package/dist/es/components/ApplePay/utils.js.map +0 -1
- package/dist/es/components/internal/PhoneInput/PhoneInput.js +0 -2
- package/dist/es/components/internal/PhoneInput/PhoneInput.js.map +0 -1
- package/dist/es-legacy/components/ApplePay/ApplePayService.js.map +0 -1
- package/dist/es-legacy/components/ApplePay/config.js +0 -2
- package/dist/es-legacy/components/ApplePay/config.js.map +0 -1
- package/dist/es-legacy/components/ApplePay/payment-request.js +0 -2
- package/dist/es-legacy/components/ApplePay/payment-request.js.map +0 -1
- package/dist/es-legacy/components/ApplePay/utils.js +0 -2
- package/dist/es-legacy/components/ApplePay/utils.js.map +0 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +0 -2
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +0 -1
- /package/dist/es/components/ApplePay/{ApplePayService.js → services/ApplePayService.js} +0 -0
- /package/dist/es-legacy/components/ApplePay/{ApplePayService.js → services/ApplePayService.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as
|
|
1
|
+
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as o,useRef as t,useEffect as r}from"../../../../external/preact/hooks/dist/hooks.js";import a from"../../../../_virtual/index.js";import n from"./components/AchSecuredFields.js";import l from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import s from"../../../internal/FormFields/Field/Field.js";import c from"../../../internal/LoadingWrapper/LoadingWrapper.js";import i from"./defaultProps.js";import d from"./defaultStyles.js";import{useCoreContext as u}from"../../../../core/Context/CoreProvider.js";import m from"../../../internal/StoreDetails/StoreDetails.js";import h from"../../../internal/FormFields/InputText.js";import p from"../../../internal/FormInstruction/FormInstruction.js";import f from"../../../internal/FormFields/RadioGroup/RadioGroup.js";function y(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}function N(e){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(o){y(e,o,t[o])}))}return e}function g(e,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):function(e){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o.push.apply(o,t)}return o}(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})),e}function b(e,o=!1){return!o||!!e&&"string"==typeof e&&e.trim().length>0}function F(i){const{i18n:y}=u(),F=i.hasHolderName&&(!!i.holderName||!!i.data.holderName),[_,v]=o({}),[O,k]=o(N({},i.holderNameRequired&&{holderName:F})),[P,S]=o(N({bankAccountType:"checking"},i.hasHolderName&&{holderName:i.holderName||i.data.holderName})),[w,C]=o(!1),[x,R]=o(""),[q,A]=o(!1),E=e=>{const o=e.target.value;S(g(N({},P),{holderName:o})),v(g(N({},_),{holderName:!!i.holderNameRequired&&!b(o)})),k(g(N({},O),{holderName:!i.holderNameRequired||b(o,i.holderNameRequired)}))},T=e=>{const o=e.target.value;S(g(N({},P),{bankAccountType:o}))},V=t(null),[D,H]=o("ready"),I=t({});var L;Object.keys(I.current).length||(null===(L=i.setComponentRef)||void 0===L||L.call(i,I.current));return I.current.showValidation=()=>{V.current.showValidation(),i.holderNameRequired&&!O.holderName&&v(g(N({},_),{holderName:!0}))},I.current.setStatus=H,r((()=>(this.setFocusOn=V.current.setFocusOn,this.updateStyles=V.current.updateStyles,()=>{V.current.destroy()})),[]),r((()=>{const e=b(P.holderName,i.holderNameRequired),o=w&&e;i.onChange({data:P,isValid:o,storePaymentMethod:q})}),[P,O,_,q]),e("div",{className:a({"adyen-checkout__ach":!0,"adyen-checkout__ach--loading":"loading"===D})},e(p,null),e(l,g(N({ref:V},j(i)),{styles:N({},d,i.styles),onChange:e=>{const o=e,t=o.autoCompleteName?o.autoCompleteName:P.holderName;S(g(N({},P,o.data),{holderName:t})),v(N({},_,o.errors)),k(g(N({},O,o.valid),{holderName:!i.holderNameRequired||b(t,i.holderNameRequired)})),C(o.isSfpValid)},onFocus:e=>{const o=!0===e.focus;R(e.currentFocusObject),o?i.onFocus(e):i.onBlur(e)},render:({setRootNode:o,setFocusOn:t},r)=>{var l;return e("div",{ref:o,className:"adyen-checkout__ach-input sf-input__wrapper"},e(c,{status:r.status},e("div",{className:a(["adyen-checkout__fieldset","adyen-checkout__fieldset--ach"])},e("div",{className:"adyen-checkout__fieldset__title"},y.get("ach.bankAccount")),e(s,{classNameModifiers:["bankAccountType","no-borders"],name:"bankAccountType",useLabelElement:!1},e(f,{name:"bankAccountType",value:P.bankAccountType,items:[{id:"checking",name:y.get("ach.checking")},{id:"savings",name:y.get("ach.savings")}],onChange:T,required:!0,style:"button"})),i.hasHolderName&&e(s,{label:y.get("ach.accountHolderNameField.title"),className:"adyen-checkout__pm__holderName",errorMessage:!!_.holderName&&y.get("ach.accountHolderNameField.invalid"),showContextualElement:i.showContextualElement,contextualText:y.get("ach.accountHolderNameField.contextualText"),isValid:!!O.holderName,name:"holderName"},e(h,{className:"adyen-checkout__pm__holderName__input adyen-checkout__input",placeholder:null==i||null===(l=i.placeholders)||void 0===l?void 0:l.holderName,value:P.holderName,required:i.holderNameRequired,onInput:E})),e(n,{focusedElement:x,onFocusField:t,errors:r.errors,valid:r.valid})),i.enableStoreDetails&&e(m,{onChange:A})))}})),i.showPayButton&&i.payButton({status:D,label:y.get("confirmPurchase")}))}F.defaultProps=i;const j=e=>({autoFocus:e.autoFocus,clientKey:e.clientKey,i18n:e.i18n,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,onAllValid:e.onAllValid,onConfigSuccess:e.onConfigSuccess,onError:e.onError,onFieldValid:e.onFieldValid,onFocus:e.onFocus,onLoad:e.onLoad,showWarnings:e.showWarnings,styles:e.styles,type:e.type,forceCompat:e.forceCompat,resources:e.resources,placeholders:e.placeholders,handleKeyPress:e.handleKeyPress});export{F as default};
|
|
2
2
|
//# sourceMappingURL=AchInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AchInput.js","sources":["../../../../../../src/components/Ach/components/AchInput/AchInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport classNames from 'classnames';\nimport AchSecuredFields from './components/AchSecuredFields';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Field from '../../../internal/FormFields/Field';\nimport LoadingWrapper from '../../../internal/LoadingWrapper/LoadingWrapper';\nimport defaultProps from './defaultProps';\nimport defaultStyles from './defaultStyles';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './AchInput.scss';\nimport { ACHInputDataState, ACHInputProps, ACHInputStateError, ACHInputStateValid } from './types';\nimport StoreDetails from '../../../internal/StoreDetails';\nimport InputText from '../../../internal/FormFields/InputText';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport RadioGroup from '../../../internal/FormFields/RadioGroup';\n\nfunction validateHolderName(holderName, holderNameRequired = false) {\n if (holderNameRequired) {\n return !!holderName && typeof holderName === 'string' && holderName.trim().length > 0;\n }\n return true;\n}\n\nfunction AchInput(props: ACHInputProps) {\n const { i18n } = useCoreContext();\n\n const holderNameIsValid = props.hasHolderName && (!!props.holderName || !!props.data.holderName);\n\n const [errors, setErrors] = useState<ACHInputStateError>({});\n const [valid, setValid] = useState<ACHInputStateValid>({\n ...(props.holderNameRequired && { holderName: holderNameIsValid })\n });\n\n const [data, setData] = useState<ACHInputDataState>({\n bankAccountType: 'checking',\n ...(props.hasHolderName && { holderName: props.holderName || props.data.holderName })\n });\n\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [focusedElement, setFocusedElement] = useState('');\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n\n const handleFocus = e => {\n const isFocused = e.focus === true;\n\n setFocusedElement(e.currentFocusObject);\n\n if (isFocused) {\n props.onFocus(e);\n } else {\n props.onBlur(e);\n }\n };\n\n const handleHolderName = e => {\n const holderName = e.target.value;\n\n setData({ ...data, holderName });\n setErrors({ ...errors, holderName: props.holderNameRequired ? !validateHolderName(holderName) : false });\n setValid({ ...valid, holderName: props.holderNameRequired ? validateHolderName(holderName, props.holderNameRequired) : true });\n };\n\n const handleBankAccountType = e => {\n const bankAccountType = e.target.value;\n\n setData({ ...data, bankAccountType });\n };\n\n const handleSecuredFieldsChange = newState => {\n const sfState = newState;\n\n const tempHolderName = sfState.autoCompleteName ? sfState.autoCompleteName : data.holderName;\n\n setData({ ...data, ...sfState.data, holderName: tempHolderName });\n setErrors({ ...errors, ...sfState.errors });\n setValid({\n ...valid,\n ...sfState.valid,\n holderName: props.holderNameRequired ? validateHolderName(tempHolderName, props.holderNameRequired) : true\n });\n\n setIsSfpValid(sfState.isSfpValid);\n };\n\n // Refs\n const sfp = useRef(null);\n\n const [status, setStatus] = useState('ready');\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const achRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(achRef.current).length) {\n props.setComponentRef?.(achRef.current);\n }\n\n achRef.current.showValidation = () => {\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName\n if (props.holderNameRequired && !valid.holderName) {\n setErrors({ ...errors, holderName: true });\n }\n };\n\n achRef.current.setStatus = setStatus;\n\n useEffect(() => {\n this.setFocusOn = sfp.current.setFocusOn;\n this.updateStyles = sfp.current.updateStyles;\n\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n // Run when state.data, -errors or -valid change\n useEffect(() => {\n // Validate whole component i.e holderName + securedFields\n const holderNameValid = validateHolderName(data.holderName, props.holderNameRequired);\n const sfpValid = isSfpValid;\n\n const isValid = sfpValid && holderNameValid;\n\n props.onChange({ data, isValid, storePaymentMethod });\n }, [data, valid, errors, storePaymentMethod]);\n\n return (\n <div className=\"adyen-checkout__ach\">\n <FormInstruction />\n\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...defaultStyles, ...props.styles }}\n onChange={handleSecuredFieldsChange}\n onFocus={handleFocus}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div ref={setRootNode} className=\"adyen-checkout__ach-input sf-input__wrapper\">\n <LoadingWrapper status={sfpState.status}>\n <div className={classNames(['adyen-checkout__fieldset', 'adyen-checkout__fieldset--ach'])}>\n {<div className=\"adyen-checkout__fieldset__title\">{i18n.get('ach.bankAccount')}</div>}\n\n <Field classNameModifiers={['bankAccountType', 'no-borders']} name={'bankAccountType'} useLabelElement={false}>\n <RadioGroup\n name={'bankAccountType'}\n value={data.bankAccountType}\n items={[\n { id: 'checking', name: i18n.get('ach.checking') },\n { id: 'savings', name: i18n.get('ach.savings') }\n ]}\n onChange={handleBankAccountType}\n required={true}\n style={'button'}\n />\n </Field>\n\n {props.hasHolderName && (\n <Field\n label={i18n.get('ach.accountHolderNameField.title')}\n className={'adyen-checkout__pm__holderName'}\n errorMessage={!!errors.holderName && i18n.get('ach.accountHolderNameField.invalid')}\n showContextualElement={props.showContextualElement}\n contextualText={i18n.get('ach.accountHolderNameField.contextualText')}\n isValid={!!valid.holderName}\n name={'holderName'}\n >\n <InputText\n className=\"adyen-checkout__pm__holderName__input adyen-checkout__input\"\n placeholder={props?.placeholders?.holderName}\n value={data.holderName}\n required={props.holderNameRequired}\n onInput={handleHolderName}\n />\n </Field>\n )}\n\n <AchSecuredFields\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n errors={sfpState.errors}\n valid={sfpState.valid}\n />\n </div>\n\n {props.enableStoreDetails && <StoreDetails onChange={setStorePaymentMethod} />}\n </LoadingWrapper>\n </div>\n )}\n />\n {props.showPayButton && props.payButton({ status, label: i18n.get('confirmPurchase') })}\n </div>\n );\n}\n\nAchInput.defaultProps = defaultProps;\n\nexport default AchInput;\n\nconst extractPropsForSFP = (props: ACHInputProps) => {\n return {\n autoFocus: props.autoFocus,\n clientKey: props.clientKey,\n i18n: props.i18n,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n onAllValid: props.onAllValid,\n onConfigSuccess: props.onConfigSuccess,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onFocus: props.onFocus,\n onLoad: props.onLoad,\n showWarnings: props.showWarnings,\n styles: props.styles,\n type: props.type,\n forceCompat: props.forceCompat,\n resources: props.resources,\n placeholders: props.placeholders,\n handleKeyPress: props.handleKeyPress\n };\n};\n"],"names":["validateHolderName","holderName","holderNameRequired","trim","length","AchInput","props","i18n","useCoreContext","holderNameIsValid","hasHolderName","data","errors","setErrors","useState","valid","setValid","_object_spread","setData","bankAccountType","isSfpValid","setIsSfpValid","focusedElement","setFocusedElement","storePaymentMethod","setStorePaymentMethod","handleHolderName","e","target","value","_object_spread_props","handleBankAccountType","sfp","useRef","status","setStatus","achRef","Object","keys","current","setComponentRef","showValidation","useEffect","this","setFocusOn","updateStyles","destroy","holderNameValid","isValid","onChange","h","div","className","FormInstruction","SecuredFieldsProvider","ref","extractPropsForSFP","styles","defaultStyles","newState","sfState","tempHolderName","autoCompleteName","onFocus","isFocused","focus","currentFocusObject","onBlur","render","setRootNode","sfpState","LoadingWrapper","classNames","get","Field","classNameModifiers","name","useLabelElement","RadioGroup","items","id","required","style","label","errorMessage","showContextualElement","contextualText","InputText","placeholder","placeholders","onInput","AchSecuredFields","onFocusField","enableStoreDetails","StoreDetails","showPayButton","payButton","defaultProps","autoFocus","clientKey","keypadFix","legacyInputMode","loadingContext","onAllValid","onConfigSuccess","onError","onFieldValid","onLoad","showWarnings","type","forceCompat","resources","handleKeyPress"],"mappings":"8pDAkBA,SAASA,EAAmBC,EAAYC,GAAqB,GACzD,OAAIA,KACSD,GAAoC,iBAAfA,GAA2BA,EAAWE,OAAOC,OAAS,CAG5F,CAEA,SAASC,EAASC,GACd,MAAMC,KAAEA,GAASC,IAEXC,EAAoBH,EAAMI,kBAAoBJ,EAAML,cAAgBK,EAAMK,KAAKV,aAE9EW,EAAQC,GAAaC,EAA6B,CAAA,IAClDC,EAAOC,GAAYF,EAA6BG,EAC/CX,CAAAA,EAAAA,EAAMJ,oBAAsB,CAAED,WAAYQ,MAG3CE,EAAMO,GAAWJ,EAA4BG,EAAA,CAChDE,gBAAiB,YACbb,EAAMI,eAAiB,CAAET,WAAYK,EAAML,YAAcK,EAAMK,KAAKV,eAGrEmB,EAAYC,GAAiBP,GAAS,IACtCQ,EAAgBC,GAAqBT,EAAS,KAC9CU,EAAo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../../src/components/Ach/components/AchInput/AchInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport classNames from 'classnames';\nimport AchSecuredFields from './components/AchSecuredFields';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Field from '../../../internal/FormFields/Field';\nimport LoadingWrapper from '../../../internal/LoadingWrapper/LoadingWrapper';\nimport defaultProps from './defaultProps';\nimport defaultStyles from './defaultStyles';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './AchInput.scss';\nimport { ACHInputDataState, ACHInputProps, ACHInputStateError, ACHInputStateValid } from './types';\nimport StoreDetails from '../../../internal/StoreDetails';\nimport InputText from '../../../internal/FormFields/InputText';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport RadioGroup from '../../../internal/FormFields/RadioGroup';\n\nfunction validateHolderName(holderName, holderNameRequired = false) {\n if (holderNameRequired) {\n return !!holderName && typeof holderName === 'string' && holderName.trim().length > 0;\n }\n return true;\n}\n\nfunction AchInput(props: ACHInputProps) {\n const { i18n } = useCoreContext();\n\n const holderNameIsValid = props.hasHolderName && (!!props.holderName || !!props.data.holderName);\n\n const [errors, setErrors] = useState<ACHInputStateError>({});\n const [valid, setValid] = useState<ACHInputStateValid>({\n ...(props.holderNameRequired && { holderName: holderNameIsValid })\n });\n\n const [data, setData] = useState<ACHInputDataState>({\n bankAccountType: 'checking',\n ...(props.hasHolderName && { holderName: props.holderName || props.data.holderName })\n });\n\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [focusedElement, setFocusedElement] = useState('');\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n\n const handleFocus = e => {\n const isFocused = e.focus === true;\n\n setFocusedElement(e.currentFocusObject);\n\n if (isFocused) {\n props.onFocus(e);\n } else {\n props.onBlur(e);\n }\n };\n\n const handleHolderName = e => {\n const holderName = e.target.value;\n\n setData({ ...data, holderName });\n setErrors({ ...errors, holderName: props.holderNameRequired ? !validateHolderName(holderName) : false });\n setValid({ ...valid, holderName: props.holderNameRequired ? validateHolderName(holderName, props.holderNameRequired) : true });\n };\n\n const handleBankAccountType = e => {\n const bankAccountType = e.target.value;\n\n setData({ ...data, bankAccountType });\n };\n\n const handleSecuredFieldsChange = newState => {\n const sfState = newState;\n\n const tempHolderName = sfState.autoCompleteName ? sfState.autoCompleteName : data.holderName;\n\n setData({ ...data, ...sfState.data, holderName: tempHolderName });\n setErrors({ ...errors, ...sfState.errors });\n setValid({\n ...valid,\n ...sfState.valid,\n holderName: props.holderNameRequired ? validateHolderName(tempHolderName, props.holderNameRequired) : true\n });\n\n setIsSfpValid(sfState.isSfpValid);\n };\n\n // Refs\n const sfp = useRef(null);\n\n const [status, setStatus] = useState('ready');\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const achRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(achRef.current).length) {\n props.setComponentRef?.(achRef.current);\n }\n\n achRef.current.showValidation = () => {\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName\n if (props.holderNameRequired && !valid.holderName) {\n setErrors({ ...errors, holderName: true });\n }\n };\n\n achRef.current.setStatus = setStatus;\n\n useEffect(() => {\n this.setFocusOn = sfp.current.setFocusOn;\n this.updateStyles = sfp.current.updateStyles;\n\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n // Run when state.data, -errors or -valid change\n useEffect(() => {\n // Validate whole component i.e holderName + securedFields\n const holderNameValid = validateHolderName(data.holderName, props.holderNameRequired);\n const sfpValid = isSfpValid;\n\n const isValid = sfpValid && holderNameValid;\n\n props.onChange({ data, isValid, storePaymentMethod });\n }, [data, valid, errors, storePaymentMethod]);\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__ach': true,\n 'adyen-checkout__ach--loading': status === 'loading'\n })}\n >\n <FormInstruction />\n\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...defaultStyles, ...props.styles }}\n onChange={handleSecuredFieldsChange}\n onFocus={handleFocus}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div ref={setRootNode} className=\"adyen-checkout__ach-input sf-input__wrapper\">\n <LoadingWrapper status={sfpState.status}>\n <div className={classNames(['adyen-checkout__fieldset', 'adyen-checkout__fieldset--ach'])}>\n {<div className=\"adyen-checkout__fieldset__title\">{i18n.get('ach.bankAccount')}</div>}\n\n <Field classNameModifiers={['bankAccountType', 'no-borders']} name={'bankAccountType'} useLabelElement={false}>\n <RadioGroup\n name={'bankAccountType'}\n value={data.bankAccountType}\n items={[\n { id: 'checking', name: i18n.get('ach.checking') },\n { id: 'savings', name: i18n.get('ach.savings') }\n ]}\n onChange={handleBankAccountType}\n required={true}\n style={'button'}\n />\n </Field>\n\n {props.hasHolderName && (\n <Field\n label={i18n.get('ach.accountHolderNameField.title')}\n className={'adyen-checkout__pm__holderName'}\n errorMessage={!!errors.holderName && i18n.get('ach.accountHolderNameField.invalid')}\n showContextualElement={props.showContextualElement}\n contextualText={i18n.get('ach.accountHolderNameField.contextualText')}\n isValid={!!valid.holderName}\n name={'holderName'}\n >\n <InputText\n className=\"adyen-checkout__pm__holderName__input adyen-checkout__input\"\n placeholder={props?.placeholders?.holderName}\n value={data.holderName}\n required={props.holderNameRequired}\n onInput={handleHolderName}\n />\n </Field>\n )}\n\n <AchSecuredFields\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n errors={sfpState.errors}\n valid={sfpState.valid}\n />\n </div>\n\n {props.enableStoreDetails && <StoreDetails onChange={setStorePaymentMethod} />}\n </LoadingWrapper>\n </div>\n )}\n />\n {props.showPayButton && props.payButton({ status, label: i18n.get('confirmPurchase') })}\n </div>\n );\n}\n\nAchInput.defaultProps = defaultProps;\n\nexport default AchInput;\n\nconst extractPropsForSFP = (props: ACHInputProps) => {\n return {\n autoFocus: props.autoFocus,\n clientKey: props.clientKey,\n i18n: props.i18n,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n onAllValid: props.onAllValid,\n onConfigSuccess: props.onConfigSuccess,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onFocus: props.onFocus,\n onLoad: props.onLoad,\n showWarnings: props.showWarnings,\n styles: props.styles,\n type: props.type,\n forceCompat: props.forceCompat,\n resources: props.resources,\n placeholders: props.placeholders,\n handleKeyPress: props.handleKeyPress\n };\n};\n"],"names":["validateHolderName","holderName","holderNameRequired","trim","length","AchInput","props","i18n","useCoreContext","holderNameIsValid","hasHolderName","data","errors","setErrors","useState","valid","setValid","_object_spread","setData","bankAccountType","isSfpValid","setIsSfpValid","focusedElement","setFocusedElement","storePaymentMethod","setStorePaymentMethod","handleHolderName","e","target","value","_object_spread_props","handleBankAccountType","sfp","useRef","status","setStatus","achRef","Object","keys","current","setComponentRef","showValidation","useEffect","this","setFocusOn","updateStyles","destroy","holderNameValid","isValid","onChange","h","div","className","classNames","FormInstruction","SecuredFieldsProvider","ref","extractPropsForSFP","styles","defaultStyles","newState","sfState","tempHolderName","autoCompleteName","onFocus","isFocused","focus","currentFocusObject","onBlur","render","setRootNode","sfpState","LoadingWrapper","get","Field","classNameModifiers","name","useLabelElement","RadioGroup","items","id","required","style","label","errorMessage","showContextualElement","contextualText","InputText","placeholder","placeholders","onInput","AchSecuredFields","onFocusField","enableStoreDetails","StoreDetails","showPayButton","payButton","defaultProps","autoFocus","clientKey","keypadFix","legacyInputMode","loadingContext","onAllValid","onConfigSuccess","onError","onFieldValid","onLoad","showWarnings","type","forceCompat","resources","handleKeyPress"],"mappings":"mpDAkBA,SAASA,EAAmBC,EAAYC,GAAqB,GACzD,OAAIA,KACSD,GAAoC,iBAAfA,GAA2BA,EAAWE,OAAOC,OAAS,CAG5F,CAEA,SAASC,EAASC,GACd,MAAMC,KAAEA,GAASC,IAEXC,EAAoBH,EAAMI,kBAAoBJ,EAAML,cAAgBK,EAAMK,KAAKV,aAE9EW,EAAQC,GAAaC,EAA6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ClBC,gBAAiBlG,EAAMkG,gBACvBC,QAASnG,EAAMmG,QACfC,aAAcpG,EAAMoG,aACpB1C,QAAS1D,EAAM0D,QACf2C,OAAQrG,EAAMqG,OACdC,aAActG,EAAMsG,aACpBlD,OAAQpD,EAAMoD,OACdmD,KAAMvG,EAAMuG,KACZC,YAAaxG,EAAMwG,YACnBC,UAAWzG,EAAMyG,UACjBtB,aAAcnF,EAAMmF,aACpBuB,eAAgB1G,EAAM0G"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../
|
|
1
|
+
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../_virtual/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import r from"../../../../Card/components/CardInput/components/DataSfSpan.js";import{alternativeLabelContent as o}from"../../../../Card/components/CardInput/components/FieldLabelAlternative.js";import{capitalizeFirstLetter as n}from"../../../../../utils/textUtils.js";const i=({id:i,dataInfo:s,className:l="",label:d,focused:c,filled:m,errorMessage:p="",isValid:u=!1,onFocusField:f,dir:_})=>{const F=`encrypted${n(i)}`;return e(a,{label:d,focused:c,filled:m,classNameModifiers:[i],onFocusField:()=>f(F),errorMessage:p,isValid:u,className:l,dir:_,name:i,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:o},e(r,{encryptedFieldType:F,"data-info":s,className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":p.length,"adyen-checkout__input--focus":c,"adyen-checkout__input--valid":u})}))};export{i as default};
|
|
2
2
|
//# sourceMappingURL=AchSFInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/FieldLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/FieldLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"wcAOMA,MAAAA,EAAa,EAAGC,KAAIC,WAAUC,YAAY,GAAIC,QAAOC,UAASC,SAAQC,eAAe,GAAIC,WAAU,EAAOC,eAAcC,UAC1H,MACMC,EAAiB,YADDC,EAAsBX,KAG5C,OACIY,EAACC,EAAAA,CACGV,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRS,mBAAoB,CAACd,GACrBQ,aAAc,IAAMA,EAAaE,GACjCJ,aAAcA,EACdC,QAASA,EACTL,UAAWA,EACXO,IAAKA,EACLM,KAAMf,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BP,EAACQ,EAAAA,CACGC,mBAAoBX,EACpBY,YAAWrB,EACXC,UAAWqB,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgCjB,EAAakB,OAC7C,+BAAgCpB,EAChC,+BAAgCG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../external/preact/dist/preact.js";import{UIElement as t}from"../internal/UIElement/UIElement.js";import r from"./components/ApplePayButton.js";import
|
|
1
|
+
import{createElement as e}from"../../external/preact/dist/preact.js";import{UIElement as t}from"../internal/UIElement/UIElement.js";import r from"./components/ApplePayButton.js";import o from"./services/ApplePayService.js";import s from"../../utils/base64.js";import i from"./defaultProps.js";import{httpPost as n}from"../../core/Services/http.js";import{preparePaymentRequest as a}from"./utils/payment-request.js";import p from"../../core/Errors/AdyenCheckoutError.js";import{TxVariants as l}from"../tx-variants.js";import{sanitizeResponse as d,verifyPaymentDidNotFail as c}from"../internal/UIElement/utils.js";import{ANALYTICS_SELECTED_STR as h,ANALYTICS_INSTANT_PAYMENT_BUTTON as u}from"../../core/Analytics/constants.js";import{resolveSupportedVersion as y}from"./utils/resolve-supported-version.js";import{formatApplePayContactToAdyenAddressFormat as m}from"./utils/format-applepay-contact-to-adyen-format.js";import{mapBrands as b}from"./utils/map-adyen-brands-to-applepay-brands.js";import P from"./services/ApplePaySdkLoader.js";function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){f(e,t,r[t])}))}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}class g extends t{formatProps(e){var t,r,o;const s=(null===(t=e.brands)||void 0===t?void 0:t.length)?b(e.brands):e.supportedNetworks;var i;return v(A({},e),{configuration:e.configuration,supportedNetworks:s,buttonLocale:null!==(i=e.buttonLocale)&&void 0!==i?i:null===(r=e.i18n)||void 0===r?void 0:r.locale,totalPriceLabel:e.totalPriceLabel||(null===(o=e.configuration)||void 0===o?void 0:o.merchantName)})}formatData(){const{applePayToken:e,billingAddress:t,deliveryAddress:r}=this.state,{isExpress:o}=this.props;return A({paymentMethod:A({type:g.type,applePayToken:e},o&&{subtype:"express"})},t&&{billingAddress:t},r&&{deliveryAddress:r})}submitAnalytics(e){super.submitAnalytics(A({},e),this.props)}get isValid(){return!0}async applePayCapabilities(e){const t=e||this.props.configuration.merchantId;try{var r;return await this.sdkLoader.isSdkLoaded(),await(null===(r=ApplePaySession)||void 0===r?void 0:r.applePayCapabilities(t))}catch(e){throw new p("ERROR","Apple Pay: Error when requesting applePayCapabilities()",{cause:e})}}async isAvailable(){if("https:"!==window.location.protocol)return Promise.reject(new p("IMPLEMENTATION_ERROR","Trying to start an Apple Pay session from an insecure document"));try{var e;return await this.sdkLoader.isSdkLoaded(),(null===(e=ApplePaySession)||void 0===e?void 0:e.canMakePayments())?Promise.resolve():Promise.reject(new p("ERROR","Apple Pay is not available on this device"))}catch(e){return Promise.reject(new p("ERROR","Apple Pay SDK failed to load",{cause:e}))}}defineApplePayVersionNumber(){"https:"===window.location.protocol&&(this.applePayVersionNumber=this.props.version||y(14))}configureApplePayWebOptions(){if(window.ApplePayWebOptions){const{renderApplePayCodeAs:e,onApplePayCodeClose:t}=this.props;window.ApplePayWebOptions.set(A({renderApplePayCodeAs:e},t&&{onApplePayCodeClose:t}))}}startSession(){const{onValidateMerchant:e,onPaymentMethodSelected:t,onShippingMethodSelected:r,onShippingContactSelected:s}=this.props,i=a(A({companyName:this.props.configuration.merchantName,countryCode:this.core.options.countryCode},this.props)),n=new o(i,{version:this.applePayVersionNumber,onError:e=>{this.handleError(new p("ERROR","ApplePay - Something went wrong on ApplePayService",{cause:e}))},onCancel:e=>{this.handleError(new p("CANCEL","ApplePay UI dismissed",{cause:e}))},onPaymentMethodSelected:t,onShippingMethodSelected:r,onShippingContactSelected:s,onValidateMerchant:e||this.validateMerchant,onPaymentAuthorized:(e,t,r)=>{const o=m(r.payment.billingContact),s=m(r.payment.shippingContact,!0);this.setState(A({applePayToken:btoa(JSON.stringify(r.payment.token.paymentData)),authorizedEvent:r},o&&{billingAddress:o},s&&{deliveryAddress:s})),this.handleAuthorization().then(this.makePaymentsCall).then(d).then(c).then(this.collectOrderTrackingDetailsIfNeeded).then((({paymentResponse:t,orderDetails:r})=>(e(A({status:ApplePaySession.STATUS_SUCCESS},r&&{orderDetails:r})),t))).then((e=>{this.handleResponse(e)})).catch((e=>{var r;const o=null==e||null===(r=e.error)||void 0===r?void 0:r.applePayError;t({status:ApplePaySession.STATUS_FAILURE,errors:o?Array.isArray(o)?o:[o]:void 0});const s=v(A({},e),{error:{applePayError:o}});this.handleFailedResult(s)}))}});return new Promise(((e,t)=>this.props.onClick(e,t))).then((()=>{n.begin()})).catch((()=>({})))}async handleAuthorization(){return new Promise(((e,t)=>{this.props.onAuthorized||e();const{authorizedEvent:r,billingAddress:o,deliveryAddress:s}=this.state;this.props.onAuthorized(A({authorizedEvent:r},o&&{billingAddress:o},s&&{deliveryAddress:s}),{resolve:e,reject:t})})).catch((e=>{const t={error:{applePayError:e}};return Promise.reject(t)}))}async collectOrderTrackingDetailsIfNeeded(e){return new Promise(((e,t)=>{if(!this.props.onOrderTrackingRequest)return e();this.props.onOrderTrackingRequest(e,t)})).then((t=>A({paymentResponse:e},t&&{orderDetails:t}))).catch((()=>({paymentResponse:e})))}async validateMerchant(e,t){const{hostname:r}=window.location,{clientKey:o,configuration:i,loadingContext:a,initiative:p}=this.props,{merchantName:l,merchantId:d}=i,c={loadingContext:a,path:`v1/applePay/sessions?clientKey=${o}`},h={displayName:l,domainName:r,initiative:p,merchantIdentifier:d};try{const r=await n(c,h),o=s.decode(r.data);if(o.success){e(JSON.parse(o.data))}else t("Could not decode Apple Pay session")}catch(e){t("Could not get Apple Pay session")}}render(){return this.props.showPayButton?e(r,{buttonStyle:this.props.buttonColor,buttonType:this.props.buttonType,buttonLocale:this.props.buttonLocale,onClick:this.submit}):null}constructor(e,t){super(e,t),f(this,"sdkLoader",void 0),f(this,"applePayVersionNumber",void 0),f(this,"submit",(()=>{this.props.isInstantPayment&&this.submitAnalytics({type:h,target:u}),this.startSession()}));const{isExpress:r,onShippingContactSelected:o,onShippingMethodSelected:s}=this.props;if(!1===r&&(o||s))throw new p("IMPLEMENTATION_ERROR",'ApplePay - You must set "isExpress" flag to "true" in order to use "onShippingContactSelected" and/or "onShippingMethodSelected" callbacks');this.startSession=this.startSession.bind(this),this.submit=this.submit.bind(this),this.validateMerchant=this.validateMerchant.bind(this),this.collectOrderTrackingDetailsIfNeeded=this.collectOrderTrackingDetailsIfNeeded.bind(this),this.handleAuthorization=this.handleAuthorization.bind(this),this.defineApplePayVersionNumber=this.defineApplePayVersionNumber.bind(this),this.configureApplePayWebOptions=this.configureApplePayWebOptions.bind(this),this.sdkLoader=new P,this.sdkLoader.load().then(this.defineApplePayVersionNumber).then(this.configureApplePayWebOptions).catch((e=>{this.handleError(e)}))}}f(g,"type",l.applepay),f(g,"defaultProps",i);export{g as default};
|
|
2
2
|
//# sourceMappingURL=ApplePay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplePay.js","sources":["../../../../src/components/ApplePay/ApplePay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ApplePayButton from './components/ApplePayButton';\nimport ApplePayService from './ApplePayService';\nimport base64 from '../../utils/base64';\nimport defaultProps from './defaultProps';\nimport { httpPost } from '../../core/Services/http';\nimport { APPLEPAY_SESSION_ENDPOINT } from './config';\nimport { preparePaymentRequest } from './payment-request';\nimport { resolveSupportedVersion, mapBrands, formatApplePayContactToAdyenAddressFormat } from './utils';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { DecodeObject } from '../../types/global-types';\nimport { TxVariants } from '../tx-variants';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\nimport { ANALYTICS_INSTANT_PAYMENT_BUTTON, ANALYTICS_SELECTED_STR } from '../../core/Analytics/constants';\n\nimport type { ApplePayConfiguration, ApplePayElementData, ApplePayPaymentOrderDetails, ApplePaySessionRequest } from './types';\nimport type { ICore } from '../../core/types';\nimport type { PaymentResponseData, RawPaymentResponse } from '../../types/global-types';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\nconst latestSupportedVersion = 14;\n\nclass ApplePayElement extends UIElement<ApplePayConfiguration> {\n public static type = TxVariants.applepay;\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: ApplePayConfiguration) {\n super(checkout, props);\n\n const { isExpress, onShippingContactSelected, onShippingMethodSelected } = this.props;\n\n if (isExpress === false && (onShippingContactSelected || onShippingMethodSelected)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'ApplePay - You must set \"isExpress\" flag to \"true\" in order to use \"onShippingContactSelected\" and/or \"onShippingMethodSelected\" callbacks'\n );\n }\n\n this.startSession = this.startSession.bind(this);\n this.submit = this.submit.bind(this);\n this.validateMerchant = this.validateMerchant.bind(this);\n this.collectOrderTrackingDetailsIfNeeded = this.collectOrderTrackingDetailsIfNeeded.bind(this);\n this.handleAuthorization = this.handleAuthorization.bind(this);\n }\n\n /**\n * Formats the component props\n */\n protected override formatProps(props) {\n const version = props.version || resolveSupportedVersion(latestSupportedVersion);\n const supportedNetworks = props.brands?.length ? mapBrands(props.brands) : props.supportedNetworks;\n\n return {\n ...props,\n configuration: props.configuration,\n supportedNetworks,\n version,\n totalPriceLabel: props.totalPriceLabel || props.configuration?.merchantName\n };\n }\n\n /**\n * Formats the component data output\n */\n protected override formatData(): ApplePayElementData {\n const { applePayToken, billingAddress, deliveryAddress } = this.state;\n const { isExpress } = this.props;\n\n return {\n paymentMethod: {\n type: ApplePayElement.type,\n applePayToken,\n ...(isExpress && { subtype: 'express' })\n },\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n // Analytics will need to know about this.props.isExpress & this.props.expressPage\n super.submitAnalytics({ ...analyticsObj }, this.props);\n }\n\n public override submit = (): void => {\n // Analytics\n if (this.props.isInstantPayment) {\n this.submitAnalytics({ type: ANALYTICS_SELECTED_STR, target: ANALYTICS_INSTANT_PAYMENT_BUTTON });\n }\n void this.startSession();\n };\n\n private startSession() {\n const { version, onValidateMerchant, onPaymentMethodSelected, onShippingMethodSelected, onShippingContactSelected } = this.props;\n\n const paymentRequest = preparePaymentRequest({\n companyName: this.props.configuration.merchantName,\n countryCode: this.core.options.countryCode,\n ...this.props\n });\n\n const session = new ApplePayService(paymentRequest, {\n version,\n onError: (error: unknown) => {\n this.handleError(\n new AdyenCheckoutError('ERROR', 'ApplePay - Something went wrong on ApplePayService', {\n cause: error\n })\n );\n },\n onCancel: event => {\n this.handleError(new AdyenCheckoutError('CANCEL', 'ApplePay UI dismissed', { cause: event }));\n },\n onPaymentMethodSelected,\n onShippingMethodSelected,\n onShippingContactSelected,\n onValidateMerchant: onValidateMerchant || this.validateMerchant,\n onPaymentAuthorized: (resolve, reject, event) => {\n const billingAddress = formatApplePayContactToAdyenAddressFormat(event.payment.billingContact);\n const deliveryAddress = formatApplePayContactToAdyenAddressFormat(event.payment.shippingContact, true);\n\n this.setState({\n applePayToken: btoa(JSON.stringify(event.payment.token.paymentData)),\n authorizedEvent: event,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n this.handleAuthorization()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.collectOrderTrackingDetailsIfNeeded)\n .then(({ paymentResponse, orderDetails }) => {\n resolve({\n status: ApplePaySession.STATUS_SUCCESS,\n ...(orderDetails && { orderDetails })\n });\n return paymentResponse;\n })\n .then(paymentResponse => {\n this.handleResponse(paymentResponse);\n })\n .catch((paymentResponse?: RawPaymentResponse) => {\n const errors = paymentResponse?.error?.applePayError;\n\n reject({\n status: ApplePaySession.STATUS_FAILURE,\n errors: errors ? (Array.isArray(errors) ? errors : [errors]) : undefined\n });\n\n const responseWithError: RawPaymentResponse = {\n ...paymentResponse,\n error: {\n applePayError: errors\n }\n };\n\n this.handleFailedResult(responseWithError);\n });\n }\n });\n\n return new Promise((resolve, reject) => this.props.onClick(resolve, reject))\n .then(() => {\n session.begin();\n })\n .catch(() => ({\n // Swallow exception triggered by onClick reject\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\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?: ApplePayJS.ApplePayError) => {\n // Format error in a way that the 'catch' of the 'onPaymentAuthorize' block accepts it\n const data = { error: { applePayError: error } };\n return Promise.reject(data);\n });\n }\n\n /**\n * Verify if the 'onOrderTrackingRequest' is provided. If so, triggers the callback expecting an\n * Apple Pay order details back\n *\n * @private\n */\n private async collectOrderTrackingDetailsIfNeeded(\n paymentResponse: PaymentResponseData\n ): Promise<{ orderDetails?: ApplePayPaymentOrderDetails; paymentResponse: PaymentResponseData }> {\n return new Promise<ApplePayPaymentOrderDetails | void>((resolve, reject) => {\n if (!this.props.onOrderTrackingRequest) {\n return resolve();\n }\n\n this.props.onOrderTrackingRequest(resolve, reject);\n })\n .then(orderDetails => {\n return {\n paymentResponse,\n ...(orderDetails && { orderDetails })\n };\n })\n .catch(() => {\n return { paymentResponse };\n });\n }\n\n private async validateMerchant(resolve, reject) {\n const { hostname: domainName } = window.location;\n const { clientKey, configuration, loadingContext, initiative } = this.props;\n const { merchantName, merchantId } = configuration;\n const path = `${APPLEPAY_SESSION_ENDPOINT}?clientKey=${clientKey}`;\n const options = { loadingContext, path };\n const request: ApplePaySessionRequest = {\n displayName: merchantName,\n domainName,\n initiative,\n merchantIdentifier: merchantId\n };\n\n try {\n const response = await httpPost(options, request);\n const decodedData: DecodeObject = base64.decode(response.data);\n if (!decodedData.success) {\n reject('Could not decode Apple Pay session');\n } else {\n const session = JSON.parse(decodedData.data);\n resolve(session);\n }\n } catch (e) {\n reject('Could not get Apple Pay session');\n }\n }\n\n /**\n * Validation\n *\n * @remarks\n * Apple Pay does not require any specific validation\n */\n get isValid(): boolean {\n return true;\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from Apple Pay.\n * @returns Promise Resolve/Reject whether the shopper can use Apple Pay\n */\n public override async isAvailable(): Promise<void> {\n if (document.location.protocol !== 'https:') {\n return Promise.reject(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'Trying to start an Apple Pay session from an insecure document'));\n }\n\n if (!this.props.onValidateMerchant && !this.props.clientKey) {\n return Promise.reject(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'clientKey was not provided'));\n }\n\n try {\n if (window.ApplePaySession && ApplePaySession.canMakePayments() && ApplePaySession.supportsVersion(this.props.version)) {\n return Promise.resolve();\n }\n } catch (error) {\n console.warn(error);\n }\n\n return Promise.reject(new AdyenCheckoutError('ERROR', 'Apple Pay is not available on this device'));\n }\n\n /**\n * Renders the Apple Pay button or nothing in the Dropin\n */\n render() {\n if (this.props.showPayButton) {\n return (\n <ApplePayButton\n i18n={this.props.i18n}\n buttonColor={this.props.buttonColor}\n buttonType={this.props.buttonType}\n onClick={e => {\n e.preventDefault();\n this.submit();\n }}\n />\n );\n }\n\n return null;\n }\n}\n\nexport default ApplePayElement;\n"],"names":["ApplePayElement","UIElement","formatProps","props","version","resolveSupportedVersion","supportedNetworks","brands","length","mapBrands","_object_spread_props","configuration","totalPriceLabel","merchantName","formatData","applePayToken","billingAddress","deliveryAddress","this","state","isExpress","_object_spread","paymentMethod","type","subtype","submitAnalytics","analyticsObj","super","startSession","onValidateMerchant","onPaymentMethodSelected","onShippingMethodSelected","onShippingContactSelected","paymentRequest","preparePaymentRequest","companyName","countryCode","core","options","session","ApplePayService","onError","error","handleError","AdyenCheckoutError","cause","onCancel","event","validateMerchant","onPaymentAuthorized","resolve","reject","formatApplePayContactToAdyenAddressFormat","payment","billingContact","shippingContact","setState","btoa","JSON","stringify","token","paymentData","authorizedEvent","handleAuthorization","then","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","collectOrderTrackingDetailsIfNeeded","paymentResponse","orderDetails","status","ApplePaySession","STATUS_SUCCESS","handleResponse","catch","errors","applePayError","STATUS_FAILURE","Array","isArray","undefined","responseWithError","handleFailedResult","Promise","onClick","begin","onAuthorized","data","onOrderTrackingRequest","hostname","domainName","window","location","clientKey","loadingContext","initiative","merchantId","path","APPLEPAY_SESSION_ENDPOINT","request","displayName","merchantIdentifier","response","httpPost","decodedData","base64","decode","success","parse","e","isValid","isAvailable","document","protocol","canMakePayments","supportsVersion","console","warn","render","showPayButton","h","ApplePayButton","i18n","buttonColor","buttonType","preventDefault","submit","constructor","checkout","_define_property","isInstantPayment","ANALYTICS_SELECTED_STR","target","ANALYTICS_INSTANT_PAYMENT_BUTTON","bind","TxVariants","applepay","defaultProps"],"mappings":"gqDAuBA,MAAMA,UAAwBC,EA0BPC,WAAAA,CAAYC,OAEDA,EAOoBA,EAR9C,MAAMC,EAAUD,EAAMC,SAAWC,EA7BV,IA8BjBC,GAAoBH,QAAAA,EAAAA,EAAMI,cAANJ,IAAAA,OAAAA,EAAAA,EAAcK,QAASC,EAAUN,EAAMI,QAAUJ,EAAMG,kBAEjF,OAAOI,EACAP,EAAAA,CAAAA,EAAAA,GAAAA,CACHQ,cAAeR,EAAMQ,cACrBL,oBACAF,UACAQ,gBAAiBT,EAAMS,kBA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wH,KACjBC,YAAa1G,KAAKf,MAAMyH,YACxBC,WAAY3G,KAAKf,MAAM0H,WACvBxC,QAASyB,IACLA,EAAEgB,iBACF5G,KAAK6G,QAAM,IAMpB,IACX,CA1RAC,WAAAA,CAAYC,EAAiB9H,GACzBwB,MAAMsG,EAAU9H,GAyDpB+H,EAAAhH,KAAgB6G,UAAS,KAEjB7G,KAAKf,MAAMgI,kBACXjH,KAAKO,gBAAgB,CAAEF,KAAM6G,EAAwBC,OAAQC,IAE5DpH,KAAKU,cAAY,IA5DtB,MAAMR,UAAEA,EAASY,0BAAEA,EAAyBD,yBAAEA,GAA6Bb,KAAKf,MAEhF,IAAkB,IAAdiB,IAAwBY,GAA6BD,GACrD,MAAM,IAAIa,EACN,uBACA,8IAIR1B,KAAKU,aAAeV,KAAKU,aAAa2G,KAAKrH,MAC3CA,KAAK6G,OAAS7G,KAAK6G,OAAOQ,KAAKrH,MAC/BA,KAAK8B,iBAAmB9B,KAAK8B,iBAAiBuF,KAAKrH,MACnDA,KAAKkD,oCAAsClD,KAAKkD,oCAAoCmE,KAAKrH,MACzFA,KAAK6C,oBAAsB7C,KAAK6C,oBAAoBwE,KAAKrH,KAC7D,EApBAgH,EADElI,EACYuB,OAAOiH,EAAWC,UAChCP,EAFElI,EAEe0I,eAAeA"}
|
|
1
|
+
{"version":3,"file":"ApplePay.js","sources":["../../../../src/components/ApplePay/ApplePay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ApplePayButton from './components/ApplePayButton';\nimport ApplePayService from './services/ApplePayService';\nimport base64 from '../../utils/base64';\nimport defaultProps from './defaultProps';\nimport { httpPost } from '../../core/Services/http';\nimport { preparePaymentRequest } from './utils/payment-request';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { DecodeObject } from '../../types/global-types';\nimport { TxVariants } from '../tx-variants';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\nimport { ANALYTICS_INSTANT_PAYMENT_BUTTON, ANALYTICS_SELECTED_STR } from '../../core/Analytics/constants';\nimport { resolveSupportedVersion } from './utils/resolve-supported-version';\nimport { formatApplePayContactToAdyenAddressFormat } from './utils/format-applepay-contact-to-adyen-format';\nimport { mapBrands } from './utils/map-adyen-brands-to-applepay-brands';\nimport ApplePaySdkLoader from './services/ApplePaySdkLoader';\n\nimport type { SendAnalyticsObject } from '../../core/Analytics/types';\nimport type { ApplePayConfiguration, ApplePayElementData, ApplePayPaymentOrderDetails, ApplePaySessionRequest } from './types';\nimport type { ICore } from '../../core/types';\nimport type { PaymentResponseData, RawPaymentResponse } from '../../types/global-types';\n\nconst LATEST_APPLE_PAY_VERSION = 14;\n\nclass ApplePayElement extends UIElement<ApplePayConfiguration> {\n public static type = TxVariants.applepay;\n\n protected static defaultProps = defaultProps;\n\n private sdkLoader: ApplePaySdkLoader;\n private applePayVersionNumber: number = undefined;\n\n constructor(checkout: ICore, props?: ApplePayConfiguration) {\n super(checkout, props);\n\n const { isExpress, onShippingContactSelected, onShippingMethodSelected } = this.props;\n\n if (isExpress === false && (onShippingContactSelected || onShippingMethodSelected)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'ApplePay - You must set \"isExpress\" flag to \"true\" in order to use \"onShippingContactSelected\" and/or \"onShippingMethodSelected\" callbacks'\n );\n }\n\n this.startSession = this.startSession.bind(this);\n this.submit = this.submit.bind(this);\n this.validateMerchant = this.validateMerchant.bind(this);\n this.collectOrderTrackingDetailsIfNeeded = this.collectOrderTrackingDetailsIfNeeded.bind(this);\n this.handleAuthorization = this.handleAuthorization.bind(this);\n this.defineApplePayVersionNumber = this.defineApplePayVersionNumber.bind(this);\n this.configureApplePayWebOptions = this.configureApplePayWebOptions.bind(this);\n\n this.sdkLoader = new ApplePaySdkLoader();\n\n void this.sdkLoader\n .load()\n .then(this.defineApplePayVersionNumber)\n .then(this.configureApplePayWebOptions)\n .catch(error => {\n this.handleError(error);\n });\n }\n\n /**\n * Formats the component props\n */\n protected override formatProps(props): ApplePayConfiguration {\n const supportedNetworks = props.brands?.length ? mapBrands(props.brands) : props.supportedNetworks;\n\n return {\n ...props,\n configuration: props.configuration,\n supportedNetworks,\n buttonLocale: props.buttonLocale ?? props.i18n?.locale,\n totalPriceLabel: props.totalPriceLabel || props.configuration?.merchantName\n };\n }\n\n /**\n * Formats the component data output\n */\n protected override formatData(): ApplePayElementData {\n const { applePayToken, billingAddress, deliveryAddress } = this.state;\n const { isExpress } = this.props;\n\n return {\n paymentMethod: {\n type: ApplePayElement.type,\n applePayToken,\n ...(isExpress && { subtype: 'express' })\n },\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n // Analytics will need to know about this.props.isExpress & this.props.expressPage\n super.submitAnalytics({ ...analyticsObj }, this.props);\n }\n\n public override submit = (): void => {\n // Analytics\n if (this.props.isInstantPayment) {\n this.submitAnalytics({ type: ANALYTICS_SELECTED_STR, target: ANALYTICS_INSTANT_PAYMENT_BUTTON });\n }\n void this.startSession();\n };\n\n public get isValid(): boolean {\n return true;\n }\n\n /**\n * This API is only intended for upstreaming or defaulting to Apple Pay, all other scenarios should continue to\n * use canMakePayments(). For Safari browsers, this API will indicate whether there is a card available to make\n * payments. For third-party browsers a new status of paymentCredentialStatusUnknown will be returned. This does\n * not mean there are no cards available, it means the status cannot be determined and as such defaulting\n * and upstreaming should still be considered.\n *\n * {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities}\n * @param merchantIdentifier\n */\n public async applePayCapabilities(merchantIdentifier?: string): Promise<ApplePayJS.PaymentCredentialStatusResponse> {\n const identifier = merchantIdentifier || this.props.configuration.merchantId;\n\n try {\n await this.sdkLoader.isSdkLoaded();\n return await ApplePaySession?.applePayCapabilities(identifier);\n } catch (error) {\n throw new AdyenCheckoutError('ERROR', 'Apple Pay: Error when requesting applePayCapabilities()', { cause: error });\n }\n }\n\n /**\n * Determines if Apple Pay component can be displayed or not\n */\n public override async isAvailable(): Promise<void> {\n if (window.location.protocol !== 'https:') {\n return Promise.reject(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'Trying to start an Apple Pay session from an insecure document'));\n }\n\n try {\n await this.sdkLoader.isSdkLoaded();\n\n if (ApplePaySession?.canMakePayments()) {\n return Promise.resolve();\n }\n\n return Promise.reject(new AdyenCheckoutError('ERROR', 'Apple Pay is not available on this device'));\n } catch (error) {\n return Promise.reject(new AdyenCheckoutError('ERROR', 'Apple Pay SDK failed to load', { cause: error }));\n }\n }\n\n /**\n * Sets the Apple Pay version available for the shopper.\n * This code needs to be executed once the Apple Pay SDK is fully loaded\n * @private\n */\n private defineApplePayVersionNumber() {\n if (window.location.protocol !== 'https:') return;\n this.applePayVersionNumber = this.props.version || resolveSupportedVersion(LATEST_APPLE_PAY_VERSION);\n }\n\n /**\n * Sets the configuration/callbacks that pertain to the Apple Pay code overlay/modal.\n * @private\n */\n private configureApplePayWebOptions() {\n if (window.ApplePayWebOptions) {\n const { renderApplePayCodeAs, onApplePayCodeClose } = this.props;\n\n window.ApplePayWebOptions.set({\n renderApplePayCodeAs,\n ...(onApplePayCodeClose && { onApplePayCodeClose })\n });\n }\n }\n\n private startSession() {\n const { onValidateMerchant, onPaymentMethodSelected, onShippingMethodSelected, onShippingContactSelected } = this.props;\n\n const paymentRequest = preparePaymentRequest({\n companyName: this.props.configuration.merchantName,\n countryCode: this.core.options.countryCode,\n ...this.props\n });\n\n const session = new ApplePayService(paymentRequest, {\n version: this.applePayVersionNumber,\n onError: (error: unknown) => {\n this.handleError(\n new AdyenCheckoutError('ERROR', 'ApplePay - Something went wrong on ApplePayService', {\n cause: error\n })\n );\n },\n onCancel: event => {\n this.handleError(new AdyenCheckoutError('CANCEL', 'ApplePay UI dismissed', { cause: event }));\n },\n onPaymentMethodSelected,\n onShippingMethodSelected,\n onShippingContactSelected,\n onValidateMerchant: onValidateMerchant || this.validateMerchant,\n onPaymentAuthorized: (resolve, reject, event) => {\n const billingAddress = formatApplePayContactToAdyenAddressFormat(event.payment.billingContact);\n const deliveryAddress = formatApplePayContactToAdyenAddressFormat(event.payment.shippingContact, true);\n\n this.setState({\n applePayToken: btoa(JSON.stringify(event.payment.token.paymentData)),\n authorizedEvent: event,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n this.handleAuthorization()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.collectOrderTrackingDetailsIfNeeded)\n .then(({ paymentResponse, orderDetails }) => {\n resolve({\n status: ApplePaySession.STATUS_SUCCESS,\n ...(orderDetails && { orderDetails })\n });\n return paymentResponse;\n })\n .then(paymentResponse => {\n this.handleResponse(paymentResponse);\n })\n .catch((paymentResponse?: RawPaymentResponse) => {\n const errors = paymentResponse?.error?.applePayError;\n\n reject({\n status: ApplePaySession.STATUS_FAILURE,\n errors: errors ? (Array.isArray(errors) ? errors : [errors]) : undefined\n });\n\n const responseWithError: RawPaymentResponse = {\n ...paymentResponse,\n error: {\n applePayError: errors\n }\n };\n\n this.handleFailedResult(responseWithError);\n });\n }\n });\n\n return new Promise((resolve, reject) => this.props.onClick(resolve, reject))\n .then(() => {\n session.begin();\n })\n .catch(() => ({\n // Swallow exception triggered by onClick reject\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\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?: ApplePayJS.ApplePayError) => {\n // Format error in a way that the 'catch' of the 'onPaymentAuthorize' block accepts it\n const data = { error: { applePayError: error } };\n return Promise.reject(data);\n });\n }\n\n /**\n * Verify if the 'onOrderTrackingRequest' is provided. If so, triggers the callback expecting an\n * Apple Pay order details back\n *\n * @private\n */\n private async collectOrderTrackingDetailsIfNeeded(\n paymentResponse: PaymentResponseData\n ): Promise<{ orderDetails?: ApplePayPaymentOrderDetails; paymentResponse: PaymentResponseData }> {\n return new Promise<ApplePayPaymentOrderDetails | void>((resolve, reject) => {\n if (!this.props.onOrderTrackingRequest) {\n return resolve();\n }\n\n this.props.onOrderTrackingRequest(resolve, reject);\n })\n .then(orderDetails => {\n return {\n paymentResponse,\n ...(orderDetails && { orderDetails })\n };\n })\n .catch(() => {\n return { paymentResponse };\n });\n }\n\n private async validateMerchant(resolve, reject) {\n const { hostname: domainName } = window.location;\n const { clientKey, configuration, loadingContext, initiative } = this.props;\n const { merchantName, merchantId } = configuration;\n const path = `v1/applePay/sessions?clientKey=${clientKey}`;\n const options = { loadingContext, path };\n const request: ApplePaySessionRequest = {\n displayName: merchantName,\n domainName,\n initiative,\n merchantIdentifier: merchantId\n };\n\n try {\n const response = await httpPost(options, request);\n const decodedData: DecodeObject = base64.decode(response.data);\n if (!decodedData.success) {\n reject('Could not decode Apple Pay session');\n } else {\n const session = JSON.parse(decodedData.data);\n resolve(session);\n }\n } catch (e) {\n reject('Could not get Apple Pay session');\n }\n }\n\n render() {\n if (!this.props.showPayButton) {\n return null;\n }\n\n return (\n <ApplePayButton\n buttonStyle={this.props.buttonColor}\n buttonType={this.props.buttonType}\n buttonLocale={this.props.buttonLocale}\n onClick={this.submit}\n />\n );\n }\n}\n\nexport default ApplePayElement;\n"],"names":["ApplePayElement","UIElement","formatProps","props","supportedNetworks","brands","length","mapBrands","_object_spread_props","configuration","buttonLocale","i18n","locale","totalPriceLabel","merchantName","formatData","applePayToken","billingAddress","deliveryAddress","this","state","isExpress","_object_spread","paymentMethod","type","subtype","submitAnalytics","analyticsObj","super","isValid","applePayCapabilities","merchantIdentifier","identifier","merchantId","ApplePaySession","sdkLoader","isSdkLoaded","error","AdyenCheckoutError","cause","isAvailable","window","location","protocol","Promise","reject","canMakePayments","resolve","defineApplePayVersionNumber","applePayVersionNumber","version","resolveSupportedVersion","configureApplePayWebOptions","ApplePayWebOptions","renderApplePayCodeAs","onApplePayCodeClose","set","startSession","onValidateMerchant","onPaymentMethodSelected","onShippingMethodSelected","onShippingContactSelected","paymentRequest","preparePaymentRequest","companyName","countryCode","core","options","session","ApplePayService","onError","handleError","onCancel","event","validateMerchant","onPaymentAuthorized","formatApplePayContactToAdyenAddressFormat","payment","billingContact","shippingContact","setState","btoa","JSON","stringify","token","paymentData","authorizedEvent","handleAuthorization","then","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","collectOrderTrackingDetailsIfNeeded","paymentResponse","orderDetails","status","STATUS_SUCCESS","handleResponse","catch","errors","applePayError","STATUS_FAILURE","Array","isArray","undefined","responseWithError","handleFailedResult","onClick","begin","onAuthorized","data","onOrderTrackingRequest","hostname","domainName","clientKey","loadingContext","initiative","path","request","displayName","response","httpPost","decodedData","base64","decode","success","parse","e","render","showPayButton","h","ApplePayButton","buttonStyle","buttonColor","buttonType","submit","constructor","checkout","_define_property","isInstantPayment","ANALYTICS_SELECTED_STR","target","ANALYTICS_INSTANT_PAYMENT_BUTTON","bind","ApplePaySdkLoader","load","TxVariants","applepay","defaultProps"],"mappings":"4zDAyBA,MAAMA,UAAwBC,EA0CPC,WAAAA,CAAYC,GACDA,IAAAA,EAMcA,EACMA,EAP9C,MAAMC,GAAoBD,QAAAA,EAAAA,EAAME,cAANF,IAAAA,OAAAA,EAAAA,EAAcG,QAASC,EAAUJ,EAAME,QAAUF,EAAMC,kBAM/DD,IAAAA,EAJlB,OAAOK,EACAL,EAAAA,CAAAA,EAAAA,GAAAA,CACHM,cAAeN,EAAMM,cACrBL,oBACAM,aAAcP,QAAAA,EAAAA,EAAMO,oBAANP,IAAAA,EAAAA,EAAsBA,QAAAA,EAAAA,EAAMQ,YAANR,IAAAA,OAAAA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iBqE,KAAK5H,MACnDA,KAAKyE,oCAAsCzE,KAAKyE,oCAAoCmD,KAAK5H,MACzFA,KAAKoE,oBAAsBpE,KAAKoE,oBAAoBwD,KAAK5H,MACzDA,KAAK6B,4BAA8B7B,KAAK6B,4BAA4B+F,KAAK5H,MACzEA,KAAKiC,4BAA8BjC,KAAKiC,4BAA4B2F,KAAK5H,MAEzEA,KAAKgB,UAAY,IAAI6G,EAEhB7H,KAAKgB,UACL8G,OACAzD,KAAKrE,KAAK6B,6BACVwC,KAAKrE,KAAKiC,6BACV8C,OAAM7D,IACHlB,KAAKoD,YAAYlC,EAAAA,GAE7B,EApCAqG,EADE1I,EACYwB,OAAO0H,EAAWC,UAEhCT,EAHE1I,EAGeoJ,eAAeA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createElement as t}from"../../../external/preact/dist/preact.js";const e=({buttonStyle:e,buttonType:a,buttonLocale:o,onClick:l})=>t("apple-pay-button",{"data-testid":"apple-pay-button",buttonstyle:e,type:a,locale:o,onclick:l});export{e as default};
|
|
2
2
|
//# sourceMappingURL=ApplePayButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport type { ApplePayButtonStyle, ApplePayButtonType } from '../types';\nimport './ApplePayButton.scss';\n\ninterface ApplePayButtonProps {\n buttonStyle: ApplePayButtonStyle;\n buttonType: ApplePayButtonType;\n buttonLocale: string;\n onClick(): void;\n}\n\nconst ApplePayButton = ({ buttonStyle, buttonType, buttonLocale, onClick }: ApplePayButtonProps) => {\n return <apple-pay-button data-testid=\"apple-pay-button\" buttonstyle={buttonStyle} type={buttonType} locale={buttonLocale} onclick={onClick} />;\n};\n\nexport default ApplePayButton;\n"],"names":["ApplePayButton","buttonStyle","buttonType","buttonLocale","onClick","h","apple-pay-button","data-testid","buttonstyle","type","locale","onclick"],"mappings":"wEAWMA,MAAAA,EAAiB,EAAGC,cAAaC,aAAYC,eAAcC,aACtDC,EAACC,mBAAAA,CAAiBC,cAAY,mBAAmBC,YAAaP,EAAaQ,KAAMP,EAAYQ,OAAQP,EAAcQ,QAASP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{inIframe as t}from"../../utils/inIframe.js";const e={isExpress:!1,amount:{currency:"USD",value:0},totalPriceStatus:"final",initiative:"web",merchantCapabilities:["supports3DS"],supportedNetworks:["amex","discover","masterCard","visa"],buttonType:"plain",buttonColor:"black",renderApplePayCodeAs:t()?"window":"modal",onClick:t=>t()};export{e as default};
|
|
2
2
|
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/ApplePay/defaultProps.ts"],"sourcesContent":["import { ApplePayConfiguration } from './types';\n\nconst defaultProps: ApplePayConfiguration = {\n isExpress: false,\n amount: { currency: 'USD', value: 0 },\n totalPriceStatus: 'final',\n initiative: 'web',\n merchantCapabilities: ['supports3DS'],\n supportedNetworks: ['amex', 'discover', 'masterCard', 'visa'],\n buttonType: 'plain',\n buttonColor: 'black',\n onClick: resolve => resolve()\n};\n\nexport default defaultProps;\n"],"names":["defaultProps","isExpress","amount","currency","value","totalPriceStatus","initiative","merchantCapabilities","supportedNetworks","buttonType","buttonColor","onClick","resolve"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/ApplePay/defaultProps.ts"],"sourcesContent":["import { ApplePayConfiguration } from './types';\nimport { inIframe } from '../../utils/inIframe';\n\nconst defaultProps: ApplePayConfiguration = {\n isExpress: false,\n amount: { currency: 'USD', value: 0 },\n totalPriceStatus: 'final',\n initiative: 'web',\n merchantCapabilities: ['supports3DS'],\n supportedNetworks: ['amex', 'discover', 'masterCard', 'visa'],\n buttonType: 'plain',\n buttonColor: 'black',\n renderApplePayCodeAs: inIframe() ? 'window' : 'modal',\n onClick: resolve => resolve()\n};\n\nexport default defaultProps;\n"],"names":["defaultProps","isExpress","amount","currency","value","totalPriceStatus","initiative","merchantCapabilities","supportedNetworks","buttonType","buttonColor","renderApplePayCodeAs","inIframe","onClick","resolve"],"mappings":"mDAGA,MAAMA,EAAsC,CACxCC,WAAW,EACXC,OAAQ,CAAEC,SAAU,MAAOC,MAAO,GAClCC,iBAAkB,QAClBC,WAAY,MACZC,qBAAsB,CAAC,eACvBC,kBAAmB,CAAC,OAAQ,WAAY,aAAc,QACtDC,WAAY,QACZC,YAAa,QACbC,qBAAsBC,IAAa,SAAW,QAC9CC,QAASC,GAAWA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"../../../utils/Script.js";import s from"../../../core/Errors/AdyenCheckoutError.js";const e="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";class r{async load(){try{var r;const s=new o(e,"body",{crossOrigin:"anonymous"});return this.sdkLoadingPromise=s.load(),await this.sdkLoadingPromise,null===(r=window)||void 0===r?void 0:r.ApplePaySession}catch(o){throw new s("SCRIPT_ERROR","ApplePaySDK failed to load",{cause:o})}}isSdkLoaded(){return void 0===this.sdkLoadingPromise?Promise.reject():this.sdkLoadingPromise}constructor(){var o,s,e;e=void 0,(s="sdkLoadingPromise")in(o=this)?Object.defineProperty(o,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[s]=e}}export{e as APPLE_PAY_SDK_URL,r as default};
|
|
2
|
+
//# sourceMappingURL=ApplePaySdkLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplePaySdkLoader.js","sources":["../../../../../src/components/ApplePay/services/ApplePaySdkLoader.ts"],"sourcesContent":["import Script from '../../../utils/Script';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\n\nexport const APPLE_PAY_SDK_URL = 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js';\n\nclass ApplePaySdkLoader {\n private sdkLoadingPromise: Promise<void>;\n\n public async load(): Promise<ApplePaySession> {\n try {\n const scriptElement = new Script(APPLE_PAY_SDK_URL, 'body', { crossOrigin: 'anonymous' });\n this.sdkLoadingPromise = scriptElement.load();\n await this.sdkLoadingPromise;\n return window?.ApplePaySession;\n } catch (error) {\n throw new AdyenCheckoutError('SCRIPT_ERROR', 'ApplePaySDK failed to load', { cause: error });\n }\n }\n\n public isSdkLoaded(): Promise<void> {\n if (this.sdkLoadingPromise === undefined) {\n return Promise.reject();\n }\n\n return this.sdkLoadingPromise;\n }\n}\n\nexport default ApplePaySdkLoader;\n"],"names":["APPLE_PAY_SDK_URL","ApplePaySdkLoader","load","window","scriptElement","Script","crossOrigin","this","sdkLoadingPromise","ApplePaySession","error","AdyenCheckoutError","cause","isSdkLoaded","undefined","Promise","reject"],"mappings":"kGAGO,MAAMA,EAAoB,iEAEjC,MAAMC,EAGF,UAAaC,GACT,IAIWC,IAAAA,EAHP,MAAMC,EAAgB,IAAIC,EAAOL,EAAmB,OAAQ,CAAEM,YAAa,cAG3E,OAFAC,KAAKC,kBAAoBJ,EAAcF,aACjCK,KAAKC,kBACJL,QAAAA,EAAAA,cAAAA,IAAAA,OAAAA,EAAAA,EAAQM,eACnB,CAAE,MAAOC,GACL,MAAM,IAAIC,EAAmB,eAAgB,6BAA8B,CAAEC,MAAOF,GACxF,CACJ,CAEOG,WAAAA,GACH,YAA+BC,IAA3BP,KAAKC,kBACEO,QAAQC,SAGZT,KAAKC,iBAChB,gCAnBA,KAAQA,yBAARD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplePayService.js","sources":["../../../../../src/components/ApplePay/services/ApplePayService.ts"],"sourcesContent":["import { ApplePayPaymentAuthorizationResult } from '../types';\n\nexport interface ApplePayServiceOptions {\n version: number;\n onValidateMerchant: (resolve, reject, url) => void;\n onError: (error?: unknown) => void;\n onCancel?: (event: ApplePayJS.Event) => void;\n onPaymentMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;\n onShippingMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;\n onShippingContactSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;\n onPaymentAuthorized: (\n resolve: (result: ApplePayPaymentAuthorizationResult) => void,\n reject: (result: ApplePayPaymentAuthorizationResult) => void,\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent\n ) => void;\n}\n\nclass ApplePayService {\n private session: ApplePaySession;\n private readonly options: ApplePayServiceOptions;\n\n constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions) {\n this.options = options;\n\n this.session = new ApplePaySession(options.version, paymentRequest);\n this.session.onvalidatemerchant = event => {\n void this.onvalidatemerchant(event, options.onValidateMerchant);\n };\n this.session.onpaymentauthorized = event => {\n void this.onpaymentauthorized(event, options.onPaymentAuthorized);\n };\n\n this.session.oncancel = event => {\n this.oncancel(event, options.onCancel);\n };\n\n if (typeof options.onPaymentMethodSelected === 'function') {\n this.session.onpaymentmethodselected = event => {\n void this.onpaymentmethodselected(event, options.onPaymentMethodSelected);\n };\n }\n\n if (typeof options.onShippingContactSelected === 'function') {\n this.session.onshippingcontactselected = event => {\n void this.onshippingcontactselected(event, options.onShippingContactSelected);\n };\n }\n\n if (typeof options.onShippingMethodSelected === 'function') {\n this.session.onshippingmethodselected = event => {\n void this.onshippingmethodselected(event, options.onShippingMethodSelected);\n };\n }\n }\n\n /**\n * Begins the merchant validation process.\n * When this method is called, the payment sheet is presented and the merchant validation process is initiated.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778001-begin}\n */\n begin() {\n return this.session.begin();\n }\n\n /**\n * An event handler that is called when the payment sheet is displayed.\n * Use this attribute to request and return a merchant session.\n * @param event - An ApplePayValidateMerchantEvent object (contains validationURL)\n * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}\n */\n onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant) {\n return new Promise((resolve, reject) => onValidateMerchant(resolve, reject, event.validationURL))\n .then(response => {\n this.session.completeMerchantValidation(response);\n })\n .catch(error => {\n console.error(error);\n this.session.abort();\n this.options.onError(error);\n });\n }\n\n /**\n * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.\n * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentAuthorized - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized}\n */\n onpaymentauthorized(\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent,\n onPaymentAuthorized: ApplePayServiceOptions['onPaymentAuthorized']\n ): Promise<void> {\n return new Promise((resolve, reject) => onPaymentAuthorized(resolve, reject, event))\n .then((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n })\n .catch((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}\n */\n onpaymentmethodselected(event: ApplePayJS.ApplePayPaymentMethodSelectedEvent, onPaymentMethodSelected) {\n return new Promise((resolve, reject) => onPaymentMethodSelected(resolve, reject, event))\n .then((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n })\n .catch((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingContact attribute.\n * @param onShippingContactSelected - A promise that will complete the selection of a shipping contact with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingcontactselected(event: ApplePayJS.ApplePayShippingContactSelectedEvent, onShippingContactSelected) {\n return new Promise((resolve, reject) => onShippingContactSelected(resolve, reject, event))\n .then((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n })\n .catch((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingMethod attribute.\n * @param onShippingMethodSelected - A promise that will complete the selection of a shipping method with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingmethodselected(event: ApplePayJS.ApplePayShippingMethodSelectedEvent, onShippingMethodSelected) {\n return new Promise((resolve, reject) => onShippingMethodSelected(resolve, reject, event))\n .then((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n })\n .catch((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n });\n }\n\n /**\n * An event handler that is automatically called when the payment UI is dismissed.\n * This function can be called even after an onpaymentauthorized event has been dispatched.\n * @param event -\n * @param onCancel -\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}\n */\n oncancel(event: ApplePayJS.Event, onCancel): void {\n onCancel(event);\n }\n}\n\nexport default ApplePayService;\n"],"names":["ApplePayService","begin","this","session","onvalidatemerchant","event","onValidateMerchant","Promise","resolve","reject","validationURL","then","response","completeMerchantValidation","catch","error","console","abort","options","onError","onpaymentauthorized","onPaymentAuthorized","result","completePayment","onpaymentmethodselected","onPaymentMethodSelected","paymentMethodUpdate","completePaymentMethodSelection","onshippingcontactselected","onShippingContactSelected","shippingContactUpdate","completeShippingContactSelection","onshippingmethodselected","onShippingMethodSelected","shippingMethodUpdate","completeShippingMethodSelection","oncancel","onCancel","constructor","paymentRequest","_define_property","ApplePaySession","version"],"mappings":"wHAiBA,MAAMA,EA2CFC,KAAAA,GACI,OAAOC,KAAKC,QAAQF,OACxB,CASAG,kBAAAA,CAAmBC,EAAiDC,GAChE,OAAO,IAAIC,SAAQ,CAACC,EAASC,IAAWH,EAAmBE,EAASC,EAAQJ,EAAMK,iBAC7EC,MAAKC,IACFV,KAAKC,QAAQU,2BAA2BD,EAAAA,IAE3CE,OAAMC,IACHC,QAAQD,MAAMA,GACdb,KAAKC,QAAQc,QACbf,KAAKgB,QAAQC,QAAQJ,EAAAA,GAEjC,CAUAK,mBAAAA,CACIf,EACAgB,GAEA,OAAO,IAAId,SAAQ,CAACC,EAASC,IAAWY,EAAoBb,EAASC,EAAQJ,KACxEM,MAAMW,IACHpB,KAAKC,QAAQoB,gBAAgBD,EAAAA,IAEhCR,OAAOQ,IACJpB,KAAKC,QAAQoB,gBAAgBD,EAAAA,GAEzC,CAUAE,uBAAAA,CAAwBnB,EAAsDoB,GAC1E,OAAO,IAAIlB,SAAQ,CAACC,EAASC,IAAWgB,EAAwBjB,EAASC,EAAQJ,KAC5EM,MAAMe,IACHxB,KAAKC,QAAQwB,+BAA+BD,EAAAA,IAE/CZ,OAAOY,IACJxB,KAAKC,QAAQwB,+BAA+BD,EAAAA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yBAAyB3B,EAAOa,EAAQe,yBAAwB,EAGtF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(t,r){var n;if(t)return function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(r){e(t,r,n[r])}))}return t}({city:t.locality,country:t.countryCode,houseNumberOrName:"ZZ",postalCode:t.postalCode,street:null===(n=t.addressLines)||void 0===n?void 0:n.join(" ").trim()},t.administrativeArea&&{stateOrProvince:t.administrativeArea},r&&{firstName:t.givenName,lastName:t.familyName})}export{t as formatApplePayContactToAdyenAddressFormat};
|
|
2
|
+
//# sourceMappingURL=format-applepay-contact-to-adyen-format.js.map
|
package/dist/es-legacy/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-applepay-contact-to-adyen-format.js","sources":["../../../../../src/components/ApplePay/utils/format-applepay-contact-to-adyen-format.ts"],"sourcesContent":["import { AddressData } from '../../../types/global-types';\n\n/**\n * This function formats Apple 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 formatApplePayContactToAdyenAddressFormat(\n paymentContact: ApplePayJS.ApplePayPaymentContact,\n isDeliveryAddress?: boolean\n): AddressData | undefined {\n if (!paymentContact) {\n return;\n }\n\n return {\n city: paymentContact.locality,\n country: paymentContact.countryCode,\n houseNumberOrName: 'ZZ',\n postalCode: paymentContact.postalCode,\n street: paymentContact.addressLines?.join(' ').trim(),\n ...(paymentContact.administrativeArea && { stateOrProvince: paymentContact.administrativeArea }),\n ...(isDeliveryAddress && {\n firstName: paymentContact.givenName,\n lastName: paymentContact.familyName\n })\n };\n}\n"],"names":["formatApplePayContactToAdyenAddressFormat","paymentContact","isDeliveryAddress","_object_spread","city","locality","country","countryCode","houseNumberOrName","postalCode","street","addressLines","join","trim","administrativeArea","stateOrProvince","firstName","givenName","lastName","familyName"],"mappings":"wHAQO,SAASA,EACZC,EACAC,GAWYD,IAAAA,EATZ,GAAKA,EAIL,6UAAOE,CAAA,CACHC,KAAMH,EAAeI,SACrBC,QAASL,EAAeM,YACxBC,kBAAmB,KACnBC,WAAYR,EAAeQ,WAC3BC,OAAmC,QAA3BT,EAAAA,EAAeU,wBAAfV,SAAAA,EAA6BW,KAAK,KAAKC,QAC3CZ,EAAea,oBAAsB,CAAEC,gBAAiBd,EAAea,oBACvEZ,GAAqB,CACrBc,UAAWf,EAAegB,UAC1BC,SAAUjB,EAAekB,YAGrC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){const r={mc:"masterCard",amex:"amex",visa:"visa",elodebit:"elo",elo:"elo",interac:"interac",discover:"discover",jcb:"jcb",electron:"electron",maestro:"maestro",girocard:"girocard",cartebancaire:"cartesBancaires",eftpos_australia:"eftpos"};return e.reduce(((e,a)=>(r[a]&&!e.includes(r[a])&&e.push(r[a]),e)),[])}export{e as mapBrands};
|
|
2
|
+
//# sourceMappingURL=map-adyen-brands-to-applepay-brands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-adyen-brands-to-applepay-brands.js","sources":["../../../../../src/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.ts"],"sourcesContent":["export function mapBrands(brands) {\n const brandMapping = {\n mc: 'masterCard',\n amex: 'amex',\n visa: 'visa',\n elodebit: 'elo',\n elo: 'elo',\n interac: 'interac',\n discover: 'discover',\n jcb: 'jcb',\n electron: 'electron',\n maestro: 'maestro',\n girocard: 'girocard',\n cartebancaire: 'cartesBancaires',\n eftpos_australia: 'eftpos'\n };\n\n return brands.reduce((accumulator, item) => {\n if (!!brandMapping[item] && !accumulator.includes(brandMapping[item])) {\n accumulator.push(brandMapping[item]);\n }\n return accumulator;\n }, []);\n}\n"],"names":["mapBrands","brands","brandMapping","mc","amex","visa","elodebit","elo","interac","discover","jcb","electron","maestro","girocard","cartebancaire","eftpos_australia","reduce","accumulator","item","includes","push"],"mappings":"AAAO,SAASA,EAAUC,GACtB,MAAMC,EAAe,CACjBC,GAAI,aACJC,KAAM,OACNC,KAAM,OACNC,SAAU,MACVC,IAAK,MACLC,QAAS,UACTC,SAAU,WACVC,IAAK,MACLC,SAAU,WACVC,QAAS,UACTC,SAAU,WACVC,cAAe,kBACfC,iBAAkB,UAGtB,OAAOd,EAAOe,QAAO,CAACC,EAAaC,KACzBhB,EAAagB,KAAUD,EAAYE,SAASjB,EAAagB,KAC3DD,EAAYG,KAAKlB,EAAagB,IAE3BD,IACR,GACP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getDecimalAmount as t}from"../../../utils/amount-util.js";function e(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}const n=n=>{const{countryCode:r,companyName:i,amount:o}=n,a=e(n,["countryCode","companyName","amount"]),p=(e=>String(t(e.value,e.currency)))(o);return r||console.warn("Apple Pay - Make sure to set the countryCode in the AdyenCheckout configuration or in the Checkout Session creation"),{countryCode:r,currencyCode:o.currency,total:{label:a.totalPriceLabel,amount:p,type:a.totalPriceStatus},lineItems:a.lineItems,shippingMethods:a.shippingMethods,shippingType:a.shippingType,recurringPaymentRequest:a.recurringPaymentRequest,merchantCapabilities:a.merchantCapabilities,supportedCountries:a.supportedCountries,supportedNetworks:a.supportedNetworks,requiredShippingContactFields:a.requiredShippingContactFields,requiredBillingContactFields:a.requiredBillingContactFields,billingContact:a.billingContact,shippingContact:a.shippingContact,applicationData:a.applicationData}};export{n as default,n as preparePaymentRequest};
|
|
2
|
+
//# sourceMappingURL=payment-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-request.js","sources":["../../../../../src/components/ApplePay/utils/payment-request.ts"],"sourcesContent":["import { getDecimalAmount } from '../../../utils/amount-util';\nimport { PaymentAmount } from '../../../types/global-types';\n\nconst formatAmount = (amount: PaymentAmount) => String(getDecimalAmount(amount.value, amount.currency));\n\nexport const preparePaymentRequest = (paymentRequest): ApplePayJS.ApplePayPaymentRequest => {\n const { countryCode, companyName, amount, ...props } = paymentRequest;\n const formattedAmount = formatAmount(amount);\n\n if (!countryCode) {\n console.warn('Apple Pay - Make sure to set the countryCode in the AdyenCheckout configuration or in the Checkout Session creation');\n }\n\n return {\n countryCode,\n currencyCode: amount.currency,\n\n total: {\n label: props.totalPriceLabel,\n amount: formattedAmount,\n type: props.totalPriceStatus\n },\n\n lineItems: props.lineItems,\n shippingMethods: props.shippingMethods,\n shippingType: props.shippingType,\n\n recurringPaymentRequest: props.recurringPaymentRequest,\n\n merchantCapabilities: props.merchantCapabilities,\n supportedCountries: props.supportedCountries,\n supportedNetworks: props.supportedNetworks,\n\n requiredShippingContactFields: props.requiredShippingContactFields,\n requiredBillingContactFields: props.requiredBillingContactFields,\n\n billingContact: props.billingContact,\n shippingContact: props.shippingContact,\n\n applicationData: props.applicationData\n };\n};\n\nexport default preparePaymentRequest;\n"],"names":["preparePaymentRequest","paymentRequest","countryCode","companyName","amount","props","formattedAmount","String","getDecimalAmount","value","currency","formatAmount","console","warn","currencyCode","total","label","totalPriceLabel","type","totalPriceStatus","lineItems","shippingMethods","shippingType","recurringPaymentRequest","merchantCapabilities","supportedCountries","supportedNetworks","requiredShippingContactFields","requiredBillingContactFields","billingContact","shippingContact","applicationData"],"mappings":"qbAGA,MAEaA,EAAyBC,IAClC,MAAMC,YAAEA,EAAWC,YAAEA,EAAWC,OAAEA,GAAqBH,EAAVI,EAAUJ,EAAAA,EAAAA,CAA/CC,cAAaC,cAAaC,WAC5BE,EAJW,CAACF,GAA0BG,OAAOC,EAAiBJ,EAAOK,MAAOL,EAAOM,WAIjEC,CAAaP,GAMrC,OAJKF,GACDU,QAAQC,KAAK,uHAGV,CACHX,cACAY,aAAcV,EAAOM,SAErBK,MAAO,CACHC,MAAOX,EAAMY,gBACbb,OAAQE,EACRY,KAAMb,EAAMc,kBAGhBC,UAAWf,EAAMe,UACjBC,gBAAiBhB,EAAMgB,gBACvBC,aAAcjB,EAAMiB,aAEpBC,wBAAyBlB,EAAMkB,wBAE/BC,qBAAsBnB,EAAMmB,qBAC5BC,mBAAoBpB,EAAMoB,mBAC1BC,kBAAmBrB,EAAMqB,kBAEzBC,8BAA+BtB,EAAMsB,8BACrCC,6BAA8BvB,EAAMuB,6BAEpCC,eAAgBxB,EAAMwB,eACtBC,gBAAiBzB,EAAMyB,gBAEvBC,gBAAiB1B,EAAM0B,gBAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-supported-version.js","sources":["../../../../../src/components/ApplePay/utils/resolve-supported-version.ts"],"sourcesContent":["export function resolveSupportedVersion(latestVersion: number): number | null {\n try {\n for (let v = latestVersion; v > 0; v--) {\n if (ApplePaySession?.supportsVersion(v)) {\n return v;\n }\n }\n } catch (error) {\n console.warn(error);\n }\n return null;\n}\n"],"names":["resolveSupportedVersion","latestVersion","v","ApplePaySession","supportsVersion","error","console","warn"],"mappings":"AAAO,SAASA,EAAwBC,GACpC,IACI,IAAK,IAAIC,EAAID,EAAeC,EAAI,EAAGA,IAAK,CAChCC,IAAAA,EAAJ,GAAIA,QAAAA,EAAAA,uBAAAA,IAAAA,OAAAA,EAAAA,EAAiBC,gBAAgBF,GACjC,OAAOA,CAEf,CACJ,CAAE,MAAOG,GACLC,QAAQC,KAAKF,EACjB,CACA,OAAO,IACX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as a,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import n from"../../../
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as a,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import n from"../../../_virtual/index.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import r from"../../internal/FormFields/Field/Field.js";import c from"../../internal/FormFields/ConsentCheckbox/ConsentCheckbox.js";import{bacsFormatters as i,bacsValidationRules as s}from"./validate.js";import l from"../../../utils/useForm/useForm.js";import d from"../../../core/Context/useImage.js";import u from"../../internal/FormFields/InputText.js";import m from"../../internal/FormFields/InputEmail.js";import b from"../../internal/FormInstruction/FormInstruction.js";import{getErrorMessage as h}from"../../../utils/getErrorMessage.js";import{PREFIX as p}from"../../internal/Icon/constants.js";const k="enter-data",g="confirm-data";function f(f){var N,_;const{i18n:C}=t(),v=d(),{handleChangeFor:y,triggerValidation:I,data:x,valid:E,errors:F,isValid:j}=l({schema:["holderName","bankAccountNumber","bankLocationId","shopperEmail","amountConsentCheckbox","accountConsentCheckbox"],defaultData:f.data,formatters:i,rules:s}),[L,M]=a(k);this.setStatus=M,this.showValidation=I;return o((()=>{f.onChange({data:x,valid:E,errors:F,isValid:j})}),[x,E,F,j]),e("div",{className:n({"adyen-checkout__bacs":!0,"adyen-checkout__bacs--confirm":L===g||"loading"===L})},e(b,null),L==g&&e("div",{className:n({"adyen-checkout__bacs--edit":!0,"adyen-checkout__bacs--edit-dropin":f.isDropin})},e(u,{name:"bacsEdit",className:"adyen-checkout__bacs--edit-button",value:C.get("edit"),"aria-label":C.get("edit"),readonly:!0,onClick:()=>this.setStatus(k)})),e(r,{className:n({"adyen-checkout__bacs--holder-name":!0,"adyen-checkout__field--inactive":L===g||"loading"===L}),label:C.get("bacs.accountHolderName"),errorMessage:!!F.holderName&&C.get("bacs.accountHolderName.invalid"),isValid:E.holderName,name:"accountHolderName",i18n:C},e(u,{name:"bacs.accountHolderName",className:"adyen-checkout__bacs-input--holder-name",placeholder:f.placeholders.holderName,value:x.holderName,"aria-invalid":!E.holderName,"aria-label":C.get("bacs.accountHolderName"),"aria-required":"true",required:!0,readonly:L===g||"loading"===L,autocorrect:"off",onBlur:y("holderName","blur"),onInput:y("holderName","input")})),e("div",{className:"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper"},e(r,{errorMessage:!!F.bankAccountNumber&&C.get("bacs.accountNumber.invalid"),label:C.get("bacs.accountNumber"),className:n({"adyen-checkout__bacs--bank-account-number":!0,"adyen-checkout__field--inactive":L===g||"loading"===L}),classNameModifiers:["col-70"],isValid:E.bankAccountNumber,name:"bankAccountNumber",i18n:C},e(u,{value:x.bankAccountNumber,className:"adyen-checkout__bacs-input--bank-account-number",placeholder:f.placeholders.bankAccountNumber,"aria-invalid":!E.bankAccountNumber,"aria-label":C.get("bacs.accountNumber"),"aria-required":"true",required:!0,readonly:L===g||"loading"===L,autocorrect:"off",onBlur:y("bankAccountNumber","blur"),onInput:y("bankAccountNumber","input")})),e(r,{errorMessage:!!F.bankLocationId&&C.get("bacs.bankLocationId.invalid"),label:C.get("bacs.bankLocationId"),className:n({"adyen-checkout__bacs--bank-location-id":!0,"adyen-checkout__field--inactive":L===g||"loading"===L}),classNameModifiers:["col-30"],isValid:E.bankLocationId,name:"bankLocationId",i18n:C},e(u,{value:x.bankLocationId,className:"adyen-checkout__bacs-input--bank-location-id",placeholder:f.placeholders.bankLocationId,"aria-invalid":!E.bankLocationId,"aria-label":C.get("bacs.bankLocationId"),"aria-required":"true",required:!0,readonly:L===g||"loading"===L,autocorrect:"off",onBlur:y("bankLocationId","blur"),onInput:y("bankLocationId","input")}))),e(r,{errorMessage:h(C,F.shopperEmail,C.get("shopperEmail")),label:C.get("shopperEmail"),className:n({"adyen-checkout__bacs--shopper-email":!0,"adyen-checkout__field--inactive":L===g||"loading"===L}),isValid:E.shopperEmail,name:"emailAddress",i18n:C},e(m,{value:x.shopperEmail,name:"shopperEmail",className:"adyen-checkout__bacs-input--shopper-email",classNameModifiers:["large"],placeholder:f.placeholders.shopperEmail,spellcheck:!1,"aria-invalid":!E.shopperEmail,"aria-label":C.get("shopperEmail"),"aria-required":"true",required:!0,readonly:L===g||"loading"===L,autocorrect:"off",onInput:y("shopperEmail","input"),onBlur:y("shopperEmail","blur")})),L===k&&e(c,{classNameModifiers:["amountConsentCheckbox"],errorMessage:!!F.amountConsentCheckbox,label:C.get("bacs.consent.amount"),onChange:y("amountConsentCheckbox"),checked:!!x.amountConsentCheckbox,i18n:C}),L===k&&e(c,{classNameModifiers:["accountConsentCheckbox"],errorMessage:!!F.accountConsentCheckbox,label:C.get("bacs.consent.account"),onChange:y("accountConsentCheckbox"),checked:!!x.accountConsentCheckbox,i18n:C}),f.showPayButton&&f.payButton({status:L,label:L===k?C.get("continue"):`${C.get("bacs.confirm")} ${(null===(N=f.amount)||void 0===N?void 0:N.value)&&(null===(_=f.amount)||void 0===_?void 0:_.currency)?C.amount(f.amount.value,f.amount.currency):""}`,icon:v({imageFolder:"components/"})(`${p}lock`),onClick:()=>j?L===k?this.setStatus(g):L===g?f.onSubmit():void 0:this.showValidation()}))}f.defaultProps={data:{},placeholders:{}};export{f as default};
|
|
2
2
|
//# sourceMappingURL=BacsInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BacsInput.js","sources":["../../../../../src/components/BacsDD/components/BacsInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport ConsentCheckbox from '../../internal/FormFields/ConsentCheckbox';\nimport { bacsValidationRules, bacsFormatters } from './validate';\nimport { BacsDataState, BacsInputProps } from './types';\nimport './BacsInput.scss';\n\nimport useForm from '../../../utils/useForm';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport InputEmail from '../../internal/FormFields/InputEmail';\nimport FormInstruction from '../../internal/FormInstruction';\nimport { getErrorMessage } from '../../../utils/getErrorMessage';\nimport { PREFIX } from '../../internal/Icon/constants';\n\nconst ENTER_STATE = 'enter-data';\nconst CONFIRM_STATE = 'confirm-data';\n\nfunction BacsInput(props: BacsInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BacsDataState>({\n schema: ['holderName', 'bankAccountNumber', 'bankLocationId', 'shopperEmail', 'amountConsentCheckbox', 'accountConsentCheckbox'],\n defaultData: props.data,\n formatters: bacsFormatters,\n rules: bacsValidationRules\n });\n\n const [status, setStatus] = useState(ENTER_STATE);\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n const handlePayButton = () => {\n if (!isValid) return this.showValidation();\n\n if (status === ENTER_STATE) {\n return this.setStatus(CONFIRM_STATE);\n } else if (status === CONFIRM_STATE) {\n return props.onSubmit();\n }\n };\n\n const handleEdit = () => {\n return this.setStatus(ENTER_STATE);\n };\n\n useEffect(() => {\n props.onChange({ data, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__bacs': true,\n 'adyen-checkout__bacs--confirm': status === CONFIRM_STATE || status === 'loading'\n })}\n >\n <FormInstruction />\n\n {status == CONFIRM_STATE && (\n <div\n className={classNames({\n 'adyen-checkout__bacs--edit': true,\n 'adyen-checkout__bacs--edit-dropin': props.isDropin\n })}\n >\n <InputText\n name={'bacsEdit'}\n className={'adyen-checkout__bacs--edit-button'}\n value={i18n.get('edit')}\n aria-label={i18n.get('edit')}\n readonly={true}\n onClick={handleEdit}\n />\n </div>\n )}\n\n <Field\n className={classNames({\n 'adyen-checkout__bacs--holder-name': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n label={i18n.get('bacs.accountHolderName')}\n errorMessage={errors.holderName ? i18n.get('bacs.accountHolderName.invalid') : false}\n isValid={valid.holderName}\n name={'accountHolderName'}\n i18n={i18n}\n >\n <InputText\n name={'bacs.accountHolderName'}\n className={'adyen-checkout__bacs-input--holder-name'}\n placeholder={props.placeholders.holderName}\n value={data.holderName}\n aria-invalid={!valid.holderName}\n aria-label={i18n.get('bacs.accountHolderName')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n />\n </Field>\n\n <div className=\"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper\">\n <Field\n errorMessage={!!errors.bankAccountNumber && i18n.get('bacs.accountNumber.invalid')}\n label={i18n.get('bacs.accountNumber')}\n className={classNames({\n 'adyen-checkout__bacs--bank-account-number': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-70']}\n isValid={valid.bankAccountNumber}\n name={'bankAccountNumber'}\n i18n={i18n}\n >\n <InputText\n value={data.bankAccountNumber}\n className={'adyen-checkout__bacs-input--bank-account-number'}\n placeholder={props.placeholders.bankAccountNumber}\n aria-invalid={!valid.bankAccountNumber}\n aria-label={i18n.get('bacs.accountNumber')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankAccountNumber', 'blur')}\n onInput={handleChangeFor('bankAccountNumber', 'input')}\n />\n </Field>\n\n <Field\n errorMessage={!!errors.bankLocationId && i18n.get('bacs.bankLocationId.invalid')}\n label={i18n.get('bacs.bankLocationId')}\n className={classNames({\n 'adyen-checkout__bacs--bank-location-id': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-30']}\n isValid={valid.bankLocationId}\n name={'bankLocationId'}\n i18n={i18n}\n >\n <InputText\n value={data.bankLocationId}\n className={'adyen-checkout__bacs-input--bank-location-id'}\n placeholder={props.placeholders.bankLocationId}\n aria-invalid={!valid.bankLocationId}\n aria-label={i18n.get('bacs.bankLocationId')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankLocationId', 'blur')}\n onInput={handleChangeFor('bankLocationId', 'input')}\n />\n </Field>\n </div>\n\n <Field\n errorMessage={getErrorMessage(i18n, errors.shopperEmail, i18n.get('shopperEmail'))}\n label={i18n.get('shopperEmail')}\n className={classNames({\n 'adyen-checkout__bacs--shopper-email': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n isValid={valid.shopperEmail}\n name={'emailAddress'}\n i18n={i18n}\n >\n <InputEmail\n value={data.shopperEmail}\n name={'shopperEmail'}\n className={'adyen-checkout__bacs-input--shopper-email'}\n classNameModifiers={['large']}\n placeholder={props.placeholders.shopperEmail}\n spellcheck={false}\n aria-invalid={!valid.shopperEmail}\n aria-label={i18n.get('shopperEmail')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onInput={handleChangeFor('shopperEmail', 'input')}\n onBlur={handleChangeFor('shopperEmail', 'blur')}\n />\n </Field>\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['amountConsentCheckbox']}\n errorMessage={!!errors.amountConsentCheckbox}\n label={i18n.get('bacs.consent.amount')}\n onChange={handleChangeFor('amountConsentCheckbox')}\n checked={!!data.amountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['accountConsentCheckbox']}\n errorMessage={!!errors.accountConsentCheckbox}\n label={i18n.get('bacs.consent.account')}\n onChange={handleChangeFor('accountConsentCheckbox')}\n checked={!!data.accountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {props.showPayButton &&\n props.payButton({\n status,\n label:\n status === ENTER_STATE\n ? i18n.get('continue')\n : `${i18n.get('bacs.confirm')} ${\n !!props.amount?.value && !!props.amount?.currency ? i18n.amount(props.amount.value, props.amount.currency) : ''\n }`,\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`),\n onClick: handlePayButton\n })}\n </div>\n );\n}\n\nBacsInput.defaultProps = {\n data: {},\n placeholders: {}\n};\n\nexport default BacsInput;\n"],"names":["ENTER_STATE","CONFIRM_STATE","BacsInput","props","i18n","useCoreContext","getImage","useImage","handleChangeFor","triggerValidation","data","valid","errors","isValid","useForm","schema","defaultData","formatters","bacsFormatters","rules","bacsValidationRules","status","setStatus","useState","this","showValidation","useEffect","onChange","h","div","className","classNames","FormInstruction","isDropin","InputText","name","value","get","aria-label","readonly","onClick","Field","label","errorMessage","holderName","placeholder","placeholders","aria-invalid","aria-required","required","autocorrect","onBlur","onInput","bankAccountNumber","classNameModifiers","bankLocationId","getErrorMessage","shopperEmail","InputEmail","spellcheck","ConsentCheckbox","amountConsentCheckbox","checked","accountConsentCheckbox","showPayButton","payButton","amount","currency","icon","imageFolder","PREFIX","onSubmit","defaultProps"],"mappings":"q3BAkBA,MAAMA,EAAc,aACdC,EAAgB,eAEtB,SAASC,EAAUC,OAyMiBA,EAAyBA,EAxMzD,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,gBAAEA,EAAeC,kBAAEA,EAAiBC,KAAEA,EAAIC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAAuB,CAChGC,OAAQ,CAAC,aAAc,oBAAqB,iBAAkB,eAAgB,wBAAyB,0BACvGC,YAAab,EAAMO,KACnBO,WAAYC,EACZC,MAAOC,KAGJC,EAAQC,GAAaC,EAASvB,GACrCwB,KAAKF,UAAYA,EACjBE,KAAKC,eAAiBhB,EAoBtB,OAJAiB,GAAU,KACNvB,EAAMwB,SAAS,CAAEjB,OAAMC,QAAOC,SAAQC,WAAQ,GAC/C,CAACH,EAAM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AI,gBACrBW,gBAAe,OACfC,UAAU,EACVV,SAAUlB,IAAWpB,GAA4B,YAAXoB,EACtC6B,YAAa,MACbE,QAAS5C,EAAgB,eAAgB,SACzC2C,OAAQ3C,EAAgB,eAAgB,WAI/Ca,IAAWrB,GACR4B,EAACgC,EAAAA,CACGN,mBAAoB,CAAC,yBACrBX,eAAgB/B,EAAOiD,sBACvBnB,MAAOtC,EAAKiC,IAAI,uBAChBV,SAAUnB,EAAgB,yBAC1BsD,UAAWpD,EAAKmD,sBAChBzD,KAAMA,IAIbiB,IAAWrB,GACR4B,EAACgC,EAAAA,CACGN,mBAAoB,CAAC,0BACrBX,eAAgB/B,EAAOmD,uBACvBrB,MAAOtC,EAAKiC,IAAI,wBAChBV,SAAUnB,EAAgB,0BAC1BsD,UAAWpD,EAAKqD,uBAChB3D,KAAMA,IAIbD,EAAM6D,eACH7D,EAAM8D,UAAU,CACZ5C,SACAqB,MACIrB,IAAWrB,EACLI,EAAKiC,IAAI,YACT,GAAGjC,EAAKiC,IAAI,oBACM,QAAZlC,EAAAA,EAAM+D,cAAN/D,IAAAA,OAAAA,EAAAA,EAAciC,SAAuB,QAAZjC,EAAAA,EAAM+D,kBAAN/D,SAAAA,EAAcgE,UAAW/D,EAAK8D,OAAO/D,EAAM+D,OAAO9B,MAAOjC,EAAM+D,OAAOC,UAAY,KAE3HC,KAAM9D,EAAS,CAAE+D,YAAa,eAAxB/D,CAAyC,GAAGgE,SAClD9B,QA7LQ,IACf3B,EAEDQ,IAAWrB,EACJwB,KAAKF,UAAUrB,GACfoB,IAAWpB,EACXE,EAAMoE,gBADV,EAJc/C,KAAKC,mBAgMlC,CAEAvB,EAAUsE,aAAe,CACrB9D,KAAM,CAAC,EACPoC,aAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"BacsInput.js","sources":["../../../../../src/components/BacsDD/components/BacsInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport ConsentCheckbox from '../../internal/FormFields/ConsentCheckbox';\nimport { bacsValidationRules, bacsFormatters } from './validate';\nimport { BacsDataState, BacsInputProps } from './types';\nimport './BacsInput.scss';\n\nimport useForm from '../../../utils/useForm';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport InputEmail from '../../internal/FormFields/InputEmail';\nimport FormInstruction from '../../internal/FormInstruction';\nimport { getErrorMessage } from '../../../utils/getErrorMessage';\nimport { PREFIX } from '../../internal/Icon/constants';\n\nconst ENTER_STATE = 'enter-data';\nconst CONFIRM_STATE = 'confirm-data';\n\nfunction BacsInput(props: BacsInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BacsDataState>({\n schema: ['holderName', 'bankAccountNumber', 'bankLocationId', 'shopperEmail', 'amountConsentCheckbox', 'accountConsentCheckbox'],\n defaultData: props.data,\n formatters: bacsFormatters,\n rules: bacsValidationRules\n });\n\n const [status, setStatus] = useState(ENTER_STATE);\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n const handlePayButton = () => {\n if (!isValid) return this.showValidation();\n\n if (status === ENTER_STATE) {\n return this.setStatus(CONFIRM_STATE);\n } else if (status === CONFIRM_STATE) {\n return props.onSubmit();\n }\n };\n\n const handleEdit = () => {\n return this.setStatus(ENTER_STATE);\n };\n\n useEffect(() => {\n props.onChange({ data, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__bacs': true,\n 'adyen-checkout__bacs--confirm': status === CONFIRM_STATE || status === 'loading'\n })}\n >\n <FormInstruction />\n\n {status == CONFIRM_STATE && (\n <div\n className={classNames({\n 'adyen-checkout__bacs--edit': true,\n 'adyen-checkout__bacs--edit-dropin': props.isDropin\n })}\n >\n <InputText\n name={'bacsEdit'}\n className={'adyen-checkout__bacs--edit-button'}\n value={i18n.get('edit')}\n aria-label={i18n.get('edit')}\n readonly={true}\n onClick={handleEdit}\n />\n </div>\n )}\n\n <Field\n className={classNames({\n 'adyen-checkout__bacs--holder-name': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n label={i18n.get('bacs.accountHolderName')}\n errorMessage={errors.holderName ? i18n.get('bacs.accountHolderName.invalid') : false}\n isValid={valid.holderName}\n name={'accountHolderName'}\n i18n={i18n}\n >\n <InputText\n name={'bacs.accountHolderName'}\n className={'adyen-checkout__bacs-input--holder-name'}\n placeholder={props.placeholders.holderName}\n value={data.holderName}\n aria-invalid={!valid.holderName}\n aria-label={i18n.get('bacs.accountHolderName')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n />\n </Field>\n\n <div className=\"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper\">\n <Field\n errorMessage={!!errors.bankAccountNumber && i18n.get('bacs.accountNumber.invalid')}\n label={i18n.get('bacs.accountNumber')}\n className={classNames({\n 'adyen-checkout__bacs--bank-account-number': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-70']}\n isValid={valid.bankAccountNumber}\n name={'bankAccountNumber'}\n i18n={i18n}\n >\n <InputText\n value={data.bankAccountNumber}\n className={'adyen-checkout__bacs-input--bank-account-number'}\n placeholder={props.placeholders.bankAccountNumber}\n aria-invalid={!valid.bankAccountNumber}\n aria-label={i18n.get('bacs.accountNumber')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankAccountNumber', 'blur')}\n onInput={handleChangeFor('bankAccountNumber', 'input')}\n />\n </Field>\n\n <Field\n errorMessage={!!errors.bankLocationId && i18n.get('bacs.bankLocationId.invalid')}\n label={i18n.get('bacs.bankLocationId')}\n className={classNames({\n 'adyen-checkout__bacs--bank-location-id': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-30']}\n isValid={valid.bankLocationId}\n name={'bankLocationId'}\n i18n={i18n}\n >\n <InputText\n value={data.bankLocationId}\n className={'adyen-checkout__bacs-input--bank-location-id'}\n placeholder={props.placeholders.bankLocationId}\n aria-invalid={!valid.bankLocationId}\n aria-label={i18n.get('bacs.bankLocationId')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankLocationId', 'blur')}\n onInput={handleChangeFor('bankLocationId', 'input')}\n />\n </Field>\n </div>\n\n <Field\n errorMessage={getErrorMessage(i18n, errors.shopperEmail, i18n.get('shopperEmail'))}\n label={i18n.get('shopperEmail')}\n className={classNames({\n 'adyen-checkout__bacs--shopper-email': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n isValid={valid.shopperEmail}\n name={'emailAddress'}\n i18n={i18n}\n >\n <InputEmail\n value={data.shopperEmail}\n name={'shopperEmail'}\n className={'adyen-checkout__bacs-input--shopper-email'}\n classNameModifiers={['large']}\n placeholder={props.placeholders.shopperEmail}\n spellcheck={false}\n aria-invalid={!valid.shopperEmail}\n aria-label={i18n.get('shopperEmail')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onInput={handleChangeFor('shopperEmail', 'input')}\n onBlur={handleChangeFor('shopperEmail', 'blur')}\n />\n </Field>\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['amountConsentCheckbox']}\n errorMessage={!!errors.amountConsentCheckbox}\n label={i18n.get('bacs.consent.amount')}\n onChange={handleChangeFor('amountConsentCheckbox')}\n checked={!!data.amountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['accountConsentCheckbox']}\n errorMessage={!!errors.accountConsentCheckbox}\n label={i18n.get('bacs.consent.account')}\n onChange={handleChangeFor('accountConsentCheckbox')}\n checked={!!data.accountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {props.showPayButton &&\n props.payButton({\n status,\n label:\n status === ENTER_STATE\n ? i18n.get('continue')\n : `${i18n.get('bacs.confirm')} ${\n !!props.amount?.value && !!props.amount?.currency ? i18n.amount(props.amount.value, props.amount.currency) : ''\n }`,\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`),\n onClick: handlePayButton\n })}\n </div>\n );\n}\n\nBacsInput.defaultProps = {\n data: {},\n placeholders: {}\n};\n\nexport default BacsInput;\n"],"names":["ENTER_STATE","CONFIRM_STATE","BacsInput","props","i18n","useCoreContext","getImage","useImage","handleChangeFor","triggerValidation","data","valid","errors","isValid","useForm","schema","defaultData","formatters","bacsFormatters","rules","bacsValidationRules","status","setStatus","useState","this","showValidation","useEffect","onChange","h","div","className","classNames","FormInstruction","isDropin","InputText","name","value","get","aria-label","readonly","onClick","Field","label","errorMessage","holderName","placeholder","placeholders","aria-invalid","aria-required","required","autocorrect","onBlur","onInput","bankAccountNumber","classNameModifiers","bankLocationId","getErrorMessage","shopperEmail","InputEmail","spellcheck","ConsentCheckbox","amountConsentCheckbox","checked","accountConsentCheckbox","showPayButton","payButton","amount","currency","icon","imageFolder","PREFIX","onSubmit","defaultProps"],"mappings":"02BAkBA,MAAMA,EAAc,aACdC,EAAgB,eAEtB,SAASC,EAAUC,OAyMiBA,EAAyBA,EAxMzD,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,gBAAEA,EAAeC,kBAAEA,EAAiBC,KAAEA,EAAIC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAAuB,CAChGC,OAAQ,CAAC,aAAc,oBAAqB,iBAAkB,eAAgB,wBAAyB,0BACvGC,YAAab,EAAMO,KACnBO,WAAYC,EACZC,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