@adyen/adyen-web 6.0.0-alpha.0 → 6.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +166 -0
- package/auto/auto.js +2 -0
- package/dist/cjs/adyen.css +3 -3
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2414 -2537
- package/dist/es/adyen.css +3 -3
- package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.js +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.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/defaultProps.js +1 -1
- package/dist/es/components/ApplePay/defaultProps.js.map +1 -1
- package/dist/es/components/ApplePay/payment-request.js.map +1 -1
- package/dist/es/components/Boleto/components/BoletoInput/validate.js +1 -1
- package/dist/es/components/Boleto/components/BoletoInput/validate.js.map +1 -1
- package/dist/es/components/Card/Card.js +1 -1
- package/dist/es/components/Card/Card.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardHolderName.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardHolderName.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/Card/components/CardInput/types.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/validate.js +1 -1
- package/dist/es/components/Card/components/CardInput/validate.js.map +1 -1
- package/dist/es/components/CashAppPay/defaultProps.js +1 -1
- package/dist/es/components/CashAppPay/defaultProps.js.map +1 -1
- package/dist/es/components/Donation/Donation.js.map +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es/components/Dropin/Dropin.js +1 -1
- package/dist/es/components/Dropin/Dropin.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es/components/Dropin/defaultProps.js +1 -1
- package/dist/es/components/Dropin/defaultProps.js.map +1 -1
- package/dist/es/components/Econtext/Econtext.js +1 -1
- package/dist/es/components/Econtext/Econtext.js.map +1 -1
- package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.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.map +1 -1
- package/dist/es/components/Giropay/Giropay.js +1 -1
- package/dist/es/components/Giropay/Giropay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePayService.js +1 -1
- package/dist/es/components/GooglePay/GooglePayService.js.map +1 -1
- package/dist/es/components/GooglePay/defaultProps.js +1 -1
- package/dist/es/components/GooglePay/defaultProps.js.map +1 -1
- package/dist/es/components/GooglePay/requests.js.map +1 -1
- package/dist/es/components/Multibanco/Multibanco.js +1 -1
- package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es/components/PayPal/Paypal.js +1 -1
- package/dist/es/components/PayPal/Paypal.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/PayPal/components/PaypalComponent.js +1 -1
- package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es/components/PayPal/defaultProps.js +1 -1
- package/dist/es/components/PayPal/defaultProps.js.map +1 -1
- package/dist/es/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js +1 -1
- package/dist/es/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js.map +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-locale.js +2 -0
- package/dist/es/components/PayPal/utils/get-paypal-locale.js.map +1 -0
- package/dist/es/components/PayPal/utils/get-paypal-settings.js +2 -0
- package/dist/es/components/PayPal/utils/get-paypal-settings.js.map +1 -0
- package/dist/es/components/PayPal/utils/get-paypal-styles.js +2 -0
- package/dist/es/components/PayPal/utils/get-paypal-styles.js.map +1 -0
- package/dist/es/components/PayPal/utils/get-paypal-url.js +2 -0
- package/dist/es/components/PayPal/utils/get-paypal-url.js.map +1 -0
- package/dist/es/components/Pix/Pix.js +1 -1
- package/dist/es/components/Pix/Pix.js.map +1 -1
- package/dist/es/components/Pix/PixInput/PixInput.js +1 -1
- package/dist/es/components/Pix/PixInput/PixInput.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/utils.js +1 -1
- package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/Address/validate.js +1 -1
- package/dist/es/components/internal/Address/validate.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/CompanyDetails/validate.js +1 -1
- package/dist/es/components/internal/CompanyDetails/validate.js.map +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.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/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es/components/internal/PersonalDetails/validate.js +1 -1
- package/dist/es/components/internal/PersonalDetails/validate.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/triggerBinLookUp.js +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/processErrors.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/processErrors.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/configuration/constants.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/configuration/constants.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/utilities/addContextTranslations.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/UIElement/UIElement.js +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/components/internal/UIElement/utils.js +1 -1
- package/dist/es/components/internal/UIElement/utils.js.map +1 -1
- package/dist/es/core/AdyenCheckout.js +1 -1
- package/dist/es/core/AdyenCheckout.js.map +1 -1
- package/dist/es/core/Analytics/Analytics.js +1 -1
- package/dist/es/core/Analytics/Analytics.js.map +1 -1
- package/dist/es/core/Analytics/EventsQueue.js +1 -1
- package/dist/es/core/Analytics/EventsQueue.js.map +1 -1
- package/dist/es/core/Analytics/constants.js +1 -1
- package/dist/es/core/Analytics/constants.js.map +1 -1
- package/dist/es/core/Analytics/utils.js +1 -1
- package/dist/es/core/Analytics/utils.js.map +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es/core/Errors/constants.js +1 -1
- package/dist/es/core/Errors/constants.js.map +1 -1
- package/dist/es/core/Errors/utils.js +1 -1
- package/dist/es/core/Errors/utils.js.map +1 -1
- package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.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/Services/analytics/log-event.js +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/core/config.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/index.d.ts +2414 -2537
- package/dist/es/language/locales/ar.json.js +1 -1
- package/dist/es/language/locales/cs-CZ.json.js +1 -1
- package/dist/es/language/locales/da-DK.json.js +1 -1
- package/dist/es/language/locales/de-DE.json.js +1 -1
- package/dist/es/language/locales/el-GR.json.js +1 -1
- package/dist/es/language/locales/en-US.json.js +1 -1
- package/dist/es/language/locales/es-ES.json.js +1 -1
- package/dist/es/language/locales/fi-FI.json.js +1 -1
- package/dist/es/language/locales/fr-FR.json.js +1 -1
- package/dist/es/language/locales/hr-HR.json.js +1 -1
- package/dist/es/language/locales/hu-HU.json.js +1 -1
- package/dist/es/language/locales/it-IT.json.js +1 -1
- package/dist/es/language/locales/ja-JP.json.js +1 -1
- package/dist/es/language/locales/ko-KR.json.js +1 -1
- package/dist/es/language/locales/nl-NL.json.js +1 -1
- package/dist/es/language/locales/no-NO.json.js +1 -1
- package/dist/es/language/locales/pl-PL.json.js +1 -1
- package/dist/es/language/locales/pt-BR.json.js +1 -1
- package/dist/es/language/locales/pt-PT.json.js +1 -1
- package/dist/es/language/locales/ro-RO.json.js +1 -1
- package/dist/es/language/locales/ru-RU.json.js +1 -1
- package/dist/es/language/locales/sk-SK.json.js +1 -1
- package/dist/es/language/locales/sl-SI.json.js +1 -1
- package/dist/es/language/locales/sv-SE.json.js +1 -1
- package/dist/es/language/locales/zh-CN.json.js +1 -1
- package/dist/es/language/locales/zh-TW.json.js +1 -1
- package/dist/es/utils/Formatters/formatters.js.map +1 -1
- package/dist/es/utils/Script.js +1 -1
- package/dist/es/utils/Script.js.map +1 -1
- package/dist/es/utils/Validator/defaultRules.js +1 -1
- package/dist/es/utils/Validator/defaultRules.js.map +1 -1
- package/dist/es/utils/base64.js +1 -1
- package/dist/es/utils/base64.js.map +1 -1
- package/dist/es/utils/getErrorMessage.js +1 -1
- package/dist/es/utils/getErrorMessage.js.map +1 -1
- package/dist/es-legacy/adyen.css +3 -3
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.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/defaultProps.js +1 -1
- package/dist/es-legacy/components/ApplePay/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/payment-request.js.map +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/validate.js +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/validate.js.map +1 -1
- package/dist/es-legacy/components/Card/Card.js +1 -1
- package/dist/es-legacy/components/Card/Card.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardHolderName.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardHolderName.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/validate.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/validate.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/defaultProps.js +1 -1
- package/dist/es-legacy/components/CashAppPay/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es-legacy/components/Dropin/defaultProps.js +1 -1
- package/dist/es-legacy/components/Dropin/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
- package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.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.map +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.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/GooglePay/GooglePayService.js +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePayService.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/defaultProps.js +1 -1
- package/dist/es-legacy/components/GooglePay/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
- package/dist/es-legacy/components/PayPal/Paypal.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/PayPal/components/PaypalComponent.js +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es-legacy/components/PayPal/defaultProps.js +1 -1
- package/dist/es-legacy/components/PayPal/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js +1 -1
- package/dist/es-legacy/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js.map +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-locale.js +2 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-locale.js.map +1 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +2 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-styles.js +2 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-styles.js.map +1 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-url.js +2 -0
- package/dist/es-legacy/components/PayPal/utils/get-paypal-url.js.map +1 -0
- package/dist/es-legacy/components/Pix/Pix.js +1 -1
- package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
- package/dist/es-legacy/components/Pix/PixInput/PixInput.js +1 -1
- package/dist/es-legacy/components/Pix/PixInput/PixInput.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/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/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/validate.js +1 -1
- package/dist/es-legacy/components/internal/Address/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/validate.js +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.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/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/validate.js +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/triggerBinLookUp.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/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/SecuredFields/lib/CSF/utils/processErrors.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/processErrors.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/configuration/constants.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/configuration/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/addContextTranslations.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/UIElement/UIElement.js +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es-legacy/components/internal/UIElement/utils.js +1 -1
- package/dist/es-legacy/components/internal/UIElement/utils.js.map +1 -1
- package/dist/es-legacy/core/AdyenCheckout.js +1 -1
- package/dist/es-legacy/core/AdyenCheckout.js.map +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
- package/dist/es-legacy/core/Analytics/EventsQueue.js +1 -1
- package/dist/es-legacy/core/Analytics/EventsQueue.js.map +1 -1
- package/dist/es-legacy/core/Analytics/constants.js +1 -1
- package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
- package/dist/es-legacy/core/Analytics/utils.js +1 -1
- package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
- package/dist/es-legacy/core/Errors/AdyenCheckoutError.js +1 -1
- package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es-legacy/core/Errors/constants.js +1 -1
- package/dist/es-legacy/core/Errors/constants.js.map +1 -1
- package/dist/es-legacy/core/Errors/utils.js +1 -1
- package/dist/es-legacy/core/Errors/utils.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.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/Services/analytics/log-event.js +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/core/config.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/language/locales/ar.json.js +1 -1
- package/dist/es-legacy/language/locales/cs-CZ.json.js +1 -1
- package/dist/es-legacy/language/locales/da-DK.json.js +1 -1
- package/dist/es-legacy/language/locales/de-DE.json.js +1 -1
- package/dist/es-legacy/language/locales/el-GR.json.js +1 -1
- package/dist/es-legacy/language/locales/en-US.json.js +1 -1
- package/dist/es-legacy/language/locales/es-ES.json.js +1 -1
- package/dist/es-legacy/language/locales/fi-FI.json.js +1 -1
- package/dist/es-legacy/language/locales/fr-FR.json.js +1 -1
- package/dist/es-legacy/language/locales/hr-HR.json.js +1 -1
- package/dist/es-legacy/language/locales/hu-HU.json.js +1 -1
- package/dist/es-legacy/language/locales/it-IT.json.js +1 -1
- package/dist/es-legacy/language/locales/ja-JP.json.js +1 -1
- package/dist/es-legacy/language/locales/ko-KR.json.js +1 -1
- package/dist/es-legacy/language/locales/nl-NL.json.js +1 -1
- package/dist/es-legacy/language/locales/no-NO.json.js +1 -1
- package/dist/es-legacy/language/locales/pl-PL.json.js +1 -1
- package/dist/es-legacy/language/locales/pt-BR.json.js +1 -1
- package/dist/es-legacy/language/locales/pt-PT.json.js +1 -1
- package/dist/es-legacy/language/locales/ro-RO.json.js +1 -1
- package/dist/es-legacy/language/locales/ru-RU.json.js +1 -1
- package/dist/es-legacy/language/locales/sk-SK.json.js +1 -1
- package/dist/es-legacy/language/locales/sl-SI.json.js +1 -1
- package/dist/es-legacy/language/locales/sv-SE.json.js +1 -1
- package/dist/es-legacy/language/locales/zh-CN.json.js +1 -1
- package/dist/es-legacy/language/locales/zh-TW.json.js +1 -1
- package/dist/es-legacy/utils/Formatters/formatters.js.map +1 -1
- package/dist/es-legacy/utils/Script.js +1 -1
- package/dist/es-legacy/utils/Script.js.map +1 -1
- package/dist/es-legacy/utils/Validator/defaultRules.js +1 -1
- package/dist/es-legacy/utils/Validator/defaultRules.js.map +1 -1
- package/dist/es-legacy/utils/base64.js +1 -1
- package/dist/es-legacy/utils/base64.js.map +1 -1
- package/dist/es-legacy/utils/getErrorMessage.js +1 -1
- package/dist/es-legacy/utils/getErrorMessage.js.map +1 -1
- package/dist/umd/adyen.css +3 -3
- package/dist/umd/adyen.js +2 -2
- package/dist/umd/adyen.js.map +1 -1
- package/package.json +2 -2
- package/dist/es/components/PayPal/utils.js +0 -2
- package/dist/es/components/PayPal/utils.js.map +0 -1
- package/dist/es-legacy/components/PayPal/utils.js +0 -2
- package/dist/es-legacy/components/PayPal/utils.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isReadyToPayRequest as t,initiatePaymentRequest as e}from"./requests.js";import{resolveEnvironment as a}from"./utils.js";import n from"../../utils/Script.js";import i from"./config.js";class o{async getGooglePaymentsClient(t){var e;if(!(null===(e=window.google)||void 0===e?void 0:e.payments)){const t=new n(i.URL);await t.load()}return new google.payments.api.PaymentsClient(t)}isReadyToPay(e){return this.paymentsClient?this.paymentsClient.then((a=>a.isReadyToPay(t(e)))):Promise.reject(new Error("Google Pay is not available"))}prefetchPaymentData(t,a){if(!this.paymentsClient)throw new Error("Google Pay is not available");const n=e(t,a);this.paymentsClient.then((t=>t.prefetchPaymentData(n)))}initiatePayment(t,a){if(!this.paymentsClient)throw new Error("Google Pay is not available");const n=e(t,a);return this.paymentsClient.then((t=>t.loadPaymentData(n)))}constructor(t){var
|
|
1
|
+
import{isReadyToPayRequest as t,initiatePaymentRequest as e}from"./requests.js";import{resolveEnvironment as a}from"./utils.js";import n from"../../utils/Script.js";import i from"./config.js";class o{async getGooglePaymentsClient(t){var e;if(!(null===(e=window.google)||void 0===e?void 0:e.payments)){const t=new n(i.URL);await t.load()}return new google.payments.api.PaymentsClient(t)}isReadyToPay(e){return this.paymentsClient?this.paymentsClient.then((a=>a.isReadyToPay(t(e)))):Promise.reject(new Error("Google Pay is not available"))}prefetchPaymentData(t,a){if(!this.paymentsClient)throw new Error("Google Pay is not available");const n=e(t,a);this.paymentsClient.then((t=>t.prefetchPaymentData(n)))}initiatePayment(t,a){if(!this.paymentsClient)throw new Error("Google Pay is not available");const n=e(t,a);return this.paymentsClient.then((t=>t.loadPaymentData(n)))}constructor(t,e){var n,i,o;o=void 0,(i="paymentsClient")in(n=this)?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o;const s=a(t);this.paymentsClient=this.getGooglePaymentsClient({environment:s,paymentDataCallbacks:e})}}export{o as default};
|
|
2
2
|
//# sourceMappingURL=GooglePayService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GooglePayService.js","sources":["../../../../src/components/GooglePay/GooglePayService.ts"],"sourcesContent":["import { isReadyToPayRequest, initiatePaymentRequest } from './requests';\nimport { resolveEnvironment } from './utils';\nimport Script from '../../utils/Script';\nimport config from './config';\nimport type { GooglePayConfiguration } from './types';\n\nclass GooglePayService {\n public readonly paymentsClient: Promise<google.payments.api.PaymentsClient>;\n\n constructor(
|
|
1
|
+
{"version":3,"file":"GooglePayService.js","sources":["../../../../src/components/GooglePay/GooglePayService.ts"],"sourcesContent":["import { isReadyToPayRequest, initiatePaymentRequest } from './requests';\nimport { resolveEnvironment } from './utils';\nimport Script from '../../utils/Script';\nimport config from './config';\nimport type { GooglePayConfiguration } from './types';\n\nclass GooglePayService {\n public readonly paymentsClient: Promise<google.payments.api.PaymentsClient>;\n\n constructor(environment: string, paymentDataCallbacks: google.payments.api.PaymentDataCallbacks) {\n const googlePayEnvironment = resolveEnvironment(environment);\n\n this.paymentsClient = this.getGooglePaymentsClient({\n environment: googlePayEnvironment,\n paymentDataCallbacks\n });\n }\n\n /**\n * Initialize a Google Pay API client\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n * @returns Google Pay API client\n */\n async getGooglePaymentsClient(paymentOptions: google.payments.api.PaymentOptions): Promise<google.payments.api.PaymentsClient> {\n if (!window.google?.payments) {\n const script = new Script(config.URL);\n await script.load();\n }\n\n return new google.payments.api.PaymentsClient(paymentOptions);\n }\n\n /**\n * Determine a shopper's ability to return a form of payment from the Google Pay API.\n * @see {@link https://developers.google.com/pay/api/web/reference/client#isReadyToPay|isReadyToPay}\n */\n isReadyToPay(props): Promise<google.payments.api.IsReadyToPayResponse> {\n if (!this.paymentsClient) return Promise.reject(new Error('Google Pay is not available'));\n\n return this.paymentsClient.then(client => client.isReadyToPay(isReadyToPayRequest(props)));\n }\n\n prefetchPaymentData(props: GooglePayConfiguration, countryCode: string): void {\n if (!this.paymentsClient) throw new Error('Google Pay is not available');\n\n const paymentDataRequest = initiatePaymentRequest(props, countryCode);\n this.paymentsClient.then(client => client.prefetchPaymentData(paymentDataRequest));\n }\n\n /**\n * Show Google Pay payment sheet when Google Pay payment button is clicked\n * @returns paymentData response from Google Pay API after user approves payment\n * @see {@link https://developers.google.com/pay/api/web/reference/object#PaymentData|PaymentData object reference}\n */\n initiatePayment(props: GooglePayConfiguration, countryCode: string): Promise<google.payments.api.PaymentData> {\n if (!this.paymentsClient) throw new Error('Google Pay is not available');\n\n const paymentDataRequest = initiatePaymentRequest(props, countryCode);\n return this.paymentsClient.then(client => client.loadPaymentData(paymentDataRequest));\n }\n}\n\nexport default GooglePayService;\n"],"names":["GooglePayService","getGooglePaymentsClient","paymentOptions","window","google","payments","script","Script","config","URL","load","api","PaymentsClient","isReadyToPay","props","this","paymentsClient","then","client","isReadyToPayRequest","Promise","reject","Error","prefetchPaymentData","countryCode","paymentDataRequest","initiatePaymentRequest","initiatePayment","loadPaymentData","constructor","environment","paymentDataCallbacks","googlePayEnvironment","resolveEnvironment"],"mappings":"gMAMA,MAAMA,EAkBF,6BAAMC,CAAwBC,GACrBC,IAAAA,EAAL,aAAKA,EAAAA,OAAOC,cAAPD,IAAAA,OAAAA,EAAAA,EAAeE,UAAU,CAC1B,MAAMC,EAAS,IAAIC,EAAOC,EAAOC,WAC3BH,EAAOI,MACjB,CAEA,OAAO,IAAIN,OAAOC,SAASM,IAAIC,eAAeV,EAClD,CAMAW,YAAAA,CAAaC,GACT,OAAKC,KAAKC,eAEHD,KAAKC,eAAeC,MAAKC,GAAUA,EAAOL,aAAaM,EAAoBL,MAFjDM,QAAQC,OAAO,IAAIC,MAAM,+BAG9D,CAEAC,mBAAAA,CAAoBT,EAA+BU,GAC/C,IAAKT,KAAKC,eAAgB,MAAM,IAAIM,MAAM,+BAE1C,MAAMG,EAAqBC,EAAuBZ,EAAOU,GACzDT,KAAKC,eAAeC,MAAKC,GAAUA,EAAOK,oBAAoBE,IAClE,CAOAE,eAAAA,CAAgBb,EAA+BU,GAC3C,IAAKT,KAAKC,eAAgB,MAAM,IAAIM,MAAM,+BAE1C,MAAMG,EAAqBC,EAAuBZ,EAAOU,GACzD,OAAOT,KAAKC,eAAeC,MAAKC,GAAUA,EAAOU,gBAAgBH,IACrE,CAnDAI,WAAAA,CAAYC,EAAqBC,oBAFjC,KAAgBf,sBAAhBD,4FAGI,MAAMiB,EAAuBC,EAAmBH,GAEhDf,KAAKC,eAAiBD,KAAKd,wBAAwB,CAC/C6B,YAAaE,EACbD,wBAER"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e={isExpress:!1,existingPaymentMethodRequired:!1,buttonColor:"default",buttonType:"long",buttonSizeMode:void 0,configuration:{gatewayMerchantId:"",merchantId:"",merchantName:""},amount:{value:0,currency:"USD"},totalPriceStatus:"FINAL",onClick:e=>e(),allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","JCB","MASTERCARD","VISA"],allowCreditCards:!0,allowPrepaidCards:!0,billingAddressRequired:!1,billingAddressParameters:void 0,assuranceDetailsRequired:!1,emailRequired:!1,shippingAddressRequired:!1,shippingAddressParameters:void 0,shippingOptionRequired:!1,shippingOptionParameters:void 0,callbackIntents:[]};export{e as default};
|
|
2
2
|
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/GooglePay/defaultProps.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/GooglePay/defaultProps.ts"],"sourcesContent":["import { GooglePayConfiguration } from './types';\n\nconst defaultProps: GooglePayConfiguration = {\n isExpress: false,\n\n // isReadyToPayRequest\n existingPaymentMethodRequired: false,\n\n // ButtonOptions\n // https://developers.google.com/pay/api/web/reference/object#ButtonOptions\n buttonColor: 'default' as google.payments.api.ButtonColor, // default/black/white\n buttonType: 'long' as google.payments.api.ButtonType, // long/short\n buttonSizeMode: undefined,\n\n // PaymentDataRequest\n configuration: {\n // Adyen's merchant account\n gatewayMerchantId: '', // E.g TestMerchant\n\n // https://developers.google.com/pay/api/web/reference/object#MerchantInfo\n merchantId: '', // E.g 039484839309\n merchantName: '' // E.g Example Merchant,\n },\n\n // Payment\n amount: {\n value: 0,\n currency: 'USD'\n },\n\n totalPriceStatus: 'FINAL' as google.payments.api.TotalPriceStatus,\n\n // Callbacks\n onClick: resolve => resolve(),\n\n // CardParameters\n // https://developers.google.com/pay/api/web/reference/object#CardParameters\n allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'] as google.payments.api.CardAuthMethod[],\n allowedCardNetworks: ['AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'] as google.payments.api.CardNetwork[],\n allowCreditCards: true, // Set to false if you don't support credit cards.\n allowPrepaidCards: true, // Set to false if you don't support prepaid cards.\n billingAddressRequired: false, // A billing address should only be requested if it's required to process the transaction.\n billingAddressParameters: undefined, // The expected fields returned if billingAddressRequired is set to true.\n assuranceDetailsRequired: false, // https://developers.google.com/pay/api/web/reference/response-objects#assurance-details-specifications\n\n emailRequired: false,\n shippingAddressRequired: false,\n shippingAddressParameters: undefined, // https://developers.google.com/pay/api/web/reference/object#ShippingAddressParameters\n shippingOptionRequired: false,\n shippingOptionParameters: undefined,\n callbackIntents: []\n};\n\nexport default defaultProps;\n"],"names":["defaultProps","isExpress","existingPaymentMethodRequired","buttonColor","buttonType","buttonSizeMode","undefined","configuration","gatewayMerchantId","merchantId","merchantName","amount","value","currency","totalPriceStatus","onClick","resolve","allowedAuthMethods","allowedCardNetworks","allowCreditCards","allowPrepaidCards","billingAddressRequired","billingAddressParameters","assuranceDetailsRequired","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters","callbackIntents"],"mappings":"AAEA,MAAMA,EAAuC,CACzCC,WAAW,EAGXC,+BAA+B,EAI/BC,YAAa,UACbC,WAAY,OACZC,oBAAgBC,EAGhBC,cAAe,CAEXC,kBAAmB,GAGnBC,WAAY,GACZC,aAAc,IAIlBC,OAAQ,CACJC,MAAO,EACPC,SAAU,OAGdC,iBAAkB,QAGlBC,QAASC,GAAWA,IAIpBC,mBAAoB,CAAC,WAAY,kBACjCC,oBAAqB,CAAC,OAAQ,WAAY,MAAO,aAAc,QAC/DC,kBAAkB,EAClBC,mBAAmB,EACnBC,wBAAwB,EACxBC,8BAA0BhB,EAC1BiB,0BAA0B,EAE1BC,eAAe,EACfC,yBAAyB,EACzBC,+BAA2BpB,EAC3BqB,wBAAwB,EACxBC,8BAA0BtB,EAC1BuB,gBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sources":["../../../../src/components/GooglePay/requests.ts"],"sourcesContent":["import { getDecimalAmount } from '../../utils/amount-util';\nimport config from './config';\nimport { GooglePaymentDataRequest, GooglePayConfiguration } from './types';\n\n/**\n * Configure your site's support for payment methods supported by the Google Pay API.\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#IsReadyToPayRequest|isReadyToPayRequest}\n * @returns Google Pay API version, payment methods supported by the site\n */\nexport function isReadyToPayRequest({\n allowedAuthMethods,\n allowedCardNetworks,\n existingPaymentMethodRequired = false\n}): google.payments.api.IsReadyToPayRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n allowedPaymentMethods: [\n {\n type: 'CARD',\n parameters: {\n allowedAuthMethods,\n allowedCardNetworks\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {}\n }\n }\n ],\n existingPaymentMethodRequired\n };\n}\n\n/**\n * Provide Google Pay API with a payment amount, currency, and amount status\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#TransactionInfo|TransactionInfo}\n * @returns transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n */\nexport function getTransactionInfo({\n amount,\n countryCode = 'US',\n totalPriceStatus = 'FINAL',\n ...props\n}: GooglePayConfiguration): google.payments.api.TransactionInfo {\n const formattedPrice = String(getDecimalAmount(amount.value, amount.currency));\n\n return {\n countryCode,\n currencyCode: amount.currency,\n totalPrice: formattedPrice,\n totalPriceStatus: totalPriceStatus as google.payments.api.TotalPriceStatus,\n ...props.transactionInfo\n };\n}\n\nexport function initiatePaymentRequest({ configuration, ...props }: GooglePayConfiguration, countryCode: string): GooglePaymentDataRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n transactionInfo: getTransactionInfo({ countryCode, ...props }),\n merchantInfo: {\n merchantId: configuration.merchantId,\n merchantName: configuration.merchantName,\n ...(configuration.merchantOrigin ? { merchantOrigin: configuration.merchantOrigin } : {}),\n ...(configuration.authJwt ? { authJwt: configuration.authJwt } : {})\n },\n allowedPaymentMethods: [\n {\n type: 'CARD',\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n gateway: config.GATEWAY,\n gatewayMerchantId: configuration.gatewayMerchantId\n }\n },\n parameters: {\n allowedAuthMethods: props.allowedAuthMethods,\n allowedCardNetworks: props.allowedCardNetworks,\n assuranceDetailsRequired: props.assuranceDetailsRequired,\n allowPrepaidCards: props.allowPrepaidCards,\n allowCreditCards: props.allowCreditCards,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressParameters: props.billingAddressParameters\n }\n }\n ],\n emailRequired: props.emailRequired,\n shippingAddressRequired: props.shippingAddressRequired,\n shippingAddressParameters: props.shippingAddressParameters,\n shippingOptionRequired: props.shippingOptionRequired,\n shippingOptionParameters: props.shippingOptionParameters,\n callbackIntents: props.callbackIntents\n };\n}\n"],"names":["isReadyToPayRequest","allowedAuthMethods","allowedCardNetworks","existingPaymentMethodRequired","apiVersion","config","API_VERSION","apiVersionMinor","API_VERSION_MINOR","allowedPaymentMethods","type","parameters","tokenizationSpecification","getTransactionInfo","_param","amount","countryCode","totalPriceStatus","props","_object_without_properties","formattedPrice","String","getDecimalAmount","value","currency","_object_spread","currencyCode","totalPrice","transactionInfo","initiatePaymentRequest","configuration","merchantInfo","merchantId","merchantName","merchantOrigin","authJwt","gateway","GATEWAY","gatewayMerchantId","assuranceDetailsRequired","allowPrepaidCards","allowCreditCards","billingAddressRequired","billingAddressParameters","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters","callbackIntents"],"mappings":"64BAUO,SAASA,GAAoBC,mBAChCA,EAAkBC,oBAClBA,EAAmBC,8BACnBA,GAAgC,
|
|
1
|
+
{"version":3,"file":"requests.js","sources":["../../../../src/components/GooglePay/requests.ts"],"sourcesContent":["import { getDecimalAmount } from '../../utils/amount-util';\nimport config from './config';\nimport { GooglePaymentDataRequest, GooglePayConfiguration } from './types';\n\n/**\n * Configure your site's support for payment methods supported by the Google Pay API.\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#IsReadyToPayRequest|isReadyToPayRequest}\n * @returns Google Pay API version, payment methods supported by the site\n */\nexport function isReadyToPayRequest({\n allowedAuthMethods,\n allowedCardNetworks,\n existingPaymentMethodRequired = false\n}: Pick<\n GooglePayConfiguration,\n 'allowedAuthMethods' | 'allowedCardNetworks' | 'existingPaymentMethodRequired'\n>): google.payments.api.IsReadyToPayRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n allowedPaymentMethods: [\n {\n type: 'CARD',\n parameters: {\n allowedAuthMethods,\n allowedCardNetworks\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {}\n }\n }\n ],\n existingPaymentMethodRequired\n };\n}\n\n/**\n * Provide Google Pay API with a payment amount, currency, and amount status\n *\n * @see {@link https://developers.google.com/pay/api/web/reference/object#TransactionInfo|TransactionInfo}\n * @returns transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n */\nexport function getTransactionInfo({\n amount,\n countryCode = 'US',\n totalPriceStatus = 'FINAL',\n ...props\n}: GooglePayConfiguration): google.payments.api.TransactionInfo {\n const formattedPrice = String(getDecimalAmount(amount.value, amount.currency));\n\n return {\n countryCode,\n currencyCode: amount.currency,\n totalPrice: formattedPrice,\n totalPriceStatus: totalPriceStatus as google.payments.api.TotalPriceStatus,\n ...props.transactionInfo\n };\n}\n\nexport function initiatePaymentRequest({ configuration, ...props }: GooglePayConfiguration, countryCode: string): GooglePaymentDataRequest {\n return {\n apiVersion: config.API_VERSION,\n apiVersionMinor: config.API_VERSION_MINOR,\n transactionInfo: getTransactionInfo({ countryCode, ...props }),\n merchantInfo: {\n merchantId: configuration.merchantId,\n merchantName: configuration.merchantName,\n ...(configuration.merchantOrigin ? { merchantOrigin: configuration.merchantOrigin } : {}),\n ...(configuration.authJwt ? { authJwt: configuration.authJwt } : {})\n },\n allowedPaymentMethods: [\n {\n type: 'CARD',\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n gateway: config.GATEWAY,\n gatewayMerchantId: configuration.gatewayMerchantId\n }\n },\n parameters: {\n allowedAuthMethods: props.allowedAuthMethods,\n allowedCardNetworks: props.allowedCardNetworks,\n assuranceDetailsRequired: props.assuranceDetailsRequired,\n allowPrepaidCards: props.allowPrepaidCards,\n allowCreditCards: props.allowCreditCards,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressParameters: props.billingAddressParameters\n }\n }\n ],\n emailRequired: props.emailRequired,\n shippingAddressRequired: props.shippingAddressRequired,\n shippingAddressParameters: props.shippingAddressParameters,\n shippingOptionRequired: props.shippingOptionRequired,\n shippingOptionParameters: props.shippingOptionParameters,\n callbackIntents: props.callbackIntents\n };\n}\n"],"names":["isReadyToPayRequest","allowedAuthMethods","allowedCardNetworks","existingPaymentMethodRequired","apiVersion","config","API_VERSION","apiVersionMinor","API_VERSION_MINOR","allowedPaymentMethods","type","parameters","tokenizationSpecification","getTransactionInfo","_param","amount","countryCode","totalPriceStatus","props","_object_without_properties","formattedPrice","String","getDecimalAmount","value","currency","_object_spread","currencyCode","totalPrice","transactionInfo","initiatePaymentRequest","configuration","merchantInfo","merchantId","merchantName","merchantOrigin","authJwt","gateway","GATEWAY","gatewayMerchantId","assuranceDetailsRequired","allowPrepaidCards","allowCreditCards","billingAddressRequired","billingAddressParameters","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters","callbackIntents"],"mappings":"64BAUO,SAASA,GAAoBC,mBAChCA,EAAkBC,oBAClBA,EAAmBC,8BACnBA,GAAgC,IAKhC,MAAO,CACHC,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBC,sBAAuB,CACnB,CACIC,KAAM,OACNC,WAAY,CACRV,qBACAC,uBAEJU,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CAAC,KAIzBR,gCAER,CAQO,SAASU,EAAmBC,OAAAC,OAC/BA,EAAMC,YACNA,EAAc,KAAIC,iBAClBA,EAAmB,SAHYH,EAI5BI,EAJ4BC,EAAAL,EAAA,CAC/BC,SACAC,cACAC,qBAGA,MAAMG,EAAiBC,OAAOC,EAAiBP,EAAOQ,MAAOR,EAAOS,WAEpE,OAAOC,EAAA,CACHT,cACAU,aAAcX,EAAOS,SACrBG,WAAYP,EACZH,iBAAkBA,GACfC,EAAMU,gBAEjB,CAEO,SAASC,EAAuBf,EAAqDE,GAArD,IAAAc,cAAEA,GAAFhB,EAAoBI,EAApBC,EAAAL,EAAA,CAAEgB,kBACrC,MAAO,CACH1B,WAAYC,EAAOC,YACnBC,gBAAiBF,EAAOG,kBACxBoB,gBAAiBf,EAAmBY,EAAA,CAAET,eAAgBE,IACtDa,aAAcN,EAAA,CACVO,WAAYF,EAAcE,WAC1BC,aAAcH,EAAcG,cACxBH,EAAcI,eAAiB,CAAEA,eAAgBJ,EAAcI,gBAAmB,CAAC,EACnFJ,EAAcK,QAAU,CAAEA,QAASL,EAAcK,SAAY,IAErE1B,sBAAuB,CACnB,CACIC,KAAM,OACNE,0BAA2B,CACvBF,KAAM,kBACNC,WAAY,CACRyB,QAAS/B,EAAOgC,QAChBC,kBAAmBR,EAAcQ,oBAGzC3B,WAAY,CACRV,mBAAoBiB,EAAMjB,mBAC1BC,oBAAqBgB,EAAMhB,oBAC3BqC,yBAA0BrB,EAAMqB,yBAChCC,kBAAmBtB,EAAMsB,kBACzBC,iBAAkBvB,EAAMuB,iBACxBC,uBAAwBxB,EAAMwB,uBAC9BC,yBAA0BzB,EAAMyB,4BAI5CC,cAAe1B,EAAM0B,cACrBC,wBAAyB3B,EAAM2B,wBAC/BC,0BAA2B5B,EAAM4B,0BACjCC,uBAAwB7B,EAAM6B,uBAC9BC,yBAA0B9B,EAAM8B,yBAChCC,gBAAiB/B,EAAM+B,gBAE/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/MultibancoVoucherResult/MultibancoVoucherResult.js";import o from"../../core/Context/CoreProvider.js";import n from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as s}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(e){i(t,e,r[e])}))}return t}function c(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class a extends e{get isValid(){return!0}formatProps(t){return c(p({},t),{name:t.name||"Multibanco"})}formatData(){return{paymentMethod:{type:this.props.type||a.type}}}render(){return this.props.reference?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,p({ref:this.handleRef},this.props))):this.props.showPayButton?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}})):null}constructor(...t){super(...t),i(this,"handleRef",(t=>{this.componentRef=t}))}}i(a,"type",s.multibanco)
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/MultibancoVoucherResult/MultibancoVoucherResult.js";import o from"../../core/Context/CoreProvider.js";import n from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as s}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(e){i(t,e,r[e])}))}return t}function c(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class a extends e{get isValid(){return!0}formatProps(t){return c(p({},t),{name:t.name||"Multibanco"})}formatData(){return{paymentMethod:{type:this.props.type||a.type}}}render(){return this.props.reference?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,p({ref:this.handleRef},this.props))):this.props.showPayButton?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}})):null}constructor(...t){super(...t),i(this,"handleRef",(t=>{this.componentRef=t}))}}i(a,"type",s.multibanco);export{a as MultibancoElement,a as default};
|
|
2
2
|
//# sourceMappingURL=Multibanco.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Multibanco.js","sources":["../../../../src/components/Multibanco/Multibanco.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport MultibancoVoucherResult from './components/MultibancoVoucherResult';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class MultibancoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.multibanco;\n
|
|
1
|
+
{"version":3,"file":"Multibanco.js","sources":["../../../../src/components/Multibanco/Multibanco.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport MultibancoVoucherResult from './components/MultibancoVoucherResult';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class MultibancoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.multibanco;\n\n get isValid() {\n return true;\n }\n\n formatProps(props) {\n return {\n ...props,\n name: props.name || 'Multibanco'\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: this.props.type || MultibancoElement.type\n }\n };\n }\n\n private handleRef = ref => {\n this.componentRef = ref;\n };\n\n render() {\n if (this.props.reference) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <MultibancoVoucherResult ref={this.handleRef} {...this.props} />\n </CoreProvider>\n );\n }\n\n if (this.props.showPayButton) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <RedirectButton\n name={this.displayName}\n amount={this.props.amount}\n payButton={this.payButton}\n onSubmit={this.submit}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n </CoreProvider>\n );\n }\n\n return null;\n }\n}\n\nexport default MultibancoElement;\n"],"names":["MultibancoElement","UIElement","isValid","formatProps","props","_object_spread_props","name","formatData","paymentMethod","type","this","render","reference","h","CoreProvider","i18n","loadingContext","resources","MultibancoVoucherResult","ref","handleRef","showPayButton","RedirectButton","displayName","amount","payButton","onSubmit","submit","componentRef","_define_property","TxVariants","multibanco"],"mappings":"wvCAQO,MAAMA,UAA0BC,EAGnC,WAAIC,GACA,OAAO,CACX,CAEAC,WAAAA,CAAYC,GACR,OAAOC,EACAD,EAAAA,CAAAA,EAAAA,GAAAA,CACHE,KAAMF,EAAME,MAAQ,cAE5B,CAKAC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKN,MAAMK,MAAQT,EAAkBS,MAGvD,CAMAE,MAAAA,GACI,OAAID,KAAKN,MAAMQ,UAEPC,EAACC,EAAAA,CAAaC,KAAML,KAAKN,MAAMW,KAAMC,eAAgBN,KAAKN,MAAMY,eAAgBC,UAAWP,KAAKO,WAC5FJ,EAACK,EAAAA,EAAAA,CAAwBC,IAAKT,KAAKU,WAAeV,KAAKN,SAK/DM,KAAKN,MAAMiB,cAEPR,EAACC,EAAAA,CAAaC,KAAML,KAAKN,MAAMW,KAAMC,eAAgBN,KAAKN,MAAMY,eAAgBC,UAAWP,KAAKO,WAC5FJ,EAACS,EAAAA,CACGhB,KAAMI,KAAKa,YACXC,OAAQd,KAAKN,MAAMoB,OACnBC,UAAWf,KAAKe,UAChBC,SAAUhB,KAAKiB,OACfR,IAAKA,IACDT,KAAKkB,aAAeT,CAAAA,KAOjC,IACX,+BA9BAU,EAAAnB,KAAQU,aAAYD,IAChBT,KAAKkB,aAAeT,CAAAA,KAzBxBU,EADS7B,EACKS,OAAOqB,EAAWC"}
|
|
@@ -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 n from"./components/PaypalComponent.js";import r from"./defaultProps.js";import i from"../../core/Context/CoreProvider.js";import o from"../../core/Errors/AdyenCheckoutError.js";import{ERRORS as s}from"./constants.js";import{TxVariants as a}from"../tx-variants.js";import{
|
|
1
|
+
import{createElement as e}from"../../external/preact/dist/preact.js";import{UIElement as t}from"../internal/UIElement/UIElement.js";import n from"./components/PaypalComponent.js";import r from"./defaultProps.js";import i from"../../core/Context/CoreProvider.js";import o from"../../core/Errors/AdyenCheckoutError.js";import{ERRORS as s}from"./constants.js";import{TxVariants as a}from"../tx-variants.js";import{formatPaypalOrderContactToAdyenFormat as p}from"./utils/format-paypal-order-contact-to-adyen-format.js";function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function u(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}class c extends t{formatProps(e){var t,n,r;const i=null===(t=e.configuration)||void 0===t?void 0:t.merchantId,o=null===(n=e.configuration)||void 0===n?void 0:n.intent,s=0===(null===(r=e.amount)||void 0===r?void 0:r.value)?"tokenize":e.intent||o,a="tokenize"===s||e.vault,p="continue"===e.userAction;return d(l({},e),{commit:!p&&e.commit,vault:a,configuration:{intent:s,merchantId:i}})}updatePaymentData(e){e||console.warn("PayPal - Updating payment data with an invalid value"),this.paymentData=e}formatData(){const{isExpress:e,userAction:t}=this.props;return{paymentMethod:{type:c.type,userAction:t,subtype:e?"express":c.subtype}}}get isValid(){return!0}handleResolve(e){if(!this.resolve)return this.handleError(new o("ERROR",s.WRONG_INSTANCE));this.resolve(e)}handleReject(e){if(!this.reject)return this.handleError(new o("ERROR",s.WRONG_INSTANCE));this.reject(new Error(e))}handleSubmit(){return super.submit(),new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}handleOnShippingAddressChange(e,t){return this.props.onShippingAddressChange(e,t,this)}handleOnShippingOptionsChange(e,t){return this.props.onShippingOptionsChange(e,t,this)}render(){if(!this.props.showPayButton)return null;const t=this.props,{onShippingAddressChange:r,onShippingOptionsChange:s}=t,a=u(t,["onShippingAddressChange","onShippingOptionsChange"]);return e(i,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},e(n,d(l({ref:e=>{this.componentRef=e}},a,r&&{onShippingAddressChange:this.handleOnShippingAddressChange},s&&{onShippingOptionsChange:this.handleOnShippingOptionsChange}),{onCancel:()=>this.handleError(new o("CANCEL")),onChange:this.setState,onApprove:this.handleOnApprove,onError:e=>{this.handleError(new o("ERROR",e.toString(),{cause:e}))},onScriptLoadFailure:e=>this.handleError(e),onSubmit:this.handleSubmit})))}constructor(e,t){super(e,t),h(this,"paymentData",null),h(this,"resolve",null),h(this,"reject",null),h(this,"submit",(()=>{this.handleError(new o("IMPLEMENTATION_ERROR",s.SUBMIT_NOT_SUPPORTED))})),h(this,"handleAction",(e=>this.updateWithAction(e))),h(this,"updateWithAction",(e=>{if(e.paymentMethodType!==this.type)throw new Error("Invalid Action");return e.paymentData&&(this.paymentData=e.paymentData),e.sdkData&&e.sdkData.token?this.handleResolve(e.sdkData.token):this.handleReject(s.NO_TOKEN_PROVIDED),null})),h(this,"handleOnApprove",((e,t)=>{const{onAuthorized:n}=this.props,r={data:{details:e,paymentData:this.paymentData}};if(n)return t.order.get().then((e=>{var t;const r=p(null==e?void 0:e.payer),i=p(null==e||null===(t=e.purchase_units)||void 0===t?void 0:t[0].shipping,!0);return this.setState(l({authorizedEvent:e},r&&{billingAddress:r},i&&{deliveryAddress:i})),new Promise(((t,o)=>n(l({authorizedEvent:e},r&&{billingAddress:r},i&&{deliveryAddress:i}),{resolve:t,reject:o})))})).then((()=>this.handleAdditionalDetails(r))).catch((e=>this.handleError(new o("ERROR","Something went wrong while parsing PayPal Order",{cause:e}))));this.handleAdditionalDetails(r)})),this.handleSubmit=this.handleSubmit.bind(this),this.handleOnShippingAddressChange=this.handleOnShippingAddressChange.bind(this),this.handleOnShippingOptionsChange=this.handleOnShippingOptionsChange.bind(this)}}h(c,"type",a.paypal),h(c,"subtype","sdk"),h(c,"defaultProps",r);export{c as default};
|
|
2
2
|
//# sourceMappingURL=Paypal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paypal.js","sources":["../../../../src/components/PayPal/Paypal.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PaypalComponent from './components/PaypalComponent';\nimport defaultProps from './defaultProps';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { ERRORS } from './constants';\nimport { TxVariants } from '../tx-variants';\nimport { formatPaypalOrderContatcToAdyenFormat } from './utils/format-paypal-order-contact-to-adyen-format';\n\nimport type { ICore } from '../../core/types';\nimport type { PaymentAction } from '../../types/global-types';\nimport type { Intent, PayPalConfiguration } from './types';\n\nimport './Paypal.scss';\n\nclass PaypalElement extends UIElement<PayPalConfiguration> {\n public static type = TxVariants.paypal;\n public static subtype = 'sdk';\n\n public paymentData: string = null;\n\n private resolve = null;\n private reject = null;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: PayPalConfiguration) {\n super(checkout, props);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleOnShippingAddressChange = this.handleOnShippingAddressChange.bind(this);\n this.handleOnShippingOptionsChange = this.handleOnShippingOptionsChange.bind(this);\n }\n\n formatProps(props: PayPalConfiguration): PayPalConfiguration {\n const { merchantId, intent: intentFromConfig } = props.configuration;\n const isZeroAuth = props.amount?.value === 0;\n const intent: Intent = isZeroAuth ? 'tokenize' : props.intent || intentFromConfig;\n const vault = intent === 'tokenize' || props.vault;\n\n const displayContinueToReviewPageButton = props.userAction === 'continue';\n\n return {\n ...props,\n commit: displayContinueToReviewPageButton ? false : props.commit,\n vault,\n configuration: {\n intent,\n merchantId\n }\n };\n }\n\n public submit = () => {\n this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', ERRORS.SUBMIT_NOT_SUPPORTED));\n };\n\n /**\n * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount\n * @param paymentData - Payment data value\n */\n public updatePaymentData(paymentData: string): void {\n if (!paymentData) console.warn('PayPal - Updating payment data with an invalid value');\n this.paymentData = paymentData;\n }\n\n /**\n * Formats the component data output\n */\n protected formatData() {\n const { isExpress, userAction } = this.props;\n\n return {\n paymentMethod: {\n type: PaypalElement.type,\n userAction,\n subtype: isExpress ? 'express' : PaypalElement.subtype\n }\n };\n }\n\n public handleAction = (action: PaymentAction) => {\n return this.updateWithAction(action);\n };\n\n public updateWithAction = (action: PaymentAction) => {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n\n if (action.paymentData) {\n this.paymentData = action.paymentData;\n }\n\n if (action.sdkData && action.sdkData.token) {\n this.handleResolve(action.sdkData.token);\n } else {\n this.handleReject(ERRORS.NO_TOKEN_PROVIDED);\n }\n\n return null;\n };\n\n /**\n * Dropin Validation\n *\n * @remarks\n * Paypal does not require any specific Dropin validation\n */\n get isValid() {\n return true;\n }\n\n private handleOnApprove = (data: any, actions: any): Promise<void> | void => {\n const { onAuthorized } = this.props;\n const state = { data: { details: data, paymentData: this.paymentData } };\n\n if (!onAuthorized) {\n this.handleAdditionalDetails(state);\n return;\n }\n\n return actions.order\n .get()\n .then((paypalOrder: any) => {\n const billingAddress = formatPaypalOrderContatcToAdyenFormat(paypalOrder?.payer);\n const deliveryAddress = formatPaypalOrderContatcToAdyenFormat(paypalOrder?.purchase_units?.[0].shipping, true);\n\n this.setState({\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<void>((resolve, reject) =>\n onAuthorized(\n {\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n )\n );\n })\n .then(() => this.handleAdditionalDetails(state))\n .catch(error => this.handleError(new AdyenCheckoutError('ERROR', 'Something went wrong while parsing PayPal Order', { cause: error })));\n };\n\n handleResolve(token: string) {\n if (!this.resolve) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.resolve(token);\n }\n\n handleReject(errorMessage: string) {\n if (!this.reject) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.reject(new Error(errorMessage));\n }\n\n private handleSubmit(): Promise<void> {\n super.submit();\n\n return new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n /**\n * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingAddressChange(data, actions): Promise<void> {\n return this.props.onShippingAddressChange(data, actions, this);\n }\n\n /**\n * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingOptionsChange(data, actions): Promise<void> {\n return this.props.onShippingOptionsChange(data, actions, this);\n }\n\n render() {\n if (!this.props.showPayButton) return null;\n\n const { onShippingAddressChange, onShippingOptionsChange, ...rest } = this.props;\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PaypalComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...rest}\n {...(onShippingAddressChange && { onShippingAddressChange: this.handleOnShippingAddressChange })}\n {...(onShippingOptionsChange && { onShippingOptionsChange: this.handleOnShippingOptionsChange })}\n onCancel={() => this.handleError(new AdyenCheckoutError('CANCEL'))}\n onChange={this.setState}\n onApprove={this.handleOnApprove}\n onError={error => {\n this.handleError(new AdyenCheckoutError('ERROR', error.toString(), { cause: error }));\n }}\n onSubmit={this.handleSubmit}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default PaypalElement;\n"],"names":["PaypalElement","UIElement","formatProps","props","merchantId","intent","intentFromConfig","configuration","amount","value","vault","displayContinueToReviewPageButton","userAction","_object_spread_props","commit","updatePaymentData","paymentData","console","warn","this","formatData","isExpress","paymentMethod","type","subtype","isValid","handleResolve","token","resolve","handleError","AdyenCheckoutError","ERRORS","WRONG_INSTANCE","handleReject","errorMessage","reject","Error","handleSubmit","super","submit","Promise","handleOnShippingAddressChange","data","actions","onShippingAddressChange","handleOnShippingOptionsChange","onShippingOptionsChange","render","showPayButton","_this_props","rest","_object_without_properties","h","CoreProvider","i18n","loadingContext","resources","PaypalComponent","ref","componentRef","onCancel","onChange","setState","onApprove","handleOnApprove","onError","error","toString","cause","onSubmit","constructor","checkout","_define_property","SUBMIT_NOT_SUPPORTED","handleAction","action","updateWithAction","paymentMethodType","sdkData","NO_TOKEN_PROVIDED","onAuthorized","state","details","order","get","then","paypalOrder","billingAddress","formatPaypalOrderContatcToAdyenFormat","payer","deliveryAddress","purchase_units","shipping","_object_spread","authorizedEvent","handleAdditionalDetails","catch","bind","TxVariants","paypal","defaultProps"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Paypal.js","sources":["../../../../src/components/PayPal/Paypal.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PaypalComponent from './components/PaypalComponent';\nimport defaultProps from './defaultProps';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { ERRORS } from './constants';\nimport { TxVariants } from '../tx-variants';\nimport { formatPaypalOrderContactToAdyenFormat } from './utils/format-paypal-order-contact-to-adyen-format';\n\nimport type { ICore } from '../../core/types';\nimport type { PaymentAction } from '../../types/global-types';\nimport type { Intent, PayPalConfiguration } from './types';\n\nimport './Paypal.scss';\n\nclass PaypalElement extends UIElement<PayPalConfiguration> {\n public static type = TxVariants.paypal;\n public static subtype = 'sdk';\n\n public paymentData: string = null;\n\n private resolve = null;\n private reject = null;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: PayPalConfiguration) {\n super(checkout, props);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleOnShippingAddressChange = this.handleOnShippingAddressChange.bind(this);\n this.handleOnShippingOptionsChange = this.handleOnShippingOptionsChange.bind(this);\n }\n\n formatProps(props: PayPalConfiguration): PayPalConfiguration {\n const merchantId = props.configuration?.merchantId;\n const intentFromConfig = props.configuration?.intent;\n const isZeroAuth = props.amount?.value === 0;\n const intent: Intent = isZeroAuth ? 'tokenize' : props.intent || intentFromConfig;\n const vault = intent === 'tokenize' || props.vault;\n\n const displayContinueToReviewPageButton = props.userAction === 'continue';\n\n return {\n ...props,\n commit: displayContinueToReviewPageButton ? false : props.commit,\n vault,\n configuration: {\n intent,\n merchantId\n }\n };\n }\n\n public submit = () => {\n this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', ERRORS.SUBMIT_NOT_SUPPORTED));\n };\n\n /**\n * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount\n * @param paymentData - Payment data value\n */\n public updatePaymentData(paymentData: string): void {\n if (!paymentData) console.warn('PayPal - Updating payment data with an invalid value');\n this.paymentData = paymentData;\n }\n\n /**\n * Formats the component data output\n */\n protected formatData() {\n const { isExpress, userAction } = this.props;\n\n return {\n paymentMethod: {\n type: PaypalElement.type,\n userAction,\n subtype: isExpress ? 'express' : PaypalElement.subtype\n }\n };\n }\n\n public handleAction = (action: PaymentAction) => {\n return this.updateWithAction(action);\n };\n\n public updateWithAction = (action: PaymentAction) => {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n\n if (action.paymentData) {\n this.paymentData = action.paymentData;\n }\n\n if (action.sdkData && action.sdkData.token) {\n this.handleResolve(action.sdkData.token);\n } else {\n this.handleReject(ERRORS.NO_TOKEN_PROVIDED);\n }\n\n return null;\n };\n\n /**\n * Dropin Validation\n *\n * @remarks\n * Paypal does not require any specific Dropin validation\n */\n get isValid() {\n return true;\n }\n\n private handleOnApprove = (data: any, actions: any): Promise<void> | void => {\n const { onAuthorized } = this.props;\n const state = { data: { details: data, paymentData: this.paymentData } };\n\n if (!onAuthorized) {\n this.handleAdditionalDetails(state);\n return;\n }\n\n return actions.order\n .get()\n .then((paypalOrder: any) => {\n const billingAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.payer);\n const deliveryAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.purchase_units?.[0].shipping, true);\n\n this.setState({\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<void>((resolve, reject) =>\n onAuthorized(\n {\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n )\n );\n })\n .then(() => this.handleAdditionalDetails(state))\n .catch(error => this.handleError(new AdyenCheckoutError('ERROR', 'Something went wrong while parsing PayPal Order', { cause: error })));\n };\n\n handleResolve(token: string) {\n if (!this.resolve) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.resolve(token);\n }\n\n handleReject(errorMessage: string) {\n if (!this.reject) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.reject(new Error(errorMessage));\n }\n\n private handleSubmit(): Promise<void> {\n super.submit();\n\n return new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n /**\n * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingAddressChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingAddressChange(data, actions, this);\n }\n\n /**\n * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingOptionsChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingOptionsChange(data, actions, this);\n }\n\n render() {\n if (!this.props.showPayButton) return null;\n\n const { onShippingAddressChange, onShippingOptionsChange, ...rest } = this.props;\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PaypalComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...rest}\n {...(onShippingAddressChange && { onShippingAddressChange: this.handleOnShippingAddressChange })}\n {...(onShippingOptionsChange && { onShippingOptionsChange: this.handleOnShippingOptionsChange })}\n onCancel={() => this.handleError(new AdyenCheckoutError('CANCEL'))}\n onChange={this.setState}\n onApprove={this.handleOnApprove}\n onError={error => {\n this.handleError(new AdyenCheckoutError('ERROR', error.toString(), { cause: error }));\n }}\n onScriptLoadFailure={error => this.handleError(error)}\n onSubmit={this.handleSubmit}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default PaypalElement;\n"],"names":["PaypalElement","UIElement","formatProps","props","merchantId","configuration","intentFromConfig","intent","amount","value","vault","displayContinueToReviewPageButton","userAction","_object_spread_props","commit","updatePaymentData","paymentData","console","warn","this","formatData","isExpress","paymentMethod","type","subtype","isValid","handleResolve","token","resolve","handleError","AdyenCheckoutError","ERRORS","WRONG_INSTANCE","handleReject","errorMessage","reject","Error","handleSubmit","super","submit","Promise","handleOnShippingAddressChange","data","actions","onShippingAddressChange","handleOnShippingOptionsChange","onShippingOptionsChange","render","showPayButton","_this_props","rest","_object_without_properties","h","CoreProvider","i18n","loadingContext","resources","PaypalComponent","ref","componentRef","onCancel","onChange","setState","onApprove","handleOnApprove","onError","error","toString","cause","onScriptLoadFailure","onSubmit","constructor","checkout","_define_property","SUBMIT_NOT_SUPPORTED","handleAction","action","updateWithAction","paymentMethodType","sdkData","NO_TOKEN_PROVIDED","onAuthorized","state","details","order","get","then","paypalOrder","billingAddress","formatPaypalOrderContactToAdyenFormat","payer","deliveryAddress","purchase_units","shipping","_object_spread","authorizedEvent","handleAdditionalDetails","catch","bind","TxVariants","paypal","defaultProps"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as t,useEffect as n}from"../../../external/preact/hooks/dist/hooks.js";import o from"../../../external/classnames/index.js";import{getStyle as r}from"../utils/get-paypal-styles.js";import a from"../../internal/Spinner/Spinner.js";import c from"../../../core/Context/useCoreContext.js";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function l(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s(s){var u,{onInit:y,onApprove:f,onClick:_,onCancel:b,onError:m,onShippingAddressChange:d,onShippingOptionsChange:g,onSubmit:O,isProcessingPayment:h,paypalRef:P,style:j}=s,k=l(s,["onInit","onApprove","onClick","onCancel","onError","onShippingAddressChange","onShippingOptionsChange","onSubmit","isProcessingPayment","paypalRef","style"]);const{i18n:v}=c(),C="tokenize"===(null===(u=k.configuration)||void 0===u?void 0:u.intent),S=t(null),w=t(null),E=t(null),A=t(null),N=(e,t)=>{const n=p(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},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(t){i(e,t,n[t])}))}return e}({},C&&{createBillingAgreement:O},!C&&{createOrder:O},!C&&"venmo"!==e&&d&&{onShippingAddressChange:d},!C&&"venmo"!==e&&g&&{onShippingOptionsChange:g}),{fundingSource:e,style:r(e,j),onInit:y,onClick:_,onCancel:b,onError:m,onApprove:f}),o=P.Buttons(n);o.isEligible()&&o.render(t.current)};n((()=>{const{PAYPAL:e,CREDIT:t,PAYLATER:n,VENMO:o}=P.FUNDING;N(e,S),k.blockPayPalCreditButton||N(t,w),k.blockPayPalPayLaterButton||N(n,E),k.blockPayPalVenmoButton||N(o,A)}),[]);const x=!0===k.commit;return e("div",{className:o("adyen-checkout__paypal__buttons",{"adyen-checkout__paypal-processing":h})},e("div",{className:"adyen-checkout__paypal__button adyen-checkout__paypal__button--paypal",ref:S}),e("div",{className:"adyen-checkout__paypal__button adyen-checkout__paypal__button--credit",ref:w}),e("div",{className:"adyen-checkout__paypal__button adyen-checkout__paypal__button--pay-later",ref:E}),e("div",{className:"adyen-checkout__paypal__button adyen-checkout__paypal__button--venmo",ref:A}),h&&e("div",{className:"adyen-checkout__paypal"},e("div",{className:"adyen-checkout__paypal__status adyen-checkout__paypal__status--processing"},e(a,{size:"medium",inline:!0}),x&&v.get("paypal.processingPayment"))))}export{s as default};
|
|
2
2
|
//# sourceMappingURL=PaypalButtons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaypalButtons.js","sources":["../../../../../src/components/PayPal/components/PaypalButtons.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport classnames from 'classnames';\nimport {
|
|
1
|
+
{"version":3,"file":"PaypalButtons.js","sources":["../../../../../src/components/PayPal/components/PaypalButtons.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport classnames from 'classnames';\nimport { getStyle } from '../utils/get-paypal-styles';\nimport Spinner from '../../internal/Spinner';\nimport useCoreContext from '../../../core/Context/useCoreContext';\n\nimport type { PayPalButtonsProps } from './types';\nimport type { FundingSource } from '../types';\n\nexport default function PaypalButtons({\n onInit,\n onApprove,\n onClick,\n onCancel,\n onError,\n onShippingAddressChange,\n onShippingOptionsChange,\n onSubmit,\n isProcessingPayment,\n paypalRef,\n style,\n ...props\n}: PayPalButtonsProps) {\n const { i18n } = useCoreContext();\n const isTokenize = props.configuration?.intent === 'tokenize';\n const paypalButtonRef = useRef<HTMLDivElement>(null);\n const creditButtonRef = useRef<HTMLDivElement>(null);\n const payLaterButtonRef = useRef<HTMLDivElement>(null);\n const venmoButtonRef = useRef<HTMLDivElement>(null);\n\n const createButton = (fundingSource: FundingSource, buttonRef) => {\n const configuration = {\n ...(isTokenize && { createBillingAgreement: onSubmit }),\n ...(!isTokenize && { createOrder: onSubmit }),\n ...(!isTokenize && fundingSource !== 'venmo' && onShippingAddressChange && { onShippingAddressChange }),\n ...(!isTokenize && fundingSource !== 'venmo' && onShippingOptionsChange && { onShippingOptionsChange }),\n fundingSource,\n style: getStyle(fundingSource, style),\n onInit,\n onClick,\n onCancel,\n onError,\n onApprove\n };\n\n const button = paypalRef.Buttons(configuration);\n\n if (button.isEligible()) {\n button.render(buttonRef.current);\n }\n };\n\n useEffect(() => {\n const { PAYPAL, CREDIT, PAYLATER, VENMO } = paypalRef.FUNDING;\n createButton(PAYPAL, paypalButtonRef);\n\n if (!props.blockPayPalCreditButton) createButton(CREDIT, creditButtonRef);\n if (!props.blockPayPalPayLaterButton) createButton(PAYLATER, payLaterButtonRef);\n if (!props.blockPayPalVenmoButton) createButton(VENMO, venmoButtonRef);\n }, []);\n\n const isProcessingPaymentWithoutReviewPage = props.commit === true;\n\n return (\n <div className={classnames('adyen-checkout__paypal__buttons', { 'adyen-checkout__paypal-processing': isProcessingPayment })}>\n <div className=\"adyen-checkout__paypal__button adyen-checkout__paypal__button--paypal\" ref={paypalButtonRef} />\n <div className=\"adyen-checkout__paypal__button adyen-checkout__paypal__button--credit\" ref={creditButtonRef} />\n <div className=\"adyen-checkout__paypal__button adyen-checkout__paypal__button--pay-later\" ref={payLaterButtonRef} />\n <div className=\"adyen-checkout__paypal__button adyen-checkout__paypal__button--venmo\" ref={venmoButtonRef} />\n\n {isProcessingPayment && (\n <div className=\"adyen-checkout__paypal\">\n <div className=\"adyen-checkout__paypal__status adyen-checkout__paypal__status--processing\">\n <Spinner size=\"medium\" inline />\n {isProcessingPaymentWithoutReviewPage && i18n.get('paypal.processingPayment')}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":["PaypalButtons","_param","props","onInit","onApprove","onClick","onCancel","onError","onShippingAddressChange","onShippingOptionsChange","onSubmit","isProcessingPayment","paypalRef","style","_object_without_properties","i18n","useCoreContext","isTokenize","configuration","intent","paypalButtonRef","useRef","creditButtonRef","payLaterButtonRef","venmoButtonRef","createButton","fundingSource","buttonRef","_object_spread_props","createBillingAgreement","createOrder","getStyle","button","Buttons","isEligible","render","current","useEffect","PAYPAL","CREDIT","PAYLATER","VENMO","FUNDING","blockPayPalCreditButton","blockPayPalPayLaterButton","blockPayPalVenmoButton","isProcessingPaymentWithoutReviewPage","commit","h","div","className","classnames","ref","Spinner","size","inline","get"],"mappings":"uyCAUe,SAASA,EAAcC,OAefC,GAfeC,OAClCA,EAAMC,UACNA,EAASC,QACTA,EAAOC,SACPA,EAAQC,QACRA,EAAOC,wBACPA,EAAuBC,wBACvBA,EAAuBC,SACvBA,EAAQC,oBACRA,EAAmBC,UACnBA,EAASC,MACTA,GAXkCZ,EAY/BC,EAZ+BY,EAAAb,EAAA,CAClCE,SACAC,YACAC,UACAC,WACAC,UACAC,0BACAC,0BACAC,WACAC,sBACAC,YACAC,UAGA,MAAME,KAAEA,GAASC,IACXC,EAA6C,cAAhCf,QAAAA,EAAAA,EAAMgB,qBAANhB,IAAAA,OAAAA,EAAAA,EAAqBiB,QAClCC,EAAkBC,EAAuB,MACzCC,EAAkBD,EAAuB,MACzCE,EAAoBF,EAAuB,MAC3CG,EAAiBH,EAAuB,MAExCI,EAAe,CAACC,EAA8BC,KAChD,MAAMT,EAAgBU,4UACdX,GAAc,CAAEY,uBAAwBnB,IACvCO,GAAc,CAAEa,YAAapB,IAC7BO,GAAgC,UAAlBS,GAA6BlB,GAA2B,CAAEA,4BACxES,GAAgC,UAAlBS,GAA6BjB,GAA2B,CAAEA,4BAAwB,CACrGiB,gBACAb,MAAOkB,EAASL,EAAeb,GAC/BV,SACAE,UACAC,WACAC,UACAH,cAGE4B,EAASpB,EAAUqB,QAAQf,GAE7Bc,EAAOE,cACPF,EAAOG,OAAOR,EAAUS,QAC5B,EAGJC,GAAU,KACN,MAAMC,OAAEA,EAAMC,OAAEA,EAAMC,SAAEA,EAAQC,MAAEA,GAAU7B,EAAU8B,QACtDjB,EAAaa,EAAQlB,GAEhBlB,EAAMyC,yBAAyBlB,EAAac,EAAQjB,GACpDpB,EAAM0C,2BAA2BnB,EAAae,EAAUjB,GACxDrB,EAAM2C,wBAAwBpB,EAAagB,EAAOjB,EAAAA,GACxD,IAEH,MAAMsB,GAAwD,IAAjB5C,EAAM6C,OAEnD,OACIC,EAACC,MAAAA,CAAIC,UAAWC,EAAW,kCAAmC,CAAE,oCAAqCxC,KACjGqC,EAACC,MAAAA,CAAIC,UAAU,wEAAwEE,IAAKhC,IAC5F4B,EAACC,MAAAA,CAAIC,UAAU,wEAAwEE,IAAK9B,IAC5F0B,EAACC,MAAAA,CAAIC,UAAU,2EAA2EE,IAAK7B,IAC/FyB,EAACC,MAAAA,CAAIC,UAAU,uEAAuEE,IAAK5B,IAE1Fb,GACGqC,EAACC,MAAAA,CAAIC,UAAU,0BACXF,EAACC,MAAAA,CAAIC,UAAU,6EACXF,EAACK,EAAAA,CAAQC,KAAK,SAASC,QAAAA,IACtBT,GAAwC/B,EAAKyC,IAAI,8BAM1E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as t,useCallback as r,useEffect as n}from"../../../external/preact/hooks/dist/hooks.js";import o from"./PaypalButtons.js";import c from"../../internal/Spinner/Spinner.js";import{getPaypalUrl as a}from"../utils.js";import p from"../../../utils/Script.js";function
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as t,useCallback as r,useEffect as n}from"../../../external/preact/hooks/dist/hooks.js";import o from"./PaypalButtons.js";import c from"../../internal/Spinner/Spinner.js";import{getPaypalUrl as a}from"../utils/get-paypal-url.js";import p from"../../../utils/Script.js";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}function l(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function u(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function y(i){var{onApprove:y,onCancel:f,onChange:b,onError:O,onSubmit:m,onScriptLoadFailure:g}=i,j=u(i,["onApprove","onCancel","onChange","onError","onSubmit","onScriptLoadFailure"]);const[d,h]=t("pending");this.setStatus=h;const v=r(((e,t)=>{h("processing"),y(e,t)}),[y]),P=()=>{h("ready")},S=e=>{g(e)};return n((()=>{const e=a(j),t=s({},j.cspNonce&&{nonce:j.cspNonce}),r=s({},j.cspNonce&&{cspNonce:j.cspNonce}),n=new p(e,"body",t,r);return n.load().then(P).catch(S),()=>{n.remove()}}),[]),"pending"===d?e("div",{className:"adyen-checkout__paypal","aria-live":"polite","aria-busy":"true"},e("div",{className:"adyen-checkout__paypal__status adyen-checkout__paypal__status--pending"},e(c,null))):e("div",{className:"adyen-checkout__paypal"},e(o,l(s({},j),{onCancel:f,onChange:b,onError:O,onSubmit:m,onApprove:v,isProcessingPayment:"processing"===d,paypalRef:window.paypal})))}export{y as default};
|
|
2
2
|
//# sourceMappingURL=PaypalComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaypalComponent.js","sources":["../../../../../src/components/PayPal/components/PaypalComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useCallback } from 'preact/hooks';\nimport PaypalButtons from './PaypalButtons';\nimport Spinner from '../../internal/Spinner';\nimport { getPaypalUrl } from '../utils';\nimport
|
|
1
|
+
{"version":3,"file":"PaypalComponent.js","sources":["../../../../../src/components/PayPal/components/PaypalComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useCallback } from 'preact/hooks';\nimport PaypalButtons from './PaypalButtons';\nimport Spinner from '../../internal/Spinner';\nimport { getPaypalUrl } from '../utils/get-paypal-url';\nimport Script from '../../../utils/Script';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport type { PayPalComponentProps } from './types';\n\nexport default function PaypalComponent({ onApprove, onCancel, onChange, onError, onSubmit, onScriptLoadFailure, ...props }: PayPalComponentProps) {\n const [status, setStatus] = useState('pending');\n\n this.setStatus = setStatus;\n\n const handleOnApprove = useCallback(\n (data: any, actions: any) => {\n setStatus('processing');\n onApprove(data, actions);\n },\n [onApprove]\n );\n\n const handlePaypalLoad = () => {\n setStatus('ready');\n };\n\n const handlePaypalLoadFailure = (error: AdyenCheckoutError) => {\n onScriptLoadFailure(error);\n };\n\n useEffect(() => {\n const src = getPaypalUrl(props);\n\n const attributes = { ...(props.cspNonce && { nonce: props.cspNonce }) },\n dataAttributes = { ...(props.cspNonce && { cspNonce: props.cspNonce }) };\n\n const script = new Script(src, 'body', attributes, dataAttributes);\n\n script.load().then(handlePaypalLoad).catch(handlePaypalLoadFailure);\n\n return () => {\n script.remove();\n };\n }, []);\n\n if (status === 'pending') {\n return (\n <div className=\"adyen-checkout__paypal\" aria-live=\"polite\" aria-busy=\"true\">\n <div className=\"adyen-checkout__paypal__status adyen-checkout__paypal__status--pending\">\n <Spinner />\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"adyen-checkout__paypal\">\n <PaypalButtons\n {...props}\n onCancel={onCancel}\n onChange={onChange}\n onError={onError}\n onSubmit={onSubmit}\n onApprove={handleOnApprove}\n isProcessingPayment={status === 'processing'}\n paypalRef={window.paypal}\n />\n </div>\n );\n}\n"],"names":["PaypalComponent","_param","onApprove","onCancel","onChange","onError","onSubmit","onScriptLoadFailure","props","_object_without_properties","status","setStatus","useState","this","handleOnApprove","useCallback","data","actions","handlePaypalLoad","handlePaypalLoadFailure","error","useEffect","src","getPaypalUrl","attributes","_object_spread","cspNonce","nonce","dataAttributes","script","Script","load","then","catch","remove","h","div","className","aria-live","aria-busy","Spinner","PaypalButtons","isProcessingPayment","paypalRef","window","paypal"],"mappings":"imDASe,SAASA,EAAgBC,GAAA,IAAAC,UAAEA,EAASC,SAAEA,EAAQC,SAAEA,EAAQC,QAAEA,EAAOC,SAAEA,EAAQC,oBAAEA,GAApDN,EAA4EO,EAA5EC,EAAAR,EAAA,CAAEC,YAAWC,WAAUC,WAAUC,UAASC,WAAUC,wBACxF,MAAOG,EAAQC,GAAaC,EAAS,WAErCC,KAAKF,UAAYA,EAEjB,MAAMG,EAAkBC,GACpB,CAACC,EAAWC,KACRN,EAAU,cACVT,EAAUc,EAAMC,EAAAA,GAEpB,CAACf,IAGCgB,EAAmB,KACrBP,EAAU,QAAA,EAGRQ,EAA2BC,IAC7Bb,EAAoBa,EAAAA,EAkBxB,OAfAC,GAAU,KACN,MAAMC,EAAMC,EAAaf,GAEnBgB,EAAaC,EAAA,GAAMjB,EAAMkB,UAAY,CAAEC,MAAOnB,EAAMkB,WACtDE,EAAiBH,EAAA,CAAA,EAAMjB,EAAMkB,UAAY,CAAEA,SAAUlB,EAAMkB,WAEzDG,EAAS,IAAIC,EAAOR,EAAK,OAAQE,EAAYI,GAInD,OAFAC,EAAOE,OAAOC,KAAKd,GAAkBe,MAAMd,GAEpC,KACHU,EAAOK,QAAM,CACjB,GACD,IAEY,YAAXxB,EAEIyB,EAACC,MAAAA,CAAIC,UAAU,yBAAyBC,YAAU,SAASC,YAAU,QACjEJ,EAACC,MAAAA,CAAIC,UAAU,0EACXF,EAACK,EAAAA,QAObL,EAACC,MAAAA,CAAIC,UAAU,0BACXF,EAACM,EACOjC,EAAAA,EAAAA,CAAAA,EAAAA,GAAAA,CACJL,SAAUA,EACVC,SAAUA,EACVC,QAASA,EACTC,SAAUA,EACVJ,UAAWY,EACX4B,oBAAgC,eAAXhC,EACrBiC,UAAWC,OAAOC,UAIlC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t={isExpress:!1,userAction:"pay",commit:!0,vault:!1,enableMessages:!1,style:{height:50},blockPayPalCreditButton:!1,blockPayPalPayLaterButton:!1,blockPayPalVenmoButton:!1};export{t as default};
|
|
2
2
|
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/PayPal/defaultProps.ts"],"sourcesContent":["import { PayPalConfiguration } from './types';\n\nconst defaultProps: Partial<PayPalConfiguration> = {\n
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../../../src/components/PayPal/defaultProps.ts"],"sourcesContent":["import { PayPalConfiguration } from './types';\n\nconst defaultProps: Partial<PayPalConfiguration> = {\n isExpress: false,\n userAction: 'pay',\n commit: true,\n vault: false,\n enableMessages: false,\n style: {\n height: 50 // The height of the buttons is set to 50px to align with the default size of our Pay buttons.\n },\n blockPayPalCreditButton: false,\n blockPayPalPayLaterButton: false,\n blockPayPalVenmoButton: false\n};\n\nexport default defaultProps;\n"],"names":["defaultProps","isExpress","userAction","commit","vault","enableMessages","style","height","blockPayPalCreditButton","blockPayPalPayLaterButton","blockPayPalVenmoButton"],"mappings":"AAEA,MAAMA,EAA6C,CAC/CC,WAAW,EACXC,WAAY,MACZC,QAAQ,EACRC,OAAO,EACPC,gBAAgB,EAChBC,MAAO,CACHC,OAAQ,IAEZC,yBAAyB,EACzBC,2BAA2B,EAC3BC,wBAAwB"}
|
package/dist/es-legacy/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}const r=(r,n)=>{if(void 0===(null==r?void 0:r.address))return null;const{address:t,name:o}=r,a=((e=null,r=null)=>e&&r?`${e}, ${r}`:e||(r||null))(t.address_line_1,t.address_line_2);return function(r){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(n){e(r,n,t[n])}))}return r}({houseNumberOrName:"ZZ"},a&&{street:a},t.admin_area_1&&{stateOrProvince:t.admin_area_1},t.admin_area_2&&{city:t.admin_area_2},t.postal_code&&{postalCode:t.postal_code},t.country_code&&{country:t.country_code},n&&{firstName:o.full_name})};export{r as
|
|
1
|
+
function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}const r=(r,n)=>{if(void 0===(null==r?void 0:r.address))return null;const{address:t,name:o}=r,a=((e=null,r=null)=>e&&r?`${e}, ${r}`:e||(r||null))(t.address_line_1,t.address_line_2);return function(r){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(n){e(r,n,t[n])}))}return r}({houseNumberOrName:"ZZ"},a&&{street:a},t.admin_area_1&&{stateOrProvince:t.admin_area_1},t.admin_area_2&&{city:t.admin_area_2},t.postal_code&&{postalCode:t.postal_code},t.country_code&&{country:t.country_code},n&&{firstName:o.full_name})};export{r as formatPaypalOrderContactToAdyenFormat};
|
|
2
2
|
//# sourceMappingURL=format-paypal-order-contact-to-adyen-format.js.map
|
package/dist/es-legacy/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-paypal-order-contact-to-adyen-format.js","sources":["../../../../../src/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.ts"],"sourcesContent":["import { AddressData } from '../../../types/global-types';\n\n/**\n * This function formats PayPal contact format to Adyen address format\n */\nexport const
|
|
1
|
+
{"version":3,"file":"format-paypal-order-contact-to-adyen-format.js","sources":["../../../../../src/components/PayPal/utils/format-paypal-order-contact-to-adyen-format.ts"],"sourcesContent":["import { AddressData } from '../../../types/global-types';\n\n/**\n * This function formats PayPal contact format to Adyen address format\n */\nexport const formatPaypalOrderContactToAdyenFormat = (paymentContact: any, isDeliveryAddress?: boolean): AddressData | null => {\n const getStreet = (addressPart1 = null, addressPart2 = null): string | null => {\n if (addressPart1 && addressPart2) return `${addressPart1}, ${addressPart2}`;\n if (addressPart1) return addressPart1;\n if (addressPart2) return addressPart2;\n return null;\n };\n\n if (paymentContact?.address === undefined) return null;\n\n const { address, name } = paymentContact;\n const street = getStreet(address.address_line_1, address.address_line_2);\n\n return {\n houseNumberOrName: 'ZZ',\n ...(street && { street }),\n ...(address.admin_area_1 && { stateOrProvince: address.admin_area_1 }),\n ...(address.admin_area_2 && { city: address.admin_area_2 }),\n ...(address.postal_code && { postalCode: address.postal_code }),\n ...(address.country_code && { country: address.country_code }),\n ...(isDeliveryAddress && {\n firstName: name.full_name\n })\n };\n};\n"],"names":["formatPaypalOrderContactToAdyenFormat","paymentContact","isDeliveryAddress","undefined","address","name","street","addressPart1","addressPart2","getStreet","address_line_1","address_line_2","_object_spread","houseNumberOrName","admin_area_1","stateOrProvince","admin_area_2","city","postal_code","postalCode","country_code","country","firstName","full_name"],"mappings":"wHAKO,MAAMA,EAAwC,CAACC,EAAqBC,KAQvE,QAAgCC,KAA5BF,aAAAA,EAAAA,EAAgBG,SAAuB,OAAO,KAElD,MAAMA,QAAEA,EAAOC,KAAEA,GAASJ,EACpBK,EAVY,EAACC,EAAe,KAAMC,EAAe,OAC/CD,GAAgBC,EAAqB,GAAGD,MAAiBC,IACzDD,IACAC,GACG,MAMIC,CAAUL,EAAQM,eAAgBN,EAAQO,gBAEzD,6UAAOC,CAAA,CACHC,kBAAmB,MACfP,GAAU,CAAEA,UACZF,EAAQU,cAAgB,CAAEC,gBAAiBX,EAAQU,cACnDV,EAAQY,cAAgB,CAAEC,KAAMb,EAAQY,cACxCZ,EAAQc,aAAe,CAAEC,WAAYf,EAAQc,aAC7Cd,EAAQgB,cAAgB,CAAEC,QAASjB,EAAQgB,cAC3ClB,GAAqB,CACrBoB,UAAWjB,EAAKkB,WACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-paypal-locale.js","sources":["../../../../../src/components/PayPal/utils/get-paypal-locale.ts"],"sourcesContent":["import { SUPPORTED_LOCALES } from '../config';\nimport type { PayPalSupportedLocale } from './types';\n\n/**\n * Returns either a locale supported by PayPal or null, in order to let the PayPal SDK auto-detect the shopper locale.\n */\nexport const getSupportedLocale = (locale: string): PayPalSupportedLocale => {\n const formattedLocale = locale ? locale.replace('-', '_') : null;\n const supportedLocale = SUPPORTED_LOCALES.includes(formattedLocale as PayPalSupportedLocale) ? formattedLocale : null;\n return supportedLocale as PayPalSupportedLocale;\n};\n"],"names":["getSupportedLocale","locale","formattedLocale","replace","SUPPORTED_LOCALES","includes","supportedLocale"],"mappings":"iDAMaA,MAAAA,EAAsBC,IAC/B,MAAMC,EAAkBD,EAASA,EAAOE,QAAQ,IAAK,KAAO,KAE5D,OADwBC,EAAkBC,SAASH,GAA4CA,EAAkB,IAC1GI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getSupportedLocale as e}from"./get-paypal-locale.js";import{INTEGRATION_DATE as t,ADYEN_CLIENTID_TEST as r,ADYEN_CLIENTID_LIVE as n}from"../config.js";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const i=({amount:i,countryCode:u,debug:l,environment:a="",locale:b,configuration:s,commit:p,vault:y,enableMessages:f})=>{const O=e(b),g=i?i.currency:null,m="test"===a.toLowerCase(),j=m?r:n,{merchantId:d,intent:P}=s,w="buttons,funding-eligibility"+(f?",messages":"");return c(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}({},d&&{"merchant-id":d},O&&{locale:O},u&&m&&{"buyer-country":u},l&&m&&{debug:l},g&&{currency:g},P&&{intent:P}),{commit:p,vault:y,"client-id":j,"integration-date":t,"enable-funding":"paylater,venmo",components:w})};export{i as getPaypalSettings};
|
|
2
|
+
//# sourceMappingURL=get-paypal-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-paypal-settings.js","sources":["../../../../../src/components/PayPal/utils/get-paypal-settings.ts"],"sourcesContent":["import { getSupportedLocale } from './get-paypal-locale';\nimport { ADYEN_CLIENTID_LIVE, ADYEN_CLIENTID_TEST, INTEGRATION_DATE } from '../config';\nimport type { PaypalSettings, PayPalSupportedLocale } from './types';\nimport type { PayPalComponentProps } from '../components/types';\n\n/**\n * Returns an object of settings for the PayPal SDK\n */\nexport const getPaypalSettings = ({\n amount,\n countryCode,\n debug,\n environment = '',\n locale,\n configuration,\n commit,\n vault,\n enableMessages\n}: Partial<PayPalComponentProps>): PaypalSettings => {\n const shopperLocale: PayPalSupportedLocale = getSupportedLocale(locale);\n const currency: string = amount ? amount.currency : null;\n const isTestEnvironment: boolean = environment.toLowerCase() === 'test';\n const clientId: string = isTestEnvironment ? ADYEN_CLIENTID_TEST : ADYEN_CLIENTID_LIVE;\n const { merchantId, intent } = configuration;\n const components = `buttons,funding-eligibility${enableMessages ? ',messages' : ''}`;\n\n return {\n ...(merchantId && { 'merchant-id': merchantId }),\n ...(shopperLocale && { locale: shopperLocale }),\n ...(countryCode && isTestEnvironment && { 'buyer-country': countryCode }),\n ...(debug && isTestEnvironment && { debug }),\n ...(currency && { currency }),\n ...(intent && { intent }),\n commit,\n vault,\n 'client-id': clientId,\n 'integration-date': INTEGRATION_DATE,\n 'enable-funding': 'paylater,venmo',\n components\n };\n};\n"],"names":["getPaypalSettings","amount","countryCode","debug","environment","locale","configuration","commit","vault","enableMessages","shopperLocale","getSupportedLocale","currency","isTestEnvironment","toLowerCase","clientId","ADYEN_CLIENTID_TEST","ADYEN_CLIENTID_LIVE","merchantId","intent","components","_object_spread_props","INTEGRATION_DATE"],"mappings":"ouBAQaA,EAAoB,EAC7BC,SACAC,cACAC,QACAC,cAAc,GACdC,SACAC,gBACAC,SACAC,QACAC,qBAEA,MAAMC,EAAuCC,EAAmBN,GAC1DO,EAAmBX,EAASA,EAAOW,SAAW,KAC9CC,EAA2D,SAA9BT,EAAYU,cACzCC,EAAmBF,EAAoBG,EAAsBC,GAC7DC,WAAEA,EAAUC,OAAEA,GAAWb,EACzBc,EAAa,+BAA8BX,EAAiB,YAAc,IAEhF,OAAOY,4UACCH,GAAc,CAAE,cAAeA,GAC/BR,GAAiB,CAAEL,OAAQK,GAC3BR,GAAeW,GAAqB,CAAE,gBAAiBX,GACvDC,GAASU,GAAqB,CAAEV,SAChCS,GAAY,CAAEA,YACdO,GAAU,CAAEA,WAAO,CACvBZ,SACAC,QACA,YAAaO,EACb,mBAAoBO,EACpB,iBAAkB,iBAClBF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{SUPPORTED_COLORS_FOR_CREDIT as e}from"../config.js";function r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const t=(t,n={})=>"paypal"===t?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},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(t){r(e,t,n[t])}))}return e}({},n):Object.keys(n).reduce(((r,t)=>{const o=n[t];return("color"!==t||e.includes(o))&&(r[t]=o),r}),{});export{t as getStyle};
|
|
2
|
+
//# sourceMappingURL=get-paypal-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-paypal-styles.js","sources":["../../../../../src/components/PayPal/utils/get-paypal-styles.ts"],"sourcesContent":["import { SUPPORTED_COLORS_FOR_CREDIT } from '../config';\nimport type { FundingSource } from '../types';\n\n/**\n * Processes and returns a new style object.\n */\nexport const getStyle = (fundingSource: FundingSource, style = {}) => {\n if (fundingSource === 'paypal') return { ...style };\n\n return Object.keys(style).reduce((acc, prop) => {\n const value = style[prop];\n if (prop !== 'color' || SUPPORTED_COLORS_FOR_CREDIT.includes(value)) {\n acc[prop] = value;\n }\n return acc;\n }, {});\n};\n"],"names":["getStyle","fundingSource","style","_object_spread","Object","keys","reduce","acc","prop","value","SUPPORTED_COLORS_FOR_CREDIT","includes"],"mappings":"mLAMaA,MAAAA,EAAW,CAACC,EAA8BC,EAAQ,CAAA,IACrC,WAAlBD,wUAAmCE,CAAKD,CAAAA,EAAAA,GAErCE,OAAOC,KAAKH,GAAOI,QAAO,CAACC,EAAKC,KACnC,MAAMC,EAAQP,EAAMM,GAIpB,OAHa,UAATA,GAAoBE,EAA4BC,SAASF,MACzDF,EAAIC,GAAQC,GAETF,CAAAA,GACR,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getPaypalSettings as o}from"./get-paypal-settings.js";import{PAYPAL_JS_URL as t}from"../config.js";const e=e=>{const n=o(e),p=decodeURIComponent(Object.keys(n).map((o=>`${o}=${n[o]}`)).join("&"));return`${t}?${p}`};export{e as getPaypalUrl};
|
|
2
|
+
//# sourceMappingURL=get-paypal-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-paypal-url.js","sources":["../../../../../src/components/PayPal/utils/get-paypal-url.ts"],"sourcesContent":["import { getPaypalSettings } from './get-paypal-settings';\nimport { PAYPAL_JS_URL } from '../config';\nimport type { PayPalComponentProps } from '../components/types';\n\n/**\n * Returns the PayPal SDK script URL with query parameters\n * @see {@link https://developer.paypal.com/docs/checkout/reference/customize-sdk/}\n */\nexport const getPaypalUrl = (props: Partial<PayPalComponentProps>): string => {\n const settings = getPaypalSettings(props);\n const params = decodeURIComponent(\n Object.keys(settings)\n .map(key => `${key}=${settings[key]}`)\n .join('&')\n );\n return `${PAYPAL_JS_URL}?${params}`;\n};\n"],"names":["getPaypalUrl","props","settings","getPaypalSettings","params","decodeURIComponent","Object","keys","map","key","join","PAYPAL_JS_URL"],"mappings":"0GAQaA,MAAAA,EAAgBC,IACzB,MAAMC,EAAWC,EAAkBF,GAC7BG,EAASC,mBACXC,OAAOC,KAAKL,GACPM,KAAIC,GAAO,GAAGA,KAAOP,EAASO,OAC9BC,KAAK,MAEd,MAAO,GAAGC,KAAiBP,GAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../external/preact/dist/preact.js";import e from"../helpers/QRLoaderContainer/QRLoaderContainer.js";import r from"../../core/Context/CoreProvider.js";import o from"./PixInput/PixInput.js";import{cleanCPFCNPJ as n}from"../internal/SocialSecurityNumberBrazil/utils.js";import{TxVariants as s}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(e){i(t,e,r[e])}))}return t}function p(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class c extends e{get isValid(){return!!this.state.isValid}formatProps(t){return a({copyBtn:!0,introduction:"pix.instructions"},super.formatProps(t))}formatData(){const{data:t={}}=this.state,{firstName:e,lastName:r,socialSecurityNumber:o=""}=t;return a({paymentMethod:{type:this.props.type||this.constructor.type}},e&&r&&{shopperName:{firstName:e,lastName:r}},o&&{socialSecurityNumber:n(o)})}render(){return this.props.paymentData?this.renderQRCode():t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(o,p(a({ref:t=>{this.componentRef=t}},this.props),{showPayButton:this.props.showPayButton,personalDetailsRequired:this.props.personalDetailsRequired,name:this.displayName,onChange:this.setState,payButton:this.payButton})))}}i(c,"type",s.pix),i(c,"defaultProps",a({
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import e from"../helpers/QRLoaderContainer/QRLoaderContainer.js";import r from"../../core/Context/CoreProvider.js";import o from"./PixInput/PixInput.js";import{cleanCPFCNPJ as n}from"../internal/SocialSecurityNumberBrazil/utils.js";import{TxVariants as s}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(e){i(t,e,r[e])}))}return t}function p(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class c extends e{get isValid(){return!!this.state.isValid}formatProps(t){return a({copyBtn:!0,introduction:"pix.instructions"},super.formatProps(t))}formatData(){const{data:t={}}=this.state,{firstName:e,lastName:r,socialSecurityNumber:o=""}=t;return a({paymentMethod:{type:this.props.type||this.constructor.type}},e&&r&&{shopperName:{firstName:e,lastName:r}},o&&{socialSecurityNumber:n(o)})}render(){return this.props.paymentData?this.renderQRCode():t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(o,p(a({ref:t=>{this.componentRef=t}},this.props),{showPayButton:this.props.showPayButton,personalDetailsRequired:this.props.personalDetailsRequired,name:this.displayName,onChange:this.setState,payButton:this.payButton})))}}i(c,"type",s.pix),i(c,"defaultProps",a({personalDetailsRequired:!1,countdownTime:15,delay:2e3},e.defaultProps));export{c as default};
|
|
2
2
|
//# sourceMappingURL=Pix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pix.js","sources":["../../../../src/components/Pix/Pix.tsx"],"sourcesContent":["import { h } from 'preact';\nimport QRLoaderContainer from '../helpers/QRLoaderContainer/QRLoaderContainer';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport PixInput from './PixInput';\nimport { cleanCPFCNPJ } from '../internal/SocialSecurityNumberBrazil/utils';\nimport { PixElementData, PixConfiguration } from './types';\nimport { TxVariants } from '../tx-variants';\n\nclass PixElement extends QRLoaderContainer<PixConfiguration> {\n public static type = TxVariants.pix;\n\n public static defaultProps = {\n
|
|
1
|
+
{"version":3,"file":"Pix.js","sources":["../../../../src/components/Pix/Pix.tsx"],"sourcesContent":["import { h } from 'preact';\nimport QRLoaderContainer from '../helpers/QRLoaderContainer/QRLoaderContainer';\nimport CoreProvider from '../../core/Context/CoreProvider';\nimport PixInput from './PixInput';\nimport { cleanCPFCNPJ } from '../internal/SocialSecurityNumberBrazil/utils';\nimport { PixElementData, PixConfiguration } from './types';\nimport { TxVariants } from '../tx-variants';\n\nclass PixElement extends QRLoaderContainer<PixConfiguration> {\n public static type = TxVariants.pix;\n\n public static defaultProps = {\n personalDetailsRequired: false,\n countdownTime: 15,\n delay: 2000,\n ...QRLoaderContainer.defaultProps\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n formatProps(props): PixConfiguration {\n return {\n copyBtn: true,\n introduction: 'pix.instructions',\n ...super.formatProps(props)\n };\n }\n\n formatData(): PixElementData {\n const { data = {} } = this.state;\n const { firstName, lastName, socialSecurityNumber = '' } = data;\n\n return {\n paymentMethod: {\n type: this.props.type || this.constructor['type']\n },\n ...(firstName && lastName && { shopperName: { firstName, lastName } }),\n ...(socialSecurityNumber && { socialSecurityNumber: cleanCPFCNPJ(socialSecurityNumber) })\n };\n }\n\n render() {\n if (this.props.paymentData) {\n return this.renderQRCode();\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PixInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n showPayButton={this.props.showPayButton}\n personalDetailsRequired={this.props.personalDetailsRequired}\n name={this.displayName}\n onChange={this.setState}\n payButton={this.payButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default PixElement;\n"],"names":["PixElement","QRLoaderContainer","isValid","this","state","formatProps","props","_object_spread","copyBtn","introduction","super","formatData","data","firstName","lastName","socialSecurityNumber","paymentMethod","type","constructor","shopperName","cleanCPFCNPJ","render","paymentData","renderQRCode","h","CoreProvider","i18n","loadingContext","resources","PixInput","ref","componentRef","showPayButton","personalDetailsRequired","name","displayName","onChange","setState","payButton","_define_property","TxVariants","pix","defaultProps","countdownTime","delay"],"mappings":"ouCAQA,MAAMA,UAAmBC,EAUrB,WAAIC,GACA,QAASC,KAAKC,MAAMF,OACxB,CAEAG,WAAAA,CAAYC,GACR,OAAOC,EAAA,CACHC,SAAS,EACTC,aAAc,oBACXC,MAAML,YAAYC,GAE7B,CAEAK,UAAAA,GACI,MAAMC,KAAEA,EAAO,CAAA,GAAOT,KAAKC,OACrBS,UAAEA,EAASC,SAAEA,EAAQC,qBAAEA,EAAuB,IAAOH,EAE3D,OAAOL,EAAA,CACHS,cAAe,CACXC,KAAMd,KAAKG,MAAMW,MAAQd,KAAKe,YAAmB,OAEjDL,GAAaC,GAAY,CAAEK,YAAa,CAAEN,YAAWC,aACrDC,GAAwB,CAAEA,qBAAsBK,EAAaL,IAEzE,CAEAM,MAAAA,GACI,OAAIlB,KAAKG,MAAMgB,YACJnB,KAAKoB,eAIZC,EAACC,EAAAA,CAAaC,KAAMvB,KAAKG,MAAMoB,KAAMC,eAAgBxB,KAAKG,MAAMqB,eAAgBC,UAAWzB,KAAKyB,WAC5FJ,EAACK,EAAAA,EAAAA,EAAAA,CACGC,IAAKA,IACD3B,KAAK4B,aAAeD,CAAAA,GAEpB3B,KAAKG,OAAK,CACd0B,cAAe7B,KAAKG,MAAM0B,cAC1BC,wBAAyB9B,KAAKG,MAAM2B,wBACpCC,KAAM/B,KAAKgC,YACXC,SAAUjC,KAAKkC,SACfC,UAAWnC,KAAKmC,aAIhC,EAtDAC,EADEvC,EACYiB,OAAOuB,EAAWC,KAEhCF,EAHEvC,EAGY0C,eAAenC,EAAA,CACzB0B,yBAAyB,EACzBU,cAAe,GACfC,MAAO,KACJ3C,EAAkByC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../../external/preact/dist/preact.js";import{useEffect as a,useState as e}from"../../../external/preact/hooks/dist/hooks.js";import{pixValidationRules as s}from"./validate.js";import{pixFormatters as r}from"./utils.js";import o from"../../../core/Context/useCoreContext.js";import i from"../../../utils/useForm/useForm.js";import{BrazilPersonalDetail as l}from"../../internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js";function n({name:n,data:m,personalDetailsRequired:d,showPayButton:u
|
|
1
|
+
import{createElement as t}from"../../../external/preact/dist/preact.js";import{useEffect as a,useState as e}from"../../../external/preact/hooks/dist/hooks.js";import{pixValidationRules as s}from"./validate.js";import{pixFormatters as r}from"./utils.js";import o from"../../../core/Context/useCoreContext.js";import i from"../../../utils/useForm/useForm.js";import{BrazilPersonalDetail as l}from"../../internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js";function n({name:n,data:m,personalDetailsRequired:d,showPayButton:u,onChange:c,payButton:f}){const{i18n:p}=o(),h=["firstName","lastName","socialSecurityNumber"],{handleChangeFor:y,triggerValidation:j,setSchema:g,data:x,valid:C,errors:N,isValid:S}=i({schema:h,defaultData:m,rules:s,formatters:r});a((()=>{const t=d?[...h]:[];g(t)}),[d]);const[v,B]=e("ready");this.setStatus=B,this.showValidation=()=>{j()},a((()=>{c({data:x,valid:C,errors:N,isValid:S})}),[c,x,C,N]);const F=d?[]:["standalone"];return t("div",{className:"adyen-checkout__pix-input__field",style:u||d?null:{display:"none"}},d&&t(l,{i18n:p,data:x,handleChangeFor:y,errors:N,valid:C}),u&&f({status:v,label:`${p.get("continueTo")} ${n}`,classNameModifiers:F}))}export{n as default};
|
|
2
2
|
//# sourceMappingURL=PixInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PixInput.js","sources":["../../../../../src/components/Pix/PixInput/PixInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\nimport { pixValidationRules } from './validate';\nimport { pixFormatters } from './utils';\nimport useCoreContext from '../../../core/Context/useCoreContext';\nimport useForm from '../../../utils/useForm';\nimport { BrazilPersonalDetail } from '../../internal/SocialSecurityNumberBrazil/BrazilPersonalDetail';\nimport { PixInputDataState, PixInputProps } from './types';\n\nfunction PixInput({ name, data: dataProps, personalDetailsRequired, showPayButton
|
|
1
|
+
{"version":3,"file":"PixInput.js","sources":["../../../../../src/components/Pix/PixInput/PixInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\nimport { pixValidationRules } from './validate';\nimport { pixFormatters } from './utils';\nimport useCoreContext from '../../../core/Context/useCoreContext';\nimport useForm from '../../../utils/useForm';\nimport { BrazilPersonalDetail } from '../../internal/SocialSecurityNumberBrazil/BrazilPersonalDetail';\nimport { PixInputDataState, PixInputProps } from './types';\n\nfunction PixInput({ name, data: dataProps, personalDetailsRequired, showPayButton, onChange, payButton }: PixInputProps) {\n const { i18n } = useCoreContext();\n const formSchema = ['firstName', 'lastName', 'socialSecurityNumber'];\n const { handleChangeFor, triggerValidation, setSchema, data, valid, errors, isValid } = useForm<PixInputDataState>({\n schema: formSchema,\n defaultData: dataProps,\n rules: pixValidationRules,\n formatters: pixFormatters\n });\n\n // Handle form schema updates\n useEffect(() => {\n const newSchema = personalDetailsRequired ? [...formSchema] : [];\n setSchema(newSchema);\n }, [personalDetailsRequired]);\n\n const [status, setStatus] = useState('ready');\n this.setStatus = setStatus;\n\n this.showValidation = () => {\n triggerValidation();\n };\n\n useEffect(() => {\n onChange({ data, valid, errors, isValid });\n }, [onChange, data, valid, errors]);\n\n const buttonModifiers = !personalDetailsRequired ? ['standalone'] : [];\n\n return (\n <div className=\"adyen-checkout__pix-input__field\" style={!showPayButton && !personalDetailsRequired ? { display: 'none' } : null}>\n {personalDetailsRequired && (\n <BrazilPersonalDetail i18n={i18n} data={data} handleChangeFor={handleChangeFor} errors={errors} valid={valid} />\n )}\n\n {showPayButton &&\n payButton({\n status,\n label: `${i18n.get('continueTo')} ${name}`,\n classNameModifiers: buttonModifiers\n })}\n </div>\n );\n}\n\nexport default PixInput;\n"],"names":["PixInput","name","data","dataProps","personalDetailsRequired","showPayButton","onChange","payButton","i18n","useCoreContext","formSchema","handleChangeFor","triggerValidation","setSchema","valid","errors","isValid","useForm","schema","defaultData","rules","pixValidationRules","formatters","pixFormatters","useEffect","newSchema","status","setStatus","useState","this","showValidation","buttonModifiers","h","div","className","style","display","BrazilPersonalDetail","label","get","classNameModifiers"],"mappings":"8cASA,SAASA,GAASC,KAAEA,EAAMC,KAAMC,EAASC,wBAAEA,EAAuBC,cAAEA,EAAaC,SAAEA,EAAQC,UAAEA,IACzF,MAAMC,KAAEA,GAASC,IACXC,EAAa,CAAC,YAAa,WAAY,yBACvCC,gBAAEA,EAAeC,kBAAEA,EAAiBC,UAAEA,EAASX,KAAEA,EAAIY,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAA2B,CAC/GC,OAAQR,EACRS,YAAahB,EACbiB,MAAOC,EACPC,WAAYC,IAIhBC,GAAU,KACN,MAAMC,EAAYrB,EAA0B,IAAIM,GAAc,GAC9DG,EAAUY,EAAAA,GACX,CAACrB,IAEJ,MAAOsB,EAAQC,GAAaC,EAAS,SACrCC,KAAKF,UAAYA,EAEjBE,KAAKC,eAAiB,KAClBlB,GAAAA,EAGJY,GAAU,KACNlB,EAAS,CAAEJ,OAAMY,QAAOC,SAAQC,WAAQ,GACzC,CAACV,EAAUJ,EAAMY,EAAOC,IAE3B,MAAMgB,EAAmB3B,EAA2C,GAAjB,CAAC,cAEpD,OACI4B,EAACC,MAAAA,CAAIC,UAAU,mCAAmCC,MAAQ9B,GAAkBD,EAAgD,KAAtB,CAAEgC,QAAS,SAC5GhC,GACG4B,EAACK,EAAAA,CAAqB7B,KAAMA,EAAMN,KAAMA,EAAMS,gBAAiBA,EAAiBI,OAAQA,EAAQD,MAAOA,IAG1GT,GACGE,EAAU,CACNmB,SACAY,MAAO,GAAG9B,EAAK+B,IAAI,iBAAiBtC,IACpCuC,mBAAoBT,IAIxC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/DeviceFingerprint/PrepareFingerprint3DS2.js";import n from"./callSubmit3DS2Fingerprint.js";import{existy as o}from"../internal/SecuredFields/lib/utilities/commonUtils.js";import{TxVariants as i}from"../tx-variants.js";import s,{API_ERROR as p}from"../../core/Errors/AdyenCheckoutError.js";import{ANALYTICS_ERROR_CODE_ACTION_IS_MISSING_PAYMENT_DATA as c,ANALYTICS_API_ERROR as a,ANALYTICS_RENDERED_STR as l}from"../../core/Analytics/constants.js";import{THREEDS2_ERROR as m,THREEDS2_FINGERPRINT_ERROR as u,THREEDS2_FINGERPRINT as y}from"./config.js";function b(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class j extends e{onComplete(t){super.onComplete(t),this.unmount()}render(){return o(this.props.paymentData)?t(r,f(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){b(t,e,r[e])}))}return t}({},this.props),{onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics})):(this.props.onError(new s(p,"No paymentData received. 3DS2 Fingerprint cannot proceed")),this.submitAnalytics({type:m,code:c,errorType:a,message:`${u}: Missing 'paymentData' property from threeDS2 action`}),null)}constructor(...t){super(...t),b(this,"callSubmit3DS2Fingerprint",n.bind(this)),b(this,"submitAnalytics",(t=>{t.type!==l&&super.submitAnalytics(t)}))}}b(j,"type",i.threeDS2Fingerprint),b(j,"defaultProps",{dataKey:"fingerprintResult",type:y});export{j as default};
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/DeviceFingerprint/PrepareFingerprint3DS2.js";import n from"./callSubmit3DS2Fingerprint.js";import{existy as o}from"../internal/SecuredFields/lib/utilities/commonUtils.js";import{TxVariants as i}from"../tx-variants.js";import s,{API_ERROR as p}from"../../core/Errors/AdyenCheckoutError.js";import{ANALYTICS_ERROR_CODE_ACTION_IS_MISSING_PAYMENT_DATA as c,ANALYTICS_API_ERROR as a,ANALYTICS_RENDERED_STR as l}from"../../core/Analytics/constants.js";import{THREEDS2_ERROR as m,THREEDS2_FINGERPRINT_ERROR as u,THREEDS2_FINGERPRINT as y}from"./config.js";function b(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class j extends e{onComplete(t){super.onComplete(t),this.unmount()}render(){return o(this.props.paymentData)?t(r,f(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){b(t,e,r[e])}))}return t}({},this.props),{onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics,isMDFlow:this.props.paymentData.length<15})):(this.props.onError(new s(p,"No paymentData received. 3DS2 Fingerprint cannot proceed")),this.submitAnalytics({type:m,code:c,errorType:a,message:`${u}: Missing 'paymentData' property from threeDS2 action`}),null)}constructor(...t){super(...t),b(this,"callSubmit3DS2Fingerprint",n.bind(this)),b(this,"submitAnalytics",(t=>{t.type!==l&&super.submitAnalytics(t)}))}}b(j,"type",i.threeDS2Fingerprint),b(j,"defaultProps",{dataKey:"fingerprintResult",type:y});export{j as default};
|
|
2
2
|
//# sourceMappingURL=ThreeDS2DeviceFingerprint.js.map
|