@adyen/adyen-web 6.40.2 → 6.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +49 -41
- package/dist/es/components/ANCV/ANCV.js +1 -1
- package/dist/es/components/ANCV/ANCV.js.map +1 -1
- package/dist/es/components/ANCV/components/ANCVInput.js +1 -1
- package/dist/es/components/ANCV/components/ANCVInput.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/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/CustomCard/CustomCard.js +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
- package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es/components/Dropin/Dropin.js +1 -1
- package/dist/es/components/Dropin/Dropin.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es/components/Giftcard/Giftcard.js +1 -1
- package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/Button/Button.js +1 -1
- package/dist/es/components/internal/Button/Button.js.map +1 -1
- package/dist/es/components/internal/Button/CopyButton.js +1 -1
- package/dist/es/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es/components/internal/Button/CopyIconButton.js +1 -1
- package/dist/es/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/defaultProps.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/configureCallbacks.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es/components/internal/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/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/index.d.ts +49 -41
- package/dist/es/utils/commonUtils.js +1 -1
- package/dist/es/utils/commonUtils.js.map +1 -1
- package/dist/es/utils/promiseTimeout.js.map +1 -1
- package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
- package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
- package/dist/es-legacy/components/ANCV/components/ANCVInput.js +1 -1
- package/dist/es-legacy/components/ANCV/components/ANCVInput.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/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/CustomCard/CustomCard.js +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.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/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +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/DoFingerprint3DS2.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/Button/Button.js +1 -1
- package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyButton.js +1 -1
- package/dist/es-legacy/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyIconButton.js +1 -1
- package/dist/es-legacy/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.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/configureCallbacks.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +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 +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.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/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/utils/commonUtils.js +1 -1
- package/dist/es-legacy/utils/commonUtils.js.map +1 -1
- package/dist/es-legacy/utils/promiseTimeout.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIElement.js","sources":["../../../../../src/components/internal/UIElement/UIElement.tsx"],"sourcesContent":["import { createRef, h, RefObject } from 'preact';\nimport { Resources } from '../../../core/Context/Resources';\nimport AdyenCheckoutError, { NETWORK_ERROR } from '../../../core/Errors/AdyenCheckoutError';\nimport { hasOwnProperty } from '../../../utils/hasOwnProperty';\nimport BaseElement from '../BaseElement/BaseElement';\nimport PayButton from '../PayButton';\nimport { assertIsDropin, cleanupFinalResult, getRegulatoryDefaults, sanitizeResponse, verifyPaymentDidNotFail } from './utils';\n\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { AnalyticsErrorEvent, ErrorEventType } from '../../../core/Analytics/events/AnalyticsErrorEvent';\nimport { AnalyticsInfoEvent, InfoEventType } from '../../../core/Analytics/events/AnalyticsInfoEvent';\nimport { AnalyticsLogEvent, LogEventType } from '../../../core/Analytics/events/AnalyticsLogEvent';\nimport type { CheckoutSessionDetailsResponse, CheckoutSessionPaymentResponse } from '../../../core/CheckoutSession/types';\nimport type { NewableComponent } from '../../../core/core.registry';\nimport CancelError from '../../../core/Errors/CancelError';\nimport type { AdditionalDetailsData, CoreConfiguration, ICore } from '../../../core/types';\nimport type {\n ActionHandledReturnObject,\n CheckoutAdvancedFlowResponse,\n Order,\n PaymentAction,\n PaymentAmount,\n PaymentData,\n PaymentMethodsResponse,\n PaymentResponseData,\n RawPaymentMethod\n} from '../../../types/global-types';\nimport type { ComponentMethodsRef, UIElementProps, UIElementStatus } from './types';\nimport type { IAnalytics } from '../../../core/Analytics/Analytics';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport { SRPanel } from '../../../core/Errors/SRPanel';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { AmountProvider, AmountProviderRef } from '../../../core/Context/AmountProvider';\nimport { PayButtonProps } from '../PayButton/PayButton';\nimport { TxVariants } from '../../tx-variants';\nimport Donation from '../../Donation/Donation';\nimport './UIElement.scss';\n\nexport abstract class UIElement<P extends UIElementProps = UIElementProps> extends BaseElement<P> {\n /**\n * componentRef is a ref to the primary component inside the subclass that extends UIElement e.g. CardInput.tsx (which sits inside Card.tsx)\n */\n protected componentRef: any;\n\n protected resources: Resources;\n\n /**\n * elementRef is a ref to the subclass that extends UIElement e.g. Card.tsx or Dropin.tsx\n */\n public elementRef: UIElement;\n\n public static readonly type: string | undefined = undefined;\n\n /**\n * Reference to the methods exposed by the AmountProvider context\n */\n protected amountProviderRef: RefObject<AmountProviderRef> = createRef();\n\n /**\n * Defines all txVariants that the Component supports (in case it support multiple ones besides the 'type' one)\n */\n public static readonly txVariants: string[] = [];\n\n constructor(checkout: ICore, props?: P) {\n super(checkout, props);\n\n this.core.register(this.constructor as NewableComponent);\n\n this.submit = this.submit.bind(this);\n this.setState = this.setState.bind(this);\n this.onComplete = this.onComplete.bind(this);\n this.handleAction = this.handleAction.bind(this);\n this.handleOrder = this.handleOrder.bind(this);\n this.handleAdditionalDetails = this.handleAdditionalDetails.bind(this);\n this.handleResponse = this.handleResponse.bind(this);\n this.setElementStatus = this.setElementStatus.bind(this);\n this.submitAnalytics = this.submitAnalytics.bind(this);\n this.makePaymentsCall = this.makePaymentsCall.bind(this);\n this.makeAdditionalDetailsCall = this.makeAdditionalDetailsCall.bind(this);\n this.submitUsingSessionsFlow = this.submitUsingSessionsFlow.bind(this);\n this.updateAmount = this.updateAmount.bind(this);\n this.setupSessionsDonation = this.setupSessionsDonation.bind(this);\n\n this.elementRef = (props && props.elementRef) || this;\n this.resources = this.props.modules ? this.props.modules.resources : undefined;\n\n this.storeElementRefOnCore(this.props);\n\n this.onEnterKeyPressed = this.onEnterKeyPressed.bind(this);\n this.onActionHandled = this.onActionHandled.bind(this);\n\n this.createBeforeRenderHook(props);\n this.reportIntegrationFlavor();\n }\n\n /**\n * Creates a hook tied to render() method. This hook is called every time render() is invoked.\n * Currently useful for Analytics\n *\n * @param configSetByMerchant\n * @private\n */\n private createBeforeRenderHook(configSetByMerchant: P): void {\n const originalRender = this.render;\n\n this.render = (...args: any[]) => {\n this.beforeRender(configSetByMerchant);\n return originalRender.apply(this, args);\n };\n }\n\n protected beforeRender(configSetByMerchant?: P): void {\n // We don't send 'rendered' events when rendering actions\n if (configSetByMerchant?.originalAction) {\n return;\n }\n\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.rendered,\n component: this.type,\n configData: { ...configSetByMerchant, showPayButton: this.props.showPayButton },\n ...(configSetByMerchant?.oneClick && { isStoredPaymentMethod: true })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n protected reportIntegrationFlavor(): void {\n void this.analytics.sendFlavor('components');\n }\n\n get analytics(): IAnalytics {\n return this.core.modules.analytics;\n }\n\n get srPanel(): SRPanel {\n return this.core.modules.srPanel;\n }\n\n protected getPaymentMethodConfigFromResponse(componentProps: P) {\n if (componentProps?.storedPaymentMethodId) return this.getStoredPaymentMethodDetails(componentProps.storedPaymentMethodId);\n return this.getPaymentMethodFromPaymentMethodsResponse(componentProps?.type, componentProps?.paymentMethodId);\n }\n\n protected override buildElementProps(componentProps?: P) {\n const globalCoreProps = this.core.getCorePropsForComponent();\n\n const paymentMethodFromResponse = this.getPaymentMethodConfigFromResponse(componentProps);\n\n const finalProps = {\n showPayButton: true,\n ...globalCoreProps,\n ...paymentMethodFromResponse,\n ...componentProps\n };\n\n const isDropinInstance = assertIsDropin(this);\n\n this.props = this.formatProps({\n ...this.constructor['defaultProps'], // component defaults\n ...getRegulatoryDefaults(this.core.options.countryCode, isDropinInstance), // regulatory defaults\n ...finalProps // the rest (inc. merchant defined config)\n });\n }\n\n protected getStoredPaymentMethodDetails(storedPaymentMethodId: string) {\n return this.core.paymentMethodsResponse.findStoredPaymentMethod(storedPaymentMethodId);\n }\n\n /**\n * Get the payment method from the paymentMethodsResponse\n *\n * @param type - The type of the payment method to get. (This prop is passed by Drop-in OR Standalone components containing the property 'type' as part of their configuration)\n * @param paymentMethodId - Unique internal payment method ID\n */\n protected getPaymentMethodFromPaymentMethodsResponse(type?: string, paymentMethodId?: string): RawPaymentMethod {\n if (paymentMethodId) return this.core.paymentMethodsResponse.findById(paymentMethodId);\n return this.core.paymentMethodsResponse?.find(type || this.constructor['type']);\n }\n\n protected storeElementRefOnCore(props?: P) {\n if (!props?.isDropin) {\n this.core.storeElementReference(this);\n }\n }\n\n public isAvailable(): Promise<void> {\n return Promise.resolve();\n }\n\n public setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n this.onChange();\n }\n\n public showValidation(): this {\n if (this.componentRef && this.componentRef.showValidation) this.componentRef.showValidation();\n return this;\n }\n\n /**\n * Updates the amount in the props and propagates it to the AmountProvider.\n * This allows children components to access the updated amount via context.\n *\n * @param amount - Primary payment amount object\n * @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)\n * @internal\n */\n public updateAmount(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void {\n this.props = {\n ...this.props,\n ...(amount && { amount }),\n ...(secondaryAmount && { secondaryAmount })\n };\n this.amountProviderRef.current?.update(amount, secondaryAmount);\n }\n\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n public setElementStatus(status: UIElementStatus, props?: any): this {\n this.elementRef?.setStatus(status, props);\n return this;\n }\n\n /**\n * componentRef is a ref to the primary component inside that subclass e.g. CardInput.tsx\n */\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n return this;\n }\n\n protected onChange(): void {\n this.props.onChange?.(\n {\n data: this.data,\n isValid: this.isValid,\n errors: this.state.errors,\n valid: this.state.valid\n },\n this.elementRef\n );\n }\n\n protected override submitAnalytics(event: AbstractAnalyticsEvent) {\n this.analytics.sendAnalytics(event);\n }\n\n public submit(): void {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n this.makePaymentsCall()\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) {\n this.setElementStatus('ready');\n return;\n }\n this.handleFailedResult(e as PaymentResponseData);\n });\n }\n\n protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse> {\n this.setElementStatus('loading');\n\n if (this.props.onSubmit) {\n return this.submitUsingAdvancedFlow();\n }\n\n if (this.core.session) {\n const beforeSubmitEvent: Promise<PaymentData> = this.props.beforeSubmit\n ? new Promise((resolve, reject) => {\n void this.props.beforeSubmit(this.data, this.elementRef, {\n resolve,\n reject: () => reject(new CancelError('beforeSubmitRejected'))\n });\n })\n : Promise.resolve(this.data);\n\n return beforeSubmitEvent.then(this.submitUsingSessionsFlow);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments call. Callback \"onSubmit\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitUsingAdvancedFlow(): Promise<CheckoutAdvancedFlowResponse> {\n const event = new AnalyticsLogEvent({\n component: this.type,\n type: LogEventType.submit,\n message: 'Shopper clicked pay'\n });\n this.submitAnalytics(event);\n\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onSubmit(\n {\n data: this.data,\n isValid: this.isValid\n },\n this.elementRef,\n { resolve, reject }\n );\n });\n }\n\n private async submitUsingSessionsFlow(data: PaymentData): Promise<CheckoutSessionPaymentResponse> {\n const event = new AnalyticsLogEvent({\n component: this.type,\n type: LogEventType.submit,\n message: 'Shopper clicked pay'\n });\n this.submitAnalytics(event);\n\n try {\n return await this.core.session.submitPayment(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) {\n this.handleError(error);\n } else {\n this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /payments call', { cause: error }));\n }\n\n return Promise.reject(error);\n }\n\n // // Uncomment to simulate failed\n // return {\n // resultCode: 'Refused',\n // sessionData:\n // 'Ab02b4c0!BQABAgBKGgqfEz8uQlU4yCIOWjA8bkEwmbJ7Qt4r+x5IPXREu1rMjwNk5MDoHFNlv+MWvinS6nXIDniXgRzXCdSC4ksw9CNDBAjOa+B88wRoj/rLTieuWh/0leR88qkV24vtIkjsIsbJTDB78Pd8wX8MEDsXhaAdEIyX9E8eqxuQ3bwPbvLs1Dlgo1ZrfkQRzaNiuVM8ejRG0IWE1bGThJzY+sJvZZHvlDMXIlxhZcDoQvsMj/WwE6+nFJxBiC3oRzmvVn3AbkLQGtvwq16UUSfYbPzG9dXypJMtcrZAQYq2g/2+BSibCcmee9AXq/wij11BERrYmjbDt5NkkdUnDVgAB7pdqbnWX0A2sxBKeYtLSP2kxp+5LoU/Wty3fmcVA3VKVkHfgmIihkeL8lY++5hvHjnkzOE4tyx/sheiKS4zqoWE43TD6n8mpFskAzwMHq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kl5zuw47GQrN9Qzxl2WV3A38MQPUqFtIr/71Rjkphgg49ZGWEYCwgFmm8jJc2/5qTabSGk4bzwiETCTzeydq30bUGqCwglj8CrFViAuQeTJm7dp+PYKMkUNvQRpnSXMj6Kz7rvAMzhzJgK62ltN2idqKxLC7WtivCUgejuQUvNreCYBQCaKwTwP02lZsJpGF9yw8gbyuoB+2aB7IZmgIB8GP4qVQ/ht5B9z/FLohK/8cSPV/4i32SNNdcwhV',\n // sessionResult:\n // 'X3XtfGC7!H4sIAAAAAAAA/6tWykxRslJyDjaxNDMyM3E2MXIyNDUys3RU0lHKTS1KzkjMK3FMTs4vzSsBKgtJLS7xhYo6Z6QmZ+eXlgAVFpcklpQWA+WLUtNKi1NTlGoBMEEbz1cAAAA=iMsCaEJ5LcnsqIUtmNxjm8HtfQ8gZW8JewEU3wHz4qg='\n // };\n }\n\n protected onComplete(state): void {\n this.handleAdditionalDetails(state);\n }\n\n protected handleError = (error: AdyenCheckoutError): void => {\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n this.setElementStatus('ready');\n\n if (error.name === NETWORK_ERROR && error.options.code) {\n const event = new AnalyticsErrorEvent({\n component: this.type,\n errorType: ErrorEventType.apiError,\n code: error.options.code\n });\n\n this.submitAnalytics(event);\n }\n\n if (this.props.onError) {\n this.props.onError(error, this.elementRef);\n }\n };\n\n protected handleAdditionalDetails(state: AdditionalDetailsData): void {\n this.makeAdditionalDetailsCall(state)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n private makeAdditionalDetailsCall(state: AdditionalDetailsData): Promise<CheckoutSessionDetailsResponse | CheckoutAdvancedFlowResponse> {\n if (this.props.onAdditionalDetails) {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onAdditionalDetails(state, this.elementRef, { resolve, reject });\n });\n }\n\n if (this.core.session) {\n return this.submitAdditionalDetailsUsingSessionsFlow(state.data);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments/details call. Callback \"onAdditionalDetails\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitAdditionalDetailsUsingSessionsFlow(data: any): Promise<CheckoutSessionDetailsResponse> {\n try {\n return await this.core.session.submitDetails(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.handleError(error);\n else this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /details call', { cause: error }));\n\n return Promise.reject(error);\n }\n }\n\n public handleAction(action: PaymentAction, props = {}): UIElement | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n const paymentAction = this.core.createFromAction(action, {\n ...this.elementRef.props,\n ...props\n });\n\n if (paymentAction) {\n this.unmount();\n return paymentAction.mount(this._node);\n }\n\n return null;\n }\n\n protected onActionHandled(actionHandledObj: ActionHandledReturnObject) {\n this.props?.onActionHandled?.({ originalAction: this.props.originalAction, ...actionHandledObj });\n }\n\n protected handleOrder = (response: PaymentResponseData): void => {\n const { order } = response;\n\n const updateCorePromise = this.core.session\n ? this.core.update({\n order\n })\n : this.handleAdvanceFlowPaymentMethodsUpdate(order);\n\n void updateCorePromise.then(() => {\n this.props.onOrderUpdated?.({ order });\n });\n };\n\n protected setupSessionsDonation() {\n const { amount, donation } = this.props;\n\n // If merchant hasn't explicitly disabled autoMount by setting it to false\n if (donation?.autoMount !== false) {\n const rootNode: HTMLElement = assertIsDropin(this.elementRef) ? this.elementRef._node : this._node;\n\n const DonationComponentRef = this.core.getComponent(TxVariants.donation) as typeof Donation;\n new DonationComponentRef(this.core, { rootNode, commercialTxAmount: amount.value }); // NOSONAR: Instantiation triggers internal async initialization (fire-and-forget pattern)\n }\n }\n\n /**\n * Handles when the payment fails. The payment fails when:\n * - adv flow: the merchant rejects the payment due to a critical error\n * - adv flow: the merchant resolves the payment with a failed resultCode\n * - sessions: a network error occurs when making the payment\n * - sessions: the payment fails with a failed resultCode\n *\n * @param result\n */\n protected handleFailedResult = (result?: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('error');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentFailed?.(result, this.elementRef);\n };\n\n protected handleSuccessResult = (result: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('success');\n }\n\n cleanupFinalResult(result);\n\n /** If we are using sessions and the response mandates it - create a Donation instance */\n if (this.core.session && result.askDonation === true) {\n this.setupSessionsDonation();\n }\n\n this.props.onPaymentCompleted?.(result, this.elementRef);\n };\n\n /**\n * Handles a /payments or /payments/details response.\n * The component will handle automatically actions, orders, and final results.\n *\n * Expected to be called after sanitizeResponse has been run on the raw payment response\n *\n * @param response -\n */\n protected handleResponse(response: PaymentResponseData): void {\n if (response.action) {\n this.elementRef.handleAction(response.action);\n return;\n }\n\n if (response.order?.remainingAmount?.value > 0) {\n // we don't want to call elementRef here, use the component handler\n // we do this way so the logic on handlingOrder is associated with payment method\n this.handleOrder(response);\n return;\n }\n\n this.handleSuccessResult(response);\n }\n\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent) {\n if (e.key === 'Enter' || e.code === 'Enter') {\n e.preventDefault(); // Prevent <form> submission if Component is placed inside a form\n\n this.onEnterKeyPressed(document?.activeElement, this);\n }\n }\n\n /**\n * Handle Enter key pressed from a UIElement (called via handleKeyPress)\n * @param obj\n */\n protected onEnterKeyPressed(activeElement: Element, component: UIElement) {\n if (this.props.onEnterKeyPressed) {\n this.props.onEnterKeyPressed(activeElement, component);\n } else {\n (activeElement as HTMLElement).blur();\n this.submit();\n }\n }\n\n /**\n * Call update on parent instance\n * This function exist to make safe access to the protected _parentInstance\n * @param options - CoreOptions\n */\n public updateParent(options: CoreConfiguration = {}): Promise<ICore> {\n return this.elementRef.core.update(options);\n }\n\n public setComponentRef = (ref: ComponentMethodsRef) => {\n this.componentRef = ref;\n };\n\n /**\n * Get the current validation status of the element\n */\n public get isValid(): boolean {\n return false;\n }\n\n /**\n * Get the element icon URL for the current environment\n */\n public get icon(): string {\n const type = this.props.paymentMethodType || this.type;\n return this.props.icon ?? this.resources.getImage()(type);\n }\n\n /**\n * Get the element's displayable name\n */\n public get displayName(): string {\n const paymentMethodFromResponse = this.core.paymentMethodsResponse?.paymentMethods?.find(pm => pm.type === this.type);\n return this.props.name || paymentMethodFromResponse?.name || this.type;\n }\n\n /**\n * Get the element accessible name, used in the aria-label of the button that controls selected payment method\n */\n public get accessibleName(): string {\n return this.displayName;\n }\n\n /**\n * Used to display the second line of a payment method item\n */\n get additionalInfo(): string {\n return null;\n }\n\n /**\n * Return the type of an element\n */\n public get type(): string {\n return this.props.type || this.constructor['type'];\n }\n\n /**\n * Get the payButton component for the current element\n */\n protected payButton = (props: PayButtonProps) => {\n return <PayButton {...props} onClick={this.submit} />;\n };\n\n /**\n * Used in the Partial Orders flow.\n * When the Order is updated, the merchant can request new payment methods based on the new remaining amount\n *\n * @private\n */\n protected async handleAdvanceFlowPaymentMethodsUpdate(order: Order | null, amount?: PaymentAmount) {\n return new Promise<void | PaymentMethodsResponse>((resolve, reject) => {\n if (!this.props.onPaymentMethodsRequest) {\n return resolve();\n }\n\n this.props.onPaymentMethodsRequest(\n {\n ...(order && {\n order: {\n orderData: order.orderData,\n pspReference: order.pspReference\n }\n }),\n locale: this.core.options.locale\n },\n { resolve, reject }\n );\n })\n .catch(error => {\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'Something failed during payment methods update or onPaymentMethodsRequest was not implemented',\n {\n cause: error\n }\n )\n );\n })\n .then(paymentMethodsResponse => {\n // in the case of the session flow we get order, amount, countryCode and shopperLocale from initialize()\n // apply the same logic here for order and amount\n // in the future it might be worth moving this logic to be performed by the core on update()\n // it would make this more consistent\n return this.core.update({\n ...(paymentMethodsResponse && { paymentMethodsResponse }),\n order,\n amount: order ? order.remainingAmount : amount\n });\n });\n }\n\n protected abstract componentToRender(): h.JSX.Element | null;\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources} analytics={this.analytics}>\n <SRPanelProvider srPanel={this.srPanel}>\n <AmountProvider amount={this.props.amount} secondaryAmount={this.props.secondaryAmount} providerRef={this.amountProviderRef}>\n {this.componentToRender()}\n </AmountProvider>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UIElement;\n"],"names":["UIElement","BaseElement","createBeforeRenderHook","configSetByMerchant","originalRender","this","render","args","beforeRender","apply","originalAction","event","AnalyticsInfoEvent","type","InfoEventType","rendered","component","configData","showPayButton","props","oneClick","isStoredPaymentMethod","analytics","sendAnalytics","reportIntegrationFlavor","sendFlavor","core","modules","srPanel","getPaymentMethodConfigFromResponse","componentProps","storedPaymentMethodId","getStoredPaymentMethodDetails","getPaymentMethodFromPaymentMethodsResponse","paymentMethodId","buildElementProps","finalProps","getCorePropsForComponent","isDropinInstance","assertIsDropin","formatProps","constructor","getRegulatoryDefaults","options","countryCode","paymentMethodsResponse","findStoredPaymentMethod","findById","find","storeElementRefOnCore","isDropin","storeElementReference","isAvailable","Promise","resolve","setState","newState","state","onChange","showValidation","componentRef","updateAmount","amount","secondaryAmount","amountProviderRef","current","update","setElementStatus","status","elementRef","setStatus","data","isValid","errors","valid","submitAnalytics","submit","makePaymentsCall","then","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","catch","e","CancelError","handleFailedResult","onSubmit","submitUsingAdvancedFlow","session","beforeSubmit","reject","submitUsingSessionsFlow","handleError","AdyenCheckoutError","AnalyticsLogEvent","LogEventType","message","submitPayment","error","cause","onComplete","handleAdditionalDetails","makeAdditionalDetailsCall","onAdditionalDetails","submitAdditionalDetailsUsingSessionsFlow","submitDetails","handleAction","action","hasOwnProperty","Error","paymentAction","createFromAction","unmount","mount","_node","onActionHandled","actionHandledObj","setupSessionsDonation","donation","autoMount","rootNode","getComponent","TxVariants","commercialTxAmount","value","response","order","remainingAmount","handleOrder","handleSuccessResult","handleKeyPress","key","code","preventDefault","onEnterKeyPressed","document","activeElement","blur","updateParent","icon","paymentMethodType","resources","getImage","displayName","paymentMethodFromResponse","paymentMethods","pm","name","accessibleName","additionalInfo","handleAdvanceFlowPaymentMethodsUpdate","onPaymentMethodsRequest","orderData","pspReference","locale","h","CoreProvider","i18n","loadingContext","SRPanelProvider","AmountProvider","providerRef","componentToRender","checkout","super","_define_property","createRef","NETWORK_ERROR","AnalyticsErrorEvent","errorType","ErrorEventType","apiError","onError","onOrderUpdated","result","displayFinalAnimation","cleanupFinalResult","onPaymentFailed","askDonation","onPaymentCompleted","setComponentRef","ref","payButton","PayButton","onClick","register","bind","undefined","txVariants"],"mappings":"wrCAsCO,MAAeA,UAA6DC,EAgEvEC,sBAAAA,CAAuBC,GAC3B,MAAMC,EAAiBC,KAAKC,OAE5BD,KAAKC,OAAS,IAAIC,KACdF,KAAKG,aAAaL,GACXC,EAAeK,MAAMJ,KAAME,GAE1C,CAEUC,YAAAA,CAAaL,GAEnB,GAAIA,GAAqBO,eACrB,OAGJ,MAAMC,EAAQ,IAAIC,EAAmB,CACjCC,KAAMC,EAAcC,SACpBC,UAAWX,KAAKQ,KAChBI,WAAY,IAAKd,EAAqBe,cAAeb,KAAKc,MAAMD,kBAC5Df,GAAqBiB,UAAY,CAAEC,uBAAuB,KAGlEhB,KAAKiB,UAAUC,cAAcZ,EACjC,CAEUa,uBAAAA,GACDnB,KAAKiB,UAAUG,WAAW,aACnC,CAEA,aAAIH,GACA,OAAOjB,KAAKqB,KAAKC,QAAQL,SAC7B,CAEA,WAAIM,GACA,OAAOvB,KAAKqB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Bd,KAAKmB,yBACT,EA1CA6I,EAbkBrK,EAaKa,YAA2B8K,GAUlDtB,EAvBkBrK,EAuBK4L,aAAuB"}
|
|
1
|
+
{"version":3,"file":"UIElement.js","sources":["../../../../../src/components/internal/UIElement/UIElement.tsx"],"sourcesContent":["import { createRef, h, RefObject, TargetedKeyboardEvent } from 'preact';\nimport { Resources } from '../../../core/Context/Resources';\nimport AdyenCheckoutError, { NETWORK_ERROR } from '../../../core/Errors/AdyenCheckoutError';\nimport { hasOwnProperty } from '../../../utils/hasOwnProperty';\nimport BaseElement from '../BaseElement/BaseElement';\nimport PayButton from '../PayButton';\nimport { assertIsDropin, cleanupFinalResult, getRegulatoryDefaults, sanitizeResponse, verifyPaymentDidNotFail } from './utils';\n\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { AnalyticsErrorEvent, ErrorEventType } from '../../../core/Analytics/events/AnalyticsErrorEvent';\nimport { AnalyticsInfoEvent, InfoEventType } from '../../../core/Analytics/events/AnalyticsInfoEvent';\nimport { AnalyticsLogEvent, LogEventType } from '../../../core/Analytics/events/AnalyticsLogEvent';\nimport type { CheckoutSessionDetailsResponse, CheckoutSessionPaymentResponse } from '../../../core/CheckoutSession/types';\nimport type { NewableComponent } from '../../../core/core.registry';\nimport CancelError from '../../../core/Errors/CancelError';\nimport type { AdditionalDetailsData, CoreConfiguration, ICore } from '../../../core/types';\nimport type {\n ActionHandledReturnObject,\n CheckoutAdvancedFlowResponse,\n Order,\n PaymentAction,\n PaymentAmount,\n PaymentData,\n PaymentMethodsResponse,\n PaymentResponseData,\n RawPaymentMethod\n} from '../../../types/global-types';\nimport type { ComponentMethodsRef, UIElementProps, UIElementStatus } from './types';\nimport type { IAnalytics } from '../../../core/Analytics/Analytics';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport { SRPanel } from '../../../core/Errors/SRPanel';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { AmountProvider, AmountProviderRef } from '../../../core/Context/AmountProvider';\nimport { PayButtonProps } from '../PayButton/PayButton';\nimport { TxVariants } from '../../tx-variants';\nimport Donation from '../../Donation/Donation';\nimport './UIElement.scss';\n\nexport abstract class UIElement<P extends UIElementProps = UIElementProps> extends BaseElement<P> {\n /**\n * componentRef is a ref to the primary component inside the subclass that extends UIElement e.g. CardInput.tsx (which sits inside Card.tsx)\n */\n protected componentRef: any;\n\n protected resources: Resources;\n\n /**\n * elementRef is a ref to the subclass that extends UIElement e.g. Card.tsx or Dropin.tsx\n */\n public elementRef: UIElement;\n\n public static readonly type: string | undefined = undefined;\n\n /**\n * Reference to the methods exposed by the AmountProvider context\n */\n protected amountProviderRef: RefObject<AmountProviderRef> = createRef();\n\n /**\n * Defines all txVariants that the Component supports (in case it support multiple ones besides the 'type' one)\n */\n public static readonly txVariants: string[] = [];\n\n constructor(checkout: ICore, props?: P) {\n super(checkout, props);\n\n this.core.register(this.constructor as NewableComponent);\n\n this.submit = this.submit.bind(this);\n this.setState = this.setState.bind(this);\n this.onComplete = this.onComplete.bind(this);\n this.handleAction = this.handleAction.bind(this);\n this.handleOrder = this.handleOrder.bind(this);\n this.handleAdditionalDetails = this.handleAdditionalDetails.bind(this);\n this.handleResponse = this.handleResponse.bind(this);\n this.setElementStatus = this.setElementStatus.bind(this);\n this.submitAnalytics = this.submitAnalytics.bind(this);\n this.makePaymentsCall = this.makePaymentsCall.bind(this);\n this.makeAdditionalDetailsCall = this.makeAdditionalDetailsCall.bind(this);\n this.submitUsingSessionsFlow = this.submitUsingSessionsFlow.bind(this);\n this.updateAmount = this.updateAmount.bind(this);\n this.setupSessionsDonation = this.setupSessionsDonation.bind(this);\n\n this.elementRef = (props && props.elementRef) || this;\n this.resources = this.props.modules ? this.props.modules.resources : undefined;\n\n this.storeElementRefOnCore(this.props);\n\n this.onEnterKeyPressed = this.onEnterKeyPressed.bind(this);\n this.onActionHandled = this.onActionHandled.bind(this);\n\n this.createBeforeRenderHook(props);\n this.reportIntegrationFlavor();\n }\n\n /**\n * Creates a hook tied to render() method. This hook is called every time render() is invoked.\n * Currently useful for Analytics\n *\n * @param configSetByMerchant\n * @private\n */\n private createBeforeRenderHook(configSetByMerchant: P): void {\n const originalRender = this.render;\n\n this.render = (...args: any[]) => {\n this.beforeRender(configSetByMerchant);\n return originalRender.apply(this, args);\n };\n }\n\n protected beforeRender(configSetByMerchant?: P): void {\n // We don't send 'rendered' events when rendering actions\n if (configSetByMerchant?.originalAction) {\n return;\n }\n\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.rendered,\n component: this.type,\n configData: { ...configSetByMerchant, showPayButton: this.props.showPayButton },\n ...(configSetByMerchant?.oneClick && { isStoredPaymentMethod: true })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n protected reportIntegrationFlavor(): void {\n void this.analytics.sendFlavor('components');\n }\n\n get analytics(): IAnalytics {\n return this.core.modules.analytics;\n }\n\n get srPanel(): SRPanel {\n return this.core.modules.srPanel;\n }\n\n protected getPaymentMethodConfigFromResponse(componentProps: P) {\n if (componentProps?.storedPaymentMethodId) return this.getStoredPaymentMethodDetails(componentProps.storedPaymentMethodId);\n return this.getPaymentMethodFromPaymentMethodsResponse(componentProps?.type, componentProps?.paymentMethodId);\n }\n\n protected override buildElementProps(componentProps?: P) {\n const globalCoreProps = this.core.getCorePropsForComponent();\n\n const paymentMethodFromResponse = this.getPaymentMethodConfigFromResponse(componentProps);\n\n const finalProps = {\n showPayButton: true,\n ...globalCoreProps,\n ...paymentMethodFromResponse,\n ...componentProps\n };\n\n const isDropinInstance = assertIsDropin(this);\n\n this.props = this.formatProps({\n ...this.constructor['defaultProps'], // component defaults\n ...getRegulatoryDefaults(this.core.options.countryCode, isDropinInstance), // regulatory defaults\n ...finalProps // the rest (inc. merchant defined config)\n });\n }\n\n protected getStoredPaymentMethodDetails(storedPaymentMethodId: string) {\n return this.core.paymentMethodsResponse.findStoredPaymentMethod(storedPaymentMethodId);\n }\n\n /**\n * Get the payment method from the paymentMethodsResponse\n *\n * @param type - The type of the payment method to get. (This prop is passed by Drop-in OR Standalone components containing the property 'type' as part of their configuration)\n * @param paymentMethodId - Unique internal payment method ID\n */\n protected getPaymentMethodFromPaymentMethodsResponse(type?: string, paymentMethodId?: string): RawPaymentMethod {\n if (paymentMethodId) return this.core.paymentMethodsResponse.findById(paymentMethodId);\n return this.core.paymentMethodsResponse?.find(type || this.constructor['type']);\n }\n\n protected storeElementRefOnCore(props?: P) {\n if (!props?.isDropin) {\n this.core.storeElementReference(this);\n }\n }\n\n public isAvailable(): Promise<void> {\n return Promise.resolve();\n }\n\n public setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n this.onChange();\n }\n\n public showValidation(): this {\n if (this.componentRef && this.componentRef.showValidation) this.componentRef.showValidation();\n return this;\n }\n\n /**\n * Updates the amount in the props and propagates it to the AmountProvider.\n * This allows children components to access the updated amount via context.\n *\n * @param amount - Primary payment amount object\n * @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)\n * @internal\n */\n public updateAmount(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void {\n this.props = {\n ...this.props,\n ...(amount && { amount }),\n ...(secondaryAmount && { secondaryAmount })\n };\n this.amountProviderRef.current?.update(amount, secondaryAmount);\n }\n\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n public setElementStatus(status: UIElementStatus, props?: any): this {\n this.elementRef?.setStatus(status, props);\n return this;\n }\n\n /**\n * componentRef is a ref to the primary component inside that subclass e.g. CardInput.tsx\n */\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n return this;\n }\n\n protected onChange(): void {\n this.props.onChange?.(\n {\n data: this.data,\n isValid: this.isValid,\n errors: this.state.errors,\n valid: this.state.valid\n },\n this.elementRef\n );\n }\n\n protected override submitAnalytics(event: AbstractAnalyticsEvent) {\n this.analytics.sendAnalytics(event);\n }\n\n public submit(): void {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n this.makePaymentsCall()\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) {\n this.setElementStatus('ready');\n return;\n }\n this.handleFailedResult(e as PaymentResponseData);\n });\n }\n\n protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse> {\n this.setElementStatus('loading');\n\n if (this.props.onSubmit) {\n return this.submitUsingAdvancedFlow();\n }\n\n if (this.core.session) {\n const beforeSubmitEvent: Promise<PaymentData> = this.props.beforeSubmit\n ? new Promise((resolve, reject) => {\n void this.props.beforeSubmit(this.data, this.elementRef, {\n resolve,\n reject: () => reject(new CancelError('beforeSubmitRejected'))\n });\n })\n : Promise.resolve(this.data);\n\n return beforeSubmitEvent.then(this.submitUsingSessionsFlow);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments call. Callback \"onSubmit\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitUsingAdvancedFlow(): Promise<CheckoutAdvancedFlowResponse> {\n const event = new AnalyticsLogEvent({\n component: this.type,\n type: LogEventType.submit,\n message: 'Shopper clicked pay'\n });\n this.submitAnalytics(event);\n\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onSubmit(\n {\n data: this.data,\n isValid: this.isValid\n },\n this.elementRef,\n { resolve, reject }\n );\n });\n }\n\n private async submitUsingSessionsFlow(data: PaymentData): Promise<CheckoutSessionPaymentResponse> {\n const event = new AnalyticsLogEvent({\n component: this.type,\n type: LogEventType.submit,\n message: 'Shopper clicked pay'\n });\n this.submitAnalytics(event);\n\n try {\n return await this.core.session.submitPayment(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) {\n this.handleError(error);\n } else {\n this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /payments call', { cause: error }));\n }\n\n return Promise.reject(error);\n }\n\n // // Uncomment to simulate failed\n // return {\n // resultCode: 'Refused',\n // sessionData:\n // 'Ab02b4c0!BQABAgBKGgqfEz8uQlU4yCIOWjA8bkEwmbJ7Qt4r+x5IPXREu1rMjwNk5MDoHFNlv+MWvinS6nXIDniXgRzXCdSC4ksw9CNDBAjOa+B88wRoj/rLTieuWh/0leR88qkV24vtIkjsIsbJTDB78Pd8wX8MEDsXhaAdEIyX9E8eqxuQ3bwPbvLs1Dlgo1ZrfkQRzaNiuVM8ejRG0IWE1bGThJzY+sJvZZHvlDMXIlxhZcDoQvsMj/WwE6+nFJxBiC3oRzmvVn3AbkLQGtvwq16UUSfYbPzG9dXypJMtcrZAQYq2g/2+BSibCcmee9AXq/wij11BERrYmjbDt5NkkdUnDVgAB7pdqbnWX0A2sxBKeYtLSP2kxp+5LoU/Wty3fmcVA3VKVkHfgmIihkeL8lY++5hvHjnkzOE4tyx/sheiKS4zqoWE43TD6n8mpFskAzwMHq4G2o6vkXqvaKFEq7y/R2fVrCypenmRhkPASizpM265rKLU+L4E/C+LMHfN0LYKRMCrLr0gI2GAp+1PZLHgh0tCtiJC/zcJJtJs6sHNQxLUN+kxJuELUHOcuL3ivjG+mWteUnBENZu7KqOSZYetiWYRiyLOXDiBHqbxuQwTuO54L15VLkS/mYB20etibM1nn+fRmbo+1IJkCSalhwi5D7fSrpjbQTmAsOpJT1N8lC1MSNmAvAwG1kWL4JxYwXDKYyYASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ98uZI4thGveOByYbomCeeP2Gy2rzs99FOBoDYVeWIUjyM+gfnW89DdJZAhxe74Tv0TnL5DRQYPCTRQPOoLbQ21NaeSho70FNE+n8XYKlVK5Ore6BoB6IVCaal5MkM27VmZPMmGflgcPx+pakx+EmRsYGdvYNImYxJYrRk3CI+l3T3ZiVpPPqebaVSLaSkEfu0iOFPjjLUhWN6QW6c18heE5vq/pcoeBf7p0Jgr9I5aBFY0avYG57BDGHzU1ZiQ9LLMTis2BA7Ap9pdNq8FVXL4fnoVHNZiiANOf3uvSknPKBID8sdOXUStA0crmO322FYjDqh1n6FG+D7+OJSayNsXIz6Zoy0eFn4HbT8nt8L2X2tdzkMayCYHXRwKh13Xyleqxt4WoEZmhwTmB3p9d1F0SylWnjcC6o/DnshJ9mMW/8D3oWS30Z7BwRODqKGVahRD0YGRzwMbVnEe5JFRfNvJZdLGl35L9632DVmuFQ0lr/8WNL/NrAJNtI6PXrZMNiza0/omPwPfe5ZYuD1Jgq59TX4h9d+3fdkArcJYL7AdoMZON1YEiWY5EzazQwtHd9yzdty9ZHPxAfuOfCh4OhbhFNp+v5YQ+PzKZ+UpM1VxV863+9XgWEURPNvX7qq1cpUSRzrSGq01QBBM3MKzRh5mAgqIdXgtl7L0EXAep0MECc7QY0/o3tW3VR8eEJGsSzrNxpFItqj0SEaIWo25dRfkl5zuw47GQrN9Qzxl2WV3A38MQPUqFtIr/71Rjkphgg49ZGWEYCwgFmm8jJc2/5qTabSGk4bzwiETCTzeydq30bUGqCwglj8CrFViAuQeTJm7dp+PYKMkUNvQRpnSXMj6Kz7rvAMzhzJgK62ltN2idqKxLC7WtivCUgejuQUvNreCYBQCaKwTwP02lZsJpGF9yw8gbyuoB+2aB7IZmgIB8GP4qVQ/ht5B9z/FLohK/8cSPV/4i32SNNdcwhV',\n // sessionResult:\n // 'X3XtfGC7!H4sIAAAAAAAA/6tWykxRslJyDjaxNDMyM3E2MXIyNDUys3RU0lHKTS1KzkjMK3FMTs4vzSsBKgtJLS7xhYo6Z6QmZ+eXlgAVFpcklpQWA+WLUtNKi1NTlGoBMEEbz1cAAAA=iMsCaEJ5LcnsqIUtmNxjm8HtfQ8gZW8JewEU3wHz4qg='\n // };\n }\n\n protected onComplete(state): void {\n this.handleAdditionalDetails(state);\n }\n\n protected handleError = (error: AdyenCheckoutError): void => {\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n this.setElementStatus('ready');\n\n if (error.name === NETWORK_ERROR && error.options.code) {\n const event = new AnalyticsErrorEvent({\n component: this.type,\n errorType: ErrorEventType.apiError,\n code: error.options.code\n });\n\n this.submitAnalytics(event);\n }\n\n if (this.props.onError) {\n this.props.onError(error, this.elementRef);\n }\n };\n\n protected handleAdditionalDetails(state: AdditionalDetailsData): void {\n this.makeAdditionalDetailsCall(state)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n private makeAdditionalDetailsCall(state: AdditionalDetailsData): Promise<CheckoutSessionDetailsResponse | CheckoutAdvancedFlowResponse> {\n if (this.props.onAdditionalDetails) {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onAdditionalDetails(state, this.elementRef, { resolve, reject });\n });\n }\n\n if (this.core.session) {\n return this.submitAdditionalDetailsUsingSessionsFlow(state.data);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments/details call. Callback \"onAdditionalDetails\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitAdditionalDetailsUsingSessionsFlow(data: any): Promise<CheckoutSessionDetailsResponse> {\n try {\n return await this.core.session.submitDetails(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.handleError(error);\n else this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /details call', { cause: error }));\n\n return Promise.reject(error);\n }\n }\n\n public handleAction(action: PaymentAction, props = {}): UIElement | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n const paymentAction = this.core.createFromAction(action, {\n ...this.elementRef.props,\n ...props\n });\n\n if (paymentAction) {\n this.unmount();\n return paymentAction.mount(this._node);\n }\n\n return null;\n }\n\n protected onActionHandled(actionHandledObj: ActionHandledReturnObject) {\n this.props?.onActionHandled?.({ originalAction: this.props.originalAction, ...actionHandledObj });\n }\n\n protected handleOrder = (response: PaymentResponseData): void => {\n const { order } = response;\n\n const updateCorePromise = this.core.session\n ? this.core.update({\n order\n })\n : this.handleAdvanceFlowPaymentMethodsUpdate(order);\n\n void updateCorePromise.then(() => {\n this.props.onOrderUpdated?.({ order });\n });\n };\n\n protected setupSessionsDonation() {\n const { amount, donation } = this.props;\n\n // If merchant hasn't explicitly disabled autoMount by setting it to false\n if (donation?.autoMount !== false) {\n const rootNode: HTMLElement = assertIsDropin(this.elementRef) ? this.elementRef._node : this._node;\n\n const DonationComponentRef = this.core.getComponent(TxVariants.donation) as typeof Donation;\n new DonationComponentRef(this.core, { rootNode, commercialTxAmount: amount.value }); // NOSONAR: Instantiation triggers internal async initialization (fire-and-forget pattern)\n }\n }\n\n /**\n * Handles when the payment fails. The payment fails when:\n * - adv flow: the merchant rejects the payment due to a critical error\n * - adv flow: the merchant resolves the payment with a failed resultCode\n * - sessions: a network error occurs when making the payment\n * - sessions: the payment fails with a failed resultCode\n *\n * @param result\n */\n protected handleFailedResult = (result?: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('error');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentFailed?.(result, this.elementRef);\n };\n\n protected handleSuccessResult = (result: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('success');\n }\n\n cleanupFinalResult(result);\n\n /** If we are using sessions and the response mandates it - create a Donation instance */\n if (this.core.session && result.askDonation === true) {\n this.setupSessionsDonation();\n }\n\n this.props.onPaymentCompleted?.(result, this.elementRef);\n };\n\n /**\n * Handles a /payments or /payments/details response.\n * The component will handle automatically actions, orders, and final results.\n *\n * Expected to be called after sanitizeResponse has been run on the raw payment response\n *\n * @param response -\n */\n protected handleResponse(response: PaymentResponseData): void {\n if (response.action) {\n this.elementRef.handleAction(response.action);\n return;\n }\n\n if (response.order?.remainingAmount?.value > 0) {\n // we don't want to call elementRef here, use the component handler\n // we do this way so the logic on handlingOrder is associated with payment method\n this.handleOrder(response);\n return;\n }\n\n this.handleSuccessResult(response);\n }\n\n protected handleKeyDown(e: TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent) {\n if (e.key === 'Enter' || e.code === 'Enter') {\n e.preventDefault(); // Prevent <form> submission if Component is placed inside a form\n\n this.onEnterKeyPressed(document?.activeElement, this);\n }\n }\n\n /**\n * Handle Enter key pressed from a UIElement (called via handleKeyDown)\n * @param obj\n */\n protected onEnterKeyPressed(activeElement: Element, component: UIElement) {\n if (this.props.onEnterKeyPressed) {\n this.props.onEnterKeyPressed(activeElement, component);\n } else {\n (activeElement as HTMLElement).blur();\n this.submit();\n }\n }\n\n /**\n * Call update on parent instance\n * This function exist to make safe access to the protected _parentInstance\n * @param options - CoreOptions\n */\n public updateParent(options: CoreConfiguration = {}): Promise<ICore> {\n return this.elementRef.core.update(options);\n }\n\n public setComponentRef = (ref: ComponentMethodsRef) => {\n this.componentRef = ref;\n };\n\n /**\n * Get the current validation status of the element\n */\n public get isValid(): boolean {\n return false;\n }\n\n /**\n * Get the element icon URL for the current environment\n */\n public get icon(): string {\n const type = this.props.paymentMethodType || this.type;\n return this.props.icon ?? this.resources.getImage()(type);\n }\n\n /**\n * Get the element's displayable name\n */\n public get displayName(): string {\n const paymentMethodFromResponse = this.core.paymentMethodsResponse?.paymentMethods?.find(pm => pm.type === this.type);\n return this.props.name || paymentMethodFromResponse?.name || this.type;\n }\n\n /**\n * Get the element accessible name, used in the aria-label of the button that controls selected payment method\n */\n public get accessibleName(): string {\n return this.displayName;\n }\n\n /**\n * Used to display the second line of a payment method item\n */\n get additionalInfo(): string {\n return null;\n }\n\n /**\n * Return the type of an element\n */\n public get type(): string {\n return this.props.type || this.constructor['type'];\n }\n\n /**\n * Get the payButton component for the current element\n */\n protected payButton = (props: PayButtonProps) => {\n return <PayButton {...props} onClick={this.submit} />;\n };\n\n /**\n * Used in the Partial Orders flow.\n * When the Order is updated, the merchant can request new payment methods based on the new remaining amount\n *\n * @private\n */\n protected async handleAdvanceFlowPaymentMethodsUpdate(order: Order | null, amount?: PaymentAmount) {\n return new Promise<void | PaymentMethodsResponse>((resolve, reject) => {\n if (!this.props.onPaymentMethodsRequest) {\n return resolve();\n }\n\n this.props.onPaymentMethodsRequest(\n {\n ...(order && {\n order: {\n orderData: order.orderData,\n pspReference: order.pspReference\n }\n }),\n locale: this.core.options.locale\n },\n { resolve, reject }\n );\n })\n .catch(error => {\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'Something failed during payment methods update or onPaymentMethodsRequest was not implemented',\n {\n cause: error\n }\n )\n );\n })\n .then(paymentMethodsResponse => {\n // in the case of the session flow we get order, amount, countryCode and shopperLocale from initialize()\n // apply the same logic here for order and amount\n // in the future it might be worth moving this logic to be performed by the core on update()\n // it would make this more consistent\n return this.core.update({\n ...(paymentMethodsResponse && { paymentMethodsResponse }),\n order,\n amount: order ? order.remainingAmount : amount\n });\n });\n }\n\n protected abstract componentToRender(): h.JSX.Element | null;\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources} analytics={this.analytics}>\n <SRPanelProvider srPanel={this.srPanel}>\n <AmountProvider amount={this.props.amount} secondaryAmount={this.props.secondaryAmount} providerRef={this.amountProviderRef}>\n {this.componentToRender()}\n </AmountProvider>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UIElement;\n"],"names":["UIElement","BaseElement","createBeforeRenderHook","configSetByMerchant","originalRender","this","render","args","beforeRender","apply","originalAction","event","AnalyticsInfoEvent","type","InfoEventType","rendered","component","configData","showPayButton","props","oneClick","isStoredPaymentMethod","analytics","sendAnalytics","reportIntegrationFlavor","sendFlavor","core","modules","srPanel","getPaymentMethodConfigFromResponse","componentProps","storedPaymentMethodId","getStoredPaymentMethodDetails","getPaymentMethodFromPaymentMethodsResponse","paymentMethodId","buildElementProps","finalProps","getCorePropsForComponent","isDropinInstance","assertIsDropin","formatProps","constructor","getRegulatoryDefaults","options","countryCode","paymentMethodsResponse","findStoredPaymentMethod","findById","find","storeElementRefOnCore","isDropin","storeElementReference","isAvailable","Promise","resolve","setState","newState","state","onChange","showValidation","componentRef","updateAmount","amount","secondaryAmount","amountProviderRef","current","update","setElementStatus","status","elementRef","setStatus","data","isValid","errors","valid","submitAnalytics","submit","makePaymentsCall","then","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","catch","e","CancelError","handleFailedResult","onSubmit","submitUsingAdvancedFlow","session","beforeSubmit","reject","submitUsingSessionsFlow","handleError","AdyenCheckoutError","AnalyticsLogEvent","LogEventType","message","submitPayment","error","cause","onComplete","handleAdditionalDetails","makeAdditionalDetailsCall","onAdditionalDetails","submitAdditionalDetailsUsingSessionsFlow","submitDetails","handleAction","action","hasOwnProperty","Error","paymentAction","createFromAction","unmount","mount","_node","onActionHandled","actionHandledObj","setupSessionsDonation","donation","autoMount","rootNode","getComponent","TxVariants","commercialTxAmount","value","response","order","remainingAmount","handleOrder","handleSuccessResult","handleKeyDown","key","code","preventDefault","onEnterKeyPressed","document","activeElement","blur","updateParent","icon","paymentMethodType","resources","getImage","displayName","paymentMethodFromResponse","paymentMethods","pm","name","accessibleName","additionalInfo","handleAdvanceFlowPaymentMethodsUpdate","onPaymentMethodsRequest","orderData","pspReference","locale","h","CoreProvider","i18n","loadingContext","SRPanelProvider","AmountProvider","providerRef","componentToRender","checkout","super","_define_property","createRef","NETWORK_ERROR","AnalyticsErrorEvent","errorType","ErrorEventType","apiError","onError","onOrderUpdated","result","displayFinalAnimation","cleanupFinalResult","onPaymentFailed","askDonation","onPaymentCompleted","setComponentRef","ref","payButton","P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AAkBtE,KAAKsE,gBAAgB+G,KAAKrL,MACjDA,KAAKwE,iBAAmBxE,KAAKwE,iBAAiB6G,KAAKrL,MACnDA,KAAKiG,0BAA4BjG,KAAKiG,0BAA0BoF,KAAKrL,MACrEA,KAAKsF,wBAA0BtF,KAAKsF,wBAAwB+F,KAAKrL,MACjEA,KAAKwD,aAAexD,KAAKwD,aAAa6H,KAAKrL,MAC3CA,KAAKgH,sBAAwBhH,KAAKgH,sBAAsBqE,KAAKrL,MAE7DA,KAAKgE,WAAclD,GAASA,EAAMkD,YAAehE,KACjDA,KAAKwI,UAAYxI,KAAKc,MAAMQ,QAAUtB,KAAKc,MAAMQ,QAAQkH,eAAY8C,EAErEtL,KAAK4C,sBAAsB5C,KAAKc,OAEhCd,KAAKiI,kBAAoBjI,KAAKiI,kBAAkBoD,KAAKrL,MACrDA,KAAK8G,gBAAkB9G,KAAK8G,gBAAgBuE,KAAKrL,MAEjDA,KAAKH,uBAAuBiB,GAC5Bd,KAAKmB,yBACT,EA1CA6I,EAbkBrK,EAaKa,YAA2B8K,GAUlDtB,EAvBkBrK,EAuBK4L,aAAuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AbstractAnalyticsEvent as E,AnalyticsEventCategory as _}from"./AbstractAnalyticsEvent.js";function e(E,_,e){return _ in E?Object.defineProperty(E,_,{value:e,enumerable:!0,configurable:!0,writable:!0}):E[_]=e,E}var r=function(E){return E.network="Network",E.implementation="Implementation",E.internal="Internal",E.apiError="ApiError",E.sdkError="SdkError",E.thirdParty="ThirdParty",E.generic="Generic",E.redirect="Redirect",E.threeDS2="ThreeDS2",E}({}),S=function(E){return E.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND="500",E.REDIRECT="600",E.SECURED_FIELDS_KEY_NOT_FOUND="608",E.SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED="609",E.SECURED_FIELDS_ENCRYPTION_ERROR="610",E.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA="700",E.THREEDS2_ACTION_IS_MISSING_TOKEN="701",E.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL="702",E.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS="703",E.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED="704",E.THREEDS2_TIMEOUT="710",E.THREEDS2_TOKEN_IS_MISSING_ACSURL="800",E.THREEDS2_NO_TRANSSTATUS="801",E.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",E.THREEDS2_NO_COMPONENT_FOR_ACTION="803",E.THREEDS2_NO_ACTION_FOR_CHALLENGE="804",E.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP="805",E}({});class T extends E{getEventCategory(){return _.error}constructor(E){super(E.component),e(this,"errorType",void 0),e(this,"code",void 0),e(this,"message",void 0),this.errorType=E.errorType,this.code=E.code,E.message&&(this.message=E.message)}}export{T as AnalyticsErrorEvent,S as ErrorEventCode,r as ErrorEventType};
|
|
1
|
+
import{AbstractAnalyticsEvent as E,AnalyticsEventCategory as _}from"./AbstractAnalyticsEvent.js";function e(E,_,e){return _ in E?Object.defineProperty(E,_,{value:e,enumerable:!0,configurable:!0,writable:!0}):E[_]=e,E}var r=function(E){return E.network="Network",E.implementation="Implementation",E.internal="Internal",E.apiError="ApiError",E.sdkError="SdkError",E.thirdParty="ThirdParty",E.generic="Generic",E.redirect="Redirect",E.threeDS2="ThreeDS2",E}({}),S=function(E){return E.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND="500",E.REDIRECT="600",E.SECURED_FIELDS_KEY_NOT_FOUND="608",E.SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED="609",E.SECURED_FIELDS_ENCRYPTION_ERROR="610",E.THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA="700",E.THREEDS2_ACTION_IS_MISSING_TOKEN="701",E.THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL="702",E.THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS="703",E.THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED="704",E.THREEDS2_TIMEOUT="710",E.THREEDS2_TOKEN_IS_MISSING_ACSURL="800",E.THREEDS2_NO_TRANSSTATUS="801",E.THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",E.THREEDS2_NO_COMPONENT_FOR_ACTION="803",E.THREEDS2_NO_ACTION_FOR_CHALLENGE="804",E.THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP="805",E.THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL="806",E}({});class T extends E{getEventCategory(){return _.error}constructor(E){super(E.component),e(this,"errorType",void 0),e(this,"code",void 0),e(this,"message",void 0),this.errorType=E.errorType,this.code=E.code,E.message&&(this.message=E.message)}}export{T as AnalyticsErrorEvent,S as ErrorEventCode,r as ErrorEventType};
|
|
2
2
|
//# sourceMappingURL=AnalyticsErrorEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsErrorEvent.js","sources":["../../../../../src/core/Analytics/events/AnalyticsErrorEvent.ts"],"sourcesContent":["import { AbstractAnalyticsEvent, AnalyticsEventCategory } from './AbstractAnalyticsEvent';\n\ntype AnalyticsErrorEventProps = {\n component: string;\n errorType: ErrorEventType;\n code: string;\n message?: string;\n};\n\nexport enum ErrorEventType {\n network = 'Network',\n implementation = 'Implementation',\n internal = 'Internal',\n apiError = 'ApiError',\n sdkError = 'SdkError',\n thirdParty = 'ThirdParty',\n generic = 'Generic',\n redirect = 'Redirect',\n threeDS2 = 'ThreeDS2'\n}\n\nexport enum ErrorEventCode {\n /** Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined (meaning the containing element is not in the DOM */\n SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND = '500',\n /** */\n REDIRECT = '600',\n /**\n * Key not present in served securedFields asset\n */\n SECURED_FIELDS_KEY_NOT_FOUND = '608',\n /**\n * Encryption key generation failed in securedField\n */\n SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED = '609',\n /**\n * Encryption failed in securedField\n */\n SECURED_FIELDS_ENCRYPTION_ERROR = '610',\n\n /** See also API_ERROR_CODE object in /src/core/Services/sessions/constants.ts which uses codes in the range 620-628 */\n\n /** Missing 'paymentData' property from threeDS2 action */\n THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA = '700',\n\n /** Missing 'token' property from threeDS2 action */\n THREEDS2_ACTION_IS_MISSING_TOKEN = '701',\n\n /** Decoded token is missing a valid threeDSMethodURL property */\n THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL = '702',\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n /** Token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token') */\n THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED = '704',\n\n /** 3DS2 process has timed out */\n THREEDS2_TIMEOUT = '710',\n\n /** Decoded token is missing a valid acsURL property */\n THREEDS2_TOKEN_IS_MISSING_ACSURL = '800',\n\n /** Challenge has resulted in an error (no transStatus could be retrieved by the backend) */\n THREEDS2_NO_TRANSSTATUS = '801',\n\n /** callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object */\n THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802',\n\n /** callSubmit3DS2Fingerprint cannot find a component to handle the action response */\n THREEDS2_NO_COMPONENT_FOR_ACTION = '803',\n\n /** callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object */\n THREEDS2_NO_ACTION_FOR_CHALLENGE = '804',\n\n /** The challenge process has happened, an object has been returned, parsed & accepted as legit, but the result prop on that object is either missing or doesn't have a transStatus prop */\n THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = '805'\n}\n\nexport class AnalyticsErrorEvent extends AbstractAnalyticsEvent {\n private readonly errorType: ErrorEventType;\n private readonly code: string;\n\n private readonly message?: string;\n\n constructor(props: AnalyticsErrorEventProps) {\n super(props.component);\n\n this.errorType = props.errorType;\n this.code = props.code;\n\n if (props.message) this.message = props.message;\n }\n\n public getEventCategory(): AnalyticsEventCategory {\n return AnalyticsEventCategory.error;\n }\n}\n"],"names":["ErrorEventType","ErrorEventCode","AnalyticsErrorEvent","AbstractAnalyticsEvent","getEventCategory","AnalyticsEventCategory","error","constructor","props","super","component","_define_property","errorType","this","code","message"],"mappings":"yNASO,IAAAA,EAAKA,SAAAA,GAAAA,yNAAAA,CAUX,CAVWA,CAUX,CAAA,GAEMC,EAAKA,SAAAA,GAAAA,OACoIA,EAAA,+CAAA,MAExIA,EAAA,SAAA,MAIHA,EAAA,6BAAA,MAIAA,EAAA,yCAAA,MAIAA,EAAA,gCAAA,MAKwDA,EAAA,wCAAA,MAGPA,EAAA,iCAAA,MAGaA,EAAA,2CAAA,MAM9DA,EAAA,sCAAA,MAGkHA,EAAA,wCAAA,MAGpFA,EAAA,iBAAA,MAGsBA,EAAA,iCAAA,MAGqCA,EAAA,wBAAA,MAG2DA,EAAA,gDAAA,MAGjEA,EAAA,iCAAA,MAGwBA,EAAA,iCAAA,MAG6EA,EAAA,gDAAA,
|
|
1
|
+
{"version":3,"file":"AnalyticsErrorEvent.js","sources":["../../../../../src/core/Analytics/events/AnalyticsErrorEvent.ts"],"sourcesContent":["import { AbstractAnalyticsEvent, AnalyticsEventCategory } from './AbstractAnalyticsEvent';\n\ntype AnalyticsErrorEventProps = {\n component: string;\n errorType: ErrorEventType;\n code: string;\n message?: string;\n};\n\nexport enum ErrorEventType {\n network = 'Network',\n implementation = 'Implementation',\n internal = 'Internal',\n apiError = 'ApiError',\n sdkError = 'SdkError',\n thirdParty = 'ThirdParty',\n generic = 'Generic',\n redirect = 'Redirect',\n threeDS2 = 'ThreeDS2'\n}\n\nexport enum ErrorEventCode {\n /** Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined (meaning the containing element is not in the DOM */\n SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND = '500',\n /** */\n REDIRECT = '600',\n /**\n * Key not present in served securedFields asset\n */\n SECURED_FIELDS_KEY_NOT_FOUND = '608',\n /**\n * Encryption key generation failed in securedField\n */\n SECURED_FIELDS_ENCRYPTION_KEY_GEN_FAILED = '609',\n /**\n * Encryption failed in securedField\n */\n SECURED_FIELDS_ENCRYPTION_ERROR = '610',\n\n /** See also API_ERROR_CODE object in /src/core/Services/sessions/constants.ts which uses codes in the range 620-628 */\n\n /** Missing 'paymentData' property from threeDS2 action */\n THREEDS2_ACTION_IS_MISSING_PAYMENT_DATA = '700',\n\n /** Missing 'token' property from threeDS2 action */\n THREEDS2_ACTION_IS_MISSING_TOKEN = '701',\n\n /** Decoded token is missing a valid threeDSMethodURL property */\n THREEDS2_TOKEN_IS_MISSING_THREEDSMETHODURL = '702',\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n THREEDS2_TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n /** Token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token') */\n THREEDS2_TOKEN_DECODE_OR_PARSING_FAILED = '704',\n\n /** 3DS2 process has timed out */\n THREEDS2_TIMEOUT = '710',\n\n /** Decoded token is missing a valid acsURL property */\n THREEDS2_TOKEN_IS_MISSING_ACSURL = '800',\n\n /** Challenge has resulted in an error (no transStatus could be retrieved by the backend) */\n THREEDS2_NO_TRANSSTATUS = '801',\n\n /** callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object */\n THREEDS2_NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802',\n\n /** callSubmit3DS2Fingerprint cannot find a component to handle the action response */\n THREEDS2_NO_COMPONENT_FOR_ACTION = '803',\n\n /** callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object */\n THREEDS2_NO_ACTION_FOR_CHALLENGE = '804',\n\n /** The challenge process has happened, an object has been returned, parsed & accepted as legit, but the result prop on that object is either missing or doesn't have a transStatus prop */\n THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = '805',\n\n /** Decoded challenge token is missing a valid threeDSNotificationURL property. This means any challenge iframe that is presented will not be able to postMessage back to finalise the process, and trigger an onAdditionalDetails call. */\n THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL = '806'\n}\n\nexport class AnalyticsErrorEvent extends AbstractAnalyticsEvent {\n private readonly errorType: ErrorEventType;\n private readonly code: string;\n\n private readonly message?: string;\n\n constructor(props: AnalyticsErrorEventProps) {\n super(props.component);\n\n this.errorType = props.errorType;\n this.code = props.code;\n\n if (props.message) this.message = props.message;\n }\n\n public getEventCategory(): AnalyticsEventCategory {\n return AnalyticsEventCategory.error;\n }\n}\n"],"names":["ErrorEventType","ErrorEventCode","AnalyticsErrorEvent","AbstractAnalyticsEvent","getEventCategory","AnalyticsEventCategory","error","constructor","props","super","component","_define_property","errorType","this","code","message"],"mappings":"yNASO,IAAAA,EAAKA,SAAAA,GAAAA,yNAAAA,CAUX,CAVWA,CAUX,CAAA,GAEMC,EAAKA,SAAAA,GAAAA,OACoIA,EAAA,+CAAA,MAExIA,EAAA,SAAA,MAIHA,EAAA,6BAAA,MAIAA,EAAA,yCAAA,MAIAA,EAAA,gCAAA,MAKwDA,EAAA,wCAAA,MAGPA,EAAA,iCAAA,MAGaA,EAAA,2CAAA,MAM9DA,EAAA,sCAAA,MAGkHA,EAAA,wCAAA,MAGpFA,EAAA,iBAAA,MAGsBA,EAAA,iCAAA,MAGqCA,EAAA,wBAAA,MAG2DA,EAAA,gDAAA,MAGjEA,EAAA,iCAAA,MAGwBA,EAAA,iCAAA,MAG6EA,EAAA,gDAAA,MAGgDA,EAAA,2DAAA,MA3DjOA,CA6DX,CA7DWA,CA6DX,CAAA,GAEM,MAAMC,UAA4BC,EAe9BC,gBAAAA,GACH,OAAOC,EAAuBC,KAClC,CAXA,WAAAC,CAAYC,GACRC,MAAMD,EAAME,WANhBC,OAAiBC,oBACjBD,EAAAE,KAAiBC,eAEjBH,EAAAE,KAAiBE,kBAKbF,KAAKD,UAAYJ,EAAMI,UACvBC,KAAKC,KAAON,EAAMM,KAEdN,EAAMO,UAASF,KAAKE,QAAUP,EAAMO,QAC5C"}
|
package/dist/es/core/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,n){if(null==e)throw new Error(n);return e}const n="https://checkoutshopper-live.adyen.com/checkoutshopper/",o=e("6.
|
|
1
|
+
function e(e,n){if(null==e)throw new Error(n);return e}const n="https://checkoutshopper-live.adyen.com/checkoutshopper/",o=e("6.41.0","LIBRARY_VERSION is not defined"),t=e("esm","BUNDLE_TYPE is not defined"),r=["amount","secondaryAmount","countryCode","environment","_environmentUrls","loadingContext","i18n","modules","order","session","clientKey","showPayButton","redirectFromTopWhenInIframe","donation","onPaymentCompleted","onPaymentFailed","beforeRedirect","beforeSubmit","onSubmit","onActionHandled","onAdditionalDetails","onChange","onEnterKeyPressed","onError","onBalanceCheck","onOrderCancel","onOrderRequest","onOrderUpdated","onPaymentMethodsRequest"],i=6e4;var d=function(e){return e.WEB="web",e}({});const a="web";var s=function(e){return e.NATIVE="nativeComponent",e.GENERIC="genericComponent",e}({});export{d as CHANNEL,i as DEFAULT_HTTP_TIMEOUT,n as FALLBACK_CONTEXT,r as GENERIC_OPTIONS,t as LIBRARY_BUNDLE_TYPE,o as LIBRARY_VERSION,s as PAYMENT_METHOD_BEHAVIOR,a as PLATFORM};
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="applepayjs" />
|
|
2
2
|
/// <reference types="googlepay" />
|
|
3
3
|
import * as preact from 'preact';
|
|
4
|
-
import { h, TargetedMouseEvent, Ref, RefObject, Component, ComponentChildren, FunctionComponent, ComponentChild } from 'preact';
|
|
4
|
+
import { h, TargetedMouseEvent, Ref, RefObject, Component, ComponentChildren, FunctionComponent, ComponentChild, TargetedKeyboardEvent } from 'preact';
|
|
5
5
|
import { OrderResponseBody, OnShippingAddressChangeData, OnShippingOptionsChangeData, OnInitActions } from '@paypal/paypal-js';
|
|
6
6
|
|
|
7
7
|
interface ILanguageService {
|
|
@@ -290,7 +290,6 @@ interface ButtonProps {
|
|
|
290
290
|
complete?: () => void;
|
|
291
291
|
}) => void;
|
|
292
292
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
293
|
-
onKeyPress?: (event: KeyboardEvent) => void;
|
|
294
293
|
buttonRef?: Ref<HTMLButtonElement>;
|
|
295
294
|
onMouseEnter?: (event: MouseEvent) => void;
|
|
296
295
|
onMouseLeave?: (event: MouseEvent) => void;
|
|
@@ -813,10 +812,10 @@ interface Restrictions {
|
|
|
813
812
|
}
|
|
814
813
|
|
|
815
814
|
interface ANCVConfiguration extends UIElementProps {
|
|
816
|
-
paymentData?:
|
|
815
|
+
paymentData?: string;
|
|
817
816
|
data: ANCVDataState;
|
|
818
|
-
onOrderRequest?:
|
|
819
|
-
onOrderUpdated?:
|
|
817
|
+
onOrderRequest?: onOrderRequestCallbackType;
|
|
818
|
+
onOrderUpdated?: onOrderUpdatedCallbackType;
|
|
820
819
|
}
|
|
821
820
|
interface ANCVDataState {
|
|
822
821
|
beneficiaryId: string;
|
|
@@ -1466,24 +1465,24 @@ type GiftcardFieldsProps = {
|
|
|
1466
1465
|
*/
|
|
1467
1466
|
declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
1468
1467
|
private csfLoadFailTimeout;
|
|
1469
|
-
private csfLoadFailTimeoutMS;
|
|
1470
|
-
private csfConfigFailTimeout;
|
|
1471
|
-
private csfConfigFailTimeoutMS;
|
|
1468
|
+
private readonly csfLoadFailTimeoutMS;
|
|
1469
|
+
private readonly csfConfigFailTimeout;
|
|
1470
|
+
private readonly csfConfigFailTimeoutMS;
|
|
1472
1471
|
private numCharsInField;
|
|
1473
1472
|
private rootNode;
|
|
1474
1473
|
private numDateFields;
|
|
1475
1474
|
private csf;
|
|
1476
|
-
private handleOnLoad;
|
|
1477
|
-
private handleOnConfigSuccess;
|
|
1478
|
-
private handleOnFieldValid;
|
|
1479
|
-
private handleOnAllValid;
|
|
1480
|
-
private handleOnBrand;
|
|
1481
|
-
private handleFocus;
|
|
1482
|
-
private handleOnError;
|
|
1483
|
-
private handleOnAutoComplete;
|
|
1484
|
-
private handleOnNoDataRequired;
|
|
1485
|
-
private handleOnTouchstartIOS;
|
|
1486
|
-
private
|
|
1475
|
+
private readonly handleOnLoad;
|
|
1476
|
+
private readonly handleOnConfigSuccess;
|
|
1477
|
+
private readonly handleOnFieldValid;
|
|
1478
|
+
private readonly handleOnAllValid;
|
|
1479
|
+
private readonly handleOnBrand;
|
|
1480
|
+
private readonly handleFocus;
|
|
1481
|
+
private readonly handleOnError;
|
|
1482
|
+
private readonly handleOnAutoComplete;
|
|
1483
|
+
private readonly handleOnNoDataRequired;
|
|
1484
|
+
private readonly handleOnTouchstartIOS;
|
|
1485
|
+
private readonly handleKeyDown;
|
|
1487
1486
|
state: SFPState;
|
|
1488
1487
|
props: SFPProps;
|
|
1489
1488
|
private issuingCountryCode;
|
|
@@ -1507,7 +1506,7 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
|
1507
1506
|
onBinValue: () => void;
|
|
1508
1507
|
onFocus: () => void;
|
|
1509
1508
|
onAutoComplete: () => void;
|
|
1510
|
-
|
|
1509
|
+
handleKeyDown: () => void;
|
|
1511
1510
|
styles: {};
|
|
1512
1511
|
};
|
|
1513
1512
|
componentDidMount(): void;
|
|
@@ -1567,7 +1566,7 @@ interface SFPProps {
|
|
|
1567
1566
|
onLoad?: (cbObj: CardLoadData) => void;
|
|
1568
1567
|
onStateUpdate?: (obj: SFPState) => void;
|
|
1569
1568
|
onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
|
|
1570
|
-
|
|
1569
|
+
handleKeyDown?: (event: KeyboardEvent) => void;
|
|
1571
1570
|
rootNode?: HTMLElement;
|
|
1572
1571
|
showWarnings?: boolean;
|
|
1573
1572
|
styles?: StylesObject;
|
|
@@ -1690,6 +1689,7 @@ interface CardBinLookupData {
|
|
|
1690
1689
|
supportedBrands?: string[];
|
|
1691
1690
|
brands?: string[];
|
|
1692
1691
|
issuingCountryCode?: string;
|
|
1692
|
+
healthcare?: Record<string, boolean>[];
|
|
1693
1693
|
supportedBrandsRaw?: BrandObject[];
|
|
1694
1694
|
rootNode?: HTMLElement;
|
|
1695
1695
|
isReset?: boolean;
|
|
@@ -1752,6 +1752,13 @@ interface CardLoadData {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
type CVCPolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
|
|
1754
1754
|
type DatePolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
|
|
1755
|
+
interface BrandConfiguration {
|
|
1756
|
+
name?: string;
|
|
1757
|
+
icon?: string;
|
|
1758
|
+
}
|
|
1759
|
+
interface CardBrandsConfiguration {
|
|
1760
|
+
[key: string]: BrandConfiguration;
|
|
1761
|
+
}
|
|
1755
1762
|
|
|
1756
1763
|
declare enum ErrorEventCode {
|
|
1757
1764
|
/** Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined (meaning the containing element is not in the DOM */
|
|
@@ -1798,7 +1805,9 @@ declare enum ErrorEventCode {
|
|
|
1798
1805
|
/** callSubmit3DS2Fingerprint has received a response indicating a "challenge" but without an action object */
|
|
1799
1806
|
THREEDS2_NO_ACTION_FOR_CHALLENGE = "804",
|
|
1800
1807
|
/** The challenge process has happened, an object has been returned, parsed & accepted as legit, but the result prop on that object is either missing or doesn't have a transStatus prop */
|
|
1801
|
-
THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = "805"
|
|
1808
|
+
THREEDS2_CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = "805",
|
|
1809
|
+
/** Decoded challenge token is missing a valid threeDSNotificationURL property. This means any challenge iframe that is presented will not be able to postMessage back to finalise the process, and trigger an onAdditionalDetails call. */
|
|
1810
|
+
THREEDS2_CHALLENGE_TOKEN_IS_MISSING_THREEDSNOTIFICATIONURL = "806"
|
|
1802
1811
|
}
|
|
1803
1812
|
|
|
1804
1813
|
/**
|
|
@@ -4265,14 +4274,17 @@ type balanceCheckResponseType = {
|
|
|
4265
4274
|
transactionLimit?: PaymentAmount;
|
|
4266
4275
|
};
|
|
4267
4276
|
type onBalanceCheckCallbackType = (resolve: (res: balanceCheckResponseType) => void, reject: (error: Error) => void, data: GiftCardElementData) => Promise<void>;
|
|
4277
|
+
type onOrderUpdatedCallbackType = (data: {
|
|
4278
|
+
order: Order;
|
|
4279
|
+
}) => void;
|
|
4268
4280
|
type onRequiringConfirmationCallbackType = (resolve: () => void, reject: (error: Error) => void) => Promise<void>;
|
|
4269
4281
|
type onOrderRequestCallbackType = (resolve: (order: Order) => void, reject: (error: Error) => void, data: PaymentData) => Promise<void>;
|
|
4270
4282
|
interface GiftCardConfiguration extends UIElementProps {
|
|
4271
4283
|
pinRequired?: boolean;
|
|
4272
4284
|
expiryDateRequired?: boolean;
|
|
4273
|
-
brandsConfiguration?:
|
|
4285
|
+
brandsConfiguration?: CardBrandsConfiguration;
|
|
4274
4286
|
brand?: string;
|
|
4275
|
-
onOrderUpdated?:
|
|
4287
|
+
onOrderUpdated?: onOrderUpdatedCallbackType;
|
|
4276
4288
|
onBalanceCheck?: onBalanceCheckCallbackType;
|
|
4277
4289
|
onOrderRequest?: onOrderRequestCallbackType;
|
|
4278
4290
|
onRequiringConfirmation?: onRequiringConfirmationCallbackType;
|
|
@@ -4304,7 +4316,7 @@ interface GiftcardComponentProps extends Partial<Pick<SFPProps, 'clientKey' | 'l
|
|
|
4304
4316
|
expiryDateRequired?: boolean;
|
|
4305
4317
|
fieldsLayoutComponent: FunctionComponent<GiftcardFieldsProps>;
|
|
4306
4318
|
placeholders?: Placeholders$1;
|
|
4307
|
-
|
|
4319
|
+
handleKeyDown?: (event: KeyboardEvent) => void;
|
|
4308
4320
|
onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
|
|
4309
4321
|
}
|
|
4310
4322
|
declare class Giftcard extends Component<Readonly<GiftcardComponentProps>> {
|
|
@@ -4372,8 +4384,8 @@ declare class GiftcardElement extends UIElement<GiftCardConfiguration> {
|
|
|
4372
4384
|
formatProps(props: any): any;
|
|
4373
4385
|
formatData(): GiftCardElementData;
|
|
4374
4386
|
get isValid(): boolean;
|
|
4375
|
-
get icon():
|
|
4376
|
-
get displayName():
|
|
4387
|
+
get icon(): string;
|
|
4388
|
+
get displayName(): string;
|
|
4377
4389
|
private setBalanceCheckError;
|
|
4378
4390
|
private handleBalanceCheck;
|
|
4379
4391
|
private onOrderRequest;
|
|
@@ -6459,9 +6471,10 @@ type onOrderCancelType = (data: onOrderCancelData, actions: {
|
|
|
6459
6471
|
}) => void;
|
|
6460
6472
|
reject: (error: string) => void;
|
|
6461
6473
|
}) => void;
|
|
6474
|
+
type onOrderCancelInternalCallback = ((data: onOrderCancelData) => void) | null;
|
|
6462
6475
|
interface DropinComponentProps extends DropinConfiguration {
|
|
6463
6476
|
core: ICore;
|
|
6464
|
-
onCreateElements():
|
|
6477
|
+
onCreateElements(): [Promise<UIElement[]>, Promise<UIElement[]>, Promise<UIElement[]>, Promise<UIElement[]> | []];
|
|
6465
6478
|
onElementsCreated(elements: UIElement[]): void;
|
|
6466
6479
|
onOrderCancel?: onOrderCancelType;
|
|
6467
6480
|
}
|
|
@@ -7144,8 +7157,8 @@ declare abstract class BaseElement<P extends BaseElementProps> implements IBaseE
|
|
|
7144
7157
|
* Returns the component data necessary for the /payments request
|
|
7145
7158
|
*/
|
|
7146
7159
|
protected formatData(): any;
|
|
7147
|
-
protected submitAnalytics(
|
|
7148
|
-
protected
|
|
7160
|
+
protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent): any;
|
|
7161
|
+
protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>): any;
|
|
7149
7162
|
protected setState(newState: object): void;
|
|
7150
7163
|
/**
|
|
7151
7164
|
* Returns the component payment data ready to submit to the Checkout API
|
|
@@ -7286,9 +7299,9 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
|
|
|
7286
7299
|
* @param response -
|
|
7287
7300
|
*/
|
|
7288
7301
|
protected handleResponse(response: PaymentResponseData): void;
|
|
7289
|
-
protected
|
|
7302
|
+
protected handleKeyDown(e: TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent): void;
|
|
7290
7303
|
/**
|
|
7291
|
-
* Handle Enter key pressed from a UIElement (called via
|
|
7304
|
+
* Handle Enter key pressed from a UIElement (called via handleKeyDown)
|
|
7292
7305
|
* @param obj
|
|
7293
7306
|
*/
|
|
7294
7307
|
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
|
|
@@ -8031,13 +8044,7 @@ interface CardBackendConfiguration {
|
|
|
8031
8044
|
icon?: string;
|
|
8032
8045
|
brandsConfiguration?: CardBrandsConfiguration;
|
|
8033
8046
|
}
|
|
8034
|
-
|
|
8035
|
-
name?: string;
|
|
8036
|
-
icon?: string;
|
|
8037
|
-
}
|
|
8038
|
-
interface CardBrandsConfiguration {
|
|
8039
|
-
[key: string]: BrandConfiguration;
|
|
8040
|
-
}
|
|
8047
|
+
|
|
8041
8048
|
interface CardPaymentMethodData {
|
|
8042
8049
|
type: string;
|
|
8043
8050
|
brand?: string;
|
|
@@ -8071,6 +8078,7 @@ interface BrandObject {
|
|
|
8071
8078
|
brandImageUrl?: string;
|
|
8072
8079
|
panLength?: number;
|
|
8073
8080
|
paymentMethodVariant?: string;
|
|
8081
|
+
healthcare?: boolean;
|
|
8074
8082
|
}
|
|
8075
8083
|
interface BinLookupResponseRaw {
|
|
8076
8084
|
requestId: string;
|
|
@@ -8387,7 +8395,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
|
|
|
8387
8395
|
*/
|
|
8388
8396
|
protected handleOrder: ({ order }: PaymentResponseData) => void;
|
|
8389
8397
|
closeActivePaymentMethod(): void;
|
|
8390
|
-
protected
|
|
8398
|
+
protected handleKeyDown(e: TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent): void;
|
|
8391
8399
|
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
|
|
8392
8400
|
protected componentToRender(): h.JSX.Element;
|
|
8393
8401
|
}
|
|
@@ -8713,4 +8721,4 @@ declare namespace AdyenCheckout {
|
|
|
8713
8721
|
}
|
|
8714
8722
|
|
|
8715
8723
|
export { ANCVElement as ANCV, AchElement as Ach, AddressElement as Address, AdyenCheckout, AdyenCheckoutError, Affirm, AfterPay, AfterPayB2B, AmazonPayElement as AmazonPay, ApplePayElement as ApplePay, Atome, BacsElement as BacsDirectDebit, BancontactElement as Bancontact, BankTransferElement as BankTransfer, BCMCMobileElement as BcmcMobile, BillDeskOnlineElement as BillDeskOnline, BillDeskWalletElement as BillDeskWallet, BlikElement as Blik, BoletoElement as Boleto, CardElement as Card, CashAppPay, ClickToPayElement as ClickToPay, Core, CustomCard, DokuElement as Doku, DonationElement as Donation, DotpayElement as Dotpay, DragonpayElement as Dragonpay, DropinElement as Dropin, DuitNowElement as DuitNow, EPSElement as EPS, EcontextElement as Econtext, FacilyPay10x as FacilPay10x, FacilyPay12x as FacilPay12x, FacilyPay3x as FacilPay3x, FacilyPay4x as FacilPay4x, FacilyPay6x as FacilPay6x, Fastlane, FastlaneSDK, GiftcardElement as Giftcard, GiropayElement as Giropay, GooglePay, Iris, IrisMode, KlarnaPayments as Klarna, MBWayElement as MBWay, MealVoucherFRElement as MealVoucherFR, MolPayEBankingMYElement as MolPayEBankingMY, MolPayEBankingTHElement as MolPayEBankingTH, MolPayEbankingVNElement as MolPayEBankingVN, MultibancoElement as Multibanco, OnlineBankingCZElement as OnlineBankingCZ, OnlineBankingFI, OnlineBankingINElement as OnlineBankingIN, OnlineBankingPL, OnlineBankingSKElement as OnlineBankingSK, OxxoElement as Oxxo, PayByBank, PayByBankPixElement as PayByBankPix, PayByBankUS, PayMeElement as PayMe, PayNowElement as PayNow, PaypalElement as PayPal, PayToElement as PayTo, PayuNetCashcardElement as PayuCashcard, PayuNetBankingElement as PayuNetBanking, PersonalDetailsElement as PersonalDetails, PixElement as Pix, PreAuthorizedDebitCanada, PromptPayElement as PromptPay, RatePay, RatePayDirectDebit, RedirectElement as Redirect, Riverty, SepaElement as SepaDirectDebit, SwishElement as Swish, ThreeDS2Challenge, ThreeDS2DeviceFingerprint, TrustlyElement as Trustly, TwintElement as Twint, UIElement, UPI, VippsElement as Vipps, WalletINElement as WalletIN, WeChatPayElement as WeChat, index_d as components, initializeFastlane };
|
|
8716
|
-
export type { ANCVConfiguration, ANCVDataState, AchConfiguration, AchPlaceholders, ActionDescriptionType, ActionHandledReturnObject, AdditionalDetailsActions, AdditionalDetailsData, AddressData, AddressField, AmazonPayBackendConfiguration, AmazonPayButtonProps, AmazonPayButtonSettings, AmazonPayComponentProps, AmazonPayConfiguration, AmazonPayElementData, AmazonWindowObject, App, ApplePayButtonStyle, ApplePayButtonType, ApplePayConfiguration, ApplePayElementData, ApplePayPaymentAuthorizationResult, ApplePayPaymentOrderDetails, ApplePaySessionRequest, ApplePayWebConfiguration, AwaitComponentProps, AwaitConfiguration, BankDetailsSchema, BankTransferConfiguration, BankTransferSchema, BankTransferState, BeforeSubmitActions, BinLookupResponse, BinLookupResponseRaw, BoletoConfiguration, BoletoElementProps, BoletoInputDataState, BoletoInputErrorState, BoletoInputValidState, BrandConfiguration, BrandObject, BrowserInfo, CReqData, CardAllValidData, CardAutoCompleteData, CardBackendConfiguration, CardBinLookupData, CardBinValueData, CardBrandData, CardBrandsConfiguration, CardConfigSuccessData, CardConfiguration, CardElementData, CardErrorData, CardFieldValidData, CardFocusData, CardLoadData, CardPlaceholders, CashAppPayConfiguration, CashAppPayElementData, CashAppPayEventData, ChallengeData, ChallengeResolveData, ChallengeWindowSize, ChangeActionOptions, ChangePaymentDetailsButtonProps, ChargeAmount, CheckoutAdvancedFlowResponse, CheckoutDetailsRequest, CheckoutSession, CheckoutSessionConfig, ClickToPayConfiguration, ClickToPayPaymentData, ClickToPayProps, ClickToPayScheme, CommonVoucherProps, ComponentFocusObject, ComponentMethodsRef, CoreConfiguration, CoreModules, Currency, CustomCardConfiguration, CustomTranslations, DecodeObject, DeliverySpecifications, DokuVoucherResultProps, DonationCampaign, DonationCampaignOptions, DonationConfiguration, DonationOptions, DonationProps, DragonpayConfiguraton, DragonpayInputData, DragonpayInputIssuerItem, DragonpayInputProps, DragonpayVoucherResultProps, DropinComponentProps, DropinComponentState, DropinConfiguration, DropinStatus, DropinStatusProps, DualBrandButtons, DualBrandSelectElement, DualBrandingChangeHandler, EcontextConfiguration, EcontextInputSchema, EcontextVoucherResultProps, ErrorCodeObject, ExtendedMerchantInfo, FastlaneAddress, FastlaneAuthenticatedCustomerResult, FastlaneConfiguration, FastlaneConsentRenderState, FastlaneData, FastlaneOptions, FastlanePaymentMethodConfiguration, FastlaneProfile, FastlaneSDKConfiguration, FastlaneShipping, FastlaneShippingAddressSelectorResult, FastlaneSignupConfiguration, FastlaneWindowInstance, FieldsetVisibility, FingerPrintData, FingerprintResolveData, FundingSource, FundingSourceKeys, GiftCardBalanceCheckErrorType, GiftCardConfiguration, GiftCardElementData, GiftCardValidationError, GooglePayConfiguration, GooglePaymentDataRequest, ICore, IDropin, InstantPaymentTypes, Intent, IrisConfiguration, IrisData, IrisState, IssuerListConfiguration, IssuerListData, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration, KlarnaSdkData, KlarnaWidgetAuthorizeResponse, KlarnaWidgetProps, LedgerCurrencies, MandateFrequencyType, MandateType, OnChangeData, OpenInvoiceActiveFieldsets, OpenInvoiceConfiguration, OpenInvoiceFieldsetsRefs, OpenInvoiceProps, OpenInvoiceStateData, OpenInvoiceStateError, OpenInvoiceStateValid, OpenInvoiceVisibility, Order, OrderButtonProps, OrderStatus, PayPalConfiguration, PayToConfiguration, PayToData, PayToPlaceholdersType, PayloadJSON, PaymentAction, PaymentActionsType, PaymentAmount, PaymentCompletedData, PaymentData, PaymentFailedData, PaymentMethodBrand, PaymentMethodData, PaymentMethodGroup, PaymentMethodOptions, PaymentMethods, PaymentMethodsConfiguration, PaymentMethodsRequestData, PaymentMethodsResponse, PaymentResponseData, PersonalDetailsSchema, PixConfiguration, PixElementData, PostMsgParseErrorObject, PreAuthorizedDebitCanadaConfiguration, PreAuthorizedDebitCanadaPlaceholders, ProcessedPaymentStatusResponse, QRLoaderConfiguration, RawPaymentMethod, RawPaymentResponse, RawPaymentStatusResponse, RawStoredPaymentMethod, RecurringMetadata, RedirectConfiguration, Region, ResultCode, ResultObject, ResultValue, SepaConfiguration, SepaElementData, SessionsResponse, SignOutButtonProps, SocialSecurityMode, StatusFromAction, SubmitActions, SubmitData, SupportedLocale, SupportedPayPalFundingSources, ThreeDS2ActionProps, ThreeDS2ChallengeConfiguration, ThreeDS2ConfigProps, ThreeDS2DeviceFingerprintConfiguration, ThreeDS2FingerprintResponse, ThreeDS2FlowObject, ThreeDS2FlowProps, ThreeDS2Token, UIElementProps, UIElementStatus, UPIAppList, UPIConfiguration, UpdateAmazonCheckoutSessionRequest, UpiMode, UpiPaymentData, UpiType, ValidationError, VoucherConfiguration, VoucherDetail, VoucherProps, balanceCheckResponseType, onBalanceCheckCallbackType, onOrderCancelData, onOrderCancelType, onOrderRequestCallbackType, onRequiringConfirmationCallbackType };
|
|
8724
|
+
export type { ANCVConfiguration, ANCVDataState, AchConfiguration, AchPlaceholders, ActionDescriptionType, ActionHandledReturnObject, AdditionalDetailsActions, AdditionalDetailsData, AddressData, AddressField, AmazonPayBackendConfiguration, AmazonPayButtonProps, AmazonPayButtonSettings, AmazonPayComponentProps, AmazonPayConfiguration, AmazonPayElementData, AmazonWindowObject, App, ApplePayButtonStyle, ApplePayButtonType, ApplePayConfiguration, ApplePayElementData, ApplePayPaymentAuthorizationResult, ApplePayPaymentOrderDetails, ApplePaySessionRequest, ApplePayWebConfiguration, AwaitComponentProps, AwaitConfiguration, BankDetailsSchema, BankTransferConfiguration, BankTransferSchema, BankTransferState, BeforeSubmitActions, BinLookupResponse, BinLookupResponseRaw, BoletoConfiguration, BoletoElementProps, BoletoInputDataState, BoletoInputErrorState, BoletoInputValidState, BrandConfiguration, BrandObject, BrowserInfo, CReqData, CardAllValidData, CardAutoCompleteData, CardBackendConfiguration, CardBinLookupData, CardBinValueData, CardBrandData, CardBrandsConfiguration, CardConfigSuccessData, CardConfiguration, CardElementData, CardErrorData, CardFieldValidData, CardFocusData, CardLoadData, CardPlaceholders, CashAppPayConfiguration, CashAppPayElementData, CashAppPayEventData, ChallengeData, ChallengeResolveData, ChallengeWindowSize, ChangeActionOptions, ChangePaymentDetailsButtonProps, ChargeAmount, CheckoutAdvancedFlowResponse, CheckoutDetailsRequest, CheckoutSession, CheckoutSessionConfig, ClickToPayConfiguration, ClickToPayPaymentData, ClickToPayProps, ClickToPayScheme, CommonVoucherProps, ComponentFocusObject, ComponentMethodsRef, CoreConfiguration, CoreModules, Currency, CustomCardConfiguration, CustomTranslations, DecodeObject, DeliverySpecifications, DokuVoucherResultProps, DonationCampaign, DonationCampaignOptions, DonationConfiguration, DonationOptions, DonationProps, DragonpayConfiguraton, DragonpayInputData, DragonpayInputIssuerItem, DragonpayInputProps, DragonpayVoucherResultProps, DropinComponentProps, DropinComponentState, DropinConfiguration, DropinStatus, DropinStatusProps, DualBrandButtons, DualBrandSelectElement, DualBrandingChangeHandler, EcontextConfiguration, EcontextInputSchema, EcontextVoucherResultProps, ErrorCodeObject, ExtendedMerchantInfo, FastlaneAddress, FastlaneAuthenticatedCustomerResult, FastlaneConfiguration, FastlaneConsentRenderState, FastlaneData, FastlaneOptions, FastlanePaymentMethodConfiguration, FastlaneProfile, FastlaneSDKConfiguration, FastlaneShipping, FastlaneShippingAddressSelectorResult, FastlaneSignupConfiguration, FastlaneWindowInstance, FieldsetVisibility, FingerPrintData, FingerprintResolveData, FundingSource, FundingSourceKeys, GiftCardBalanceCheckErrorType, GiftCardConfiguration, GiftCardElementData, GiftCardValidationError, GooglePayConfiguration, GooglePaymentDataRequest, ICore, IDropin, InstantPaymentTypes, Intent, IrisConfiguration, IrisData, IrisState, IssuerListConfiguration, IssuerListData, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration, KlarnaSdkData, KlarnaWidgetAuthorizeResponse, KlarnaWidgetProps, LedgerCurrencies, MandateFrequencyType, MandateType, OnChangeData, OpenInvoiceActiveFieldsets, OpenInvoiceConfiguration, OpenInvoiceFieldsetsRefs, OpenInvoiceProps, OpenInvoiceStateData, OpenInvoiceStateError, OpenInvoiceStateValid, OpenInvoiceVisibility, Order, OrderButtonProps, OrderStatus, PayPalConfiguration, PayToConfiguration, PayToData, PayToPlaceholdersType, PayloadJSON, PaymentAction, PaymentActionsType, PaymentAmount, PaymentCompletedData, PaymentData, PaymentFailedData, PaymentMethodBrand, PaymentMethodData, PaymentMethodGroup, PaymentMethodOptions, PaymentMethods, PaymentMethodsConfiguration, PaymentMethodsRequestData, PaymentMethodsResponse, PaymentResponseData, PersonalDetailsSchema, PixConfiguration, PixElementData, PostMsgParseErrorObject, PreAuthorizedDebitCanadaConfiguration, PreAuthorizedDebitCanadaPlaceholders, ProcessedPaymentStatusResponse, QRLoaderConfiguration, RawPaymentMethod, RawPaymentResponse, RawPaymentStatusResponse, RawStoredPaymentMethod, RecurringMetadata, RedirectConfiguration, Region, ResultCode, ResultObject, ResultValue, SepaConfiguration, SepaElementData, SessionsResponse, SignOutButtonProps, SocialSecurityMode, StatusFromAction, SubmitActions, SubmitData, SupportedLocale, SupportedPayPalFundingSources, ThreeDS2ActionProps, ThreeDS2ChallengeConfiguration, ThreeDS2ConfigProps, ThreeDS2DeviceFingerprintConfiguration, ThreeDS2FingerprintResponse, ThreeDS2FlowObject, ThreeDS2FlowProps, ThreeDS2Token, UIElementProps, UIElementStatus, UPIAppList, UPIConfiguration, UpdateAmazonCheckoutSessionRequest, UpiMode, UpiPaymentData, UpiType, ValidationError, VoucherConfiguration, VoucherDetail, VoucherProps, balanceCheckResponseType, onBalanceCheckCallbackType, onOrderCancelData, onOrderCancelInternalCallback, onOrderCancelType, onOrderRequestCallbackType, onOrderUpdatedCallbackType, onRequiringConfirmationCallbackType };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t=Object.prototype.toString;function n(t){return"object"==typeof t&&null!==t&&"[object Array]"===Object.prototype.toString.call(t)}function e(t){return null!=t}function r(t){return!1!==t&&e(t)}function o(t){return!!t&&"object"==typeof t}function c(e){return!r(e)||(!(!("number"==typeof(c=e)||o(c)&&"[object Number]"===t.call(c))||0!==e&&!Number.isNaN(e))||(!(!n(e)&&!function(n){return"string"==typeof n||o(n)&&"[object String]"===t.call(n)}(e)||0!==e.length)||!(!o(e)||0!==Object.keys(e).length)));var c}function u(...t){const e=n(t[0])?t[0]:t;return{from:t=>e.map(n=>n in t?{[n]:t[n]}:{}).reduce((t,n)=>({...t,...n}),{})}}function
|
|
1
|
+
const t=Object.prototype.toString;function n(t){return"object"==typeof t&&null!==t&&"[object Array]"===Object.prototype.toString.call(t)}function e(t){return null!=t}function r(t){return!1!==t&&e(t)}function o(t){return!!t&&"object"==typeof t}function c(e){return!r(e)||(!(!("number"==typeof(c=e)||o(c)&&"[object Number]"===t.call(c))||0!==e&&!Number.isNaN(e))||(!(!n(e)&&!function(n){return"string"==typeof n||o(n)&&"[object String]"===t.call(n)}(e)||0!==e.length)||!(!o(e)||0!==Object.keys(e).length)));var c}function u(t){return!c(t)}function f(...t){const e=n(t[0])?t[0]:t;return{from:t=>e.map(n=>n in t?{[n]:t[n]}:{}).reduce((t,n)=>({...t,...n}),{})}}function i(...t){const e=n(t[0])?t[0]:t;return{from:t=>f(...Object.keys(t).filter(t=>!e.includes(t))).from(t)}}export{e as existy,c as falsy,n as isArray,u as notFalsy,f as pick,i as reject,r as truthy};
|
|
2
2
|
//# sourceMappingURL=commonUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonUtils.js","sources":["../../../src/utils/commonUtils.ts"],"sourcesContent":["/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n * @internal\n */\nconst objToString = Object.prototype.toString;\n\n/**\n * Checks if `prop` is classified as an `Array` primitive or object.\n * @internal\n * @param prop - The value to check.\n * @returns Returns `true` if `prop` is correctly classified, else `false`.\n * @example\n * ```\n * isArray([1, 2, 3]);\n * // => true\n *\n * isArray(1);\n * // => false\n * ```\n */\nexport function isArray(prop) {\n return typeof prop === 'object' && prop !== null && Object.prototype.toString.call(prop) === '[object Array]';\n}\n\n/**\n * The function existy is meant to define the existence of something.\n * Using the loose inequality operator (!=), it is possible to distinguish between null, undefined, and everything else.\n * @internal\n * @param x -\n * @returns\n */\nexport function existy(x) {\n return x != null;\n}\n\n/**\n * Used to determine if something should be considered a synonym for true\n * NOTE: The number zero is considered “truthy” by design as is '' & `{}`.\n * If you wish to retain the behavior where 0 is a synonym for false, then do not use truthy where you might expect 0\n * So - returns true if something is not false, undefined or null\n * @internal\n * @param x -\n * @returns\n */\nexport function truthy(x) {\n return x !== false && existy(x);\n}\n\n/**\n * Checks if `value` is object-like.\n * (FROM lodash.3.10.1)\n * @internal\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value === 'object';\n}\n\n/**\n * @internal\n * Checks if `value` is classified as a `Number` primitive or object.\n * NOTE: `Infinity`, `-Infinity`, and `NaN` are classified as numbers\n * (FROM lodash.3.10.1)\n * @param value - The value to check.\n * @returns Returns `true` if `value` is correctly classified, else `false`.\n * @example\n * ```\n * isNumber(8.4);\n * // => true\n *\n * isNumber(NaN);\n * // => true\n *\n * isNumber('8.4');\n * // => false\n * ```\n */\nfunction isNumber(value) {\n const numberTag = '[object Number]';\n return typeof value === 'number' || (isObjectLike(value) && objToString.call(value) === numberTag);\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n * (FROM lodash.3.10.1)\n * @internal\n * @param value - The value to check.\n * @returns Returns `true` if `value` is correctly classified, else `false`.\n * @example\n * ```\n * isString('abc');\n * // => true\n *\n * isString(1);\n * // => false\n * ```\n */\nfunction isString(value) {\n const stringTag = '[object String]';\n return typeof value === 'string' || (isObjectLike(value) && objToString.call(value) === stringTag);\n}\n\n/**\n * Returns true if x is:\n * null, undefined, false, 0, NaN, empty object or array, empty string\n * @param x -\n * @example\n * ```\n * falsy(0) // => true\n * falsy('') // => true\n * falsy({}) // => true\n * falsy([]) // => true\n * falsy(false) // => true\n * falsy(NaN) // => true\n * falsy(null) // => true\n * falsy(undefined) // => true\n *\n * falsy(1) // => false\n * falsy('d') // => false\n * falsy({type:\"kin\"}) // => false\n * falsy([6]) // => false\n * falsy(true) // => false\n * ```\n */\nexport function falsy(x) {\n // Is null, undefined or false\n if (!truthy(x)) {\n return true;\n }\n\n // = 0 || NaN\n if (isNumber(x)) {\n if (x === 0 || Number.isNaN(x)) {\n return true;\n }\n }\n\n // empty array or string\n if ((isArray(x) || isString(x)) && x.length === 0) {\n return true;\n }\n\n // empty object\n if (isObjectLike(x) && Object.keys(x).length === 0) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Inverse of falsy - returns true if x is NOT null, undefined, false, 0, NaN, empty object or array, empty string\n * @param x -\n */\nexport function notFalsy(x) {\n return !falsy(x);\n}\n\n/**\n * 'Destructures' properties from object - returns a new object only containing those properties that were asked for (including if those properties\n * have values that are falsy: null, undefined, false, '').\n *\n * @param args - property names to select: can be either 'regular' arguments (comma separated list) or an array\n * @returns - an object with a function 'from' that accepts a single argument - the object from which to choose properties.\n * This function returns a new object - a copy of the original but only including the desired properties\n *\n * @example const strippedObj = pick('cardType', 'securityCode').from(cardObject);\n * @example const strippedObj = pick(['cardType', 'securityCode']).from(cardObject);\n */\nexport function pick(...args) {\n const myArgs = isArray(args[0]) ? args[0] : args;\n return {\n from: obj => {\n return myArgs.map(k => (k in obj ? { [k]: obj[k] } : {})).reduce((res, o) => ({ ...res, ...o }), {});\n }\n };\n}\n\n/**\n *'Destructures' properties from object, returning a new object containing all the original objects properties except those that were specifically rejected\n *\n * @param args - property names to reject: can be either 'regular' arguments (comma separated list) or an array\n * @returns - an object with a function 'from' that accepts a single argument - the object from which to reject properties.\n * This function returns a new object - a copy of the original but excluding the selected properties\n *\n * @example const strippedObj = reject('permittedLengths', 'pattern', 'startingRules').from(cardObject);\n * @example const strippedObj = reject(['permittedLengths', 'pattern', 'startingRules']).from(cardObject);\n */\nexport function reject(...args) {\n const myArgs = isArray(args[0]) ? args[0] : args;\n return {\n from: obj => {\n const vkeys = Object.keys(obj).filter(k => !myArgs.includes(k));\n return pick(...vkeys).from(obj);\n }\n };\n}\n"],"names":["objToString","Object","prototype","toString","isArray","prop","call","existy","x","truthy","isObjectLike","value","falsy","Number","isNaN","isString","length","keys","pick","args","myArgs","from","obj","map","k","reduce","res","o","reject","filter","includes"],"mappings":"AAKA,MAAMA,EAAcC,OAAOC,UAAUC,SAgB9B,SAASC,EAAQC,GACpB,MAAuB,iBAATA,GAA8B,OAATA,GAA0D,mBAAzCJ,OAAOC,UAAUC,SAASG,KAAKD,EACvF,CASO,SAASE,EAAOC,GACnB,OAAY,MAALA,CACX,CAWO,SAASC,EAAOD,GACnB,OAAa,IAANA,GAAeD,EAAOC,EACjC,CASA,SAASE,EAAaC,GAClB,QAASA,GAA0B,iBAAVA,CAC7B,CAoEO,SAASC,EAAMJ,GAElB,OAAKC,EAAOD,SA/CY,iBAFVG,EAsDDH,IApDwBE,EAAaC,IADhC,oBAC0CX,EAAYM,KAAKK,KAqD/D,IAANH,IAAWK,OAAOC,MAAMN,SAM3BJ,EAAQI,KAzCjB,SAAkBG,GAEd,MAAwB,iBAAVA,GAAuBD,EAAaC,IADhC,oBAC0CX,EAAYM,KAAKK,EACjF,CAsCuBI,CAASP,IAAoB,IAAbA,EAAEQ,YAKjCN,EAAaF,IAAgC,IAA1BP,OAAOgB,KAAKT,GAAGQ,UAlE1C,IAAkBL,CAuElB,
|
|
1
|
+
{"version":3,"file":"commonUtils.js","sources":["../../../src/utils/commonUtils.ts"],"sourcesContent":["/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n * @internal\n */\nconst objToString = Object.prototype.toString;\n\n/**\n * Checks if `prop` is classified as an `Array` primitive or object.\n * @internal\n * @param prop - The value to check.\n * @returns Returns `true` if `prop` is correctly classified, else `false`.\n * @example\n * ```\n * isArray([1, 2, 3]);\n * // => true\n *\n * isArray(1);\n * // => false\n * ```\n */\nexport function isArray(prop) {\n return typeof prop === 'object' && prop !== null && Object.prototype.toString.call(prop) === '[object Array]';\n}\n\n/**\n * The function existy is meant to define the existence of something.\n * Using the loose inequality operator (!=), it is possible to distinguish between null, undefined, and everything else.\n * @internal\n * @param x -\n * @returns\n */\nexport function existy(x) {\n return x != null;\n}\n\n/**\n * Used to determine if something should be considered a synonym for true\n * NOTE: The number zero is considered “truthy” by design as is '' & `{}`.\n * If you wish to retain the behavior where 0 is a synonym for false, then do not use truthy where you might expect 0\n * So - returns true if something is not false, undefined or null\n * @internal\n * @param x -\n * @returns\n */\nexport function truthy(x) {\n return x !== false && existy(x);\n}\n\n/**\n * Checks if `value` is object-like.\n * (FROM lodash.3.10.1)\n * @internal\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value === 'object';\n}\n\n/**\n * @internal\n * Checks if `value` is classified as a `Number` primitive or object.\n * NOTE: `Infinity`, `-Infinity`, and `NaN` are classified as numbers\n * (FROM lodash.3.10.1)\n * @param value - The value to check.\n * @returns Returns `true` if `value` is correctly classified, else `false`.\n * @example\n * ```\n * isNumber(8.4);\n * // => true\n *\n * isNumber(NaN);\n * // => true\n *\n * isNumber('8.4');\n * // => false\n * ```\n */\nfunction isNumber(value) {\n const numberTag = '[object Number]';\n return typeof value === 'number' || (isObjectLike(value) && objToString.call(value) === numberTag);\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n * (FROM lodash.3.10.1)\n * @internal\n * @param value - The value to check.\n * @returns Returns `true` if `value` is correctly classified, else `false`.\n * @example\n * ```\n * isString('abc');\n * // => true\n *\n * isString(1);\n * // => false\n * ```\n */\nfunction isString(value) {\n const stringTag = '[object String]';\n return typeof value === 'string' || (isObjectLike(value) && objToString.call(value) === stringTag);\n}\n\n/**\n * Returns true if x is:\n * null, undefined, false, 0, NaN, empty object or array, empty string\n * @param x -\n * @example\n * ```\n * falsy(0) // => true\n * falsy('') // => true\n * falsy({}) // => true\n * falsy([]) // => true\n * falsy(false) // => true\n * falsy(NaN) // => true\n * falsy(null) // => true\n * falsy(undefined) // => true\n *\n * falsy(1) // => false\n * falsy('d') // => false\n * falsy({type:\"kin\"}) // => false\n * falsy([6]) // => false\n * falsy(true) // => false\n * ```\n */\nexport function falsy(x) {\n // Is null, undefined or false\n if (!truthy(x)) {\n return true;\n }\n\n // = 0 || NaN\n if (isNumber(x)) {\n if (x === 0 || Number.isNaN(x)) {\n return true;\n }\n }\n\n // empty array or string\n if ((isArray(x) || isString(x)) && x.length === 0) {\n return true;\n }\n\n // empty object\n if (isObjectLike(x) && Object.keys(x).length === 0) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Inverse of falsy - returns true if x is NOT null, undefined, false, 0, NaN, empty object or array, empty string\n * @param x -\n */\nexport function notFalsy(x) {\n return !falsy(x);\n}\n\n/**\n * 'Destructures' properties from object - returns a new object only containing those properties that were asked for (including if those properties\n * have values that are falsy: null, undefined, false, '').\n *\n * @param args - property names to select: can be either 'regular' arguments (comma separated list) or an array\n * @returns - an object with a function 'from' that accepts a single argument - the object from which to choose properties.\n * This function returns a new object - a copy of the original but only including the desired properties\n *\n * @example const strippedObj = pick('cardType', 'securityCode').from(cardObject);\n * @example const strippedObj = pick(['cardType', 'securityCode']).from(cardObject);\n */\nexport function pick(...args) {\n const myArgs = isArray(args[0]) ? args[0] : args;\n return {\n from: obj => {\n return myArgs.map(k => (k in obj ? { [k]: obj[k] } : {})).reduce((res, o) => ({ ...res, ...o }), {});\n }\n };\n}\n\n/**\n *'Destructures' properties from object, returning a new object containing all the original objects properties except those that were specifically rejected\n *\n * @param args - property names to reject: can be either 'regular' arguments (comma separated list) or an array\n * @returns - an object with a function 'from' that accepts a single argument - the object from which to reject properties.\n * This function returns a new object - a copy of the original but excluding the selected properties\n *\n * @example const strippedObj = reject('permittedLengths', 'pattern', 'startingRules').from(cardObject);\n * @example const strippedObj = reject(['permittedLengths', 'pattern', 'startingRules']).from(cardObject);\n */\nexport function reject(...args) {\n const myArgs = isArray(args[0]) ? args[0] : args;\n return {\n from: obj => {\n const vkeys = Object.keys(obj).filter(k => !myArgs.includes(k));\n return pick(...vkeys).from(obj);\n }\n };\n}\n"],"names":["objToString","Object","prototype","toString","isArray","prop","call","existy","x","truthy","isObjectLike","value","falsy","Number","isNaN","isString","length","keys","notFalsy","pick","args","myArgs","from","obj","map","k","reduce","res","o","reject","filter","includes"],"mappings":"AAKA,MAAMA,EAAcC,OAAOC,UAAUC,SAgB9B,SAASC,EAAQC,GACpB,MAAuB,iBAATA,GAA8B,OAATA,GAA0D,mBAAzCJ,OAAOC,UAAUC,SAASG,KAAKD,EACvF,CASO,SAASE,EAAOC,GACnB,OAAY,MAALA,CACX,CAWO,SAASC,EAAOD,GACnB,OAAa,IAANA,GAAeD,EAAOC,EACjC,CASA,SAASE,EAAaC,GAClB,QAASA,GAA0B,iBAAVA,CAC7B,CAoEO,SAASC,EAAMJ,GAElB,OAAKC,EAAOD,SA/CY,iBAFVG,EAsDDH,IApDwBE,EAAaC,IADhC,oBAC0CX,EAAYM,KAAKK,KAqD/D,IAANH,IAAWK,OAAOC,MAAMN,SAM3BJ,EAAQI,KAzCjB,SAAkBG,GAEd,MAAwB,iBAAVA,GAAuBD,EAAaC,IADhC,oBAC0CX,EAAYM,KAAKK,EACjF,CAsCuBI,CAASP,IAAoB,IAAbA,EAAEQ,YAKjCN,EAAaF,IAAgC,IAA1BP,OAAOgB,KAAKT,GAAGQ,UAlE1C,IAAkBL,CAuElB,CAMO,SAASO,EAASV,GACrB,OAAQI,EAAMJ,EAClB,CAaO,SAASW,KAAQC,GACpB,MAAMC,EAASjB,EAAQgB,EAAK,IAAMA,EAAK,GAAKA,EAC5C,MAAO,CACHE,KAAMC,GACKF,EAAOG,IAAIC,GAAMA,KAAKF,EAAM,CAAEE,CAACA,GAAIF,EAAIE,IAAO,CAAA,GAAKC,OAAO,CAACC,EAAKC,SAAYD,KAAQC,IAAM,CAAA,GAG7G,CAYO,SAASC,KAAUT,GACtB,MAAMC,EAASjB,EAAQgB,EAAK,IAAMA,EAAK,GAAKA,EAC5C,MAAO,CACHE,KAAMC,GAEKJ,KADOlB,OAAOgB,KAAKM,GAAKO,OAAOL,IAAMJ,EAAOU,SAASN,KACtCH,KAAKC,GAGvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promiseTimeout.js","sources":["../../../src/utils/promiseTimeout.ts"],"sourcesContent":["/**\n * Tests if a passed promise settles before a certain amount of time has elapsed\n *\n * @param ms - number of milliseconds the passed promise has to settle\n * @param promise - the passed promise\n * @param timeOutObject - the object that the promiseTimeout will reject with if the passed promise doesn't settle in time\n */\nconst promiseTimeout = <T>(ms: number, promise: Promise<T>, timeOutObject: object) => {\n let timer: NodeJS.Timeout | null;\n\n const promiseTimer: Promise<T> = new Promise((resolve, reject): void => {\n // Create a timeout to reject promise if not resolved\n timer = setTimeout((): void => {\n reject(timeOutObject);\n }, ms);\n\n promise\n .then((res): void => {\n clearTimeout(timer);\n resolve(res);\n })\n .catch((err): void => {\n clearTimeout(timer);\n reject(err);\n });\n });\n\n const cancelTimer = (): void => {\n clearTimeout(timer);\n };\n\n return {\n promise: promiseTimer,\n cancel: cancelTimer\n };\n};\n\nexport default promiseTimeout;\n"],"names":["promiseTimeout","ms","promise","timeOutObject","timer","Promise","resolve","reject","setTimeout","then","res","clearTimeout","catch","err","cancel"],"mappings":"AAOA,MAAMA,EAAiB,CAAIC,EAAYC,EAAqBC,KACxD,IAAIC,EAuBJ,MAAO,CACHF,QAtB6B,IAAIG,QAAQ,CAACC,EAASC,KAEnDH,EAAQI,WAAW,KACfD,EAAOJ,IACRF,GAEHC,EACKO,KAAMC,IACHC,aAAaP,GACbE,EAAQI,KAEXE,MAAOC,IACJF,aAAaP,GACbG,EAAOM,OAUfC,OANgB,KAChBH,aAAaP"}
|
|
1
|
+
{"version":3,"file":"promiseTimeout.js","sources":["../../../src/utils/promiseTimeout.ts"],"sourcesContent":["/**\n * Tests if a passed promise settles before a certain amount of time has elapsed\n *\n * @param ms - number of milliseconds the passed promise has to settle\n * @param promise - the passed promise\n * @param timeOutObject - the object that the promiseTimeout will reject with if the passed promise doesn't settle in time\n */\nconst promiseTimeout = <T>(ms: number, promise: Promise<T>, timeOutObject: object): { promise: Promise<T>; cancel: () => void } => {\n let timer: NodeJS.Timeout | null;\n\n const promiseTimer: Promise<T> = new Promise((resolve, reject): void => {\n // Create a timeout to reject promise if not resolved\n timer = setTimeout((): void => {\n reject(timeOutObject);\n }, ms);\n\n promise\n .then((res): void => {\n clearTimeout(timer);\n resolve(res);\n })\n .catch((err): void => {\n clearTimeout(timer);\n reject(err);\n });\n });\n\n const cancelTimer = (): void => {\n clearTimeout(timer);\n };\n\n return {\n promise: promiseTimer,\n cancel: cancelTimer\n };\n};\n\nexport default promiseTimeout;\n"],"names":["promiseTimeout","ms","promise","timeOutObject","timer","Promise","resolve","reject","setTimeout","then","res","clearTimeout","catch","err","cancel"],"mappings":"AAOA,MAAMA,EAAiB,CAAIC,EAAYC,EAAqBC,KACxD,IAAIC,EAuBJ,MAAO,CACHF,QAtB6B,IAAIG,QAAQ,CAACC,EAASC,KAEnDH,EAAQI,WAAW,KACfD,EAAOJ,IACRF,GAEHC,EACKO,KAAMC,IACHC,aAAaP,GACbE,EAAQI,KAEXE,MAAOC,IACJF,aAAaP,GACbG,EAAOM,OAUfC,OANgB,KAChBH,aAAaP"}
|
|
@@ -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/ANCVInput.js";import o from"./components/ANCVAwait/config.js";import{Await as n}from"../internal/Await/Await.js";import s from"../../core/Errors/AdyenCheckoutError.js";import i from"../internal/PayButton/PayButton.js";import{sanitizeResponse as a,verifyPaymentDidNotFail as p}from"../internal/UIElement/utils.js";function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e}(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}class
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/ANCVInput.js";import o from"./components/ANCVAwait/config.js";import{Await as n}from"../internal/Await/Await.js";import s from"../../core/Errors/AdyenCheckoutError.js";import i from"../internal/PayButton/PayButton.js";import{sanitizeResponse as a,verifyPaymentDidNotFail as p}from"../internal/UIElement/utils.js";function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e}(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}class m extends e{formatData(){var t;return{paymentMethod:{type:m.type,beneficiaryId:null===(t=this.state.data)||void 0===t?void 0:t.beneficiaryId}}}submit(){if(!this.isValid)return this.showValidation(),!1;this.createOrder().then(this.makePaymentsCall).then(a).then(p).then(this.handleResponse).catch(this.handleFailedResult)}get isValid(){return!!this.state.isValid}get displayName(){return this.props.name}componentToRender(){return this.props.paymentData?t(n,{clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.props.onError,onComplete:this.onComplete,brandLogo:this.icon,brandName:this.displayName,type:this.constructor.type,messageText:this.props.i18n.get("ancv.confirmPayment"),awaitText:this.props.i18n.get("await.waitForConfirmation"),showCountdownTimer:o.showCountdownTimer,throttleTime:o.THROTTLE_TIME,throttleInterval:o.THROTTLE_INTERVAL,onActionHandled:this.onActionHandled}):t(r,h(function(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){c(t,e,r[e])})}return t}({},this.props),{setComponentRef:this.setComponentRef,onSubmit:this.submit,onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton}))}constructor(...e){super(...e),c(this,"onOrderRequest",t=>this.props.onOrderRequest?new Promise((e,r)=>{this.props.onOrderRequest(e,r,t)}):this.props.session?this.props.session.createOrder():void 0),c(this,"createOrder",()=>(this.setStatus("loading"),this.props.order?Promise.resolve():this.onOrderRequest(this.data).then(t=>{const e={order:{orderData:t.orderData,pspReference:t.pspReference}};return this.setState(e),Promise.resolve()}).catch(t=>{t instanceof s?this.handleError(t):this.handleError(new s("ERROR",t))}))),c(this,"payButton",e=>t(i,e))}}c(m,"type","ancv");export{m as ANCVElement,m as default};
|
|
2
2
|
//# sourceMappingURL=ANCV.js.map
|