@adyen/adyen-web 6.0.2 → 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.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/components/Riverty/Riverty.js +1 -1
- package/dist/es/components/Riverty/Riverty.js.map +1 -1
- package/dist/es/components/Riverty/config.js +1 -1
- package/dist/es/components/Riverty/config.js.map +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es/core/Services/analytics/collect-id.js +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
- package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
- package/dist/es-legacy/components/Riverty/config.js +1 -1
- package/dist/es-legacy/components/Riverty/config.js.map +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
- package/dist/es-legacy/core/core.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as
|
|
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\
|
|
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
|
+
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
|
package/dist/es/core/core.js
CHANGED
|
@@ -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
|
+
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
|
|
@@ -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
|
|
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
|
|
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
|
|
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":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{isValidHttpUrl as
|
|
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\
|
|
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
|
+
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
|
+
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
|