@adyen/adyen-web 6.41.0 → 6.42.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 +48 -33
- 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/utils/paymentMethodsAnalytics.js +2 -0
- package/dist/es/components/Dropin/utils/paymentMethodsAnalytics.js.map +1 -0
- 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/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/constants.js +1 -1
- package/dist/es/components/ThreeDS2/constants.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/Address/validate.formats.js +1 -1
- package/dist/es/components/internal/Address/validate.formats.js.map +1 -1
- package/dist/es/components/internal/Address/validate.js +1 -1
- package/dist/es/components/internal/Address/validate.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/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/ClickToPay/context/ClickToPayProvider.js +1 -1
- package/dist/es/components/internal/ClickToPay/context/ClickToPayProvider.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/IFrame/Iframe.js +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
- package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.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/AnalyticsInfoEvent.js +1 -1
- package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
- package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/index.d.ts +48 -33
- package/dist/es/utils/validator-utils.js +1 -1
- package/dist/es/utils/validator-utils.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/utils/paymentMethodsAnalytics.js +2 -0
- package/dist/es-legacy/components/Dropin/utils/paymentMethodsAnalytics.js.map +1 -0
- 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/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/constants.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/validate.formats.js +1 -1
- package/dist/es-legacy/components/internal/Address/validate.formats.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/validate.js +1 -1
- package/dist/es-legacy/components/internal/Address/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es-legacy/components/internal/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/ClickToPay/context/ClickToPayProvider.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/context/ClickToPayProvider.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/IFrame/Iframe.js +1 -1
- package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.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/AnalyticsInfoEvent.js +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/utils/validator-utils.js +1 -1
- package/dist/es-legacy/utils/validator-utils.js.map +1 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionTypes.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/actionTypes.ts"],"sourcesContent":["import { get3DS2FlowProps } from '../../../components/ThreeDS2/components/utils';\nimport uuid from '../../../utils/uuid';\nimport type { StatusFromAction, ThreeDS2ActionProps, UIElement, UIElementProps } from '../../../types';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\nimport type { ThreeDS2ConfigProps } from '../../../types';\nimport type { ActionHandlerConfig } from './types';\n\nconst createComponent = (core: ICore, registry: IRegistry, componentType: string, props: ActionHandlerConfig | ThreeDS2ConfigProps): UIElement => {\n const Element = registry.getComponent(componentType);\n\n if (!Element) {\n throw Error(`Action Element of type ${componentType} not found in the registry`);\n }\n\n const element = new Element(core, { ...props, id: `${componentType}-${uuid()}` });\n return element;\n};\n\nconst getActionHandler = (statusType: StatusFromAction) => {\n return (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps): UIElement => {\n const config: ActionHandlerConfig = {\n ...props,\n ...action,\n onError: props.onError,\n statusType,\n originalAction: action\n };\n\n return createComponent(core, registry, action.paymentMethodType, config);\n };\n};\n\nconst actionTypes = {\n redirect: (core: ICore, registry, action: PaymentAction, props: UIElementProps): UIElement => {\n const config: ActionHandlerConfig = {\n ...props,\n ...action,\n statusType: 'redirect',\n originalAction: action\n };\n\n return createComponent(core, registry, 'redirect', config);\n },\n\n threeDS2: (core: ICore, registry, action: PaymentAction, props: ThreeDS2ActionProps): UIElement => {\n const componentType = action.subtype === 'fingerprint' ? 'threeDS2DeviceFingerprint' : 'threeDS2Challenge';\n\n /**\n * NOTE: the isMDFlow prop comes from the options object, added within the MDFlow when it calls createFromAction(action, options) to initiate a 3DS2 component\n * It replaces the useOriginalFlow config prop that the MDFlow used to pass when directly initiating the threeDS2Fingerprint or threeDS2Challenge components\n */\n const paymentData = action.subtype === 'fingerprint' || props.isMDFlow ? action.paymentData : action.authorisationToken;\n\n const config: ThreeDS2ConfigProps = {\n // Props common to both flows\n core,\n token: action.token,\n paymentData,\n onActionHandled: props.onActionHandled,\n on3DS2RedirectFlowComplete: props.on3DS2RedirectFlowComplete, // NOTE: We only ever expect props.on3DS2RedirectFlowComplete to be defined for the MDFlow\n onAdditionalDetails: props.onAdditionalDetails, // Needed to prevent regression in v6.24.0 re. supporting onAdditionalDetails being directly set on Card component (in v7 we will *not* allow this, & this line can be removed)\n onError: props.onError,\n isDropin: !!props.isDropin,\n loadingContext: props.loadingContext,\n clientKey: props.clientKey,\n paymentMethodType: props.paymentMethodType,\n challengeWindowSize: props.challengeWindowSize, // always pass challengeWindowSize in case it's been set directly in the handleAction config object\n isMDFlow: props.isMDFlow,\n modules: {\n analytics: props.modules?.analytics,\n resources: props.modules?.resources\n },\n\n // Props unique to a particular flow\n ...get3DS2FlowProps(action.subtype, props)\n };\n\n return createComponent(core, registry, componentType, config);\n },\n\n voucher: getActionHandler('custom'),\n qrCode: getActionHandler('custom'),\n await: getActionHandler('custom'),\n bankTransfer: getActionHandler('custom'),\n sdk: getActionHandler('custom')\n} as const;\n\nexport default actionTypes;\n"],"names":["createComponent","core","registry","componentType","props","Element","getComponent","Error","id","uuid","getActionHandler","statusType","action","config","onError","originalAction","paymentMethodType","actionTypes","redirect","threeDS2","subtype","paymentData","isMDFlow","authorisationToken","token","onActionHandled","on3DS2RedirectFlowComplete","onAdditionalDetails","isDropin","loadingContext","clientKey","challengeWindowSize","modules","analytics","resources","get3DS2FlowProps","voucher","qrCode","await","bankTransfer","sdk"],"mappings":"0HASA,MAAMA,EAAkB,CAACC,EAAaC,EAAqBC,EAAuBC,KAC9E,MAAMC,EAAUH,EAASI,aAAaH,GAEtC,IAAKE,EACD,MAAME,MAAM,0BAA0BJ,+BAI1C,OADgB,IAAIE,EAAQJ,EAAM,IAAKG,EAAOI,GAAI,GAAGL,KAAiBM,SAIpEC,EAAoBC,GACf,CAACV,EAAaC,EAAqBU,EAAuBR,KAC7D,MAAMS,EAA8B,IAC7BT,KACAQ,EACHE,QAASV,EAAMU,QACfH,aACAI,eAAgBH,GAGpB,OAAOZ,EAAgBC,EAAMC,EAAUU,EAAOI,kBAAmBH,IAInEI,EAAc,CAChBC,SAAU,CAACjB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMS,EAA8B,IAC7BT,KACAQ,EACHD,WAAY,WACZI,eAAgBH,GAGpB,OAAOZ,EAAgBC,EAAMC,EAAU,WAAYW,IAGvDM,SAAU,CAAClB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMD,EAAmC,gBAAnBS,EAAOQ,QAA4B,4BAA8B,oBAMjFC,EAAiC,gBAAnBT,EAAOQ,SAA6BhB,EAAMkB,SAAWV,EAAOS,YAAcT,EAAOW,mBAE/FV,EAA8B,CAEhCZ,OACAuB,MAAOZ,EAAOY,MACdH,cACAI,gBAAiBrB,EAAMqB,gBACvBC,2BAA4BtB,EAAMsB,2BAClCC,oBAAqBvB,EAAMuB,oBAC3Bb,QAASV,EAAMU,QACfc,WAAYxB,EAAMwB,SAClBC,eAAgBzB,EAAMyB,eACtBC,UAAW1B,EAAM0B,UACjBd,kBAAmBZ,EAAMY,kBACzBe,oBAAqB3B,EAAM2B,
|
|
1
|
+
{"version":3,"file":"actionTypes.js","sources":["../../../../../src/core/ProcessResponse/PaymentAction/actionTypes.ts"],"sourcesContent":["import { get3DS2FlowProps } from '../../../components/ThreeDS2/components/utils';\nimport uuid from '../../../utils/uuid';\nimport type { StatusFromAction, ThreeDS2ActionProps, UIElement, UIElementProps } from '../../../types';\nimport type { PaymentAction } from '../../../types/global-types';\nimport type { IRegistry } from '../../core.registry';\nimport type { ICore } from '../../types';\nimport type { ThreeDS2ConfigProps } from '../../../types';\nimport type { ActionHandlerConfig } from './types';\n\nconst createComponent = (core: ICore, registry: IRegistry, componentType: string, props: ActionHandlerConfig | ThreeDS2ConfigProps): UIElement => {\n const Element = registry.getComponent(componentType);\n\n if (!Element) {\n throw Error(`Action Element of type ${componentType} not found in the registry`);\n }\n\n const element = new Element(core, { ...props, id: `${componentType}-${uuid()}` });\n return element;\n};\n\nconst getActionHandler = (statusType: StatusFromAction) => {\n return (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps): UIElement => {\n const config: ActionHandlerConfig = {\n ...props,\n ...action,\n onError: props.onError,\n statusType,\n originalAction: action\n };\n\n return createComponent(core, registry, action.paymentMethodType, config);\n };\n};\n\nconst actionTypes = {\n redirect: (core: ICore, registry, action: PaymentAction, props: UIElementProps): UIElement => {\n const config: ActionHandlerConfig = {\n ...props,\n ...action,\n statusType: 'redirect',\n originalAction: action\n };\n\n return createComponent(core, registry, 'redirect', config);\n },\n\n threeDS2: (core: ICore, registry, action: PaymentAction, props: ThreeDS2ActionProps): UIElement => {\n const componentType = action.subtype === 'fingerprint' ? 'threeDS2DeviceFingerprint' : 'threeDS2Challenge';\n\n /**\n * NOTE: the isMDFlow prop comes from the options object, added within the MDFlow when it calls createFromAction(action, options) to initiate a 3DS2 component\n * It replaces the useOriginalFlow config prop that the MDFlow used to pass when directly initiating the threeDS2Fingerprint or threeDS2Challenge components\n */\n const paymentData = action.subtype === 'fingerprint' || props.isMDFlow ? action.paymentData : action.authorisationToken;\n\n const config: ThreeDS2ConfigProps = {\n // Props common to both flows\n core,\n token: action.token,\n paymentData,\n onActionHandled: props.onActionHandled,\n on3DS2RedirectFlowComplete: props.on3DS2RedirectFlowComplete, // NOTE: We only ever expect props.on3DS2RedirectFlowComplete to be defined for the MDFlow\n onAdditionalDetails: props.onAdditionalDetails, // Needed to prevent regression in v6.24.0 re. supporting onAdditionalDetails being directly set on Card component (in v7 we will *not* allow this, & this line can be removed)\n onError: props.onError,\n isDropin: !!props.isDropin,\n loadingContext: props.loadingContext,\n clientKey: props.clientKey,\n paymentMethodType: props.paymentMethodType,\n challengeWindowSize: props.challengeWindowSize, // always pass challengeWindowSize in case it's been set directly in the handleAction config object\n usePasskeyIFrameAttributes: props.usePasskeyIFrameAttributes,\n isMDFlow: props.isMDFlow,\n modules: {\n analytics: props.modules?.analytics,\n resources: props.modules?.resources\n },\n\n // Props unique to a particular flow\n ...get3DS2FlowProps(action.subtype, props)\n };\n\n return createComponent(core, registry, componentType, config);\n },\n\n voucher: getActionHandler('custom'),\n qrCode: getActionHandler('custom'),\n await: getActionHandler('custom'),\n bankTransfer: getActionHandler('custom'),\n sdk: getActionHandler('custom')\n} as const;\n\nexport default actionTypes;\n"],"names":["createComponent","core","registry","componentType","props","Element","getComponent","Error","id","uuid","getActionHandler","statusType","action","config","onError","originalAction","paymentMethodType","actionTypes","redirect","threeDS2","subtype","paymentData","isMDFlow","authorisationToken","token","onActionHandled","on3DS2RedirectFlowComplete","onAdditionalDetails","isDropin","loadingContext","clientKey","challengeWindowSize","usePasskeyIFrameAttributes","modules","analytics","resources","get3DS2FlowProps","voucher","qrCode","await","bankTransfer","sdk"],"mappings":"0HASA,MAAMA,EAAkB,CAACC,EAAaC,EAAqBC,EAAuBC,KAC9E,MAAMC,EAAUH,EAASI,aAAaH,GAEtC,IAAKE,EACD,MAAME,MAAM,0BAA0BJ,+BAI1C,OADgB,IAAIE,EAAQJ,EAAM,IAAKG,EAAOI,GAAI,GAAGL,KAAiBM,SAIpEC,EAAoBC,GACf,CAACV,EAAaC,EAAqBU,EAAuBR,KAC7D,MAAMS,EAA8B,IAC7BT,KACAQ,EACHE,QAASV,EAAMU,QACfH,aACAI,eAAgBH,GAGpB,OAAOZ,EAAgBC,EAAMC,EAAUU,EAAOI,kBAAmBH,IAInEI,EAAc,CAChBC,SAAU,CAACjB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMS,EAA8B,IAC7BT,KACAQ,EACHD,WAAY,WACZI,eAAgBH,GAGpB,OAAOZ,EAAgBC,EAAMC,EAAU,WAAYW,IAGvDM,SAAU,CAAClB,EAAaC,EAAUU,EAAuBR,KACrD,MAAMD,EAAmC,gBAAnBS,EAAOQ,QAA4B,4BAA8B,oBAMjFC,EAAiC,gBAAnBT,EAAOQ,SAA6BhB,EAAMkB,SAAWV,EAAOS,YAAcT,EAAOW,mBAE/FV,EAA8B,CAEhCZ,OACAuB,MAAOZ,EAAOY,MACdH,cACAI,gBAAiBrB,EAAMqB,gBACvBC,2BAA4BtB,EAAMsB,2BAClCC,oBAAqBvB,EAAMuB,oBAC3Bb,QAASV,EAAMU,QACfc,WAAYxB,EAAMwB,SAClBC,eAAgBzB,EAAMyB,eACtBC,UAAW1B,EAAM0B,UACjBd,kBAAmBZ,EAAMY,kBACzBe,oBAAqB3B,EAAM2B,oBAC3BC,2BAA4B5B,EAAM4B,2BAClCV,SAAUlB,EAAMkB,SAChBW,QAAS,CACLC,UAAW9B,EAAM6B,SAASC,UAC1BC,UAAW/B,EAAM6B,SAASE,cAI3BC,EAAiBxB,EAAOQ,QAAShB,IAGxC,OAAOJ,EAAgBC,EAAMC,EAAUC,EAAeU,IAG1DwB,QAAS3B,EAAiB,UAC1B4B,OAAQ5B,EAAiB,UACzB6B,MAAO7B,EAAiB,UACxB8B,aAAc9B,EAAiB,UAC/B+B,IAAK/B,EAAiB"}
|
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.42.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
|
|
4
|
+
import { h, TargetedMouseEvent, Ref, RefObject, Component, ComponentChildren, FunctionComponent, ComponentChild } from 'preact';
|
|
5
5
|
import { OrderResponseBody, OnShippingAddressChangeData, OnShippingOptionsChangeData, OnInitActions } from '@paypal/paypal-js';
|
|
6
6
|
|
|
7
7
|
interface ILanguageService {
|
|
@@ -290,6 +290,7 @@ interface ButtonProps {
|
|
|
290
290
|
complete?: () => void;
|
|
291
291
|
}) => void;
|
|
292
292
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
293
|
+
onKeyPress?: (event: KeyboardEvent) => void;
|
|
293
294
|
buttonRef?: Ref<HTMLButtonElement>;
|
|
294
295
|
onMouseEnter?: (event: MouseEvent) => void;
|
|
295
296
|
onMouseLeave?: (event: MouseEvent) => void;
|
|
@@ -1465,24 +1466,24 @@ type GiftcardFieldsProps = {
|
|
|
1465
1466
|
*/
|
|
1466
1467
|
declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
1467
1468
|
private csfLoadFailTimeout;
|
|
1468
|
-
private
|
|
1469
|
-
private
|
|
1470
|
-
private
|
|
1469
|
+
private csfLoadFailTimeoutMS;
|
|
1470
|
+
private csfConfigFailTimeout;
|
|
1471
|
+
private csfConfigFailTimeoutMS;
|
|
1471
1472
|
private numCharsInField;
|
|
1472
1473
|
private rootNode;
|
|
1473
1474
|
private numDateFields;
|
|
1474
1475
|
private csf;
|
|
1475
|
-
private
|
|
1476
|
-
private
|
|
1477
|
-
private
|
|
1478
|
-
private
|
|
1479
|
-
private
|
|
1480
|
-
private
|
|
1481
|
-
private
|
|
1482
|
-
private
|
|
1483
|
-
private
|
|
1484
|
-
private
|
|
1485
|
-
private
|
|
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 handleKeyPressed;
|
|
1486
1487
|
state: SFPState;
|
|
1487
1488
|
props: SFPProps;
|
|
1488
1489
|
private issuingCountryCode;
|
|
@@ -1506,7 +1507,7 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
|
1506
1507
|
onBinValue: () => void;
|
|
1507
1508
|
onFocus: () => void;
|
|
1508
1509
|
onAutoComplete: () => void;
|
|
1509
|
-
|
|
1510
|
+
handleKeyPress: () => void;
|
|
1510
1511
|
styles: {};
|
|
1511
1512
|
};
|
|
1512
1513
|
componentDidMount(): void;
|
|
@@ -1566,7 +1567,7 @@ interface SFPProps {
|
|
|
1566
1567
|
onLoad?: (cbObj: CardLoadData) => void;
|
|
1567
1568
|
onStateUpdate?: (obj: SFPState) => void;
|
|
1568
1569
|
onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
|
|
1569
|
-
|
|
1570
|
+
handleKeyPress?: (obj: KeyboardEvent) => void;
|
|
1570
1571
|
rootNode?: HTMLElement;
|
|
1571
1572
|
showWarnings?: boolean;
|
|
1572
1573
|
styles?: StylesObject;
|
|
@@ -1685,8 +1686,8 @@ interface CardAutoCompleteData {
|
|
|
1685
1686
|
}
|
|
1686
1687
|
interface CardBinLookupData {
|
|
1687
1688
|
type?: string;
|
|
1688
|
-
detectedBrands?: string[];
|
|
1689
|
-
supportedBrands?: string[];
|
|
1689
|
+
detectedBrands?: string[] | null;
|
|
1690
|
+
supportedBrands?: string[] | null;
|
|
1690
1691
|
brands?: string[];
|
|
1691
1692
|
issuingCountryCode?: string;
|
|
1692
1693
|
healthcare?: Record<string, boolean>[];
|
|
@@ -1694,6 +1695,7 @@ interface CardBinLookupData {
|
|
|
1694
1695
|
rootNode?: HTMLElement;
|
|
1695
1696
|
isReset?: boolean;
|
|
1696
1697
|
dualBrandingType?: string;
|
|
1698
|
+
paymentMethodVariants?: (string | undefined)[];
|
|
1697
1699
|
}
|
|
1698
1700
|
interface CardBinValueData {
|
|
1699
1701
|
type: string;
|
|
@@ -1840,6 +1842,12 @@ interface ThreeDS2Configuration extends UIElementProps {
|
|
|
1840
1842
|
token?: string;
|
|
1841
1843
|
type?: string;
|
|
1842
1844
|
challengeWindowSize?: ChallengeWindowSize;
|
|
1845
|
+
/**
|
|
1846
|
+
* @internal Visa Passkey only. Requires isMDFlow.
|
|
1847
|
+
* When true, adds sandbox and allow attributes to the challenge iframe
|
|
1848
|
+
* for WebAuthn credential creation/retrieval.
|
|
1849
|
+
*/
|
|
1850
|
+
usePasskeyIFrameAttributes?: boolean;
|
|
1843
1851
|
}
|
|
1844
1852
|
interface ThreeDS2DeviceFingerprintConfiguration extends ThreeDS2Configuration {
|
|
1845
1853
|
clientKey?: string;
|
|
@@ -1955,6 +1963,12 @@ type ThreeDS2ConfigProps = {
|
|
|
1955
1963
|
readonly clientKey: string;
|
|
1956
1964
|
readonly paymentMethodType: string;
|
|
1957
1965
|
readonly challengeWindowSize?: ChallengeWindowSize;
|
|
1966
|
+
/**
|
|
1967
|
+
* @internal Visa Passkey only. Requires isMDFlow.
|
|
1968
|
+
* When true, adds sandbox and allow attributes to the challenge iframe
|
|
1969
|
+
* for WebAuthn credential creation/retrieval.
|
|
1970
|
+
*/
|
|
1971
|
+
readonly usePasskeyIFrameAttributes?: boolean;
|
|
1958
1972
|
readonly isMDFlow?: boolean;
|
|
1959
1973
|
readonly modules?: {
|
|
1960
1974
|
readonly analytics?: IAnalytics;
|
|
@@ -1965,7 +1979,7 @@ type ThreeDS2ConfigProps = {
|
|
|
1965
1979
|
readonly elementRef?: UIElement;
|
|
1966
1980
|
readonly i18n?: Language;
|
|
1967
1981
|
};
|
|
1968
|
-
type ThreeDS2ActionProps = CardConfiguration & Pick<ThreeDS2ConfigProps, 'isMDFlow' | 'on3DS2RedirectFlowComplete'>;
|
|
1982
|
+
type ThreeDS2ActionProps = CardConfiguration & Pick<ThreeDS2ConfigProps, 'isMDFlow' | 'on3DS2RedirectFlowComplete' | 'usePasskeyIFrameAttributes'>;
|
|
1969
1983
|
|
|
1970
1984
|
type CoreCallbacks$1 = Pick<CoreConfiguration, 'beforeRedirect' | 'beforeSubmit' | 'onSubmit' | 'onAdditionalDetails' | 'onPaymentFailed' | 'onPaymentCompleted' | 'onChange' | 'onActionHandled' | 'onError' | 'onEnterKeyPressed'>;
|
|
1971
1985
|
type CustomCardConfiguration = CoreCallbacks$1 & {
|
|
@@ -4316,7 +4330,7 @@ interface GiftcardComponentProps extends Partial<Pick<SFPProps, 'clientKey' | 'l
|
|
|
4316
4330
|
expiryDateRequired?: boolean;
|
|
4317
4331
|
fieldsLayoutComponent: FunctionComponent<GiftcardFieldsProps>;
|
|
4318
4332
|
placeholders?: Placeholders$1;
|
|
4319
|
-
|
|
4333
|
+
handleKeyPress?: (o: KeyboardEvent) => void;
|
|
4320
4334
|
onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
|
|
4321
4335
|
}
|
|
4322
4336
|
declare class Giftcard extends Component<Readonly<GiftcardComponentProps>> {
|
|
@@ -6372,6 +6386,7 @@ type NonMappedPaymentMethodsMap = {
|
|
|
6372
6386
|
[key: string]: any;
|
|
6373
6387
|
};
|
|
6374
6388
|
type PaymentMethodsConfiguration = PaymentMethodsConfigurationMap & PaymentActionTypesMap & NonMappedPaymentMethodsMap;
|
|
6389
|
+
type PaymentMethodDisplayMode = 'fastlane' | 'instant' | 'stored' | 'regular';
|
|
6375
6390
|
type InstantPaymentTypes = 'paywithgoogle' | 'googlepay' | 'applepay';
|
|
6376
6391
|
interface DropinConfiguration extends UIElementProps {
|
|
6377
6392
|
/**
|
|
@@ -7157,8 +7172,8 @@ declare abstract class BaseElement<P extends BaseElementProps> implements IBaseE
|
|
|
7157
7172
|
* Returns the component data necessary for the /payments request
|
|
7158
7173
|
*/
|
|
7159
7174
|
protected formatData(): any;
|
|
7160
|
-
protected submitAnalytics(
|
|
7161
|
-
protected
|
|
7175
|
+
protected submitAnalytics(analyticsObj?: AbstractAnalyticsEvent): any;
|
|
7176
|
+
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>): any;
|
|
7162
7177
|
protected setState(newState: object): void;
|
|
7163
7178
|
/**
|
|
7164
7179
|
* Returns the component payment data ready to submit to the Checkout API
|
|
@@ -7299,9 +7314,9 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
|
|
|
7299
7314
|
* @param response -
|
|
7300
7315
|
*/
|
|
7301
7316
|
protected handleResponse(response: PaymentResponseData): void;
|
|
7302
|
-
protected
|
|
7317
|
+
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent): void;
|
|
7303
7318
|
/**
|
|
7304
|
-
* Handle Enter key pressed from a UIElement (called via
|
|
7319
|
+
* Handle Enter key pressed from a UIElement (called via handleKeyPress)
|
|
7305
7320
|
* @param obj
|
|
7306
7321
|
*/
|
|
7307
7322
|
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
|
|
@@ -8121,7 +8136,7 @@ declare class CardElement extends UIElement<CardConfiguration> {
|
|
|
8121
8136
|
constructor(checkout: ICore, props?: CardConfiguration);
|
|
8122
8137
|
protected static readonly defaultProps: any;
|
|
8123
8138
|
setStatus(status: UIElementStatus, props?: any): this;
|
|
8124
|
-
private setClickToPayRef;
|
|
8139
|
+
private readonly setClickToPayRef;
|
|
8125
8140
|
protected getPaymentMethodConfigFromResponse(componentProps: CardConfiguration): RawPaymentMethod;
|
|
8126
8141
|
formatProps(props: CardConfiguration): CardConfiguration;
|
|
8127
8142
|
/**
|
|
@@ -8132,13 +8147,13 @@ declare class CardElement extends UIElement<CardConfiguration> {
|
|
|
8132
8147
|
updateStyles(stylesObj: any): this;
|
|
8133
8148
|
setFocusOn(fieldName: any): this;
|
|
8134
8149
|
onBrand: (event: any) => void;
|
|
8135
|
-
processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset?: boolean): this;
|
|
8150
|
+
processBinLookupResponse(binLookupResponse: BinLookupResponse | null, isReset?: boolean): this;
|
|
8136
8151
|
handleUnsupportedCard(errObj: any): this;
|
|
8137
|
-
private handleClickToPaySubmit;
|
|
8152
|
+
private readonly handleClickToPaySubmit;
|
|
8138
8153
|
onBinLookup(obj: CardBinLookupData): void;
|
|
8139
|
-
private onConfigSuccess;
|
|
8140
|
-
private onFocus;
|
|
8141
|
-
private onBlur;
|
|
8154
|
+
private readonly onConfigSuccess;
|
|
8155
|
+
private readonly onFocus;
|
|
8156
|
+
private readonly onBlur;
|
|
8142
8157
|
onBinValue: (callbackObj: CardBinValueData) => void;
|
|
8143
8158
|
get storePaymentMethodPayload(): {
|
|
8144
8159
|
storePaymentMethod?: undefined;
|
|
@@ -8395,7 +8410,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
|
|
|
8395
8410
|
*/
|
|
8396
8411
|
protected handleOrder: ({ order }: PaymentResponseData) => void;
|
|
8397
8412
|
closeActivePaymentMethod(): void;
|
|
8398
|
-
protected
|
|
8413
|
+
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement> | KeyboardEvent): void;
|
|
8399
8414
|
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
|
|
8400
8415
|
protected componentToRender(): h.JSX.Element;
|
|
8401
8416
|
}
|
|
@@ -8721,4 +8736,4 @@ declare namespace AdyenCheckout {
|
|
|
8721
8736
|
}
|
|
8722
8737
|
|
|
8723
8738
|
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 };
|
|
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 };
|
|
8739
|
+
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, PaymentMethodDisplayMode, 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=(t,e,r
|
|
1
|
+
const t=(t,e,n,r)=>{if(t[n]?.[e]?.formatterFn)return null;const l=t[n]?.[e]?.maxlength;return l||30},e=t=>!(null!=t&&!/^[\s]*$/.test(t)),n="?\\+_=!@#$%^&*(){}~<>\\[\\]\\\\",r=(t,e="g")=>new RegExp(`[${t}]`,e),l=t=>t.trim().replace(/\s+/g," ");export{n as SPECIAL_CHARS,r as getFormattingRegEx,t as getMaxLengthByFieldAndCountry,e as isEmpty,l as trimValWithOneSpace};
|
|
2
2
|
//# sourceMappingURL=validator-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator-utils.js","sources":["../../../src/utils/validator-utils.ts"],"sourcesContent":["import { CountryFormatRules } from './Validator/types';\n\nconst MAX_LENGTH = 30;\n\nexport const getMaxLengthByFieldAndCountry = (\n formattingRules: CountryFormatRules,\n field: string,\n country: string,\n ignoreIfFormatterExists: boolean\n): number | null => {\n // In ignoreIfFormatterExists is true we expect the formatter function to also act to limit length\n if (ignoreIfFormatterExists && formattingRules[country]?.[field]?.formatterFn) {\n return null;\n }\n const maxLength = formattingRules[country]?.[field]?.maxlength;\n return maxLength ? maxLength : MAX_LENGTH;\n};\n\n// Not null or undefined or only spaces\nexport const isEmpty = (input: string) => !!(input == null || /^[\\s]*$/.test(input));\n\nexport const isString = (input: unknown) => typeof input === 'string' || input instanceof String;\nexport const hasText = (input: string) => isString(input) && !isEmpty(input);\n\nexport const SPECIAL_CHARS = '?\\\\+_=!@#$%^&*(){}~<>\\\\[\\\\]\\\\\\\\'; // N.B. difficulty escaping \\ (takes 3 backslashes!)\n\n// Generates a regEx ideal for use in a String.replace call for use in a formatter\n// e.g. getFormattingRegEx('^\\\\d', 'g') will generate: /[^\\d]/g which is a regEx to match anything that is not a digit\nexport const getFormattingRegEx = (specChars: string, flags = 'g') => new RegExp(`[${specChars}]`, flags);\n\n// Creates a regEx ideal for use in a RegExp.test call for use in a validator\nexport const getValidatingRegEx = (specChars: string, exclude: boolean) => new RegExp(`^[${exclude ? '^' : ''}${specChars}]+$`);\n\nexport const CHARACTER_PATTERNS: { [key: string]: RegExp } = {\n digitsHyphen: /^[\\d-]+$/,\n noHtml: /^[^<>&]+$/,\n alphaNum: /^\\d[a-zA-Z0-9]{6,11}$/,\n noSpecialChars: getValidatingRegEx(SPECIAL_CHARS, true)\n};\n\nexport const exactLength = (input: string, length: number) => {\n if (isEmpty(input)) {\n return true;\n }\n return input.length === length;\n};\n\nexport const validateForSpecialChars = (name: string) => {\n const hasNoLength = !name.length;\n // RegEx .test, if run against empty string, will return false\n return CHARACTER_PATTERNS.noSpecialChars.test(name) || hasNoLength;\n};\n\n// Trim
|
|
1
|
+
{"version":3,"file":"validator-utils.js","sources":["../../../src/utils/validator-utils.ts"],"sourcesContent":["import { CountryFormatRules } from './Validator/types';\n\nconst MAX_LENGTH = 30;\n\nexport const getMaxLengthByFieldAndCountry = (\n formattingRules: CountryFormatRules,\n field: string,\n country: string,\n ignoreIfFormatterExists: boolean\n): number | null => {\n // In ignoreIfFormatterExists is true we expect the formatter function to also act to limit length\n if (ignoreIfFormatterExists && formattingRules[country]?.[field]?.formatterFn) {\n return null;\n }\n const maxLength = formattingRules[country]?.[field]?.maxlength;\n return maxLength ? maxLength : MAX_LENGTH;\n};\n\n// Not null or undefined or only spaces\nexport const isEmpty = (input: string) => !!(input == null || /^[\\s]*$/.test(input));\n\nexport const isString = (input: unknown) => typeof input === 'string' || input instanceof String;\nexport const hasText = (input: string) => isString(input) && !isEmpty(input);\n\nexport const SPECIAL_CHARS = '?\\\\+_=!@#$%^&*(){}~<>\\\\[\\\\]\\\\\\\\'; // N.B. difficulty escaping \\ (takes 3 backslashes!)\n\n// Generates a regEx ideal for use in a String.replace call for use in a formatter\n// e.g. getFormattingRegEx('^\\\\d', 'g') will generate: /[^\\d]/g which is a regEx to match anything that is not a digit\nexport const getFormattingRegEx = (specChars: string, flags = 'g') => new RegExp(`[${specChars}]`, flags);\n\n// Creates a regEx ideal for use in a RegExp.test call for use in a validator\nexport const getValidatingRegEx = (specChars: string, exclude: boolean) => new RegExp(`^[${exclude ? '^' : ''}${specChars}]+$`);\n\nexport const CHARACTER_PATTERNS: { [key: string]: RegExp } = {\n digitsHyphen: /^[\\d-]+$/,\n noHtml: /^[^<>&]+$/,\n alphaNum: /^\\d[a-zA-Z0-9]{6,11}$/,\n noSpecialChars: getValidatingRegEx(SPECIAL_CHARS, true)\n};\n\nexport const exactLength = (input: string, length: number) => {\n if (isEmpty(input)) {\n return true;\n }\n return input.length === length;\n};\n\nexport const validateForSpecialChars = (name: string) => {\n const hasNoLength = !name.length;\n // RegEx .test, if run against empty string, will return false\n return CHARACTER_PATTERNS.noSpecialChars.test(name) || hasNoLength;\n};\n\n// Trim both ends and never allow more than 1 space in between\nexport const trimValWithOneSpace = (val: string) => val.trim().replace(/\\s+/g, ' ');\n"],"names":["getMaxLengthByFieldAndCountry","formattingRules","field","country","ignoreIfFormatterExists","formatterFn","maxLength","maxlength","isEmpty","input","test","SPECIAL_CHARS","getFormattingRegEx","specChars","flags","RegExp","trimValWithOneSpace","val","trim","replace"],"mappings":"AAEA,MAEaA,EAAgC,CACzCC,EACAC,EACAC,EACAC,KAGA,GAA+BH,EAAgBE,KAAWD,IAAQG,YAC9D,OAAO,KAEX,MAAMC,EAAYL,EAAgBE,KAAWD,IAAQK,UACrD,OAAOD,GAbQ,IAiBNE,EAAWC,KAA8B,MAATA,IAAiB,UAAUC,KAAKD,IAKhEE,EAAgB,kCAIhBC,EAAqB,CAACC,EAAmBC,EAAQ,MAAQ,IAAIC,OAAO,IAAIF,KAAcC,GA0BtFE,EAAuBC,GAAgBA,EAAIC,OAAOC,QAAQ,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import e from"../../utils/browserInfo.js";import n from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i,isSecuredField as s}from"../internal/SecuredFields/utils.js";import{reject as r,notFalsy as a}from"../../utils/commonUtils.js";import{shouldIncludeInstallmentsInPaymentData as l}from"./components/CardInput/utils.js";import d from"../internal/ClickToPay/services/create-clicktopay-service.js";import u from"./components/ClickToPayWrapper.js";import{TxVariants as c}from"../tx-variants.js";import{UIElement as p}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import m,{IMPLEMENTATION_ERROR as y}from"../../core/Errors/AdyenCheckoutError.js";import f from"./components/CardInput/defaultProps.js";import{AnalyticsInfoEvent as v,InfoEventType as b}from"../../core/Analytics/events/AnalyticsInfoEvent.js";function g(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function P(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.forEach(function(o){g(t,o,e[o])})}return t}function C(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):function(t){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);o.push.apply(o,e)}return o}(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}class S extends p{setStatus(t,o){var e,n;return(null===(e=this.componentRef)||void 0===e?void 0:e.setStatus)&&this.componentRef.setStatus(t,o),(null===(n=this.clickToPayRef)||void 0===n?void 0:n.setStatus)&&this.clickToPayRef.setStatus(t,o),this}getPaymentMethodConfigFromResponse(t){var o;return(null==t?void 0:t.fundingSource)?null===(o=this.core.paymentMethodsResponse)||void 0===o?void 0:o.findByFundingSource(t.type,t.fundingSource):super.getPaymentMethodConfigFromResponse(t)}formatProps(t){var o,e,n,i,s,r,l,d,u,p,h,v,b,g,S,k,w,R,B,O,T,j,I;const M=null!==(o=null===(r=t.session)||void 0===r||null===(s=r.configuration)||void 0===s?void 0:s.enableStoreDetails)&&void 0!==o?o:t.enableStoreDetails,A=!(0===(null===(l=t.amount)||void 0===l?void 0:l.value))&&M,D=t.storedPaymentMethodId||t.id,F=D&&(null==t||null===(d=t.supportedShopperInteractions)||void 0===d?void 0:d.includes("Ecommerce"));if(D&&!F)throw new m(y,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");const N=t.installmentOptions;t.session&&a(N)&&console.warn("WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.\nWith this integration, installments configuration must be defined when you create the session. Any configuration defined elsewhere will be ignored.\n\n");const E=t.session?null!==(e=null===(p=t.session)||void 0===p||null===(u=p.configuration)||void 0===u?void 0:u.installmentOptions)&&void 0!==e?e:f.installmentOptions:N;return P(C(P({},t),{holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?f.billingAddressMode:t.billingAddressMode,brand:null!==(n=t.brand)&&void 0!==n?n:c.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:C(P({},t.configuration),{socialSecurityNumberMode:null!==(i=null===(h=t.configuration)||void 0===h?void 0:h.socialSecurityNumberMode)&&void 0!==i?i:"auto"}),brandsConfiguration:t.brandsConfiguration||(null===(v=t.configuration)||void 0===v?void 0:v.brandsConfiguration)||{},icon:t.icon||(null===(b=t.configuration)||void 0===b?void 0:b.icon),installmentOptions:E,enableStoreDetails:M,showStoreDetailsCheckbox:A,clickToPayConfiguration:C(P({},t.clickToPayConfiguration),{disableOtpAutoFocus:(null===(g=t.clickToPayConfiguration)||void 0===g?void 0:g.disableOtpAutoFocus)||!1,shopperEmail:(null===(S=t.clickToPayConfiguration)||void 0===S?void 0:S.shopperEmail)||(null===(w=this.core.options)||void 0===w||null===(k=w.session)||void 0===k?void 0:k.shopperEmail),telephoneNumber:(null===(R=t.clickToPayConfiguration)||void 0===R?void 0:R.telephoneNumber)||(null===(O=this.core.options)||void 0===O||null===(B=O.session)||void 0===B?void 0:B.telephoneNumber),locale:(null===(T=t.clickToPayConfiguration)||void 0===T?void 0:T.locale)||(null===(I=t.i18n)||void 0===I||null===(j=I.locale)||void 0===j?void 0:j.replace("-","_"))})}),D&&{storedPaymentMethodId:D})}formatData(){var t;const o=this.state.selectedBrandValue;return C(P({paymentMethod:P({type:S.type},this.state.data,this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:null!==(t=this.props.holderName)&&void 0!==t?t:""},o&&{brand:o},this.props.fundingSource&&{fundingSource:this.props.fundingSource},this.state.fastlaneData&&{fastlaneData:btoa(JSON.stringify(this.state.fastlaneData))})},this.state.billingAddress&&{billingAddress:this.state.billingAddress},this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},this.storePaymentMethodPayload,l(this.state.installments)&&{installments:this.state.installments}),{browserInfo:this.browserInfo,origin:!!window&&window.location.origin})}beforeRender(t){if(null==t?void 0:t.originalAction)return;const o=new v(P({type:b.rendered,component:this.type,configData:C(P({},t),{showPayButton:this.props.showPayButton})},(null==t?void 0:t.oneClick)&&{isStoredPaymentMethod:!0,brand:t.brand}));this.analytics.sendAnalytics(o)}updateStyles(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.updateStyles)&&this.componentRef.updateStyles(t),this}setFocusOn(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.setFocusOn)&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,o=!1){var e;return(null===(e=this.componentRef)||void 0===e?void 0:e.processBinLookupResponse)&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.handleUnsupportedCard)&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){var o,e;const n=r("supportedBrandsRaw").from(t);null===(o=(e=this.props).onBinLookup)||void 0===o||o.call(e,n)}}get storePaymentMethodPayload(){var t,o;if((null===(t=this.props.storedPaymentMethodId)||void 0===t?void 0:t.length)>0)return{};if(0===(null===(o=this.props.amount)||void 0===o?void 0:o.value))return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){var t;return null!==(t=this.props.icon)&&void 0!==t?t:this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map(t=>{var e,n;return{icon:null!==(e=null==o||null===(n=o[t])||void 0===n?void 0:n.icon)&&void 0!==e?e:this.props.modules.resources.getImage()(t),name:t}}):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||S.type}get accessibleName(){return(this.props.name||S.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return e()}renderCardInput(e=!0){return t(o,C(P({setComponentRef:this.setComponentRef},this.props,this.state),{onSubmitAnalytics:this.submitAnalytics,onChange:this.setState,onSubmit:this.submit,handleKeyDown:this.handleKeyDown,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onConfigSuccess:this.onConfigSuccess}))}componentToRender(){return t(u,{configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},t=>this.renderCardInput(t))}constructor(o,e){var r;(super(o,e),g(this,"clickToPayService",void 0),g(this,"clickToPayRef",null),g(this,"setClickToPayRef",t=>{this.clickToPayRef=t}),g(this,"onBrand",t=>{var o,e;null===(o=(e=this.props).onBrand)||void 0===o||o.call(e,t)}),g(this,"handleClickToPaySubmit",t=>{this.setState({data:P({},t),valid:{},errors:{},isValid:!0}),this.submit()}),g(this,"onConfigSuccess",t=>{var o,e;const n=new v({component:this.type,type:b.configured});this.submitAnalytics(n),null===(o=(e=this.props).onConfigSuccess)||void 0===o||o.call(e,t)}),g(this,"onFocus",t=>{const o=new v({component:this.type,type:b.focus,target:i(t.fieldType)});var e,n,r,a;(this.submitAnalytics(o),s(t.fieldType))?null===(e=(n=this.props).onFocus)||void 0===e||e.call(n,t.event):null===(r=(a=this.props).onFocus)||void 0===r||r.call(a,t)}),g(this,"onBlur",t=>{const o=new v({component:this.type,type:b.unfocus,target:i(t.fieldType)});var e,n,r,a;(this.submitAnalytics(o),s(t.fieldType))?null===(e=(n=this.props).onBlur)||void 0===e||e.call(n,t.event):null===(r=(a=this.props).onBlur)||void 0===r||r.call(a,t)}),g(this,"onBinValue",n(this)),g(this,"payButton",o=>{var e,n;const i=0===(null===(e=this.props.amount)||void 0===e?void 0:e.value),s=(null===(n=this.props.storedPaymentMethodId)||void 0===n?void 0:n.length)>0;return t(h,C(P({},o),{label:i&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit}))}),e&&!e._disableClickToPay&&"prepaid"!==this.props.fundingSource)&&(this.clickToPayService=d(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment,this.analytics),null===(r=this.clickToPayService)||void 0===r||r.initialize())}}g(S,"type",c.scheme),g(S,"defaultProps",P({showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0},r(["type","setComponentRef"]).from(f)));export{S as CardElement,S as default};
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import e from"../../utils/browserInfo.js";import{triggerBinLookUp as n}from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i,isSecuredField as s}from"../internal/SecuredFields/utils.js";import{reject as r,notFalsy as a}from"../../utils/commonUtils.js";import{shouldIncludeInstallmentsInPaymentData as l}from"./components/CardInput/utils.js";import d from"../internal/ClickToPay/services/create-clicktopay-service.js";import u from"./components/ClickToPayWrapper.js";import{TxVariants as c}from"../tx-variants.js";import{UIElement as p}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import m,{IMPLEMENTATION_ERROR as y}from"../../core/Errors/AdyenCheckoutError.js";import f from"./components/CardInput/defaultProps.js";import{AnalyticsInfoEvent as v,InfoEventType as b}from"../../core/Analytics/events/AnalyticsInfoEvent.js";function g(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function P(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.forEach(function(o){g(t,o,e[o])})}return t}function C(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):function(t){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);o.push.apply(o,e)}return o}(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}class S extends p{setStatus(t,o){var e,n;return(null===(e=this.componentRef)||void 0===e?void 0:e.setStatus)&&this.componentRef.setStatus(t,o),(null===(n=this.clickToPayRef)||void 0===n?void 0:n.setStatus)&&this.clickToPayRef.setStatus(t),this}getPaymentMethodConfigFromResponse(t){var o;return(null==t?void 0:t.fundingSource)?null===(o=this.core.paymentMethodsResponse)||void 0===o?void 0:o.findByFundingSource(t.type,t.fundingSource):super.getPaymentMethodConfigFromResponse(t)}formatProps(t){var o,e,n,i,s,r,l,d,u,p,h,v,b,g,S,k,R,w,B,O,T,j,I;const M=null!==(o=null===(r=t.session)||void 0===r||null===(s=r.configuration)||void 0===s?void 0:s.enableStoreDetails)&&void 0!==o?o:t.enableStoreDetails,A=!(0===(null===(l=t.amount)||void 0===l?void 0:l.value))&&M,F=t.storedPaymentMethodId||t.id,N=F&&(null==t||null===(d=t.supportedShopperInteractions)||void 0===d?void 0:d.includes("Ecommerce"));if(F&&!N)throw new m(y,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");const D=t.installmentOptions;t.session&&a(D)&&console.warn("WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.\nWith this integration, installments configuration must be defined when you create the session. Any configuration defined elsewhere will be ignored.\n\n");const E=t.session?null!==(e=null===(p=t.session)||void 0===p||null===(u=p.configuration)||void 0===u?void 0:u.installmentOptions)&&void 0!==e?e:f.installmentOptions:D;return P(C(P({},t),{holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?f.billingAddressMode:t.billingAddressMode,brand:null!==(n=t.brand)&&void 0!==n?n:c.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:C(P({},t.configuration),{socialSecurityNumberMode:null!==(i=null===(h=t.configuration)||void 0===h?void 0:h.socialSecurityNumberMode)&&void 0!==i?i:"auto"}),brandsConfiguration:t.brandsConfiguration||(null===(v=t.configuration)||void 0===v?void 0:v.brandsConfiguration)||{},icon:t.icon||(null===(b=t.configuration)||void 0===b?void 0:b.icon),installmentOptions:E,enableStoreDetails:M,showStoreDetailsCheckbox:A,clickToPayConfiguration:C(P({},t.clickToPayConfiguration),{disableOtpAutoFocus:(null===(g=t.clickToPayConfiguration)||void 0===g?void 0:g.disableOtpAutoFocus)||!1,shopperEmail:(null===(S=t.clickToPayConfiguration)||void 0===S?void 0:S.shopperEmail)||(null===(R=this.core.options)||void 0===R||null===(k=R.session)||void 0===k?void 0:k.shopperEmail),telephoneNumber:(null===(w=t.clickToPayConfiguration)||void 0===w?void 0:w.telephoneNumber)||(null===(O=this.core.options)||void 0===O||null===(B=O.session)||void 0===B?void 0:B.telephoneNumber),locale:(null===(T=t.clickToPayConfiguration)||void 0===T?void 0:T.locale)||(null===(I=t.i18n)||void 0===I||null===(j=I.locale)||void 0===j?void 0:j.replace("-","_"))})}),F&&{storedPaymentMethodId:F})}formatData(){var t;const o=this.state.selectedBrandValue;return C(P({paymentMethod:P({type:S.type},this.state.data,this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:null!==(t=this.props.holderName)&&void 0!==t?t:""},o&&{brand:o},this.props.fundingSource&&{fundingSource:this.props.fundingSource},this.state.fastlaneData&&{fastlaneData:btoa(JSON.stringify(this.state.fastlaneData))})},this.state.billingAddress&&{billingAddress:this.state.billingAddress},this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},this.storePaymentMethodPayload,l(this.state.installments)&&{installments:this.state.installments}),{browserInfo:this.browserInfo,origin:!!window&&window.location.origin})}beforeRender(t){if(null==t?void 0:t.originalAction)return;const o=new v(P({type:b.rendered,component:this.type,configData:C(P({},t),{showPayButton:this.props.showPayButton})},(null==t?void 0:t.oneClick)&&{isStoredPaymentMethod:!0,brand:t.brand}));this.analytics.sendAnalytics(o)}updateStyles(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.updateStyles)&&this.componentRef.updateStyles(t),this}setFocusOn(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.setFocusOn)&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,o=!1){var e;return(null===(e=this.componentRef)||void 0===e?void 0:e.processBinLookupResponse)&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.handleUnsupportedCard)&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){var o,e;const n=r("supportedBrandsRaw").from(t);null===(o=(e=this.props).onBinLookup)||void 0===o||o.call(e,n)}}get storePaymentMethodPayload(){var t,o;if((null===(t=this.props.storedPaymentMethodId)||void 0===t?void 0:t.length)>0)return{};if(0===(null===(o=this.props.amount)||void 0===o?void 0:o.value))return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){var t;return null!==(t=this.props.icon)&&void 0!==t?t:this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map(t=>{var e,n;return{icon:null!==(e=null==o||null===(n=o[t])||void 0===n?void 0:n.icon)&&void 0!==e?e:this.props.modules.resources.getImage()(t),name:t}}):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||S.type}get accessibleName(){return(this.props.name||S.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return e()}renderCardInput(e=!0){return t(o,C(P({setComponentRef:this.setComponentRef},this.props,this.state),{onSubmitAnalytics:this.submitAnalytics,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onConfigSuccess:this.onConfigSuccess}))}componentToRender(){return t(u,{configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},t=>this.renderCardInput(t))}constructor(o,e){var r;(super(o,e),g(this,"clickToPayService",void 0),g(this,"clickToPayRef",null),g(this,"setClickToPayRef",t=>{this.clickToPayRef=t}),g(this,"onBrand",t=>{var o,e;null===(o=(e=this.props).onBrand)||void 0===o||o.call(e,t)}),g(this,"handleClickToPaySubmit",t=>{this.setState({data:P({},t),valid:{},errors:{},isValid:!0}),this.submit()}),g(this,"onConfigSuccess",t=>{var o,e;const n=new v({component:this.type,type:b.configured});this.submitAnalytics(n),null===(o=(e=this.props).onConfigSuccess)||void 0===o||o.call(e,t)}),g(this,"onFocus",t=>{const o=new v({component:this.type,type:b.focus,target:i(t.fieldType)});var e,n,r,a;(this.submitAnalytics(o),s(t.fieldType))?null===(e=(n=this.props).onFocus)||void 0===e||e.call(n,t.event):null===(r=(a=this.props).onFocus)||void 0===r||r.call(a,t)}),g(this,"onBlur",t=>{const o=new v({component:this.type,type:b.unfocus,target:i(t.fieldType)});var e,n,r,a;(this.submitAnalytics(o),s(t.fieldType))?null===(e=(n=this.props).onBlur)||void 0===e||e.call(n,t.event):null===(r=(a=this.props).onBlur)||void 0===r||r.call(a,t)}),g(this,"onBinValue",n(this)),g(this,"payButton",o=>{var e,n;const i=0===(null===(e=this.props.amount)||void 0===e?void 0:e.value),s=(null===(n=this.props.storedPaymentMethodId)||void 0===n?void 0:n.length)>0;return t(h,C(P({},o),{label:i&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit}))}),e&&!e._disableClickToPay&&"prepaid"!==this.props.fundingSource)&&(this.clickToPayService=d(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment,this.analytics),null===(r=this.clickToPayService)||void 0===r||r.initialize())}}g(S,"type",c.scheme),g(S,"defaultProps",P({showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0},r(["type","setComponentRef"]).from(f)));export{S as CardElement,S as default};
|
|
2
2
|
//# sourceMappingURL=Card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CardBinLookupData, CardConfigSuccessData, CardFocusData } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase, isSecuredField } from '../internal/SecuredFields/utils';\nimport { notFalsy, reject } from '../../utils/commonUtils';\nimport { shouldIncludeInstallmentsInPaymentData } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject, PaymentMethodBrand } from '../../types/global-types';\nimport { TxVariants } from '../tx-variants';\nimport type { UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\nimport { AnalyticsInfoEvent, InfoEventType, UiTarget } from '../../core/Analytics/events/AnalyticsInfoEvent';\nimport { InstallmentOptions } from './components/CardInput/components/Installments/Installments';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static readonly type: TxVariants = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay && this.props.fundingSource !== 'prepaid') {\n this.clickToPayService = createClickToPayService(\n this.props.configuration,\n this.props.clickToPayConfiguration,\n this.props.environment,\n this.analytics\n );\n\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static readonly defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n // This is the most self contained way of handling funding source matching\n // Alternatives would be to override getPaymentMethodConfigFromResponse and change it's signature\n protected override getPaymentMethodConfigFromResponse(componentProps: CardConfiguration) {\n if (componentProps?.fundingSource) {\n return this.core.paymentMethodsResponse?.findByFundingSource(componentProps.type, componentProps.fundingSource);\n }\n\n return super.getPaymentMethodConfigFromResponse(componentProps);\n }\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n // Take the configuration set on the card component - which is either merchant defined or default (empty object)\n // @ts-ignore 'installmentOptions' is optional on CardConfiguration (the merchant-facing type), but by this point\n // UIElement.buildElementProps has already merged CardInputDefaultProps.installmentOptions ({}) into props\n // before formatProps() is called, so the value is always defined here.\n const merchantInstallmentOptions: InstallmentOptions = props.installmentOptions;\n\n if (props.session && notFalsy(merchantInstallmentOptions)) {\n console.warn(\n 'WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.\\nWith this integration, installments configuration must be defined when you create the session. Any configuration defined elsewhere will be ignored.\\n\\n'\n );\n }\n\n // In a session scenario, only the session's own installments configuration is used; otherwise fall back to the merchant configuration / default\n const shownInstallmentOptions: InstallmentOptions = props.session\n ? (props.session?.configuration?.installmentOptions ?? CardInputDefaultProps.installmentOptions)\n : merchantInstallmentOptions;\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n installmentOptions: shownInstallmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource }),\n ...(this.state.fastlaneData && { fastlaneData: btoa(JSON.stringify(this.state.fastlaneData)) })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(shouldIncludeInstallmentsInPaymentData(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n protected override beforeRender(configSetByMerchant?: CardConfiguration): 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 && {\n isStoredPaymentMethod: true,\n brand: configSetByMerchant.brand\n })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CardBinLookupData) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup?.(nuObj);\n }\n }\n\n private onConfigSuccess = (obj: CardConfigSuccessData) => {\n const event = new AnalyticsInfoEvent({ component: this.type, type: InfoEventType.configured });\n this.submitAnalytics(event);\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.focus,\n target: fieldTypeToSnakeCase(obj.fieldType) as UiTarget\n });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (isSecuredField(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CardFocusData);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.unfocus,\n target: fieldTypeToSnakeCase(obj.fieldType) as UiTarget\n });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (isSecuredField(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CardFocusData);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): PaymentMethodBrand[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration?.[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonProps): h.JSX.Element => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return <PayButton {...props} label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''} onClick={this.submit} />;\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onSubmitAnalytics={this.submitAnalytics}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyDown={this.handleKeyDown}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <ClickToPayWrapper\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","getPaymentMethodConfigFromResponse","componentProps","_this_core_paymentMethodsResponse","fundingSource","core","paymentMethodsResponse","findByFundingSource","type","super","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","_ref","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","merchantInstallmentOptions","installmentOptions","notFalsy","console","warn","shownInstallmentOptions","_ref1","CardInputDefaultProps","_object_spread","_object_spread_props","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","TxVariants","card","countryCode","toLowerCase","socialSecurityNumberMode","_ref2","brandsConfiguration","icon","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","options","telephoneNumber","locale","i18n","replace","formatData","_this_props_holderName","cardBrand","state","selectedBrandValue","paymentMethod","data","holderName","fastlaneData","btoa","JSON","stringify","billingAddress","socialSecurityNumber","storePaymentMethodPayload","shouldIncludeInstallmentsInPaymentData","installments","browserInfo","origin","window","location","beforeRender","configSetByMerchant","originalAction","event","AnalyticsInfoEvent","InfoEventType","rendered","component","configData","showPayButton","oneClick","isStoredPaymentMethod","analytics","sendAnalytics","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","_this_props_onBinLookup","_this_props","nuObj","reject","from","call","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","brandIcon","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onSubmitAnalytics","submitAnalytics","onChange","setState","onSubmit","submit","handleKeyDown","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onConfigSuccess","componentToRender","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","constructor","checkout","_this_clickToPayService","_define_property","ref","_this_props_onBrand","payload","valid","errors","_this_props_onConfigSuccess","configured","focus","target","fieldTypeToSnakeCase","fieldType","_this_props_onFocus","_this_props_onFocus1","_this_props1","isSecuredField","unfocus","_this_props_onBlur","_this_props_onBlur1","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"0xDAwBO,MAAMA,UAAoBC,EAiCtBC,SAAAA,CAAUC,EAAyBC,OAClCC,EAGAC,EAGJ,eANID,EAAAE,KAAKC,wBAALH,OAAA,EAAAA,EAAmBH,YACnBK,KAAKC,aAAaN,UAAUC,EAAQC,YAEpCE,EAAAC,KAAKE,yBAALH,OAAA,EAAAA,EAAoBJ,YACpBK,KAAKE,cAAcP,UAAUC,EAAQC,GAElCG,IACX,CAQmBG,kCAAAA,CAAmCC,GAEvC,IAAAC,EADX,OAAID,aAAAA,EAAAA,EAAgBE,eACuB,QAAhCD,EAAAL,KAAKO,KAAKC,8BAAV,IAAAH,OAAA,EAAAA,EAAkCI,oBAAoBL,EAAeM,KAAMN,EAAeE,eAG9FK,MAAMR,mCAAmCC,EACpD,CAEAQ,WAAAA,CAAYf,GA+CGA,IAAAA,EAAAA,EAAAA,EAAAA,EA7CgBA,EAAAA,EAERA,EAI2BA,EAyBvCA,EAAAA,EAoB2BA,EAEoBA,EAC9BA,EAUKA,EACPA,EAA+CgB,EAAAC,EAC5CjB,EAAkDkB,EAAAC,EAC3DnB,EAAyCA,EAAAA,EAnEzD,MAAMoB,EAAqE,QAArEA,UAAqBpB,EAAAA,EAAMqB,eAANrB,IAAAA,WAAAA,EAAAA,EAAesB,qBAAftB,IAAAA,OAAAA,EAAAA,EAA8BoB,0BAAkB,IAAAG,EAAAA,EAAIvB,EAAMoB,mBAG/EI,IADqC,KAAZ,QAAZxB,EAAAA,EAAMyB,cAANzB,IAAAA,OAAAA,EAAAA,EAAc0B,SACqBN,EAEh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":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport { triggerBinLookUp } from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CardBinLookupData, CardConfigSuccessData, CardFocusData } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase, isSecuredField } from '../internal/SecuredFields/utils';\nimport { notFalsy, reject } from '../../utils/commonUtils';\nimport { shouldIncludeInstallmentsInPaymentData } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject, PaymentMethodBrand } from '../../types/global-types';\nimport { TxVariants } from '../tx-variants';\nimport type { ComponentMethodsRef, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\nimport { AnalyticsInfoEvent, InfoEventType, UiTarget } from '../../core/Analytics/events/AnalyticsInfoEvent';\nimport { InstallmentOptions } from './components/CardInput/components/Installments/Installments';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static readonly type: TxVariants = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef: ComponentMethodsRef | null = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay && this.props.fundingSource !== 'prepaid') {\n this.clickToPayService = createClickToPayService(\n this.props.configuration,\n this.props.clickToPayConfiguration,\n this.props.environment,\n this.analytics\n );\n\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static readonly defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status);\n }\n return this;\n }\n\n private readonly setClickToPayRef = (ref: ComponentMethodsRef) => {\n this.clickToPayRef = ref;\n };\n\n // This is the most self contained way of handling funding source matching\n // Alternatives would be to override getPaymentMethodConfigFromResponse and change it's signature\n protected override getPaymentMethodConfigFromResponse(componentProps: CardConfiguration) {\n if (componentProps?.fundingSource) {\n return this.core.paymentMethodsResponse?.findByFundingSource(componentProps.type, componentProps.fundingSource);\n }\n\n return super.getPaymentMethodConfigFromResponse(componentProps);\n }\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n // Take the configuration set on the card component - which is either merchant defined or default (empty object)\n // @ts-ignore 'installmentOptions' is optional on CardConfiguration (the merchant-facing type), but by this point\n // UIElement.buildElementProps has already merged CardInputDefaultProps.installmentOptions ({}) into props\n // before formatProps() is called, so the value is always defined here.\n const merchantInstallmentOptions: InstallmentOptions = props.installmentOptions;\n\n if (props.session && notFalsy(merchantInstallmentOptions)) {\n console.warn(\n 'WARNING: You have defined installments configuration on the Card component, but you are using a /sessions integration.\\nWith this integration, installments configuration must be defined when you create the session. Any configuration defined elsewhere will be ignored.\\n\\n'\n );\n }\n\n // In a session scenario, only the session's own installments configuration is used; otherwise fall back to the merchant configuration / default\n const shownInstallmentOptions: InstallmentOptions = props.session\n ? (props.session?.configuration?.installmentOptions ?? CardInputDefaultProps.installmentOptions)\n : merchantInstallmentOptions;\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n installmentOptions: shownInstallmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource }),\n ...(this.state.fastlaneData && { fastlaneData: btoa(JSON.stringify(this.state.fastlaneData)) })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(shouldIncludeInstallmentsInPaymentData(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n protected override beforeRender(configSetByMerchant?: CardConfiguration): 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 && {\n isStoredPaymentMethod: true,\n brand: configSetByMerchant.brand\n })\n });\n\n this.analytics.sendAnalytics(event);\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse | null, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private readonly handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CardBinLookupData) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup?.(nuObj);\n }\n }\n\n private readonly onConfigSuccess = (obj: CardConfigSuccessData) => {\n const event = new AnalyticsInfoEvent({ component: this.type, type: InfoEventType.configured });\n this.submitAnalytics(event);\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private readonly onFocus = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.focus,\n target: fieldTypeToSnakeCase(obj.fieldType) as UiTarget\n });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (isSecuredField(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CardFocusData);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private readonly onBlur = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({\n component: this.type,\n type: InfoEventType.unfocus,\n target: fieldTypeToSnakeCase(obj.fieldType) as UiTarget\n });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (isSecuredField(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CardFocusData);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): PaymentMethodBrand[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration?.[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonProps): h.JSX.Element => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return <PayButton {...props} label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''} onClick={this.submit} />;\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onSubmitAnalytics={this.submitAnalytics}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n protected override componentToRender(): h.JSX.Element {\n return (\n <ClickToPayWrapper\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","getPaymentMethodConfigFromResponse","componentProps","_this_core_paymentMethodsResponse","fundingSource","core","paymentMethodsResponse","findByFundingSource","type","super","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","_ref","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","merchantInstallmentOptions","installmentOptions","notFalsy","console","warn","shownInstallmentOptions","_ref1","CardInputDefaultProps","_object_spread","_object_spread_props","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","TxVariants","card","countryCode","toLowerCase","socialSecurityNumberMode","_ref2","brandsConfiguration","icon","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","options","telephoneNumber","locale","i18n","replace","formatData","_this_props_holderName","cardBrand","state","selectedBrandValue","paymentMethod","data","holderName","fastlaneData","btoa","JSON","stringify","billingAddress","socialSecurityNumber","storePaymentMethodPayload","shouldIncludeInstallmentsInPaymentData","installments","browserInfo","origin","window","location","beforeRender","configSetByMerchant","originalAction","event","AnalyticsInfoEvent","InfoEventType","rendered","component","configData","showPayButton","oneClick","isStoredPaymentMethod","analytics","sendAnalytics","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","_this_props_onBinLookup","_this_props","nuObj","reject","from","call","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","brandIcon","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onSubmitAnalytics","submitAnalytics","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onConfigSuccess","componentToRender","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","constructor","checkout","_this_clickToPayService","_define_property","ref","_this_props_onBrand","payload","valid","errors","_this_props_onConfigSuccess","configured","focus","target","fieldTypeToSnakeCase","fieldType","_this_props_onFocus","_this_props_onFocus1","_this_props1","isSecuredField","unfocus","_this_props_onBlur","_this_props_onBlur1","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps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EAAIrB,OAEP,QAAjBkG,GAAAJ,EAAAxL,KAAKH,OAAM8J,cAAX,IAAAiC,GAAAA,EAAAvE,KAAAmE,EAAoBzE,KAI5B2D,OAAOnB,aAAasC,EAAiB7L,OAoErC0K,EAAA1K,KAAmBqJ,YAAaxJ,QACT0H,EACED,EADrB,MAAMwE,EAA0C,KAAZ,QAAjBvE,EAAAvH,KAAKH,MAAMyB,cAAX,IAAAiG,OAAA,EAAAA,EAAmBhG,OAChCwK,GAA+C,QAAhCzE,EAAAtH,KAAKH,MAAM4B,6BAAX,IAAA6F,OAAA,EAAAA,EAAkCE,QAAS,EAChE,OAAOmB,EAACqD,EAAAA,EAAAA,EAAAA,CAAAA,EAAcnM,GAAAA,CAAOoM,MAAOH,IAAeC,EAAe/L,KAAKH,MAAMmE,KAAKuE,IAAI,yBAA2B,GAAI2D,QAASlM,KAAKmJ,YA9T/HtJ,IAAUA,EAAMsM,oBAAmD,YAA7BnM,KAAKH,MAAMS,iBACjDN,KAAK+J,kBAAoBqC,EACrBpM,KAAKH,MAAMsB,cACXnB,KAAKH,MAAM6D,wBACX1D,KAAKH,MAAMwM,YACXrM,KAAKmG,WAGkB,QAAtBsE,EAAAzK,KAAK+J,yBAAL,IAAAU,GAAAA,EAAwB6B,aAErC,EAtBA5B,EADSjL,EACciB,OAAmBwC,EAAWqJ,QAwBrD7B,EAzBSjL,EAyBiB+M,eAAehK,EAAA,CACrCiK,qBAAqB,EACrBN,oBAAoB,EACpBO,aAAa,GAEVvF,EAAO,CAAC,OAAQ,oBAAoBC,KAAK7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport type {\n BinLookupResponse,\n BrandConfiguration,\n CardBrandsConfiguration,\n CardBackendConfiguration,\n DualBrandSelectElement,\n CardPlaceholders\n} from '../../types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport {\n CardAllValidData,\n CardAutoCompleteData,\n CardBinValueData,\n CardBrandData,\n CardConfigSuccessData,\n CardFieldValidData,\n CardFocusData,\n CardLoadData,\n CVCPolicyType,\n DatePolicyType\n} from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CardErrorData, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData } from '../../../../types/global-types';\nimport type { FastlaneSignupConfiguration } from '../../../PayPalFastlane/types';\nimport type { AbstractAnalyticsEvent } from '../../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { IAnalytics } from '../../../../core/Analytics/Analytics';\nimport { PayButtonProps } from '../../../internal/PayButton/PayButton';\nimport { h } from 'preact';\nimport { InstallmentOptions } from './components/Installments/Installments';\nimport type { Form } from '../../../../utils/useForm/types';\nimport type { SecuredFieldsProviderRef } from '../../../internal/SecuredFields/SFP/types';\n\nexport interface CardInputValidState {\n holderName?: boolean;\n billingAddress?: boolean;\n socialSecurityNumber?: boolean;\n encryptedCardNumber?: boolean;\n encryptedExpiryMonth?: boolean;\n encryptedExpiryYear?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: boolean;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputErrorState {\n holderName?: ValidationResult;\n billingAddress?: ValidationResult;\n socialSecurityNumber?: ValidationResult;\n encryptedCardNumber?: boolean;\n encryptedExpiryDate?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: ValidationResult;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputDataState {\n holderName?: string;\n billingAddress?: AddressData;\n socialSecurityNumber?: string;\n taxNumber?: string;\n}\n\n/**\n * Should be the subset of the props sent to CardInput that are *actually* used by CardInput\n * - either in the comp itself or are passed on to its children\n */\nexport interface CardInputProps {\n isPayButtonPrimaryVariant?: boolean;\n autoFocus?: boolean;\n billingAddressAllowedCountries?: string[];\n billingAddressRequired?: boolean;\n billingAddressRequiredFields?: string[];\n billingAddressMode?: AddressModeOptions;\n brand?: string;\n brands?: string[];\n brandsConfiguration?: CardBrandsConfiguration;\n brandsIcons: Array<BrandConfiguration>;\n clientKey: string;\n configuration: CardBackendConfiguration;\n countryCode?: string;\n cvcPolicy?: CVCPolicyType;\n data?: CardInputDataState;\n disableIOSArrowKeys?: boolean;\n enableStoreDetails?: boolean;\n expiryMonth?: string;\n expiryYear?: string;\n fastlaneConfiguration?: FastlaneSignupConfiguration;\n forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit' | 'prepaid';\n hasCVC?: boolean;\n hasHolderName?: boolean;\n holderName?: string;\n holderNameRequired?: boolean;\n i18n?: Language;\n implementationType?: 'components' | 'custom';\n installmentOptions?: InstallmentOptions;\n keypadFix?: boolean;\n lastFour?: string;\n loadingContext: string;\n legacyInputMode?: boolean;\n minimumExpiryDate?: string;\n modules?: {\n srPanel: SRPanel;\n analytics: IAnalytics;\n risk: RiskElement;\n resources: Resources;\n };\n onAdditionalSFConfig?: () => void;\n onAdditionalSFRemoved?: () => void;\n onAllValid?: (o: CardAllValidData) => void;\n onAutoComplete?: (o: CardAutoCompleteData) => void;\n onBinValue?: (o: CardBinValueData) => void;\n onBlur?: (e) => void;\n onBrand?: (o: CardBrandData) => void;\n onConfigSuccess?: (O: CardConfigSuccessData) => void;\n onChange: (state) => void;\n onError?: () => void;\n onFieldValid?: (o: CardFieldValidData) => void;\n onFocus?: (e) => void;\n onLoad?: (o: CardLoadData) => void;\n onSubmitAnalytics: (event: AbstractAnalyticsEvent) => void;\n
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport type {\n BinLookupResponse,\n BrandConfiguration,\n CardBrandsConfiguration,\n CardBackendConfiguration,\n DualBrandSelectElement,\n CardPlaceholders\n} from '../../types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport {\n CardAllValidData,\n CardAutoCompleteData,\n CardBinValueData,\n CardBrandData,\n CardConfigSuccessData,\n CardFieldValidData,\n CardFocusData,\n CardLoadData,\n CVCPolicyType,\n DatePolicyType\n} from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CardErrorData, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData } from '../../../../types/global-types';\nimport type { FastlaneSignupConfiguration } from '../../../PayPalFastlane/types';\nimport type { AbstractAnalyticsEvent } from '../../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { IAnalytics } from '../../../../core/Analytics/Analytics';\nimport { PayButtonProps } from '../../../internal/PayButton/PayButton';\nimport { h } from 'preact';\nimport { InstallmentOptions } from './components/Installments/Installments';\nimport type { Form } from '../../../../utils/useForm/types';\nimport type { SecuredFieldsProviderRef } from '../../../internal/SecuredFields/SFP/types';\n\nexport interface CardInputValidState {\n holderName?: boolean;\n billingAddress?: boolean;\n socialSecurityNumber?: boolean;\n encryptedCardNumber?: boolean;\n encryptedExpiryMonth?: boolean;\n encryptedExpiryYear?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: boolean;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputErrorState {\n holderName?: ValidationResult;\n billingAddress?: ValidationResult;\n socialSecurityNumber?: ValidationResult;\n encryptedCardNumber?: boolean;\n encryptedExpiryDate?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: ValidationResult;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputDataState {\n holderName?: string;\n billingAddress?: AddressData;\n socialSecurityNumber?: string;\n taxNumber?: string;\n}\n\n/**\n * Should be the subset of the props sent to CardInput that are *actually* used by CardInput\n * - either in the comp itself or are passed on to its children\n */\nexport interface CardInputProps {\n isPayButtonPrimaryVariant?: boolean;\n autoFocus?: boolean;\n billingAddressAllowedCountries?: string[];\n billingAddressRequired?: boolean;\n billingAddressRequiredFields?: string[];\n billingAddressMode?: AddressModeOptions;\n brand?: string;\n brands?: string[];\n brandsConfiguration?: CardBrandsConfiguration;\n brandsIcons: Array<BrandConfiguration>;\n clientKey: string;\n configuration: CardBackendConfiguration;\n countryCode?: string;\n cvcPolicy?: CVCPolicyType;\n data?: CardInputDataState;\n disableIOSArrowKeys?: boolean;\n enableStoreDetails?: boolean;\n expiryMonth?: string;\n expiryYear?: string;\n fastlaneConfiguration?: FastlaneSignupConfiguration;\n forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit' | 'prepaid';\n hasCVC?: boolean;\n hasHolderName?: boolean;\n holderName?: string;\n holderNameRequired?: boolean;\n i18n?: Language;\n implementationType?: 'components' | 'custom';\n installmentOptions?: InstallmentOptions;\n keypadFix?: boolean;\n lastFour?: string;\n loadingContext: string;\n legacyInputMode?: boolean;\n minimumExpiryDate?: string;\n modules?: {\n srPanel: SRPanel;\n analytics: IAnalytics;\n risk: RiskElement;\n resources: Resources;\n };\n onAdditionalSFConfig?: () => void;\n onAdditionalSFRemoved?: () => void;\n onAllValid?: (o: CardAllValidData) => void;\n onAutoComplete?: (o: CardAutoCompleteData) => void;\n onBinValue?: (o: CardBinValueData) => void;\n onBlur?: (e) => void;\n onBrand?: (o: CardBrandData) => void;\n onConfigSuccess?: (O: CardConfigSuccessData) => void;\n onChange: (state) => void;\n onError?: () => void;\n onFieldValid?: (o: CardFieldValidData) => void;\n onFocus?: (e) => void;\n onLoad?: (o: CardLoadData) => void;\n onSubmitAnalytics: (event: AbstractAnalyticsEvent) => void;\n handleKeyPress?: (obj: KeyboardEvent) => void;\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (props: PayButtonProps) => h.JSX.Element;\n placeholders?: CardPlaceholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showInstallmentAmounts?: boolean;\n showPayButton: boolean;\n showStoreDetailsCheckbox?: boolean;\n showWarnings?: boolean;\n showContextualElement?: boolean;\n specifications?: Specifications;\n storedPaymentMethodId?: string;\n styles?: StylesObject;\n trimTrailingSeparator?: boolean;\n type: string;\n maskSecurityCode?: boolean;\n exposeExpiryDate?: boolean;\n disclaimerMessage?: DisclaimerMsgObject;\n}\n\nexport interface CardInputState {\n dualBrandSelectElements: DualBrandSelectElement[];\n selectedBrandValue: string;\n billingAddress: object;\n brand?: string;\n data?: object;\n errors?: object;\n focusedElement: string;\n cvcPolicy: CVCPolicyType;\n expiryDatePolicy: DatePolicyType;\n isValid: boolean;\n status: string;\n valid?: object;\n issuingCountryCode: string;\n showSocialSecurityNumber?: boolean;\n}\n\n// An interface for the members exposed by CardInput to its parent Card/UIElement\nexport interface CardInputRef extends ComponentMethodsRef {\n sfp?: SecuredFieldsProviderRef;\n setFocusOn?: (who) => void;\n processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;\n updateStyles?: (stylesObj: StylesObject) => void;\n handleUnsupportedCard?: (errObj: CardErrorData) => boolean;\n}\n\nexport interface FieldError {\n errorMessage?: string;\n errorI18n?: string;\n}\n\nexport interface SFError {\n isValid?: boolean;\n errorMessage?: string;\n errorI18n?: string;\n error: string;\n rootNode: HTMLElement;\n detectedBrands?: string[];\n}\n\nexport interface SFStateErrorObj {\n [key: string]: SFError;\n}\n\nexport interface LayoutObj {\n props: CardInputProps;\n showKCP: boolean;\n showBrazilianSSN: boolean;\n countrySpecificSchemas: AddressSchema;\n billingAddressRequiredFields?: string[];\n}\n\nexport enum AddressModeOptions {\n full = 'full',\n partial = 'partial',\n none = 'none'\n}\n\nexport type CardSetFormData = Form<CardInputDataState>['setData'];\nexport type CardSetFormValid = Form<CardInputDataState>['setValid'];\nexport type CardSetFormErrors = Form<CardInputDataState>['setErrors'];\n\nexport type OnFieldFocus = (who: string, e: Event | CardFocusData) => void;\n"],"names":["AddressModeOptions"],"mappings":"AA+MO,IAAAA,EAAKA,SAAAA,GAAAA,uDAAAA,CAIX,CAJWA,CAIX,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as a,KCP_CARD as s,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{BRAND_READABLE_NAME_MAP as c}from"../../../internal/SecuredFields/lib/constants.js";import m from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as p}from"../../../../core/Errors/constants.js";const C=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),g=e=>["revolving","bonus"].includes(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,h=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let C=a;const g=e.hasHolderName&&e.holderNameRequired;if(g&&(C=e.positionHolderNameOnTop?o:n),u&&(C=s,g&&(C=e.positionHolderNameOnTop?i:r)),c&&(C=d,g&&(C=e.positionHolderNameOnTop?t:l)),m){const i=m.flat(2).filter(e=>"number"!=typeof e);let r=i;p&&(r=i.filter(e=>p.includes(e))),C=a.concat(r),g&&(C=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return C},R=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},y=e=>({billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),O=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,
|
|
1
|
+
import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as a,KCP_CARD as s,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{BRAND_READABLE_NAME_MAP as c}from"../../../internal/SecuredFields/lib/constants.js";import m from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as p}from"../../../../core/Errors/constants.js";const C=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),g=e=>["revolving","bonus"].includes(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,h=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let C=a;const g=e.hasHolderName&&e.holderNameRequired;if(g&&(C=e.positionHolderNameOnTop?o:n),u&&(C=s,g&&(C=e.positionHolderNameOnTop?i:r)),c&&(C=d,g&&(C=e.positionHolderNameOnTop?t:l)),m){const i=m.flat(2).filter(e=>"number"!=typeof e);let r=i;p&&(r=i.filter(e=>p.includes(e))),C=a.concat(r),g&&(C=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return C},R=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},y=e=>({billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),O=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),b=o=>o==e.partial?u:null;function f(e){return![p.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,p.ERROR_MSG_CARD_TOO_OLD,p.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,p.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function S(e){var o;return null!==(o=c[e])&&void 0!==o?o:e}const x=(e,o)=>e.map(e=>{var n,i;const r=e.id,t=m(),l="card"===r?"nocard":r,a=null!==(n=null==o||null===(i=o[r])||void 0===i?void 0:i.icon)&&void 0!==n?n:C(l,t);return{id:e.id,name:e.brandObject.localeBrand||e.brandObject.brand,imageURL:a,altName:S(r)}}),A=(e,o,n)=>o.some(o=>e.includes(o[n])),E=({installmentOptions:e,fundingSource:o,amount:n})=>!(!e||0===Object.keys(e).length)&&(!(!n||0===n.value)&&(!o||"credit"===o));export{y as extractPropsForCardFields,O as extractPropsForSFP,C as getCardImageUrl,S as getFullBrandName,h as getLayout,b as handlePartialAddressMode,f as lookupBlurBasedErrors,x as mapDualBrandButtons,R as mapFieldKey,A as requiresDualBrandSelection,g as shouldIncludeInstallmentsInPaymentData,E as shouldShowInstallmentsComponent};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|