@adyen/adyen-web 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4397,11 +4397,7 @@ declare class UPI extends UIElement<UPIConfiguration> {
4397
4397
  constructor(checkout: ICore, props: UPIConfiguration);
4398
4398
  formatProps(props: UPIConfiguration): {
4399
4399
  defaultMode: UpiMode;
4400
- apps: {
4401
- type: TxVariants;
4402
- id: string;
4403
- name: string;
4404
- }[];
4400
+ apps: App[];
4405
4401
  url?: string;
4406
4402
  paymentData?: string;
4407
4403
  qrCodeData?: string;
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../external/preact/dist/preact.js";import r from"../helpers/OpenInvoiceContainer/OpenInvoiceContainer.js";import{personalDetailsRequiredFields as o,deliveryAddressSpecification as t,allowedBillingCountries as i,allowedDeliveryCountries as s,termsAndConditionsUrlMap as n}from"./config.js";import a from"../internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js";import{getConsentUrl as l}from"../../utils/getConsentUrl.js";import{TxVariants as c}from"../tx-variants.js";class d extends r{static type=c.riverty;static defaultProps={personalDetailsRequiredFields:o,deliveryAddressSpecification:t,...r.defaultProps};formatProps(r){return{...super.formatProps(r),billingAddressSpecification:{...r.billingAddressSpecification,allowedCountries:r.countryCode?[r.countryCode]:i},deliveryAddressSpecification:{...r.deliveryAddressSpecification,allowedCountries:s},consentCheckboxLabel:e(a,{url:l(r.countryCode,r.i18n?.locale,n)})}}}export{d as default};
1
+ import{createElement as e}from"../../external/preact/dist/preact.js";import r from"../helpers/OpenInvoiceContainer/OpenInvoiceContainer.js";import{personalDetailsRequiredFields as i,deliveryAddressSpecification as s,allowedBillingCountries as t,allowedDeliveryCountries as o,DISCLAIMER_MESSAGE_TRANSLATION_KEY as n,termsAndConditionsUrlMap as a,privacyPolicyUrlMap as l}from"./config.js";import{getConsentUrl as c}from"../../utils/getConsentUrl.js";import{LabelOnlyDisclaimerMessage as d}from"../internal/DisclaimerMessage/DisclaimerMessage.js";import{TxVariants as p}from"../tx-variants.js";class m extends r{static type=p.riverty;static defaultProps={personalDetailsRequiredFields:i,deliveryAddressSpecification:s,...r.defaultProps};formatProps(r){const i=c(r.countryCode,r.i18n?.locale,a),s=c(r.countryCode,r.i18n?.locale,l);return{...super.formatProps(r),billingAddressSpecification:{...r.billingAddressSpecification,allowedCountries:r.countryCode?[r.countryCode]:t},deliveryAddressSpecification:{...r.deliveryAddressSpecification,allowedCountries:o},consentCheckboxLabel:e(d,{message:r.i18n.get(n),urls:[i,s]})}}}export{m as default};
2
2
  //# sourceMappingURL=Riverty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { h } from 'preact';\nimport OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport {\n allowedBillingCountries,\n allowedDeliveryCountries,\n deliveryAddressSpecification,\n personalDetailsRequiredFields,\n termsAndConditionsUrlMap\n} from './config';\nimport ConsentCheckboxLabel from '../internal/ConsentCheckboxLabel';\nimport { getConsentUrl } from '../../utils/getConsentUrl';\nimport type { OpenInvoiceConfiguration } from '../helpers/OpenInvoiceContainer/types';\nimport { TxVariants } from '../tx-variants';\n\nexport default class Riverty extends OpenInvoiceContainer {\n public static readonly type = TxVariants.riverty;\n\n protected static defaultProps = {\n personalDetailsRequiredFields,\n deliveryAddressSpecification,\n ...OpenInvoiceContainer.defaultProps\n };\n\n formatProps(props: OpenInvoiceConfiguration) {\n return {\n ...super.formatProps(props),\n billingAddressSpecification: {\n ...props.billingAddressSpecification,\n allowedCountries: props.countryCode ? [props.countryCode] : allowedBillingCountries\n },\n deliveryAddressSpecification: { ...props.deliveryAddressSpecification, allowedCountries: allowedDeliveryCountries },\n consentCheckboxLabel: <ConsentCheckboxLabel url={getConsentUrl(props.countryCode, props.i18n?.locale, termsAndConditionsUrlMap)} />\n };\n }\n}\n"],"names":["Riverty","OpenInvoiceContainer","static","TxVariants","riverty","personalDetailsRequiredFields","deliveryAddressSpecification","defaultProps","formatProps","props","super","billingAddressSpecification","allowedCountries","countryCode","allowedBillingCountries","allowedDeliveryCountries","consentCheckboxLabel","h","ConsentCheckboxLabel","url","getConsentUrl","i18n","locale","termsAndConditionsUrlMap"],"mappings":"ufAce,MAAMA,UAAgBC,EACjCC,YAA8BC,EAAWC,QAEzCF,oBAAgC,CAC5BG,gCACAC,kCACGL,EAAqBM,cAG5BC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,4BAA6B,IACtBF,EAAME,4BACTC,iBAAkBH,EAAMI,YAAc,CAACJ,EAAMI,aAAeC,GAEhER,6BAA8B,IAAKG,EAAMH,6BAA8BM,iBAAkBG,GACzFC,qBAAsBC,EAACC,EAAAA,CAAqBC,IAAKC,EAAcX,EAAMI,YAAaJ,EAAMY,MAAMC,OAAQC,KAE9G"}
1
+ {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { h } from 'preact';\nimport OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport {\n DISCLAIMER_MESSAGE_TRANSLATION_KEY,\n allowedBillingCountries,\n allowedDeliveryCountries,\n deliveryAddressSpecification,\n personalDetailsRequiredFields,\n termsAndConditionsUrlMap,\n privacyPolicyUrlMap\n} from './config';\nimport { getConsentUrl } from '../../utils/getConsentUrl';\nimport { LabelOnlyDisclaimerMessage } from '../internal/DisclaimerMessage/DisclaimerMessage';\nimport type { OpenInvoiceConfiguration } from '../helpers/OpenInvoiceContainer/types';\nimport { TxVariants } from '../tx-variants';\n\nexport default class Riverty extends OpenInvoiceContainer {\n public static readonly type = TxVariants.riverty;\n\n protected static defaultProps = {\n personalDetailsRequiredFields,\n deliveryAddressSpecification,\n ...OpenInvoiceContainer.defaultProps\n };\n\n formatProps(props: OpenInvoiceConfiguration) {\n const tocURL = getConsentUrl(props.countryCode, props.i18n?.locale, termsAndConditionsUrlMap);\n const privacyURL = getConsentUrl(props.countryCode, props.i18n?.locale, privacyPolicyUrlMap);\n\n return {\n ...super.formatProps(props),\n billingAddressSpecification: {\n ...props.billingAddressSpecification,\n allowedCountries: props.countryCode ? [props.countryCode] : allowedBillingCountries\n },\n deliveryAddressSpecification: {\n ...props.deliveryAddressSpecification,\n allowedCountries: allowedDeliveryCountries\n },\n consentCheckboxLabel: (\n <LabelOnlyDisclaimerMessage message={props.i18n.get(DISCLAIMER_MESSAGE_TRANSLATION_KEY)} urls={[tocURL, privacyURL]} />\n )\n };\n }\n}\n"],"names":["Riverty","OpenInvoiceContainer","static","TxVariants","riverty","personalDetailsRequiredFields","deliveryAddressSpecification","defaultProps","formatProps","props","tocURL","getConsentUrl","countryCode","i18n","locale","termsAndConditionsUrlMap","privacyURL","privacyPolicyUrlMap","super","billingAddressSpecification","allowedCountries","allowedBillingCountries","allowedDeliveryCountries","consentCheckboxLabel","h","LabelOnlyDisclaimerMessage","message","get","DISCLAIMER_MESSAGE_TRANSLATION_KEY","urls"],"mappings":"glBAgBe,MAAMA,UAAgBC,EACjCC,YAA8BC,EAAWC,QAEzCF,oBAAgC,CAC5BG,gCACAC,kCACGL,EAAqBM,cAG5BC,WAAAA,CAAYC,GACR,MAAMC,EAASC,EAAcF,EAAMG,YAAaH,EAAMI,MAAMC,OAAQC,GAC9DC,EAAaL,EAAcF,EAAMG,YAAaH,EAAMI,MAAMC,OAAQG,GAExE,MAAO,IACAC,MAAMV,YAAYC,GACrBU,4BAA6B,IACtBV,EAAMU,4BACTC,iBAAkBX,EAAMG,YAAc,CAACH,EAAMG,aAAeS,GAEhEf,6BAA8B,IACvBG,EAAMH,6BACTc,iBAAkBE,GAEtBC,qBACIC,EAACC,EAAAA,CAA2BC,QAASjB,EAAMI,KAAKc,IAAIC,GAAqCC,KAAM,CAACnB,EAAQM,KAGpH"}
@@ -1,2 +1,2 @@
1
- import{FIRST_NAME as e,LAST_NAME as t,COUNTRY as s,STREET as o,HOUSE_NUMBER_OR_NAME as n,POSTAL_CODE as m,CITY as i}from"../internal/Address/constants.js";const d=["AT","CH","DE"],r=["NO","SE","FI","DK","DE","AT","CH","NL","BE"],c=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"],a={default:{labels:{[e]:"deliveryAddress.firstName",[t]:"deliveryAddress.lastName"},schema:[s,[[e,50],[t,50]],[[o,70],[n,30]],[[m,30],[i,70]]]}},h={at:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de"},ch:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de",fr:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr"},de:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de"}};export{d as allowedBillingCountries,r as allowedDeliveryCountries,a as deliveryAddressSpecification,c as personalDetailsRequiredFields,h as termsAndConditionsUrlMap};
1
+ import{FIRST_NAME as t,LAST_NAME as e,COUNTRY as s,STREET as c,HOUSE_NUMBER_OR_NAME as o,POSTAL_CODE as n,CITY as m}from"../internal/Address/constants.js";const r="riverty.termsAndConditions",i=["AT","CH","DE"],d=["NO","SE","FI","DK","DE","AT","CH","NL","BE"],a=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"],h={default:{labels:{[t]:"deliveryAddress.firstName",[e]:"deliveryAddress.lastName"},schema:[s,[[t,50],[e,50]],[[c,70],[o,30]],[[n,30],[m,70]]]}},_={at:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de"},ch:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de",fr:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr"},de:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de"}},p={at:{en:"https://documents.riverty.com/privacy_statement/checkout/at_en",de:"https://documents.riverty.com/privacy_statement/checkout/at_de"},ch:{en:"https://documents.riverty.com/privacy_statement/checkout/ch_en",de:"https://documents.riverty.com/privacy_statement/checkout/h_de",fr:"https://documents.riverty.com/privacy_statement/checkout/ch_fr"},de:{en:"https://documents.riverty.com/privacy_statement/checkout/de_en",de:"https://documents.riverty.com/privacy_statement/checkout/de_de"}};export{r as DISCLAIMER_MESSAGE_TRANSLATION_KEY,i as allowedBillingCountries,d as allowedDeliveryCountries,h as deliveryAddressSpecification,a as personalDetailsRequiredFields,p as privacyPolicyUrlMap,_ as termsAndConditionsUrlMap};
2
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../../src/components/Riverty/config.ts"],"sourcesContent":["import { CITY, COUNTRY, FIRST_NAME, HOUSE_NUMBER_OR_NAME, LAST_NAME, POSTAL_CODE, STREET } from '../internal/Address/constants';\nimport { AddressSpecifications } from '../internal/Address/types';\n\nexport const allowedBillingCountries = ['AT', 'CH', 'DE'];\nexport const allowedDeliveryCountries = ['NO', 'SE', 'FI', 'DK', 'DE', 'AT', 'CH', 'NL', 'BE'];\nexport const personalDetailsRequiredFields = ['firstName', 'lastName', 'dateOfBirth', 'shopperEmail', 'telephoneNumber'];\nexport const deliveryAddressSpecification: AddressSpecifications = {\n default: {\n labels: {\n [FIRST_NAME]: 'deliveryAddress.firstName',\n [LAST_NAME]: 'deliveryAddress.lastName'\n },\n schema: [\n COUNTRY,\n [\n [FIRST_NAME, 50],\n [LAST_NAME, 50]\n ],\n [\n [STREET, 70],\n [HOUSE_NUMBER_OR_NAME, 30]\n ],\n\n [\n [POSTAL_CODE, 30],\n [CITY, 70]\n ]\n ]\n }\n};\nexport const termsAndConditionsUrlMap = {\n at: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de',\n fr: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de'\n }\n};\n"],"names":["allowedBillingCountries","allowedDeliveryCountries","personalDetailsRequiredFields","deliveryAddressSpecification","default","labels","FIRST_NAME","LAST_NAME","schema","COUNTRY","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","termsAndConditionsUrlMap","at","en","de","ch","fr"],"mappings":"iKAGaA,EAA0B,CAAC,KAAM,KAAM,MACvCC,EAA2B,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAC5EC,EAAgC,CAAC,YAAa,WAAY,cAAe,eAAgB,mBACzFC,EAAsD,CAC/DC,QAAS,CACLC,OAAQ,CACJC,CAACA,GAAa,4BACdC,CAACA,GAAY,4BAEjBC,OAAQ,CACJC,EACA,CACI,CAACH,EAAY,IACb,CAACC,EAAW,KAEhB,CACI,CAACG,EAAQ,IACT,CAACC,EAAsB,KAG3B,CACI,CAACC,EAAa,IACd,CAACC,EAAM,QAKVC,EAA2B,CACpCC,GAAI,CACAC,GAAI,+EACJC,GAAI,gFAERC,GAAI,CACAF,GAAI,+EACJC,GAAI,+EACJE,GAAI,gFAERF,GAAI,CACAD,GAAI,+EACJC,GAAI"}
1
+ {"version":3,"file":"config.js","sources":["../../../../src/components/Riverty/config.ts"],"sourcesContent":["import { CITY, COUNTRY, FIRST_NAME, HOUSE_NUMBER_OR_NAME, LAST_NAME, POSTAL_CODE, STREET } from '../internal/Address/constants';\nimport { AddressSpecifications } from '../internal/Address/types';\n\nexport const DISCLAIMER_MESSAGE_TRANSLATION_KEY = 'riverty.termsAndConditions';\n\nexport const allowedBillingCountries = ['AT', 'CH', 'DE'];\nexport const allowedDeliveryCountries = ['NO', 'SE', 'FI', 'DK', 'DE', 'AT', 'CH', 'NL', 'BE'];\nexport const personalDetailsRequiredFields = ['firstName', 'lastName', 'dateOfBirth', 'shopperEmail', 'telephoneNumber'];\nexport const deliveryAddressSpecification: AddressSpecifications = {\n default: {\n labels: {\n [FIRST_NAME]: 'deliveryAddress.firstName',\n [LAST_NAME]: 'deliveryAddress.lastName'\n },\n schema: [\n COUNTRY,\n [\n [FIRST_NAME, 50],\n [LAST_NAME, 50]\n ],\n [\n [STREET, 70],\n [HOUSE_NUMBER_OR_NAME, 30]\n ],\n\n [\n [POSTAL_CODE, 30],\n [CITY, 70]\n ]\n ]\n }\n};\nexport const termsAndConditionsUrlMap = {\n at: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de',\n fr: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de'\n }\n};\n\nexport const privacyPolicyUrlMap = {\n at: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/at_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/ch_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/h_de',\n fr: 'https://documents.riverty.com/privacy_statement/checkout/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/de_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/de_de'\n }\n};\n"],"names":["DISCLAIMER_MESSAGE_TRANSLATION_KEY","allowedBillingCountries","allowedDeliveryCountries","personalDetailsRequiredFields","deliveryAddressSpecification","default","labels","FIRST_NAME","LAST_NAME","schema","COUNTRY","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","termsAndConditionsUrlMap","at","en","de","ch","fr","privacyPolicyUrlMap"],"mappings":"2JAGO,MAAMA,EAAqC,6BAErCC,EAA0B,CAAC,KAAM,KAAM,MACvCC,EAA2B,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAC5EC,EAAgC,CAAC,YAAa,WAAY,cAAe,eAAgB,mBACzFC,EAAsD,CAC/DC,QAAS,CACLC,OAAQ,CACJC,CAACA,GAAa,4BACdC,CAACA,GAAY,4BAEjBC,OAAQ,CACJC,EACA,CACI,CAACH,EAAY,IACb,CAACC,EAAW,KAEhB,CACI,CAACG,EAAQ,IACT,CAACC,EAAsB,KAG3B,CACI,CAACC,EAAa,IACd,CAACC,EAAM,QAKVC,EAA2B,CACpCC,GAAI,CACAC,GAAI,+EACJC,GAAI,gFAERC,GAAI,CACAF,GAAI,+EACJC,GAAI,+EACJE,GAAI,gFAERF,GAAI,CACAD,GAAI,+EACJC,GAAI,iFAICG,EAAsB,CAC/BL,GAAI,CACAC,GAAI,iEACJC,GAAI,kEAERC,GAAI,CACAF,GAAI,iEACJC,GAAI,gEACJE,GAAI,kEAERF,GAAI,CACAD,GAAI,iEACJC,GAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"UPI.js","sources":["../../../../src/components/UPI/UPI.tsx"],"sourcesContent":["import { h, RefObject } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport UPIComponent from './components/UPIComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport Await from '../internal/Await';\nimport QRLoader from '../internal/QRLoader';\nimport { UPIConfiguration, UpiMode, UpiPaymentData, UpiType } from './types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport isMobile from '../../utils/isMobile';\nimport type { ICore } from '../../core/types';\n\n/**\n * For mobile:\n * We should show upi_collect or upi_intent depending on if `apps` are returned in /paymentMethods response\n * The upi_qr should always be on the second tab\n *\n * For non-mobile:\n * We should never show the upi_intent (ignore `apps` in /paymentMethods response)\n * The upi_qr should be on the first tab and the upi_collect should be on second tab\n */\n\nclass UPI extends UIElement<UPIConfiguration> {\n public static type = TxVariants.upi;\n public static txVariants = [TxVariants.upi, TxVariants.upi_qr, TxVariants.upi_collect, TxVariants.upi_intent];\n\n private selectedMode: UpiMode;\n\n constructor(checkout: ICore, props: UPIConfiguration) {\n super(checkout, props);\n this.selectedMode = this.props.defaultMode;\n }\n\n // @ts-ignore fix later\n formatProps(props: UPIConfiguration) {\n if (!isMobile()) {\n return {\n ...super.formatProps(props),\n defaultMode: props?.defaultMode ?? 'qrCode',\n // For large screen, ignore the apps\n apps: []\n };\n }\n\n const hasIntentApps = props.apps?.length > 0;\n const fallbackDefaultMode = hasIntentApps ? 'intent' : 'vpa';\n const allowedModes = [fallbackDefaultMode, 'qrCode'];\n const upiCollectApp = {\n id: 'vpa',\n name: props.i18n.get('upi.collect.dropdown.label'),\n type: TxVariants.upi_collect\n };\n const apps = hasIntentApps ? [...props.apps.map(app => ({ ...app, type: TxVariants.upi_intent })), upiCollectApp] : [];\n return {\n ...super.formatProps(props),\n defaultMode: allowedModes.includes(props?.defaultMode) ? props.defaultMode : fallbackDefaultMode,\n apps\n };\n }\n\n public get isValid(): boolean {\n return this.state.isValid;\n }\n\n public formatData(): UpiPaymentData {\n const { virtualPaymentAddress, app } = this.state.data || {};\n\n return {\n paymentMethod: {\n ...(this.paymentType && { type: this.paymentType }),\n ...(this.paymentType === TxVariants.upi_collect && virtualPaymentAddress && { virtualPaymentAddress }),\n ...(this.paymentType === TxVariants.upi_intent && app?.id && { appId: app.id })\n }\n };\n }\n\n get paymentType(): UpiType {\n if (this.selectedMode === 'qrCode') {\n return TxVariants.upi_qr;\n }\n if (this.selectedMode === 'vpa') {\n return TxVariants.upi_collect;\n }\n return this.state.data?.app?.type;\n }\n\n private onUpdateMode = (mode: UpiMode): void => {\n this.selectedMode = mode;\n };\n\n private renderContent(type: string, url: string, paymentMethodType: string): h.JSX.Element {\n switch (type) {\n case 'qrCode':\n return (\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n qrCodeData={this.props.qrCodeData ? encodeURIComponent(this.props.qrCodeData) : null}\n type={TxVariants.upi_qr}\n brandLogo={this.props.brandLogo || this.icon}\n onComplete={this.onComplete}\n introduction={this.props.i18n.get('upi.qrCodeWaitingMessage')}\n countdownTime={5}\n onActionHandled={this.props.onActionHandled}\n />\n );\n case 'await':\n return (\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n url={url}\n type={paymentMethodType}\n showCountdownTimer\n shouldRedirectAutomatically\n countdownTime={5}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onActionHandled={this.props.onActionHandled}\n onError={this.props.onError}\n messageText={this.props.i18n.get('upi.vpaWaitingMessage')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n />\n );\n default:\n return (\n <UPIComponent\n ref={(ref: RefObject<typeof UPIComponent>) => {\n this.componentRef = ref;\n }}\n payButton={this.payButton}\n onChange={this.setState}\n onUpdateMode={this.onUpdateMode}\n apps={this.props.apps}\n defaultMode={this.props.defaultMode}\n showPayButton={this.props.showPayButton}\n />\n );\n }\n }\n\n public render(): h.JSX.Element {\n const { type, url, paymentMethodType } = this.props;\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>{this.renderContent(type, url, paymentMethodType)}</SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UPI;\n"],"names":["UPI","UIElement","static","TxVariants","upi","upi_qr","upi_collect","upi_intent","selectedMode","constructor","checkout","props","super","this","defaultMode","formatProps","isMobile","apps","hasIntentApps","length","fallbackDefaultMode","allowedModes","upiCollectApp","id","name","i18n","get","type","map","app","includes","isValid","state","formatData","virtualPaymentAddress","data","paymentMethod","paymentType","appId","onUpdateMode","mode","renderContent","url","paymentMethodType","h","QRLoader","ref","componentRef","qrCodeData","encodeURIComponent","brandLogo","icon","onComplete","introduction","countdownTime","onActionHandled","Await","showCountdownTimer","shouldRedirectAutomatically","clientKey","paymentData","onError","messageText","awaitText","UPIComponent","payButton","onChange","setState","showPayButton","render","CoreProvider","loadingContext","resources","SRPanelProvider","srPanel","modules"],"mappings":"meAsBA,MAAMA,UAAYC,EACdC,YAAqBC,EAAWC,IAChCF,kBAA2B,CAACC,EAAWC,IAAKD,EAAWE,OAAQF,EAAWG,YAAaH,EAAWI,YAE1FC,aAERC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAChBE,KAAKL,aAAeK,KAAKF,MAAMG,WACnC,CAGAC,WAAAA,CAAYJ,GACR,IAAKK,IACD,MAAO,IACAJ,MAAMG,YAAYJ,GACrBG,YAAaH,GAAOG,aAAe,SAEnCG,KAAM,IAId,MAAMC,EAAgBP,EAAMM,MAAME,OAAS,EACrCC,EAAsBF,EAAgB,SAAW,MACjDG,EAAe,CAACD,EAAqB,UACrCE,EAAgB,CAClBC,GAAI,MACJC,KAAMb,EAAMc,KAAKC,IAAI,8BACrBC,KAAMxB,EAAWG,aAEfW,EAAOC,EAAgB,IAAIP,EAAMM,KAAKW,KAAIC,IAAQ,IAAKA,EAAKF,KAAMxB,EAAWI,eAAgBe,GAAiB,GACpH,MAAO,IACAV,MAAMG,YAAYJ,GACrBG,YAAaO,EAAaS,SAASnB,GAAOG,aAAeH,EAAMG,YAAcM,EAC7EH,OAER,CAEA,WAAWc,GACP,OAAOlB,KAAKmB,MAAMD,OACtB,CAEOE,UAAAA,GACH,MAAMC,sBAAEA,EAAqBL,IAAEA,GAAQhB,KAAKmB,MAAMG,M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G5B,QACI,OACIP,EAACoB,EAAAA,CACGlB,IAAMA,IACFjC,KAAKkC,aAAeD,CAAAA,EAExBmB,UAAWpD,KAAKoD,UAChBC,SAAUrD,KAAKsD,SACf5B,aAAc1B,KAAK0B,aACnBtB,KAAMJ,KAAKF,MAAMM,KACjBH,YAAaD,KAAKF,MAAMG,YACxBsD,cAAevD,KAAKF,MAAMyD,gBAI9C,CAEOC,MAAAA,GACH,MAAM1C,KAAEA,EAAIe,IAAEA,EAAGC,kBAAEA,GAAsB9B,KAAKF,MAC9C,OACIiC,EAAC0B,EAAAA,CAAa7C,KAAMZ,KAAKF,MAAMc,KAAM8C,eAAgB1D,KAAKF,MAAM4D,eAAgBC,UAAW3D,KAAK2D,WAC5F5B,EAAC6B,EAAAA,CAAgBC,QAAS7D,KAAKF,MAAMgE,QAAQD,SAAU7D,KAAK4B,cAAcd,EAAMe,EAAKC,IAGjG"}
1
+ {"version":3,"file":"UPI.js","sources":["../../../../src/components/UPI/UPI.tsx"],"sourcesContent":["import { h, RefObject } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport UPIComponent from './components/UPIComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport Await from '../internal/Await';\nimport QRLoader from '../internal/QRLoader';\nimport { App, UPIConfiguration, UpiMode, UpiPaymentData, UpiType } from './types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport isMobile from '../../utils/isMobile';\nimport type { ICore } from '../../core/types';\n\n/**\n * For mobile:\n * We should show upi_collect or upi_intent depending on if `apps` are returned in /paymentMethods response\n * The upi_qr should always be on the second tab\n *\n * For non-mobile:\n * We should never show the upi_intent (ignore `apps` in /paymentMethods response)\n * The upi_qr should be on the first tab and the upi_collect should be on second tab\n */\n\nclass UPI extends UIElement<UPIConfiguration> {\n public static type = TxVariants.upi;\n public static txVariants = [TxVariants.upi, TxVariants.upi_qr, TxVariants.upi_collect, TxVariants.upi_intent];\n\n private selectedMode: UpiMode;\n\n constructor(checkout: ICore, props: UPIConfiguration) {\n super(checkout, props);\n this.selectedMode = this.props.defaultMode;\n }\n\n formatProps(props: UPIConfiguration) {\n if (!isMobile()) {\n return {\n ...super.formatProps(props),\n defaultMode: props?.defaultMode ?? 'qrCode',\n // For large screen, ignore the apps\n apps: []\n };\n }\n\n const hasIntentApps = props.apps?.length > 0;\n const fallbackDefaultMode = hasIntentApps ? 'intent' : 'vpa';\n const allowedModes = [fallbackDefaultMode, 'qrCode'];\n const upiCollectApp: App = {\n id: 'vpa',\n name: props.i18n.get('upi.collect.dropdown.label'),\n type: TxVariants.upi_collect as UpiType\n };\n const apps = hasIntentApps ? [...props.apps.map(app => ({ ...app, type: TxVariants.upi_intent as UpiType })), upiCollectApp] : [];\n return {\n ...super.formatProps(props),\n defaultMode: allowedModes.includes(props?.defaultMode) ? props.defaultMode : fallbackDefaultMode,\n apps\n };\n }\n\n public get isValid(): boolean {\n return this.state.isValid;\n }\n\n public formatData(): UpiPaymentData {\n const { virtualPaymentAddress, app } = this.state.data || {};\n\n return {\n paymentMethod: {\n ...(this.paymentType && { type: this.paymentType }),\n ...(this.paymentType === TxVariants.upi_collect && virtualPaymentAddress && { virtualPaymentAddress }),\n ...(this.paymentType === TxVariants.upi_intent && app?.id && { appId: app.id })\n }\n };\n }\n\n get paymentType(): UpiType {\n if (this.selectedMode === 'qrCode') {\n return TxVariants.upi_qr;\n }\n if (this.selectedMode === 'vpa') {\n return TxVariants.upi_collect;\n }\n return this.state.data?.app?.type;\n }\n\n private onUpdateMode = (mode: UpiMode): void => {\n this.selectedMode = mode;\n };\n\n private renderContent(type: string, url: string, paymentMethodType: string): h.JSX.Element {\n switch (type) {\n case 'qrCode':\n return (\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n qrCodeData={this.props.qrCodeData ? encodeURIComponent(this.props.qrCodeData) : null}\n type={TxVariants.upi_qr}\n brandLogo={this.props.brandLogo || this.icon}\n onComplete={this.onComplete}\n introduction={this.props.i18n.get('upi.qrCodeWaitingMessage')}\n countdownTime={5}\n onActionHandled={this.props.onActionHandled}\n />\n );\n case 'await':\n return (\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n url={url}\n type={paymentMethodType}\n showCountdownTimer\n shouldRedirectAutomatically\n countdownTime={5}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onActionHandled={this.props.onActionHandled}\n onError={this.props.onError}\n messageText={this.props.i18n.get('upi.vpaWaitingMessage')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n />\n );\n default:\n return (\n <UPIComponent\n ref={(ref: RefObject<typeof UPIComponent>) => {\n this.componentRef = ref;\n }}\n payButton={this.payButton}\n onChange={this.setState}\n onUpdateMode={this.onUpdateMode}\n apps={this.props.apps}\n defaultMode={this.props.defaultMode}\n showPayButton={this.props.showPayButton}\n />\n );\n }\n }\n\n public render(): h.JSX.Element {\n const { type, url, paymentMethodType } = this.props;\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>{this.renderContent(type, url, paymentMethodType)}</SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UPI;\n"],"names":["UPI","UIElement","static","TxVariants","upi","upi_qr","upi_collect","upi_intent","selectedMode","constructor","checkout","props","super","this","defaultMode","formatProps","isMobile","apps","hasIntentApps","length","fallbackDefaultMode","allowedModes","upiCollectApp","id","name","i18n","get","type","map","app","includes","isValid","state","formatData","virtualPaymentAddress","data","paymentMethod","paymentType","appId","onUpdateMode","mode","renderContent","url","paymentMethodType","h","QRLoader","ref","componentRef","qrCodeData","encodeURIComponent","brandLogo","icon","onComplete","introduction","countdownTime","onActionHandled","Await","showCountdownTimer","shouldRedirectAutomatically","clientKey","paymentData","onError","messageText","awaitText","UPIComponent","payButton","onChange","setState","showPayButton","render","CoreProvider","loadingContext","resources","SRPanelProvider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MZ,KAAKF,MAAMc,KAAM8C,eAAgB1D,KAAKF,MAAM4D,eAAgBC,UAAW3D,KAAK2D,WAC5F5B,EAAC6B,EAAAA,CAAgBC,QAAS7D,KAAKF,MAAMgE,QAAQD,SAAU7D,KAAK4B,cAAcd,EAAMe,EAAKC,IAGjG"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as r}from"../../../utils/isValidURL.js";import{interpolateElement as t}from"../../../language/utils.js";function a({message:a,urls:n}){try{const s="string"==typeof a,l=n.every((e=>"string"==typeof e&&r(e)));return s&&l?function(r,a){return e("span",{className:"adyen-checkout-disclaimer__label"},t(r,a.map((r=>t=>e("a",{className:"adyen-checkout-link",href:r,target:"_blank",rel:"noopener noreferrer"},t)))))}(a,n):null}catch(e){return console.warn("Errors rendering disclaimer message"),null}}export{a as default};
1
+ import{createElement as e,Fragment as r}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as t}from"../../../utils/isValidURL.js";import{interpolateElement as a}from"../../../language/utils.js";function s({message:r,urls:t}){return e("span",{className:"adyen-checkout-disclaimer__label"},e(n,{message:r,urls:t}))}function n({message:s,urls:n}){const l="string"==typeof s,o=n.every((e=>"string"==typeof e&&t(e)));return l&&o?e(r,null,a(s,n.map((r=>function(t){return e("a",{className:"adyen-checkout__link",href:r,target:"_blank",rel:"noopener noreferrer"},t)})))):null}export{n as LabelOnlyDisclaimerMessage,s as default};
2
2
  //# sourceMappingURL=DisclaimerMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisclaimerMessage.js","sources":["../../../../../src/components/internal/DisclaimerMessage/DisclaimerMessage.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { isValidHttpUrl } from '../../../utils/isValidURL';\nimport './DisclaimerMessage.scss';\nimport { interpolateElement } from '../../../language/utils';\nexport interface DisclaimerMsgObject {\n message: string;\n linkText: string;\n link: string;\n}\n\ninterface InternalDisclaimerMsgObject {\n message: string;\n urls: Array<string>;\n}\n\nfunction render(message: string, urls: Array<string>) {\n return (\n <span className=\"adyen-checkout-disclaimer__label\">\n {interpolateElement(\n message,\n // eslint-disable-next-line react/display-name\n urls.map(url => translation => (\n <a className=\"adyen-checkout-link\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {translation}\n </a>\n ))\n )}\n </span>\n );\n}\n\n/**\n * props: {\n * message: 'By continuing you agree with the %#terms and conditions%#',\n * urls: ['https://www.adyen.com']\n * }\n * String inside the '%#' token pair will be rendered as an anchor element.\n */\n\nexport default function DisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n try {\n const messageIsStr = typeof message === 'string';\n const validUrls = urls.every(url => typeof url === 'string' && isValidHttpUrl(url));\n if (!messageIsStr || !validUrls) return null;\n\n return render(message, urls);\n } catch (e) {\n console.warn('Errors rendering disclaimer message');\n return null;\n }\n}\n"],"names":["DisclaimerMessage","message","urls","messageIsStr","validUrls","every","url","isValidHttpUrl","h","span","className","interpolateElement","map","translation","a","href","target","rel","render","e","console","warn"],"mappings":"sMAuCe,SAASA,GAAkBC,QAAEA,EAAOC,KAAEA,IACjD,IACI,MAAMC,EAAkC,iBAAZF,EACtBG,EAAYF,EAAKG,OAAMC,GAAsB,iBAARA,GAAoBC,EAAeD,KAC9E,OAAKH,GAAiBC,EA5B9B,SAAgBH,EAAiBC,GAC7B,OACIM,EAACC,OAAAA,CAAKC,UAAU,oCACXC,EACGV,EAEAC,EAAKU,KAAIN,GAAOO,GACZL,EAACM,IAAAA,CAAEJ,UAAU,sBAAsBK,KAAMT,EAAKU,OAAO,SAASC,IAAI,uBAC7DJ,MAMzB,CAgBeK,CAAOjB,EAASC,GAFiB,IAG5C,CAAE,MAAOiB,GAEL,OADAC,QAAQC,KAAK,uCACN,IACX,CACJ"}
1
+ {"version":3,"file":"DisclaimerMessage.js","sources":["../../../../../src/components/internal/DisclaimerMessage/DisclaimerMessage.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { isValidHttpUrl } from '../../../utils/isValidURL';\nimport './DisclaimerMessage.scss';\nimport { interpolateElement } from '../../../language/utils';\n\nexport interface DisclaimerMsgObject {\n message: string;\n linkText: string;\n link: string;\n}\n\ninterface InternalDisclaimerMsgObject {\n message: string;\n urls: Array<string>;\n}\n\n/**\n * props: {\n * message: 'By continuing you agree with the %#terms and conditions%#',\n * urls: ['https://www.adyen.com']\n * }\n * String inside the '%#' token pair will be rendered as an anchor element.\n */\n\nexport default function DisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n return (\n <span className=\"adyen-checkout-disclaimer__label\">\n <LabelOnlyDisclaimerMessage message={message} urls={urls} />\n </span>\n );\n}\n\nexport function LabelOnlyDisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n const messageIsStr = typeof message === 'string';\n const validUrls = urls.every(url => typeof url === 'string' && isValidHttpUrl(url));\n if (!messageIsStr || !validUrls) return null;\n\n return (\n <Fragment>\n {interpolateElement(\n message,\n urls.map(\n // for each URL in the URLs array, return a createLink function\n url =>\n function createLink(translation) {\n return (\n <a className=\"adyen-checkout__link\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {translation}\n </a>\n );\n }\n )\n )}\n </Fragment>\n );\n}\n"],"names":["DisclaimerMessage","message","urls","h","span","className","LabelOnlyDisclaimerMessage","messageIsStr","validUrls","every","url","isValidHttpUrl","Fragment","interpolateElement","map","translation","a","href","target","rel"],"mappings":"oNAwBe,SAASA,GAAkBC,QAAEA,EAAOC,KAAEA,IACjD,OACIC,EAACC,OAAAA,CAAKC,UAAU,oCACZF,EAACG,EAAAA,CAA2BL,QAASA,EAASC,KAAMA,IAGhE,CAEO,SAASI,GAA2BL,QAAEA,EAAOC,KAAEA,IAClD,MAAMK,EAAkC,iBAAZN,EACtBO,EAAYN,EAAKO,OAAMC,GAAsB,iBAARA,GAAoBC,EAAeD,KAC9E,OAAKH,GAAiBC,EAGlBL,EAACS,EACIC,KAAAA,EACGZ,EACAC,EAAKY,KAEDJ,GACI,SAAoBK,GAChB,OACIZ,EAACa,IAAAA,CAAEX,UAAU,uBAAuBY,KAAMP,EAAKQ,OAAO,SAASC,IAAI,uBAC9DJ,EAGb,MAfoB,IAoB5C"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:c,bundleType:a})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${c}?clientKey=${r}`};return n=>{const c={version:"6.0.1",channel:"Web",platform:"Web",buildType:a,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),d=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(d)?Promise.resolve(d.id):(l=e(s,c).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
1
+ import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:c,bundleType:a})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${c}?clientKey=${r}`};return n=>{const c={version:"6.0.3",channel:"Web",platform:"Web",buildType:a,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),d=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(d)?Promise.resolve(d.id):(l=e(s,c).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
2
2
  //# sourceMappingURL=collect-id.js.map
@@ -1,2 +1,2 @@
1
- import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import i from"./Analytics/Analytics.js";import{assertConfigurationPropertiesAreValid as n,processGlobalOptions as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as g}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as f}from"./Analytics/constants.js";import{THREEDS2_FULL as C}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import j from"./Services/get-translations.js";import{defaultProps as E}from"./core.defaultProps.js";import{formatLocale as v,formatCustomTranslations as A}from"../language/utils.js";import{resolveEnvironments as b}from"./Environment/Environment.js";class P{session;paymentMethodsResponse;modules;options;analyticsContext;loadingContext;cdnImagesUrl;cdnTranslationsUrl;components=[];static metadata={version:"6.0.1",bundleType:"esm"};static registry=p;static setBundleType(t){P.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}constructor(t){n(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...E,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:i}=b(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=i,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substring(0,4);if(("test"===a||"live"===a)&&!this.loadingContext.includes(a))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);"pub."===a&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=P.metadata)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:i,...n}=t;return this.setOptions({...n,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(i),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await j(this.cdnTranslationsUrl,P.metadata.version,this.options.locale)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(g,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=v(this.options.locale),this.options.translations=A(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===C?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:f,subtype:t.type,message:`${s} action was handled by the SDK`});const i={...this.getCorePropsForComponent(),...o};return e(this,p,t,i)}return this.handleCreateError()}update=(t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this))));remove=t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this);setOptions=t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}};getCorePropsForComponent(){return{...a(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:i({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:P.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}}export{P as default};
1
+ import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import i from"./Analytics/Analytics.js";import{assertConfigurationPropertiesAreValid as n,processGlobalOptions as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as g}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as f}from"./Analytics/constants.js";import{THREEDS2_FULL as C}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import j from"./Services/get-translations.js";import{defaultProps as E}from"./core.defaultProps.js";import{formatLocale as v,formatCustomTranslations as A}from"../language/utils.js";import{resolveEnvironments as b}from"./Environment/Environment.js";class P{session;paymentMethodsResponse;modules;options;analyticsContext;loadingContext;cdnImagesUrl;cdnTranslationsUrl;components=[];static metadata={version:"6.0.3",bundleType:"esm"};static registry=p;static setBundleType(t){P.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}constructor(t){n(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...E,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:i}=b(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=i,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const a=this.options.clientKey?.substring(0,4);if(("test"===a||"live"===a)&&!this.loadingContext.includes(a))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${a} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);"pub."===a&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=P.metadata)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:i,...n}=t;return this.setOptions({...n,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(i),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await j(this.cdnTranslationsUrl,P.metadata.version,this.options.locale)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(g,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=v(this.options.locale),this.options.translations=A(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===C?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:f,subtype:t.type,message:`${s} action was handled by the SDK`});const i={...this.getCorePropsForComponent(),...o};return e(this,p,t,i)}return this.handleCreateError()}update=(t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this))));remove=t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this);setOptions=t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}};getCorePropsForComponent(){return{...a(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:i({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:P.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}}export{P as default};
2
2
  //# sourceMappingURL=core.js.map
@@ -4397,11 +4397,7 @@ declare class UPI extends UIElement<UPIConfiguration> {
4397
4397
  constructor(checkout: ICore, props: UPIConfiguration);
4398
4398
  formatProps(props: UPIConfiguration): {
4399
4399
  defaultMode: UpiMode;
4400
- apps: {
4401
- type: TxVariants;
4402
- id: string;
4403
- name: string;
4404
- }[];
4400
+ apps: App[];
4405
4401
  url?: string;
4406
4402
  paymentData?: string;
4407
4403
  qrCodeData?: string;
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../external/preact/dist/preact.js";import r from"../helpers/OpenInvoiceContainer/OpenInvoiceContainer.js";import{personalDetailsRequiredFields as t,deliveryAddressSpecification as o,allowedBillingCountries as n,allowedDeliveryCountries as i,termsAndConditionsUrlMap as c}from"./config.js";import s from"../internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js";import{getConsentUrl as l}from"../../utils/getConsentUrl.js";import{TxVariants as a}from"../tx-variants.js";function p(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){p(e,r,t[r])}))}return e}function u(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}class b extends r{formatProps(r){var t;return u(f({},super.formatProps(r)),{billingAddressSpecification:u(f({},r.billingAddressSpecification),{allowedCountries:r.countryCode?[r.countryCode]:n}),deliveryAddressSpecification:u(f({},r.deliveryAddressSpecification),{allowedCountries:i}),consentCheckboxLabel:e(s,{url:l(r.countryCode,null===(t=r.i18n)||void 0===t?void 0:t.locale,c)})})}}p(b,"type",a.riverty),p(b,"defaultProps",f({personalDetailsRequiredFields:t,deliveryAddressSpecification:o},r.defaultProps));export{b as default};
1
+ import{createElement as e}from"../../external/preact/dist/preact.js";import r from"../helpers/OpenInvoiceContainer/OpenInvoiceContainer.js";import{personalDetailsRequiredFields as t,deliveryAddressSpecification as o,allowedBillingCountries as n,allowedDeliveryCountries as i,DISCLAIMER_MESSAGE_TRANSLATION_KEY as s,termsAndConditionsUrlMap as c,privacyPolicyUrlMap as l}from"./config.js";import{getConsentUrl as a}from"../../utils/getConsentUrl.js";import{LabelOnlyDisclaimerMessage as p}from"../internal/DisclaimerMessage/DisclaimerMessage.js";import{TxVariants as u}from"../tx-variants.js";function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function d(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){f(e,r,t[r])}))}return e}function y(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}class b extends r{formatProps(r){var t,o;const u=a(r.countryCode,null===(t=r.i18n)||void 0===t?void 0:t.locale,c),f=a(r.countryCode,null===(o=r.i18n)||void 0===o?void 0:o.locale,l);return y(d({},super.formatProps(r)),{billingAddressSpecification:y(d({},r.billingAddressSpecification),{allowedCountries:r.countryCode?[r.countryCode]:n}),deliveryAddressSpecification:y(d({},r.deliveryAddressSpecification),{allowedCountries:i}),consentCheckboxLabel:e(p,{message:r.i18n.get(s),urls:[u,f]})})}}f(b,"type",u.riverty),f(b,"defaultProps",d({personalDetailsRequiredFields:t,deliveryAddressSpecification:o},r.defaultProps));export{b as default};
2
2
  //# sourceMappingURL=Riverty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { h } from 'preact';\nimport OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport {\n allowedBillingCountries,\n allowedDeliveryCountries,\n deliveryAddressSpecification,\n personalDetailsRequiredFields,\n termsAndConditionsUrlMap\n} from './config';\nimport ConsentCheckboxLabel from '../internal/ConsentCheckboxLabel';\nimport { getConsentUrl } from '../../utils/getConsentUrl';\nimport type { OpenInvoiceConfiguration } from '../helpers/OpenInvoiceContainer/types';\nimport { TxVariants } from '../tx-variants';\n\nexport default class Riverty extends OpenInvoiceContainer {\n public static readonly type = TxVariants.riverty;\n\n protected static defaultProps = {\n personalDetailsRequiredFields,\n deliveryAddressSpecification,\n ...OpenInvoiceContainer.defaultProps\n };\n\n formatProps(props: OpenInvoiceConfiguration) {\n return {\n ...super.formatProps(props),\n billingAddressSpecification: {\n ...props.billingAddressSpecification,\n allowedCountries: props.countryCode ? [props.countryCode] : allowedBillingCountries\n },\n deliveryAddressSpecification: { ...props.deliveryAddressSpecification, allowedCountries: allowedDeliveryCountries },\n consentCheckboxLabel: <ConsentCheckboxLabel url={getConsentUrl(props.countryCode, props.i18n?.locale, termsAndConditionsUrlMap)} />\n };\n }\n}\n"],"names":["Riverty","OpenInvoiceContainer","formatProps","props","_object_spread_props","_object_spread","super","billingAddressSpecification","allowedCountries","countryCode","allowedBillingCountries","deliveryAddressSpecification","allowedDeliveryCountries","consentCheckboxLabel","h","ConsentCheckboxLabel","url","getConsentUrl","i18n","locale","termsAndConditionsUrlMap","_define_property","type","TxVariants","riverty","defaultProps","personalDetailsRequiredFields"],"mappings":"syCAce,MAAMA,UAAgBC,EASjCC,WAAAA,CAAYC,GAQ8EA,IAAAA,EAPtF,OAAOC,EAAAC,EAAA,CAAA,EACAC,MAAMJ,YAAYC,IAAAA,CACrBI,4BAA6BH,EAAAC,EAAA,CAAA,EACtBF,EAAMI,6BAA2B,CACpCC,iBAAkBL,EAAMM,YAAc,CAACN,EAAMM,aAAeC,IAEhEC,6BAA8BP,EAAAC,EAAA,CAAA,EAAKF,EAAMQ,8BAA4B,CAAEH,iBAAkBI,IACzFC,qBAAsBC,EAACC,EAAAA,CAAqBC,IAAKC,EAAcd,EAAMM,YAAaN,QAAAA,EAAAA,EAAMe,YAANf,IAAAA,OAAAA,EAAAA,EAAYgB,OAAQC,MAE9G,EAlBAC,EADiBrB,EACMsB,OAAOC,EAAWC,SAEzCH,EAHiBrB,EAGAyB,eAAepB,EAAA,CAC5BqB,gCACAf,gCACGV,EAAqBwB"}
1
+ {"version":3,"file":"Riverty.js","sources":["../../../../src/components/Riverty/Riverty.tsx"],"sourcesContent":["import { h } from 'preact';\nimport OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';\nimport {\n DISCLAIMER_MESSAGE_TRANSLATION_KEY,\n allowedBillingCountries,\n allowedDeliveryCountries,\n deliveryAddressSpecification,\n personalDetailsRequiredFields,\n termsAndConditionsUrlMap,\n privacyPolicyUrlMap\n} from './config';\nimport { getConsentUrl } from '../../utils/getConsentUrl';\nimport { LabelOnlyDisclaimerMessage } from '../internal/DisclaimerMessage/DisclaimerMessage';\nimport type { OpenInvoiceConfiguration } from '../helpers/OpenInvoiceContainer/types';\nimport { TxVariants } from '../tx-variants';\n\nexport default class Riverty extends OpenInvoiceContainer {\n public static readonly type = TxVariants.riverty;\n\n protected static defaultProps = {\n personalDetailsRequiredFields,\n deliveryAddressSpecification,\n ...OpenInvoiceContainer.defaultProps\n };\n\n formatProps(props: OpenInvoiceConfiguration) {\n const tocURL = getConsentUrl(props.countryCode, props.i18n?.locale, termsAndConditionsUrlMap);\n const privacyURL = getConsentUrl(props.countryCode, props.i18n?.locale, privacyPolicyUrlMap);\n\n return {\n ...super.formatProps(props),\n billingAddressSpecification: {\n ...props.billingAddressSpecification,\n allowedCountries: props.countryCode ? [props.countryCode] : allowedBillingCountries\n },\n deliveryAddressSpecification: {\n ...props.deliveryAddressSpecification,\n allowedCountries: allowedDeliveryCountries\n },\n consentCheckboxLabel: (\n <LabelOnlyDisclaimerMessage message={props.i18n.get(DISCLAIMER_MESSAGE_TRANSLATION_KEY)} urls={[tocURL, privacyURL]} />\n )\n };\n }\n}\n"],"names":["Riverty","OpenInvoiceContainer","formatProps","props","tocURL","getConsentUrl","countryCode","i18n","locale","termsAndConditionsUrlMap","privacyURL","privacyPolicyUrlMap","_object_spread_props","_object_spread","super","billingAddressSpecification","allowedCountries","allowedBillingCountries","deliveryAddressSpecification","allowedDeliveryCountries","consentCheckboxLabel","h","LabelOnlyDisclaimerMessage","message","get","DISCLAIMER_MESSAGE_TRANSLATION_KEY","urls","_define_property","type","TxVariants","riverty","defaultProps","personalDetailsRequiredFields"],"mappings":"+3CAgBe,MAAMA,UAAgBC,EASjCC,WAAAA,CAAYC,OACwCA,EACIA,EADpD,MAAMC,EAASC,EAAcF,EAAMG,YAAaH,QAAAA,EAAAA,EAAMI,YAANJ,IAAAA,OAAAA,EAAAA,EAAYK,OAAQC,GAC9DC,EAAaL,EAAcF,EAAMG,YAAaH,QAAAA,EAAAA,EAAMI,YAANJ,IAAAA,OAAAA,EAAAA,EAAYK,OAAQG,GAExE,OAAOC,EAAAC,EAAA,CAAA,EACAC,MAAMZ,YAAYC,IAAAA,CACrBY,4BAA6BH,EAAAC,EAAA,CAAA,EACtBV,EAAMY,6BAA2B,CACpCC,iBAAkBb,EAAMG,YAAc,CAACH,EAAMG,aAAeW,IAEhEC,6BAA8BN,EAAAC,EAAA,CAAA,EACvBV,EAAMe,8BAA4B,CACrCF,iBAAkBG,IAEtBC,qBACIC,EAACC,EAAAA,CAA2BC,QAASpB,EAAMI,KAAKiB,IAAIC,GAAqCC,KAAM,CAACtB,EAAQM,MAGpH,EA1BAiB,EADiB3B,EACM4B,OAAOC,EAAWC,SAEzCH,EAHiB3B,EAGA+B,eAAelB,EAAA,CAC5BmB,gCACAd,gCACGjB,EAAqB8B"}
@@ -1,2 +1,2 @@
1
- import{FIRST_NAME as e,LAST_NAME as t,COUNTRY as s,STREET as o,HOUSE_NUMBER_OR_NAME as n,POSTAL_CODE as m,CITY as i}from"../internal/Address/constants.js";const d=["AT","CH","DE"],r=["NO","SE","FI","DK","DE","AT","CH","NL","BE"],c=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"],a={default:{labels:{[e]:"deliveryAddress.firstName",[t]:"deliveryAddress.lastName"},schema:[s,[[e,50],[t,50]],[[o,70],[n,30]],[[m,30],[i,70]]]}},h={at:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de"},ch:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de",fr:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr"},de:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de"}};export{d as allowedBillingCountries,r as allowedDeliveryCountries,a as deliveryAddressSpecification,c as personalDetailsRequiredFields,h as termsAndConditionsUrlMap};
1
+ import{FIRST_NAME as t,LAST_NAME as e,COUNTRY as s,STREET as c,HOUSE_NUMBER_OR_NAME as o,POSTAL_CODE as n,CITY as m}from"../internal/Address/constants.js";const r="riverty.termsAndConditions",i=["AT","CH","DE"],d=["NO","SE","FI","DK","DE","AT","CH","NL","BE"],a=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"],h={default:{labels:{[t]:"deliveryAddress.firstName",[e]:"deliveryAddress.lastName"},schema:[s,[[t,50],[e,50]],[[c,70],[o,30]],[[n,30],[m,70]]]}},_={at:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de"},ch:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de",fr:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr"},de:{en:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en",de:"https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de"}},p={at:{en:"https://documents.riverty.com/privacy_statement/checkout/at_en",de:"https://documents.riverty.com/privacy_statement/checkout/at_de"},ch:{en:"https://documents.riverty.com/privacy_statement/checkout/ch_en",de:"https://documents.riverty.com/privacy_statement/checkout/h_de",fr:"https://documents.riverty.com/privacy_statement/checkout/ch_fr"},de:{en:"https://documents.riverty.com/privacy_statement/checkout/de_en",de:"https://documents.riverty.com/privacy_statement/checkout/de_de"}};export{r as DISCLAIMER_MESSAGE_TRANSLATION_KEY,i as allowedBillingCountries,d as allowedDeliveryCountries,h as deliveryAddressSpecification,a as personalDetailsRequiredFields,p as privacyPolicyUrlMap,_ as termsAndConditionsUrlMap};
2
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../../src/components/Riverty/config.ts"],"sourcesContent":["import { CITY, COUNTRY, FIRST_NAME, HOUSE_NUMBER_OR_NAME, LAST_NAME, POSTAL_CODE, STREET } from '../internal/Address/constants';\nimport { AddressSpecifications } from '../internal/Address/types';\n\nexport const allowedBillingCountries = ['AT', 'CH', 'DE'];\nexport const allowedDeliveryCountries = ['NO', 'SE', 'FI', 'DK', 'DE', 'AT', 'CH', 'NL', 'BE'];\nexport const personalDetailsRequiredFields = ['firstName', 'lastName', 'dateOfBirth', 'shopperEmail', 'telephoneNumber'];\nexport const deliveryAddressSpecification: AddressSpecifications = {\n default: {\n labels: {\n [FIRST_NAME]: 'deliveryAddress.firstName',\n [LAST_NAME]: 'deliveryAddress.lastName'\n },\n schema: [\n COUNTRY,\n [\n [FIRST_NAME, 50],\n [LAST_NAME, 50]\n ],\n [\n [STREET, 70],\n [HOUSE_NUMBER_OR_NAME, 30]\n ],\n\n [\n [POSTAL_CODE, 30],\n [CITY, 70]\n ]\n ]\n }\n};\nexport const termsAndConditionsUrlMap = {\n at: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de',\n fr: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de'\n }\n};\n"],"names":["allowedBillingCountries","allowedDeliveryCountries","personalDetailsRequiredFields","deliveryAddressSpecification","default","labels","FIRST_NAME","LAST_NAME","schema","COUNTRY","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","termsAndConditionsUrlMap","at","en","de","ch","fr"],"mappings":"iKAGaA,EAA0B,CAAC,KAAM,KAAM,MACvCC,EAA2B,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAC5EC,EAAgC,CAAC,YAAa,WAAY,cAAe,eAAgB,mBACzFC,EAAsD,CAC/DC,QAAS,CACLC,OAAQ,CACJC,CAACA,GAAa,4BACdC,CAACA,GAAY,4BAEjBC,OAAQ,CACJC,EACA,CACI,CAACH,EAAY,IACb,CAACC,EAAW,KAEhB,CACI,CAACG,EAAQ,IACT,CAACC,EAAsB,KAG3B,CACI,CAACC,EAAa,IACd,CAACC,EAAM,QAKVC,EAA2B,CACpCC,GAAI,CACAC,GAAI,+EACJC,GAAI,gFAERC,GAAI,CACAF,GAAI,+EACJC,GAAI,+EACJE,GAAI,gFAERF,GAAI,CACAD,GAAI,+EACJC,GAAI"}
1
+ {"version":3,"file":"config.js","sources":["../../../../src/components/Riverty/config.ts"],"sourcesContent":["import { CITY, COUNTRY, FIRST_NAME, HOUSE_NUMBER_OR_NAME, LAST_NAME, POSTAL_CODE, STREET } from '../internal/Address/constants';\nimport { AddressSpecifications } from '../internal/Address/types';\n\nexport const DISCLAIMER_MESSAGE_TRANSLATION_KEY = 'riverty.termsAndConditions';\n\nexport const allowedBillingCountries = ['AT', 'CH', 'DE'];\nexport const allowedDeliveryCountries = ['NO', 'SE', 'FI', 'DK', 'DE', 'AT', 'CH', 'NL', 'BE'];\nexport const personalDetailsRequiredFields = ['firstName', 'lastName', 'dateOfBirth', 'shopperEmail', 'telephoneNumber'];\nexport const deliveryAddressSpecification: AddressSpecifications = {\n default: {\n labels: {\n [FIRST_NAME]: 'deliveryAddress.firstName',\n [LAST_NAME]: 'deliveryAddress.lastName'\n },\n schema: [\n COUNTRY,\n [\n [FIRST_NAME, 50],\n [LAST_NAME, 50]\n ],\n [\n [STREET, 70],\n [HOUSE_NUMBER_OR_NAME, 30]\n ],\n\n [\n [POSTAL_CODE, 30],\n [CITY, 70]\n ]\n ]\n }\n};\nexport const termsAndConditionsUrlMap = {\n at: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_de',\n fr: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_en',\n de: 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/de_de'\n }\n};\n\nexport const privacyPolicyUrlMap = {\n at: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/at_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/at_de'\n },\n ch: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/ch_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/h_de',\n fr: 'https://documents.riverty.com/privacy_statement/checkout/ch_fr'\n },\n de: {\n en: 'https://documents.riverty.com/privacy_statement/checkout/de_en',\n de: 'https://documents.riverty.com/privacy_statement/checkout/de_de'\n }\n};\n"],"names":["DISCLAIMER_MESSAGE_TRANSLATION_KEY","allowedBillingCountries","allowedDeliveryCountries","personalDetailsRequiredFields","deliveryAddressSpecification","default","labels","FIRST_NAME","LAST_NAME","schema","COUNTRY","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","termsAndConditionsUrlMap","at","en","de","ch","fr","privacyPolicyUrlMap"],"mappings":"2JAGO,MAAMA,EAAqC,6BAErCC,EAA0B,CAAC,KAAM,KAAM,MACvCC,EAA2B,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAC5EC,EAAgC,CAAC,YAAa,WAAY,cAAe,eAAgB,mBACzFC,EAAsD,CAC/DC,QAAS,CACLC,OAAQ,CACJC,CAACA,GAAa,4BACdC,CAACA,GAAY,4BAEjBC,OAAQ,CACJC,EACA,CACI,CAACH,EAAY,IACb,CAACC,EAAW,KAEhB,CACI,CAACG,EAAQ,IACT,CAACC,EAAsB,KAG3B,CACI,CAACC,EAAa,IACd,CAACC,EAAM,QAKVC,EAA2B,CACpCC,GAAI,CACAC,GAAI,+EACJC,GAAI,gFAERC,GAAI,CACAF,GAAI,+EACJC,GAAI,+EACJE,GAAI,gFAERF,GAAI,CACAD,GAAI,+EACJC,GAAI,iFAICG,EAAsB,CAC/BL,GAAI,CACAC,GAAI,iEACJC,GAAI,kEAERC,GAAI,CACAF,GAAI,iEACJC,GAAI,gEACJE,GAAI,kEAERF,GAAI,CACAD,GAAI,iEACJC,GAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"UPI.js","sources":["../../../../src/components/UPI/UPI.tsx"],"sourcesContent":["import { h, RefObject } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport UPIComponent from './components/UPIComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport Await from '../internal/Await';\nimport QRLoader from '../internal/QRLoader';\nimport { UPIConfiguration, UpiMode, UpiPaymentData, UpiType } from './types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport isMobile from '../../utils/isMobile';\nimport type { ICore } from '../../core/types';\n\n/**\n * For mobile:\n * We should show upi_collect or upi_intent depending on if `apps` are returned in /paymentMethods response\n * The upi_qr should always be on the second tab\n *\n * For non-mobile:\n * We should never show the upi_intent (ignore `apps` in /paymentMethods response)\n * The upi_qr should be on the first tab and the upi_collect should be on second tab\n */\n\nclass UPI extends UIElement<UPIConfiguration> {\n public static type = TxVariants.upi;\n public static txVariants = [TxVariants.upi, TxVariants.upi_qr, TxVariants.upi_collect, TxVariants.upi_intent];\n\n private selectedMode: UpiMode;\n\n constructor(checkout: ICore, props: UPIConfiguration) {\n super(checkout, props);\n this.selectedMode = this.props.defaultMode;\n }\n\n // @ts-ignore fix later\n formatProps(props: UPIConfiguration) {\n if (!isMobile()) {\n return {\n ...super.formatProps(props),\n defaultMode: props?.defaultMode ?? 'qrCode',\n // For large screen, ignore the apps\n apps: []\n };\n }\n\n const hasIntentApps = props.apps?.length > 0;\n const fallbackDefaultMode = hasIntentApps ? 'intent' : 'vpa';\n const allowedModes = [fallbackDefaultMode, 'qrCode'];\n const upiCollectApp = {\n id: 'vpa',\n name: props.i18n.get('upi.collect.dropdown.label'),\n type: TxVariants.upi_collect\n };\n const apps = hasIntentApps ? [...props.apps.map(app => ({ ...app, type: TxVariants.upi_intent })), upiCollectApp] : [];\n return {\n ...super.formatProps(props),\n defaultMode: allowedModes.includes(props?.defaultMode) ? props.defaultMode : fallbackDefaultMode,\n apps\n };\n }\n\n public get isValid(): boolean {\n return this.state.isValid;\n }\n\n public formatData(): UpiPaymentData {\n const { virtualPaymentAddress, app } = this.state.data || {};\n\n return {\n paymentMethod: {\n ...(this.paymentType && { type: this.paymentType }),\n ...(this.paymentType === TxVariants.upi_collect && virtualPaymentAddress && { virtualPaymentAddress }),\n ...(this.paymentType === TxVariants.upi_intent && app?.id && { appId: app.id })\n }\n };\n }\n\n get paymentType(): UpiType {\n if (this.selectedMode === 'qrCode') {\n return TxVariants.upi_qr;\n }\n if (this.selectedMode === 'vpa') {\n return TxVariants.upi_collect;\n }\n return this.state.data?.app?.type;\n }\n\n private onUpdateMode = (mode: UpiMode): void => {\n this.selectedMode = mode;\n };\n\n private renderContent(type: string, url: string, paymentMethodType: string): h.JSX.Element {\n switch (type) {\n case 'qrCode':\n return (\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n qrCodeData={this.props.qrCodeData ? encodeURIComponent(this.props.qrCodeData) : null}\n type={TxVariants.upi_qr}\n brandLogo={this.props.brandLogo || this.icon}\n onComplete={this.onComplete}\n introduction={this.props.i18n.get('upi.qrCodeWaitingMessage')}\n countdownTime={5}\n onActionHandled={this.props.onActionHandled}\n />\n );\n case 'await':\n return (\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n url={url}\n type={paymentMethodType}\n showCountdownTimer\n shouldRedirectAutomatically\n countdownTime={5}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onActionHandled={this.props.onActionHandled}\n onError={this.props.onError}\n messageText={this.props.i18n.get('upi.vpaWaitingMessage')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n />\n );\n default:\n return (\n <UPIComponent\n ref={(ref: RefObject<typeof UPIComponent>) => {\n this.componentRef = ref;\n }}\n payButton={this.payButton}\n onChange={this.setState}\n onUpdateMode={this.onUpdateMode}\n apps={this.props.apps}\n defaultMode={this.props.defaultMode}\n showPayButton={this.props.showPayButton}\n />\n );\n }\n }\n\n public render(): h.JSX.Element {\n const { type, url, paymentMethodType } = this.props;\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>{this.renderContent(type, url, paymentMethodType)}</SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UPI;\n"],"names":["UPI","UIElement","formatProps","props","isMobile","_object_spread_props","_object_spread","super","defaultMode","apps","hasIntentApps","length","fallbackDefaultMode","allowedModes","upiCollectApp","id","name","i18n","get","type","TxVariants","upi_collect","map","app","upi_intent","includes","isValid","this","state","formatData","virtualPaymentAddress","data","paymentMethod","paymentType","appId","_this_state_data_app","_this_state_data","selectedMode","upi_qr","renderContent","url","paymentMethodType","h","QRLoader","ref","componentRef","qrCodeData","encodeURIComponent","brandLogo","icon","onComplete","introduction","countdownTime","onActionHandled","Await","showCountdownTimer","shouldRedirectAutomatically","clientKey","paymentData","onError","messageText","awaitText","UPIComponent","payButton","onChange","setState","onUpdateMode","showPayButton","render","CoreProvider","loadingContext","resources","SRPanelProvider","srPanel","modules","constructor","checkout","_define_property","mode","upi","txVariants"],"mappings":"kxCAsBA,MAAMA,UAAYC,EAYdC,WAAAA,CAAYC,GAUcA,IAAAA,EANDA,EAHrB,IAAKC,IACD,OAAOC,EAAAC,EAAA,CAAA,EACAC,MAAML,YAAYC,IAAAA,CACrBK,YAA+B,QAAlBL,EAAAA,aAAAA,EAAAA,EAAOK,uBAAPL,EAAAA,EAAsB,SAEnCM,KAAM,KAId,MAAMC,GAAgBP,QAAAA,EAAAA,EAAMM,YAANN,IAAAA,OAAAA,EAAAA,EAAYQ,QAAS,EACrCC,EAAsBF,EAAgB,SAAW,MACjDG,EAAe,CAACD,EAAqB,UACrCE,EAAgB,CAClBC,GAAI,MACJC,KAAMb,EAAMc,KAAKC,IAAI,8BACrBC,KAAMC,EAAWC,aAEfZ,EAAOC,EAAgB,IAAIP,EAAMM,KAAKa,KAAIC,GAAQlB,EAAKkB,EAAAA,GAAAA,GAAAA,CAAKJ,KAAMC,EAAWI,eAAgBV,GAAiB,GACpH,OAAOT,EAAAC,EAAA,CAAA,EACAC,MAAML,YAAYC,IAAAA,CACrBK,YAAaK,EA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PI/UPI.tsx"],"sourcesContent":["import { h, RefObject } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport UPIComponent from './components/UPIComponent';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport Await from '../internal/Await';\nimport QRLoader from '../internal/QRLoader';\nimport { App, UPIConfiguration, UpiMode, UpiPaymentData, UpiType } from './types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport isMobile from '../../utils/isMobile';\nimport type { ICore } from '../../core/types';\n\n/**\n * For mobile:\n * We should show upi_collect or upi_intent depending on if `apps` are returned in /paymentMethods response\n * The upi_qr should always be on the second tab\n *\n * For non-mobile:\n * We should never show the upi_intent (ignore `apps` in /paymentMethods response)\n * The upi_qr should be on the first tab and the upi_collect should be on second tab\n */\n\nclass UPI extends UIElement<UPIConfiguration> {\n public static type = TxVariants.upi;\n public static txVariants = [TxVariants.upi, TxVariants.upi_qr, TxVariants.upi_collect, TxVariants.upi_intent];\n\n private selectedMode: UpiMode;\n\n constructor(checkout: ICore, props: UPIConfiguration) {\n super(checkout, props);\n this.selectedMode = this.props.defaultMode;\n }\n\n formatProps(props: UPIConfiguration) {\n if (!isMobile()) {\n return {\n ...super.formatProps(props),\n defaultMode: props?.defaultMode ?? 'qrCode',\n // For large screen, ignore the apps\n apps: []\n };\n }\n\n const hasIntentApps = props.apps?.length > 0;\n const fallbackDefaultMode = hasIntentApps ? 'intent' : 'vpa';\n const allowedModes = [fallbackDefaultMode, 'qrCode'];\n const upiCollectApp: App = {\n id: 'vpa',\n name: props.i18n.get('upi.collect.dropdown.label'),\n type: TxVariants.upi_collect as UpiType\n };\n const apps = hasIntentApps ? [...props.apps.map(app => ({ ...app, type: TxVariants.upi_intent as UpiType })), upiCollectApp] : [];\n return {\n ...super.formatProps(props),\n defaultMode: allowedModes.includes(props?.defaultMode) ? props.defaultMode : fallbackDefaultMode,\n apps\n };\n }\n\n public get isValid(): boolean {\n return this.state.isValid;\n }\n\n public formatData(): UpiPaymentData {\n const { virtualPaymentAddress, app } = this.state.data || {};\n\n return {\n paymentMethod: {\n ...(this.paymentType && { type: this.paymentType }),\n ...(this.paymentType === TxVariants.upi_collect && virtualPaymentAddress && { virtualPaymentAddress }),\n ...(this.paymentType === TxVariants.upi_intent && app?.id && { appId: app.id })\n }\n };\n }\n\n get paymentType(): UpiType {\n if (this.selectedMode === 'qrCode') {\n return TxVariants.upi_qr;\n }\n if (this.selectedMode === 'vpa') {\n return TxVariants.upi_collect;\n }\n return this.state.data?.app?.type;\n }\n\n private onUpdateMode = (mode: UpiMode): void => {\n this.selectedMode = mode;\n };\n\n private renderContent(type: string, url: string, paymentMethodType: string): h.JSX.Element {\n switch (type) {\n case 'qrCode':\n return (\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n qrCodeData={this.props.qrCodeData ? encodeURIComponent(this.props.qrCodeData) : null}\n type={TxVariants.upi_qr}\n brandLogo={this.props.brandLogo || this.icon}\n onComplete={this.onComplete}\n introduction={this.props.i18n.get('upi.qrCodeWaitingMessage')}\n countdownTime={5}\n onActionHandled={this.props.onActionHandled}\n />\n );\n case 'await':\n return (\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n url={url}\n type={paymentMethodType}\n showCountdownTimer\n shouldRedirectAutomatically\n countdownTime={5}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onActionHandled={this.props.onActionHandled}\n onError={this.props.onError}\n messageText={this.props.i18n.get('upi.vpaWaitingMessage')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n />\n );\n default:\n return (\n <UPIComponent\n ref={(ref: RefObject<typeof UPIComponent>) => {\n this.componentRef = ref;\n }}\n payButton={this.payButton}\n onChange={this.setState}\n onUpdateMode={this.onUpdateMode}\n apps={this.props.apps}\n defaultMode={this.props.defaultMode}\n showPayButton={this.props.showPayButton}\n />\n );\n }\n }\n\n public render(): h.JSX.Element {\n const { type, url, paymentMethodType } = this.props;\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>{this.renderContent(type, url, paymentMethodType)}</SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default UPI;\n"],"names":["UPI","UIElement","formatProps","props","isMobile","_object_spread_props","_object_spread","super","defaultMode","apps","hasIntentApps","length","fallbackDefaultMode","allowedModes","upiCollectApp","id","name","i18n","get","type","TxVariants","upi_collect","map","app","upi_intent","includes","isValid","this","state","formatData","virtualPaymentAddress","data","paymentMethod","paymentType","appId","_this_state_data_app","_this_state_data","selectedMode","upi_qr","renderContent","url","paymentMethodType","h","QRLoader","ref","componentRef","qrCodeData","encodeURIComponent","brandLogo","icon","onComplete","introduction","countdownTime","onActionHandled","Await","showCountdownTimer","shouldRedirectAutomatically","clientKey","paymentData","onError","messageText","awaitText","UPIComponent","payButton","onChange","setState","onUpdateMode","showPayButton","render","CoreProvider","loadingContext","resources","SRPanelProvider","srPanel","modules","constructor","checkout","_define_property","mode","upi","txVariants"],"mappings":"kxCAsBA,MAAMA,UAAYC,EAWdC,WAAAA,CAAYC,GAUcA,IAAAA,EANDA,EAHrB,IAAKC,IACD,OAAOC,EAAAC,EAAA,CAAA,EACAC,MAAML,YAAYC,IAAAA,CACrBK,YAA+B,QAAlBL,EAAAA,aAAAA,EAAAA,EAAOK,uBAAPL,EAAAA,EAAsB,SAEnCM,KAAM,KAId,MAAMC,GAAgBP,QAAAA,EAAAA,EAAMM,YAANN,IAAAA,OAAAA,EAAAA,EAAYQ,QAAS,EACrCC,EAAsBF,EAAgB,SAAW,MACjDG,EAAe,CAACD,EAAqB,UACrCE,EAAqB,CACvBC,GAAI,MACJC,KAAMb,EAAMc,KAAKC,IAAI,8BACrBC,KAAMC,EAAWC,aAEfZ,EAAOC,EAAgB,IAAIP,EAAMM,KAAKa,KAAIC,GAAQlB,EAAKkB,EAAAA,GAAAA,GAA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AEYgF,aAAa,CAAC5D,EAAW2D,IAAK3D,EAAWkB,OAAQlB,EAAWC,YAAaD,EAAWI"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as r}from"../../../utils/isValidURL.js";import{interpolateElement as t}from"../../../language/utils.js";function a({message:a,urls:n}){try{const s="string"==typeof a,l=n.every((e=>"string"==typeof e&&r(e)));return s&&l?function(r,a){return e("span",{className:"adyen-checkout-disclaimer__label"},t(r,a.map((r=>t=>e("a",{className:"adyen-checkout-link",href:r,target:"_blank",rel:"noopener noreferrer"},t)))))}(a,n):null}catch(e){return console.warn("Errors rendering disclaimer message"),null}}export{a as default};
1
+ import{createElement as e,Fragment as r}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as t}from"../../../utils/isValidURL.js";import{interpolateElement as a}from"../../../language/utils.js";function s({message:r,urls:t}){return e("span",{className:"adyen-checkout-disclaimer__label"},e(n,{message:r,urls:t}))}function n({message:s,urls:n}){const l="string"==typeof s,o=n.every((e=>"string"==typeof e&&t(e)));return l&&o?e(r,null,a(s,n.map((r=>function(t){return e("a",{className:"adyen-checkout__link",href:r,target:"_blank",rel:"noopener noreferrer"},t)})))):null}export{n as LabelOnlyDisclaimerMessage,s as default};
2
2
  //# sourceMappingURL=DisclaimerMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisclaimerMessage.js","sources":["../../../../../src/components/internal/DisclaimerMessage/DisclaimerMessage.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { isValidHttpUrl } from '../../../utils/isValidURL';\nimport './DisclaimerMessage.scss';\nimport { interpolateElement } from '../../../language/utils';\nexport interface DisclaimerMsgObject {\n message: string;\n linkText: string;\n link: string;\n}\n\ninterface InternalDisclaimerMsgObject {\n message: string;\n urls: Array<string>;\n}\n\nfunction render(message: string, urls: Array<string>) {\n return (\n <span className=\"adyen-checkout-disclaimer__label\">\n {interpolateElement(\n message,\n // eslint-disable-next-line react/display-name\n urls.map(url => translation => (\n <a className=\"adyen-checkout-link\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {translation}\n </a>\n ))\n )}\n </span>\n );\n}\n\n/**\n * props: {\n * message: 'By continuing you agree with the %#terms and conditions%#',\n * urls: ['https://www.adyen.com']\n * }\n * String inside the '%#' token pair will be rendered as an anchor element.\n */\n\nexport default function DisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n try {\n const messageIsStr = typeof message === 'string';\n const validUrls = urls.every(url => typeof url === 'string' && isValidHttpUrl(url));\n if (!messageIsStr || !validUrls) return null;\n\n return render(message, urls);\n } catch (e) {\n console.warn('Errors rendering disclaimer message');\n return null;\n }\n}\n"],"names":["DisclaimerMessage","message","urls","messageIsStr","validUrls","every","url","isValidHttpUrl","h","span","className","interpolateElement","map","translation","a","href","target","rel","render","e","console","warn"],"mappings":"sMAuCe,SAASA,GAAkBC,QAAEA,EAAOC,KAAEA,IACjD,IACI,MAAMC,EAAkC,iBAAZF,EACtBG,EAAYF,EAAKG,OAAMC,GAAsB,iBAARA,GAAoBC,EAAeD,KAC9E,OAAKH,GAAiBC,EA5B9B,SAAgBH,EAAiBC,GAC7B,OACIM,EAACC,OAAAA,CAAKC,UAAU,oCACXC,EACGV,EAEAC,EAAKU,KAAIN,GAAOO,GACZL,EAACM,IAAAA,CAAEJ,UAAU,sBAAsBK,KAAMT,EAAKU,OAAO,SAASC,IAAI,uBAC7DJ,MAMzB,CAgBeK,CAAOjB,EAASC,GAFiB,IAG5C,CAAE,MAAOiB,GAEL,OADAC,QAAQC,KAAK,uCACN,IACX,CACJ"}
1
+ {"version":3,"file":"DisclaimerMessage.js","sources":["../../../../../src/components/internal/DisclaimerMessage/DisclaimerMessage.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { isValidHttpUrl } from '../../../utils/isValidURL';\nimport './DisclaimerMessage.scss';\nimport { interpolateElement } from '../../../language/utils';\n\nexport interface DisclaimerMsgObject {\n message: string;\n linkText: string;\n link: string;\n}\n\ninterface InternalDisclaimerMsgObject {\n message: string;\n urls: Array<string>;\n}\n\n/**\n * props: {\n * message: 'By continuing you agree with the %#terms and conditions%#',\n * urls: ['https://www.adyen.com']\n * }\n * String inside the '%#' token pair will be rendered as an anchor element.\n */\n\nexport default function DisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n return (\n <span className=\"adyen-checkout-disclaimer__label\">\n <LabelOnlyDisclaimerMessage message={message} urls={urls} />\n </span>\n );\n}\n\nexport function LabelOnlyDisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject) {\n const messageIsStr = typeof message === 'string';\n const validUrls = urls.every(url => typeof url === 'string' && isValidHttpUrl(url));\n if (!messageIsStr || !validUrls) return null;\n\n return (\n <Fragment>\n {interpolateElement(\n message,\n urls.map(\n // for each URL in the URLs array, return a createLink function\n url =>\n function createLink(translation) {\n return (\n <a className=\"adyen-checkout__link\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {translation}\n </a>\n );\n }\n )\n )}\n </Fragment>\n );\n}\n"],"names":["DisclaimerMessage","message","urls","h","span","className","LabelOnlyDisclaimerMessage","messageIsStr","validUrls","every","url","isValidHttpUrl","Fragment","interpolateElement","map","translation","a","href","target","rel"],"mappings":"oNAwBe,SAASA,GAAkBC,QAAEA,EAAOC,KAAEA,IACjD,OACIC,EAACC,OAAAA,CAAKC,UAAU,oCACZF,EAACG,EAAAA,CAA2BL,QAASA,EAASC,KAAMA,IAGhE,CAEO,SAASI,GAA2BL,QAAEA,EAAOC,KAAEA,IAClD,MAAMK,EAAkC,iBAAZN,EACtBO,EAAYN,EAAKO,OAAMC,GAAsB,iBAARA,GAAoBC,EAAeD,KAC9E,OAAKH,GAAiBC,EAGlBL,EAACS,EACIC,KAAAA,EACGZ,EACAC,EAAKY,KAEDJ,GACI,SAAoBK,GAChB,OACIZ,EAACa,IAAAA,CAAEX,UAAU,uBAAuBY,KAAMP,EAAKQ,OAAO,SAASC,IAAI,uBAC9DJ,EAGb,MAfoB,IAoB5C"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const r='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const o=({analyticsContext:o,clientKey:i,locale:c,analyticsPath:l,bundleType:a})=>{let s;const u={errorLevel:"fatal",loadingContext:o,path:`${l}?clientKey=${i}`};return o=>{const l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){n(e,t,r[t])}))}return e}({version:"6.0.1",channel:"Web",platform:"Web",buildType:a,locale:c,referrer:window.location.href,screenWidth:window.screen.width},o);if(s)return s;if(!i)return Promise.reject("no-client-key");const f=new t("checkout-attempt-id","sessionStorage"),p=f.get();return function(e){if(!(null==e?void 0:e.id))return!1;const t=Date.now()-9e5;return e.timestamp>t}(p)?Promise.resolve(p.id):(s=e(u,l).then((e=>{if(null==e?void 0:e.checkoutAttemptId)return f.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(r))),s)}};export{r as FAILURE_MSG,o as default};
1
+ import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const r='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const o=({analyticsContext:o,clientKey:i,locale:c,analyticsPath:l,bundleType:a})=>{let s;const u={errorLevel:"fatal",loadingContext:o,path:`${l}?clientKey=${i}`};return o=>{const l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){n(e,t,r[t])}))}return e}({version:"6.0.3",channel:"Web",platform:"Web",buildType:a,locale:c,referrer:window.location.href,screenWidth:window.screen.width},o);if(s)return s;if(!i)return Promise.reject("no-client-key");const f=new t("checkout-attempt-id","sessionStorage"),p=f.get();return function(e){if(!(null==e?void 0:e.id))return!1;const t=Date.now()-9e5;return e.timestamp>t}(p)?Promise.resolve(p.id):(s=e(u,l).then((e=>{if(null==e?void 0:e.checkoutAttemptId)return f.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(r))),s)}};export{r as FAILURE_MSG,o as default};
2
2
  //# sourceMappingURL=collect-id.js.map
@@ -1,2 +1,2 @@
1
- import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import e from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as s}from"./ProcessResponse/PaymentAction/PaymentAction.js";import n from"./Analytics/Analytics.js";import{processGlobalOptions as i,assertConfigurationPropertiesAreValid as r}from"./utils.js";import a from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as l}from"../utils/hasOwnProperty.js";import{Resources as c}from"./Context/Resources.js";import{SRPanel as h}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as d,verifyPaymentDidNotFail as m,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as f}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as g}from"./Analytics/constants.js";import{THREEDS2_FULL as v}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as b}from"../language/constants.js";import C from"./Services/get-translations.js";import{defaultProps as j}from"./core.defaultProps.js";import{formatLocale as w,formatCustomTranslations as O}from"../language/utils.js";import{resolveEnvironments as P}from"./Environment/Environment.js";function E(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function A(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},s=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),s.forEach((function(o){E(t,o,e[o])}))}return t}function M(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}function x(t,o){if(null==t)return{};var e,s,n=function(t,o){if(null==t)return{};var e,s,n={},i=Object.keys(t);for(s=0;s<i.length;s++)e=i[s],o.indexOf(e)>=0||(n[e]=t[e]);return n}(t,o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)e=i[s],o.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}class T{static setBundleType(t){T.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:e,countryCode:s,paymentMethods:n}=t,i=x(t,["amount","shopperLocale","countryCode","paymentMethods"]);return this.setOptions(M(A({},i),{amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||e,countryCode:this.options.countryCode||s})),this.createPaymentMethodsList(n),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await C(this.cdnTranslationsUrl,T.metadata.version,this.options.locale)}catch(n){var t,o,e,s;n instanceof y?null===(t=(o=this.options).onError)||void 0===t||t.call(o,n):null===(e=(s=this.options).onError)||void 0===e||e.call(s,new y("ERROR","Failed to fetch translation",{cause:n}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(f,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:b}),this.options.locale=w(this.options.locale),this.options.translations=O(this.options.translations)}submitDetails(t){let o=null;var e,s;(this.options.onAdditionalDetails&&(o=new Promise(((o,e)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:e})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>{var o,e;return null===(o=(e=this.options).onError)||void 0===o||o.call(e,t),Promise.reject(t)}))),o)?o.then(d).then(m).then((t=>{var o,e;u(t),null===(o=(e=this.options).onPaymentCompleted)||void 0===o||o.call(e,t)})).catch((t=>{var o,e;u(t),null===(o=(e=this.options).onPaymentFailed)||void 0===o||o.call(e,t)})):null===(e=(s=this.options).onError)||void 0===e||e.call(s,new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(l(t,"action")&&l(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const e=t.type===v?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(e,{type:g,subtype:t.type,message:`${e} action was handled by the SDK`});const n=A({},this.getCorePropsForComponent(),o);return s(this,p,t,n)}return this.handleCreateError()}getCorePropsForComponent(){return M(A({},i(this.options)),{core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction})}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){var o;const e=null!==(o=null==t?void 0:t.name)&&void 0!==o?o:"The passed payment method",s=t?`${e} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(s)}createPaymentMethodsList(t){this.paymentMethodsResponse=new e(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const e=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,M(A({},this.options),{loadingContext:this.loadingContext})),analytics:n({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:T.metadata.bundleType}),resources:new c(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:e,customTranslations:this.options.translations}),srPanel:new h(this,A({},this.options.srConfig))})}constructor(t){var o;E(this,"session",void 0),E(this,"paymentMethodsResponse",void 0),E(this,"modules",void 0),E(this,"options",void 0),E(this,"analyticsContext",void 0),E(this,"loadingContext",void 0),E(this,"cdnImagesUrl",void 0),E(this,"cdnTranslationsUrl",void 0),E(this,"components",[]),E(this,"update",((t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const e=A({},t,this.session&&{session:this.session});o.update(e)})),this)))))),E(this,"remove",(t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this))),E(this,"setOptions",(t=>{var o;this.options=M(A({},this.options,t),{locale:(null==t?void 0:t.locale)||(null===(o=this.options)||void 0===o?void 0:o.locale)})})),r(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions(A({},j,t));const{apiUrl:e,analyticsUrl:s,cdnImagesUrl:n,cdnTranslationsUrl:i}=P(this.options.environment,this.options._environmentUrls);this.loadingContext=e,this.analyticsContext=s,this.cdnImagesUrl=n,this.cdnTranslationsUrl=i,this.session=this.options.session&&new a(this.options.session,this.options.clientKey,this.loadingContext);const l=null===(o=this.options.clientKey)||void 0===o?void 0:o.substring(0,4);var c,h;if(("test"===l||"live"===l)&&!this.loadingContext.includes(l))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${l} clientKey against the ${(null===(c=this.options._environmentUrls)||void 0===c?void 0:c.api)||this.options.environment} environment`);"pub."===l&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${null===(h=this.options.clientKey)||void 0===h?void 0:h.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`);this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=T.metadata)}}E(T,"metadata",{version:"6.0.1",bundleType:"eslegacy"}),E(T,"registry",p);export{T as default};
1
+ import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import e from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as s}from"./ProcessResponse/PaymentAction/PaymentAction.js";import n from"./Analytics/Analytics.js";import{processGlobalOptions as i,assertConfigurationPropertiesAreValid as r}from"./utils.js";import a from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as l}from"../utils/hasOwnProperty.js";import{Resources as c}from"./Context/Resources.js";import{SRPanel as h}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as d,verifyPaymentDidNotFail as m,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as f}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as g}from"./Analytics/constants.js";import{THREEDS2_FULL as v}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as b}from"../language/constants.js";import C from"./Services/get-translations.js";import{defaultProps as j}from"./core.defaultProps.js";import{formatLocale as w,formatCustomTranslations as O}from"../language/utils.js";import{resolveEnvironments as P}from"./Environment/Environment.js";function E(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function A(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},s=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),s.forEach((function(o){E(t,o,e[o])}))}return t}function M(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}function x(t,o){if(null==t)return{};var e,s,n=function(t,o){if(null==t)return{};var e,s,n={},i=Object.keys(t);for(s=0;s<i.length;s++)e=i[s],o.indexOf(e)>=0||(n[e]=t[e]);return n}(t,o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)e=i[s],o.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}class T{static setBundleType(t){T.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:e,countryCode:s,paymentMethods:n}=t,i=x(t,["amount","shopperLocale","countryCode","paymentMethods"]);return this.setOptions(M(A({},i),{amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||e,countryCode:this.options.countryCode||s})),this.createPaymentMethodsList(n),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await C(this.cdnTranslationsUrl,T.metadata.version,this.options.locale)}catch(n){var t,o,e,s;n instanceof y?null===(t=(o=this.options).onError)||void 0===t||t.call(o,n):null===(e=(s=this.options).onError)||void 0===e||e.call(s,new y("ERROR","Failed to fetch translation",{cause:n}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(f,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:b}),this.options.locale=w(this.options.locale),this.options.translations=O(this.options.translations)}submitDetails(t){let o=null;var e,s;(this.options.onAdditionalDetails&&(o=new Promise(((o,e)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:e})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>{var o,e;return null===(o=(e=this.options).onError)||void 0===o||o.call(e,t),Promise.reject(t)}))),o)?o.then(d).then(m).then((t=>{var o,e;u(t),null===(o=(e=this.options).onPaymentCompleted)||void 0===o||o.call(e,t)})).catch((t=>{var o,e;u(t),null===(o=(e=this.options).onPaymentFailed)||void 0===o||o.call(e,t)})):null===(e=(s=this.options).onError)||void 0===e||e.call(s,new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(l(t,"action")&&l(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const e=t.type===v?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(e,{type:g,subtype:t.type,message:`${e} action was handled by the SDK`});const n=A({},this.getCorePropsForComponent(),o);return s(this,p,t,n)}return this.handleCreateError()}getCorePropsForComponent(){return M(A({},i(this.options)),{core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction})}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){var o;const e=null!==(o=null==t?void 0:t.name)&&void 0!==o?o:"The passed payment method",s=t?`${e} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(s)}createPaymentMethodsList(t){this.paymentMethodsResponse=new e(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const e=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,M(A({},this.options),{loadingContext:this.loadingContext})),analytics:n({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:T.metadata.bundleType}),resources:new c(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:e,customTranslations:this.options.translations}),srPanel:new h(this,A({},this.options.srConfig))})}constructor(t){var o;E(this,"session",void 0),E(this,"paymentMethodsResponse",void 0),E(this,"modules",void 0),E(this,"options",void 0),E(this,"analyticsContext",void 0),E(this,"loadingContext",void 0),E(this,"cdnImagesUrl",void 0),E(this,"cdnTranslationsUrl",void 0),E(this,"components",[]),E(this,"update",((t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const e=A({},t,this.session&&{session:this.session});o.update(e)})),this)))))),E(this,"remove",(t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this))),E(this,"setOptions",(t=>{var o;this.options=M(A({},this.options,t),{locale:(null==t?void 0:t.locale)||(null===(o=this.options)||void 0===o?void 0:o.locale)})})),r(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions(A({},j,t));const{apiUrl:e,analyticsUrl:s,cdnImagesUrl:n,cdnTranslationsUrl:i}=P(this.options.environment,this.options._environmentUrls);this.loadingContext=e,this.analyticsContext=s,this.cdnImagesUrl=n,this.cdnTranslationsUrl=i,this.session=this.options.session&&new a(this.options.session,this.options.clientKey,this.loadingContext);const l=null===(o=this.options.clientKey)||void 0===o?void 0:o.substring(0,4);var c,h;if(("test"===l||"live"===l)&&!this.loadingContext.includes(l))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${l} clientKey against the ${(null===(c=this.options._environmentUrls)||void 0===c?void 0:c.api)||this.options.environment} environment`);"pub."===l&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${null===(h=this.options.clientKey)||void 0===h?void 0:h.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`);this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=T.metadata)}}E(T,"metadata",{version:"6.0.3",bundleType:"eslegacy"}),E(T,"registry",p);export{T as default};
2
2
  //# sourceMappingURL=core.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/adyen-web",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://docs.adyen.com/checkout",
6
6
  "type": "module",