@adyen/adyen-web 6.1.1 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.d.cts +20 -4
  4. package/dist/es/components/ApplePay/ApplePayService.js +1 -1
  5. package/dist/es/components/ApplePay/ApplePayService.js.map +1 -1
  6. package/dist/es/components/Card/Card.js +1 -1
  7. package/dist/es/components/Card/Card.js.map +1 -1
  8. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  9. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  10. package/dist/es/components/Dropin/elements/createElements.js +1 -1
  11. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  12. package/dist/es/components/Dropin/elements/filters.js +1 -1
  13. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  14. package/dist/es/components/components-name-map.js +1 -1
  15. package/dist/es/components/components-name-map.js.map +1 -1
  16. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  17. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  18. package/dist/es/core/Analytics/Analytics.js +1 -1
  19. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  20. package/dist/es/core/Analytics/constants.js +1 -1
  21. package/dist/es/core/Analytics/constants.js.map +1 -1
  22. package/dist/es/core/Analytics/utils.js +1 -1
  23. package/dist/es/core/Analytics/utils.js.map +1 -1
  24. package/dist/es/core/CheckoutSession/CheckoutSession.js +1 -1
  25. package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
  26. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  27. package/dist/es/core/Services/sessions/setup-session.js +1 -1
  28. package/dist/es/core/Services/sessions/setup-session.js.map +1 -1
  29. package/dist/es/core/core.js +1 -1
  30. package/dist/es/index.d.ts +20 -4
  31. package/dist/es-legacy/components/ApplePay/ApplePayService.js +1 -1
  32. package/dist/es-legacy/components/ApplePay/ApplePayService.js.map +1 -1
  33. package/dist/es-legacy/components/Card/Card.js +1 -1
  34. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  35. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  36. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  37. package/dist/es-legacy/components/Dropin/elements/createElements.js +1 -1
  38. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  39. package/dist/es-legacy/components/Dropin/elements/filters.js +1 -1
  40. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  41. package/dist/es-legacy/components/components-name-map.js +1 -1
  42. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  43. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  44. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  45. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  46. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  47. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  48. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  49. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  50. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  51. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js +1 -1
  52. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js.map +1 -1
  53. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  54. package/dist/es-legacy/core/Services/sessions/setup-session.js +1 -1
  55. package/dist/es-legacy/core/Services/sessions/setup-session.js.map +1 -1
  56. package/dist/es-legacy/core/core.js +1 -1
  57. package/package.json +3 -2
  58. package/styles/adyen.css +84 -0
@@ -1082,6 +1082,10 @@ type CheckoutSessionOrdersResponse = {
1082
1082
  orderData: string;
1083
1083
  pspReference: string;
1084
1084
  };
1085
+ type SetupSessionOptions = {
1086
+ browserInfo?: BrowserInfo;
1087
+ order?: Order;
1088
+ };
1085
1089
 
1086
1090
  type NewableComponent = new (checkout: ICore, props?: any) => UIElement;
1087
1091
  interface IRegistry {
@@ -1647,7 +1651,7 @@ declare class ANCVElement extends UIElement<ANCVConfiguration> {
1647
1651
 
1648
1652
  declare global {
1649
1653
  interface Window {
1650
- ApplePaySession: ApplePaySession;
1654
+ ApplePaySession?: ApplePaySession;
1651
1655
  }
1652
1656
  }
1653
1657
  type Initiative = 'web' | 'messaging';
@@ -1940,8 +1944,16 @@ interface AchConfiguration extends UIElementProps {
1940
1944
  holderNameRequired?: boolean;
1941
1945
  hasHolderName?: boolean;
1942
1946
  enableStoreDetails: boolean;
1943
- bankAccountNumber: string;
1947
+ bankAccountNumber?: string;
1944
1948
  placeholders?: Placeholders;
1949
+ /**
1950
+ * Object that contains placeholder information that you can use to prefill fields.
1951
+ * - merchant set config option
1952
+ */
1953
+ data?: {
1954
+ holderName?: string;
1955
+ billingAddress?: Partial<AddressData>;
1956
+ };
1945
1957
  }
1946
1958
 
1947
1959
  interface BankTransferConfiguration extends UIElementProps {
@@ -4124,8 +4136,12 @@ declare class AchElement extends UIElement<AchConfiguration> {
4124
4136
  storedPaymentMethodId?: string;
4125
4137
  hasHolderName?: boolean;
4126
4138
  enableStoreDetails: boolean;
4127
- bankAccountNumber: string;
4139
+ bankAccountNumber?: string;
4128
4140
  placeholders?: Placeholders;
4141
+ data?: {
4142
+ holderName?: string;
4143
+ billingAddress?: Partial<AddressData>;
4144
+ };
4129
4145
  order?: Order;
4130
4146
  modules?: {
4131
4147
  srPanel?: SRPanel;
@@ -5030,7 +5046,7 @@ declare class Session {
5030
5046
  /**
5031
5047
  * Fetches data from a session
5032
5048
  */
5033
- setupSession(options: any): Promise<CheckoutSessionSetupResponse>;
5049
+ setupSession(options: SetupSessionOptions): Promise<CheckoutSessionSetupResponse>;
5034
5050
  /**
5035
5051
  * Submits a session payment
5036
5052
  */
@@ -1,2 +1,2 @@
1
- class e{session;options;constructor(e,t){this.options=t,this.session=new ApplePaySession(t.version,e),this.session.onvalidatemerchant=e=>this.onvalidatemerchant(e,t.onValidateMerchant),this.session.onpaymentauthorized=e=>this.onpaymentauthorized(e,t.onPaymentAuthorized),this.session.oncancel=e=>this.oncancel(e,t.onCancel),"function"==typeof t.onPaymentMethodSelected&&(this.session.onpaymentmethodselected=e=>this.onpaymentmethodselected(e,t.onPaymentMethodSelected)),"function"==typeof t.onShippingContactSelected&&(this.session.onshippingcontactselected=e=>this.onshippingcontactselected(e,t.onShippingContactSelected)),"function"==typeof t.onShippingMethodSelected&&(this.session.onshippingmethodselected=e=>this.onshippingmethodselected(e,t.onShippingMethodSelected))}begin(){return this.session.begin()}onvalidatemerchant(e,t){return new Promise(((n,o)=>t(n,o,e.validationURL))).then((e=>{this.session.completeMerchantValidation(e)})).catch((e=>{console.error(e),this.session.abort(),this.options.onError(e)}))}onpaymentauthorized(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completePayment(e)})).catch((e=>{this.session.completePayment(e)}))}onpaymentmethodselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completePaymentMethodSelection(e)})).catch((e=>{this.session.completePaymentMethodSelection(e)}))}onshippingcontactselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completeShippingContactSelection(e)})).catch((e=>{this.session.completeShippingContactSelection(e)}))}onshippingmethodselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completeShippingMethodSelection(e)})).catch((e=>{this.session.completeShippingMethodSelection(e)}))}oncancel(e,t){t(e)}}export{e as default};
1
+ class e{session;options;constructor(e,t){this.options=t,this.session=new ApplePaySession(t.version,e),this.session.onvalidatemerchant=e=>{this.onvalidatemerchant(e,t.onValidateMerchant)},this.session.onpaymentauthorized=e=>{this.onpaymentauthorized(e,t.onPaymentAuthorized)},this.session.oncancel=e=>{this.oncancel(e,t.onCancel)},"function"==typeof t.onPaymentMethodSelected&&(this.session.onpaymentmethodselected=e=>{this.onpaymentmethodselected(e,t.onPaymentMethodSelected)}),"function"==typeof t.onShippingContactSelected&&(this.session.onshippingcontactselected=e=>{this.onshippingcontactselected(e,t.onShippingContactSelected)}),"function"==typeof t.onShippingMethodSelected&&(this.session.onshippingmethodselected=e=>{this.onshippingmethodselected(e,t.onShippingMethodSelected)})}begin(){return this.session.begin()}onvalidatemerchant(e,t){return new Promise(((n,o)=>t(n,o,e.validationURL))).then((e=>{this.session.completeMerchantValidation(e)})).catch((e=>{console.error(e),this.session.abort(),this.options.onError(e)}))}onpaymentauthorized(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completePayment(e)})).catch((e=>{this.session.completePayment(e)}))}onpaymentmethodselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completePaymentMethodSelection(e)})).catch((e=>{this.session.completePaymentMethodSelection(e)}))}onshippingcontactselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completeShippingContactSelection(e)})).catch((e=>{this.session.completeShippingContactSelection(e)}))}onshippingmethodselected(e,t){return new Promise(((n,o)=>t(n,o,e))).then((e=>{this.session.completeShippingMethodSelection(e)})).catch((e=>{this.session.completeShippingMethodSelection(e)}))}oncancel(e,t){t(e)}}export{e as default};
2
2
  //# sourceMappingURL=ApplePayService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApplePayService.js","sources":["../../../../src/components/ApplePay/ApplePayService.ts"],"sourcesContent":["import { ApplePayPaymentAuthorizationResult } from './types';\n\ninterface ApplePayServiceOptions {\n version: number;\n onValidateMerchant: (resolve, reject, url) => void;\n onError: (error?: unknown) => void;\n onCancel?: (event: ApplePayJS.Event) => void;\n onPaymentMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;\n onShippingMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;\n onShippingContactSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;\n onPaymentAuthorized: (\n resolve: (result: ApplePayPaymentAuthorizationResult) => void,\n reject: (result: ApplePayPaymentAuthorizationResult) => void,\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent\n ) => void;\n}\n\nclass ApplePayService {\n private session: ApplePaySession;\n private readonly options: ApplePayServiceOptions;\n\n constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions) {\n this.options = options;\n\n this.session = new ApplePaySession(options.version, paymentRequest);\n /* eslint-disable @typescript-eslint/no-misused-promises */\n this.session.onvalidatemerchant = event => this.onvalidatemerchant(event, options.onValidateMerchant);\n this.session.onpaymentauthorized = event => this.onpaymentauthorized(event, options.onPaymentAuthorized);\n this.session.oncancel = event => this.oncancel(event, options.onCancel);\n\n if (typeof options.onPaymentMethodSelected === 'function') {\n this.session.onpaymentmethodselected = event => this.onpaymentmethodselected(event, options.onPaymentMethodSelected);\n }\n\n if (typeof options.onShippingContactSelected === 'function') {\n this.session.onshippingcontactselected = event => this.onshippingcontactselected(event, options.onShippingContactSelected);\n }\n\n if (typeof options.onShippingMethodSelected === 'function') {\n this.session.onshippingmethodselected = event => this.onshippingmethodselected(event, options.onShippingMethodSelected);\n }\n /* eslint-enable @typescript-eslint/no-misused-promises */\n }\n\n /**\n * Begins the merchant validation process.\n * When this method is called, the payment sheet is presented and the merchant validation process is initiated.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778001-begin}\n */\n begin() {\n return this.session.begin();\n }\n\n /**\n * An event handler that is called when the payment sheet is displayed.\n * Use this attribute to request and return a merchant session.\n * @param event - An ApplePayValidateMerchantEvent object (contains validationURL)\n * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}\n */\n onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant) {\n return new Promise((resolve, reject) => onValidateMerchant(resolve, reject, event.validationURL))\n .then(response => {\n this.session.completeMerchantValidation(response);\n })\n .catch(error => {\n console.error(error);\n this.session.abort();\n this.options.onError(error);\n });\n }\n\n /**\n * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.\n * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentAuthorized - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized}\n */\n onpaymentauthorized(\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent,\n onPaymentAuthorized: ApplePayServiceOptions['onPaymentAuthorized']\n ): Promise<void> {\n return new Promise((resolve, reject) => onPaymentAuthorized(resolve, reject, event))\n .then((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n })\n .catch((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}\n */\n onpaymentmethodselected(event: ApplePayJS.ApplePayPaymentMethodSelectedEvent, onPaymentMethodSelected) {\n return new Promise((resolve, reject) => onPaymentMethodSelected(resolve, reject, event))\n .then((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n })\n .catch((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingContact attribute.\n * @param onShippingContactSelected - A promise that will complete the selection of a shipping contact with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingcontactselected(event: ApplePayJS.ApplePayShippingContactSelectedEvent, onShippingContactSelected) {\n return new Promise((resolve, reject) => onShippingContactSelected(resolve, reject, event))\n .then((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n })\n .catch((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingMethod attribute.\n * @param onShippingMethodSelected - A promise that will complete the selection of a shipping method with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingmethodselected(event: ApplePayJS.ApplePayShippingMethodSelectedEvent, onShippingMethodSelected) {\n return new Promise((resolve, reject) => onShippingMethodSelected(resolve, reject, event))\n .then((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n })\n .catch((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n });\n }\n\n /**\n * An event handler that is automatically called when the payment UI is dismissed.\n * This function can be called even after an onpaymentauthorized event has been dispatched.\n * @param event -\n * @param onCancel -\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}\n */\n oncancel(event: ApplePayJS.Event, onCancel): void {\n onCancel(event);\n }\n}\n\nexport default ApplePayService;\n"],"names":["ApplePayService","session","options","constructor","paymentRequest","this","ApplePaySession","version","onvalidatemerchant","event","onValidateMerchant","onpaymentauthorized","onPaymentAuthorized","oncancel","onCancel","onPaymentMethodSelected","onpaymentmethodselected","onShippingContactSelected","onshippingcontactselected","onShippingMethodSelected","onshippingmethodselected","begin","Promise","resolve","reject","validationURL","then","response","completeMerchantValidation","catch","error","console","abort","onError","result","completePayment","paymentMethodUpdate","completePaymentMethodSelection","shippingContactUpdate","completeShippingContactSelection","shippingMethodUpdate","completeShippingMethodSelection"],"mappings":"AAiBA,MAAMA,EACMC,QACSC,QAEjBC,WAAAA,CAAYC,EAAmDF,GAC3DG,KAAKH,QAAUA,EAEfG,KAAKJ,QAAU,IAAIK,gBAAgBJ,EAAQK,QAASH,GAEpDC,KAAKJ,QAAQO,mBAAqBC,GAASJ,KAAKG,mBAAmBC,EAAOP,EAAQQ,oBAClFL,KAAKJ,QAAQU,oBAAsBF,GAASJ,KAAKM,oBAAoBF,EAAOP,EAAQU,qBACpFP,KAAKJ,QAAQY,SAAWJ,GAASJ,KAAKQ,SAASJ,EAAOP,EAAQY,UAEf,mBAApCZ,EAAQa,0BACfV,KAAKJ,QAAQe,wBAA0BP,GAASJ,KAAKW,wBAAwBP,EAAOP,EAAQa,0BAG/C,mBAAtCb,EAAQe,4BACfZ,KAAKJ,QAAQiB,0BAA4BT,GAASJ,KAAKa,0BAA0BT,EAAOP,EAAQe,4BAGpD,mBAArCf,EAAQiB,2BACfd,KAAKJ,QAAQmB,yBAA2BX,GAASJ,KAAKe,yBAAyBX,EAAOP,EAAQiB,0BAGtG,CAOAE,KAAAA,GACI,OAAOhB,KAAKJ,QAAQoB,OACxB,CASAb,kBAAAA,CAAmBC,EAAiDC,GAChE,OAAO,IAAIY,SAAQ,CAACC,EAASC,IAAWd,EAAmBa,EAASC,EAAQf,EAAMgB,iBAC7EC,MAAKC,IACFtB,KAAKJ,QAAQ2B,2BAA2BD,EAAAA,IAE3CE,OAAMC,IACHC,QAAQD,MAAMA,GACdzB,KAAKJ,QAAQ+B,QACb3B,KAAKH,QAAQ+B,QAAQH,EAAAA,GAEjC,CAUAnB,mBAAAA,CACIF,EACAG,GAEA,OAAO,IAAIU,SAAQ,CAACC,EAASC,IAAWZ,EAAoBW,EAASC,EAAQf,KACxEiB,MAAMQ,IACH7B,KAAKJ,QAAQkC,gBAAgBD,EAAAA,IAEhCL,OAAOK,IACJ7B,KAAKJ,QAAQkC,gBAAgBD,EAAAA,GAEzC,CAUAlB,uBAAAA,CAAwBP,EAAsDM,GAC1E,OAAO,IAAIO,SAAQ,CAACC,EAASC,IAAWT,EAAwBQ,EAASC,EAAQf,KAC5EiB,MAAMU,IACH/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,IAE/CP,OAAOO,IACJ/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,GAExD,CASAlB,yBAAAA,CAA0BT,EAAwDQ,GAC9E,OAAO,IAAIK,SAAQ,CAACC,EAASC,IAAWP,EAA0BM,EAASC,EAAQf,KAC9EiB,MAAMY,IACHjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,IAEjDT,OAAOS,IACJjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,GAE1D,CASAlB,wBAAAA,CAAyBX,EAAuDU,GAC5E,OAAO,IAAIG,SAAQ,CAACC,EAASC,IAAWL,EAAyBI,EAASC,EAAQf,KAC7EiB,MAAMc,IACHnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,IAEhDX,OAAOW,IACJnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,GAEzD,CASA3B,QAAAA,CAASJ,EAAyBK,GAC9BA,EAASL,EACb"}
1
+ {"version":3,"file":"ApplePayService.js","sources":["../../../../src/components/ApplePay/ApplePayService.ts"],"sourcesContent":["import { ApplePayPaymentAuthorizationResult } from './types';\n\ninterface ApplePayServiceOptions {\n version: number;\n onValidateMerchant: (resolve, reject, url) => void;\n onError: (error?: unknown) => void;\n onCancel?: (event: ApplePayJS.Event) => void;\n onPaymentMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;\n onShippingMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;\n onShippingContactSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;\n onPaymentAuthorized: (\n resolve: (result: ApplePayPaymentAuthorizationResult) => void,\n reject: (result: ApplePayPaymentAuthorizationResult) => void,\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent\n ) => void;\n}\n\nclass ApplePayService {\n private session: ApplePaySession;\n private readonly options: ApplePayServiceOptions;\n\n constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions) {\n this.options = options;\n\n this.session = new ApplePaySession(options.version, paymentRequest);\n this.session.onvalidatemerchant = event => {\n void this.onvalidatemerchant(event, options.onValidateMerchant);\n };\n this.session.onpaymentauthorized = event => {\n void this.onpaymentauthorized(event, options.onPaymentAuthorized);\n };\n\n this.session.oncancel = event => {\n this.oncancel(event, options.onCancel);\n };\n\n if (typeof options.onPaymentMethodSelected === 'function') {\n this.session.onpaymentmethodselected = event => {\n void this.onpaymentmethodselected(event, options.onPaymentMethodSelected);\n };\n }\n\n if (typeof options.onShippingContactSelected === 'function') {\n this.session.onshippingcontactselected = event => {\n void this.onshippingcontactselected(event, options.onShippingContactSelected);\n };\n }\n\n if (typeof options.onShippingMethodSelected === 'function') {\n this.session.onshippingmethodselected = event => {\n void this.onshippingmethodselected(event, options.onShippingMethodSelected);\n };\n }\n }\n\n /**\n * Begins the merchant validation process.\n * When this method is called, the payment sheet is presented and the merchant validation process is initiated.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778001-begin}\n */\n begin() {\n return this.session.begin();\n }\n\n /**\n * An event handler that is called when the payment sheet is displayed.\n * Use this attribute to request and return a merchant session.\n * @param event - An ApplePayValidateMerchantEvent object (contains validationURL)\n * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}\n */\n onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant) {\n return new Promise((resolve, reject) => onValidateMerchant(resolve, reject, event.validationURL))\n .then(response => {\n this.session.completeMerchantValidation(response);\n })\n .catch(error => {\n console.error(error);\n this.session.abort();\n this.options.onError(error);\n });\n }\n\n /**\n * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.\n * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentAuthorized - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized}\n */\n onpaymentauthorized(\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent,\n onPaymentAuthorized: ApplePayServiceOptions['onPaymentAuthorized']\n ): Promise<void> {\n return new Promise((resolve, reject) => onPaymentAuthorized(resolve, reject, event))\n .then((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n })\n .catch((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}\n */\n onpaymentmethodselected(event: ApplePayJS.ApplePayPaymentMethodSelectedEvent, onPaymentMethodSelected) {\n return new Promise((resolve, reject) => onPaymentMethodSelected(resolve, reject, event))\n .then((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n })\n .catch((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingContact attribute.\n * @param onShippingContactSelected - A promise that will complete the selection of a shipping contact with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingcontactselected(event: ApplePayJS.ApplePayShippingContactSelectedEvent, onShippingContactSelected) {\n return new Promise((resolve, reject) => onShippingContactSelected(resolve, reject, event))\n .then((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n })\n .catch((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingMethod attribute.\n * @param onShippingMethodSelected - A promise that will complete the selection of a shipping method with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingmethodselected(event: ApplePayJS.ApplePayShippingMethodSelectedEvent, onShippingMethodSelected) {\n return new Promise((resolve, reject) => onShippingMethodSelected(resolve, reject, event))\n .then((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n })\n .catch((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n });\n }\n\n /**\n * An event handler that is automatically called when the payment UI is dismissed.\n * This function can be called even after an onpaymentauthorized event has been dispatched.\n * @param event -\n * @param onCancel -\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}\n */\n oncancel(event: ApplePayJS.Event, onCancel): void {\n onCancel(event);\n }\n}\n\nexport default ApplePayService;\n"],"names":["ApplePayService","session","options","constructor","paymentRequest","this","ApplePaySession","version","onvalidatemerchant","event","onValidateMerchant","onpaymentauthorized","onPaymentAuthorized","oncancel","onCancel","onPaymentMethodSelected","onpaymentmethodselected","onShippingContactSelected","onshippingcontactselected","onShippingMethodSelected","onshippingmethodselected","begin","Promise","resolve","reject","validationURL","then","response","completeMerchantValidation","catch","error","console","abort","onError","result","completePayment","paymentMethodUpdate","completePaymentMethodSelection","shippingContactUpdate","completeShippingContactSelection","shippingMethodUpdate","completeShippingMethodSelection"],"mappings":"AAiBA,MAAMA,EACMC,QACSC,QAEjBC,WAAAA,CAAYC,EAAmDF,GAC3DG,KAAKH,QAAUA,EAEfG,KAAKJ,QAAU,IAAIK,gBAAgBJ,EAAQK,QAASH,GACpDC,KAAKJ,QAAQO,mBAAqBC,IACzBJ,KAAKG,mBAAmBC,EAAOP,EAAQQ,mBAAkB,EAElEL,KAAKJ,QAAQU,oBAAsBF,IAC1BJ,KAAKM,oBAAoBF,EAAOP,EAAQU,oBAAmB,EAGpEP,KAAKJ,QAAQY,SAAWJ,IACpBJ,KAAKQ,SAASJ,EAAOP,EAAQY,SAAQ,EAGM,mBAApCZ,EAAQa,0BACfV,KAAKJ,QAAQe,wBAA0BP,IAC9BJ,KAAKW,wBAAwBP,EAAOP,EAAQa,wBAAuB,GAI/B,mBAAtCb,EAAQe,4BACfZ,KAAKJ,QAAQiB,0BAA4BT,IAChCJ,KAAKa,0BAA0BT,EAAOP,EAAQe,0BAAyB,GAIpC,mBAArCf,EAAQiB,2BACfd,KAAKJ,QAAQmB,yBAA2BX,IAC/BJ,KAAKe,yBAAyBX,EAAOP,EAAQiB,yBAAwB,EAGtF,CAOAE,KAAAA,GACI,OAAOhB,KAAKJ,QAAQoB,OACxB,CASAb,kBAAAA,CAAmBC,EAAiDC,GAChE,OAAO,IAAIY,SAAQ,CAACC,EAASC,IAAWd,EAAmBa,EAASC,EAAQf,EAAMgB,iBAC7EC,MAAKC,IACFtB,KAAKJ,QAAQ2B,2BAA2BD,EAAAA,IAE3CE,OAAMC,IACHC,QAAQD,MAAMA,GACdzB,KAAKJ,QAAQ+B,QACb3B,KAAKH,QAAQ+B,QAAQH,EAAAA,GAEjC,CAUAnB,mBAAAA,CACIF,EACAG,GAEA,OAAO,IAAIU,SAAQ,CAACC,EAASC,IAAWZ,EAAoBW,EAASC,EAAQf,KACxEiB,MAAMQ,IACH7B,KAAKJ,QAAQkC,gBAAgBD,EAAAA,IAEhCL,OAAOK,IACJ7B,KAAKJ,QAAQkC,gBAAgBD,EAAAA,GAEzC,CAUAlB,uBAAAA,CAAwBP,EAAsDM,GAC1E,OAAO,IAAIO,SAAQ,CAACC,EAASC,IAAWT,EAAwBQ,EAASC,EAAQf,KAC5EiB,MAAMU,IACH/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,IAE/CP,OAAOO,IACJ/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,GAExD,CASAlB,yBAAAA,CAA0BT,EAAwDQ,GAC9E,OAAO,IAAIK,SAAQ,CAACC,EAASC,IAAWP,EAA0BM,EAASC,EAAQf,KAC9EiB,MAAMY,IACHjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,IAEjDT,OAAOS,IACJjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,GAE1D,CASAlB,wBAAAA,CAAyBX,EAAuDU,GAC5E,OAAO,IAAIG,SAAQ,CAACC,EAASC,IAAWL,EAAyBI,EAASC,EAAQf,KAC7EiB,MAAMc,IACHnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,IAEhDX,OAAOW,IACJnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,GAEzD,CASA3B,QAAAA,CAASJ,EAAyBK,GAC9BA,EAASL,EACb"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i}from"../internal/SecuredFields/utils.js";import{reject as n}from"../../utils/commonUtils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as d}from"../tx-variants.js";import{UIElement as u}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as C}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as R}from"../../core/Errors/constants.js";import B from"./components/CardInput/defaultProps.js";class I extends u{static type=d.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,...n(["type","setComponentRef"]).from(B)};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?B.billingAddressMode:t.billingAddressMode,brand:t.brand??d.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:I.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:this.props.holderName??""},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=n("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t,this.props)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:i(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,R)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||I.type}get accessibleName(){return(this.props.name||I.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{I as CardElement,I as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i}from"../internal/SecuredFields/utils.js";import{reject as n}from"../../utils/commonUtils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as d}from"../tx-variants.js";import{UIElement as u}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as C}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as R}from"../../core/Errors/constants.js";import B from"./components/CardInput/defaultProps.js";class I extends u{static type=d.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,...n(["type","setComponentRef"]).from(B)};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?B.billingAddressMode:t.billingAddressMode,brand:t.brand??d.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:I.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId,holderName:this.props.holderName??""},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=n("supportedBrandsRaw").from(t);this.props.onBinLookup?.(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t,this.props)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:i(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,R)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||I.type}get accessibleName(){return(this.props.name||I.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{I as CardElement,I as default};
2
2
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","showFormInstruction","doBinLookup","reject","from","CardInputDefaultProps","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","holderName","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","onBinLookup","obj","nuObj","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","handleKeyPress","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"mappings":"m6CAmCO,MAAMA,UAAoBC,EAC7BC,YAAqBC,EAAWC,OAEfC,kBAKTC,cAAgB,KAExBC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEZA,IAAUA,EAAME,qBAChBC,KAAKP,kBAAoBQ,EAAwBD,KAAKH,MAAMK,cAAeF,KAAKH,MAAMM,wBAAyBH,KAAKH,MAAMO,aACrHJ,KAAKP,mBAAmBY,aAErC,CAEAf,oBAAgC,CAC5BgB,qBAAqB,EACrBP,oBAAoB,EACpBQ,aA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sx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup?.(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","showFormInstruction","doBinLookup","reject","from","CardInputDefaultProps","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","holderName","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","onBinLookup","obj","nuObj","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","handleKeyPress","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"mappings":"m6CAmCO,MAAMA,UAAoBC,EAC7BC,YAAqBC,EAAWC,OAEfC,kBAKTC,cAAgB,KAExBC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEZA,IAAUA,EAAME,qBAChBC,KAAKP,kBAAoBQ,EAAwBD,KAAKH,MAAMK,cAAeF,KAAKH,MAAMM,wBAAyBH,KAAKH,MAAMO,aACrHJ,KAAKP,mBAAmBY,aAErC,CAEAf,oBAAgC,CAC5BgB,qBAAqB,EACrBP,oBAAoB,EACpBQ,aAAa,KAEVC,EAAO,CAAC,OAAQ,oBAAoBC,KAAKC,IAGzCC,SAAAA,CAAUC,EAAyBf,GAOtC,OANIG,KAAKa,cAAcF,WACnBX,KAAKa,aAAaF,UAAUC,EAAQf,GAEpCG,KAAKN,eAAeiB,WACpBX,KAAKN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KAAKH,MAAMsD,KAAK6E,IAAI,yBAA2B,GACpFS,QAASzI,KAAKwF,UAKlBkD,eAAAA,CAAgBC,GAAqB,GACzC,OACIN,EAACO,EAAAA,CACGC,gBAAiB7I,KAAK6I,mBAClB7I,KAAKH,SACLG,KAAKuD,MACTuF,SAAU9I,KAAKoF,SACf2D,SAAU/I,KAAKwF,OACfwD,eAAgBhJ,KAAKgJ,eACrBd,UAAWlI,KAAKkI,UAChBvD,QAAS3E,KAAK2E,QACduC,WAAYlH,KAAKkH,WACjBjF,MAAOjC,KAAKH,MAAMoC,MAClBgH,YAAajJ,KAAKyH,OAClByB,0BAA2BP,EAC3BpB,UAAWvH,KAAKuH,UAChBpB,QAASnG,KAAKmG,QACdM,OAAQzG,KAAKyG,OACbE,2BAA4B3G,KAAK2G,2BACjCT,gBAAiBlG,KAAKkG,iBAGlC,CAEAiD,MAAAA,GACI,OACId,EAACe,EAAAA,CAAajG,KAAMnD,KAAKH,MAAMsD,KAAMkG,eAAgBrJ,KAAKH,MAAMwJ,eAAgB9B,UAAWvH,KAAKuH,WAC5Fc,EAACiB,EAAAA,CAAgBC,QAASvJ,KAAKH,MAAM8H,QAAQ4B,SACzClB,EAACmB,EAAAA,CACGpI,OAAQpB,KAAKH,MAAMuB,OACnBlB,cAAeF,KAAKH,MAAMM,wBAC1BV,kBAAmBO,KAAKP,kBACxBgK,uBAAuB,EACvB3I,iBAAkBd,KAAKc,iBACvB4I,YAAa1J,KAAK2J,iBAClBZ,SAAU/I,KAAKkF,uBACf0E,QAAS5J,KAAK6J,cAEblB,GAAsB3I,KAAK0I,gBAAgBC,MAKhE"}
@@ -1,2 +1,2 @@
1
- import{AddressModeOptions as e}from"./types.js";var o={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:e.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{},onBinLookup:()=>{},onEnterKeyPressed:()=>{}};export{o as default};
1
+ import{AddressModeOptions as e}from"./types.js";var o={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:e.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{}};export{o as default};
2
2
  //# sourceMappingURL=defaultProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n autoFocus: true,\n billingAddressAllowedCountries: [],\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequired: false,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n data: {\n billingAddress: {}\n },\n disableIOSArrowKeys: false,\n enableStoreDetails: false,\n exposeExpiryDate: false,\n forceCompat: false,\n hasHolderName: false,\n holderNameRequired: false,\n hasCVC: true,\n hideCVC: false,\n installmentOptions: {},\n keypadFix: true,\n legacyInputMode: false,\n maskSecurityCode: false,\n minimumExpiryDate: null,\n name: null, // Affects Dropin only, the name displayed in the PMList item\n placeholders: {},\n positionHolderNameOnTop: false,\n showBrandIcon: true,\n showInstallmentAmounts: null,\n styles: {},\n\n isPayButtonPrimaryVariant: true,\n showContextualElement: true,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {},\n\n // Strictly speaking a Card level props, but needed here for analytics.configData\n onBinLookup: () => {},\n onEnterKeyPressed: () => {}\n};\n"],"names":["CardInputDefaultProps","type","setComponentRef","autoFocus","billingAddressAllowedCountries","billingAddressMode","AddressModeOptions","full","billingAddressRequired","billingAddressRequiredFields","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","data","billingAddress","disableIOSArrowKeys","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","holderNameRequired","hasCVC","hideCVC","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","styles","isPayButtonPrimaryVariant","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange","onBinLookup","onEnterKeyPressed"],"mappings":"gDAGA,IAAeA,EAAA,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,WAAW,EACXC,+BAAgC,GAChCC,mBAAoBC,EAAmBC,KACvCC,wBAAwB,EACxBC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WAEvGC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,KAAM,CACFC,eAAgB,CAAC,GAErBC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACpBC,QAAQ,EACRC,SAAS,EACTC,mBAAoB,CAAC,EACrBC,WAAW,EACXC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAmB,KACnBC,KAAM,KACNC,aAAc,CAAC,EACfC,yBAAyB,EACzBC,eAAe,EACfC,uBAAwB,KACxBC,OAAQ,CAAC,EAETC,2BAA2B,EAC3BC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,QAAS,OACTC,WAAY,OACZC,OAAQ,OACRC,QAAS,OACTC,SAAU,OAGVC,YAAa,OACbC,kBAAmB"}
1
+ {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n autoFocus: true,\n billingAddressAllowedCountries: [],\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequired: false,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n data: {\n billingAddress: {}\n },\n disableIOSArrowKeys: false,\n enableStoreDetails: false,\n exposeExpiryDate: false,\n forceCompat: false,\n hasHolderName: false,\n holderNameRequired: false,\n hasCVC: true,\n hideCVC: false,\n installmentOptions: {},\n keypadFix: true,\n legacyInputMode: false,\n maskSecurityCode: false,\n minimumExpiryDate: null,\n name: null, // Affects Dropin only, the name displayed in the PMList item\n placeholders: {},\n positionHolderNameOnTop: false,\n showBrandIcon: true,\n showInstallmentAmounts: null,\n styles: {},\n\n isPayButtonPrimaryVariant: true,\n showContextualElement: true,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {}\n};\n"],"names":["CardInputDefaultProps","type","setComponentRef","autoFocus","billingAddressAllowedCountries","billingAddressMode","AddressModeOptions","full","billingAddressRequired","billingAddressRequiredFields","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","data","billingAddress","disableIOSArrowKeys","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","holderNameRequired","hasCVC","hideCVC","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","styles","isPayButtonPrimaryVariant","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange"],"mappings":"gDAGA,IAAeA,EAAA,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,WAAW,EACXC,+BAAgC,GAChCC,mBAAoBC,EAAmBC,KACvCC,wBAAwB,EACxBC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WAEvGC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,KAAM,CACFC,eAAgB,CAAC,GAErBC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACpBC,QAAQ,EACRC,SAAS,EACTC,mBAAoB,CAAC,EACrBC,WAAW,EACXC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAmB,KACnBC,KAAM,KACNC,aAAc,CAAC,EACfC,yBAAyB,EACzBC,eAAe,EACfC,uBAAwB,KACxBC,OAAQ,CAAC,EAETC,2BAA2B,EAC3BC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,QAAS,OACTC,WAAY,OACZC,OAAQ,OACRC,QAAS,OACTC,SAAU"}
@@ -1,2 +1,2 @@
1
- import{optionallyFilterUpiSubTxVariants as t,filterPresent as e,filterUnsupported as o,filterAvailable as n}from"./filters.js";import{getComponentConfiguration as r}from"./getComponentConfiguration.js";import p from"../../components-name-map.js";const s=(s,i,m,a)=>{const f=t(s).map((t=>{const e="isStoredPaymentMethod"in t&&t.isStoredPaymentMethod,o=r(t.type,i,e),n=a.getComponent(t.type);if(!n)return console.warn(`\nDropin: You support the payment method '${t.type}' but this component has not been configured. Make sure to import the Class '${p(t.type)}' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method.`),null;const s={...t,...m,...o};return new n(a,s)})).filter(e).filter(o);return n(f)};export{s as default};
1
+ import{optionallyFilterUpiSubTxVariants as t,filterUnsupportedPaymentMethod as e,filterPresent as o,filterAvailable as n}from"./filters.js";import{getComponentConfiguration as r}from"./getComponentConfiguration.js";import p from"../../components-name-map.js";const s=(s,i,m,a)=>{const f=t(s).filter(e).map((t=>{const e="isStoredPaymentMethod"in t&&t.isStoredPaymentMethod,o=r(t.type,i,e),n=a.getComponent(t.type);if(!n)return console.warn(`\nDropin: You support the payment method '${t.type}' but this component has not been configured. Make sure to import the Class '${p(t.type)}' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method.`),null;const s={...t,...m,...o};return new n(a,s)})).filter(o);return n(f)};export{s as default};
2
2
  //# sourceMappingURL=createElements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createElements.js","sources":["../../../../../src/components/Dropin/elements/createElements.ts"],"sourcesContent":["import { filterUnsupported, filterPresent, filterAvailable, optionallyFilterUpiSubTxVariants } from './filters';\nimport { getComponentConfiguration } from './getComponentConfiguration';\nimport getComponentNameOfPaymentType from '../../components-name-map';\nimport UIElement from '../../internal/UIElement';\nimport type { PaymentMethod, StoredPaymentMethod } from '../../../types/global-types';\nimport type { PaymentMethodsConfiguration } from '../types';\nimport type { ICore } from '../../../core/types';\n\n/**\n * Returns a filtered (available) list of component Elements\n *\n * @param paymentMethods - Array of PaymentMethod objects from the /paymentMethods response\n * @param paymentMethodsConfiguration - Dropin paymentMethodsConfiguration object\n * @param commonProps - High level props to be passed through to every component\n * @param core - Reference to the checkout core object\n */\nconst createElements = (\n paymentMethods: PaymentMethod[] | StoredPaymentMethod[],\n paymentMethodsConfiguration: PaymentMethodsConfiguration,\n commonProps,\n core: ICore\n): Promise<UIElement[]> => {\n const elements = optionallyFilterUpiSubTxVariants(paymentMethods)\n .map(paymentMethod => {\n const isStoredPaymentMethod = 'isStoredPaymentMethod' in paymentMethod && paymentMethod.isStoredPaymentMethod;\n const paymentMethodConfigurationProps = getComponentConfiguration(paymentMethod.type, paymentMethodsConfiguration, isStoredPaymentMethod);\n const PaymentMethodElement = core.getComponent(paymentMethod.type);\n\n if (!PaymentMethodElement) {\n console.warn(\n `\\nDropin: You support the payment method '${\n paymentMethod.type\n }' but this component has not been configured. Make sure to import the Class '${getComponentNameOfPaymentType(\n paymentMethod.type\n )}' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method.`\n );\n return null;\n }\n\n const elementProps = { ...paymentMethod, ...commonProps, ...paymentMethodConfigurationProps };\n\n return new PaymentMethodElement(core, elementProps);\n })\n .filter(filterPresent)\n .filter(filterUnsupported);\n\n return filterAvailable(elements);\n};\n\nexport default createElements;\n"],"names":["createElements","paymentMethods","paymentMethodsConfiguration","commonProps","core","elements","optionallyFilterUpiSubTxVariants","map","paymentMethod","isStoredPaymentMethod","paymentMethodConfigurationProps","getComponentConfiguration","type","PaymentMethodElement","getComponent","console","warn","getComponentNameOfPaymentType","elementProps","filter","filterPresent","filterUnsupported","filterAvailable"],"mappings":"sPAgBMA,MAAAA,EAAiB,CACnBC,EACAC,EACAC,EACAC,KAEA,MAAMC,EAAWC,EAAiCL,GAC7CM,KAAIC,IACD,MAAMC,EAAwB,0BAA2BD,GAAiBA,EAAcC,sBAClFC,EAAkCC,EAA0BH,EAAcI,KAAMV,EAA6BO,GAC7GI,EAAuBT,EAAKU,aAAaN,EAAcI,MAE7D,IAAKC,EAQD,OAPAE,QAAQC,KACJ,6CACIR,EAAcI,qFAC+DK,EAC7ET,EAAcI,+HAGf,KAGX,MAAMM,EAAe,IAAKV,KAAkBL,KAAgBO,GAE5D,OAAO,IAAIG,EAAqBT,EAAMc,EAAAA,IAEzCC,OAAOC,GACPD,OAAOE,GAEZ,OAAOC,EAAgBjB,EAAAA"}
1
+ {"version":3,"file":"createElements.js","sources":["../../../../../src/components/Dropin/elements/createElements.ts"],"sourcesContent":["import { filterUnsupportedPaymentMethod, filterPresent, filterAvailable, optionallyFilterUpiSubTxVariants } from './filters';\nimport { getComponentConfiguration } from './getComponentConfiguration';\nimport getComponentNameOfPaymentType from '../../components-name-map';\nimport UIElement from '../../internal/UIElement';\nimport type { PaymentMethod, StoredPaymentMethod } from '../../../types/global-types';\nimport type { PaymentMethodsConfiguration } from '../types';\nimport type { ICore } from '../../../core/types';\n\n/**\n * Returns a filtered (available) list of component Elements\n *\n * @param paymentMethods - Array of PaymentMethod objects from the /paymentMethods response\n * @param paymentMethodsConfiguration - Dropin paymentMethodsConfiguration object\n * @param commonProps - High level props to be passed through to every component\n * @param core - Reference to the checkout core object\n */\nconst createElements = (\n paymentMethods: PaymentMethod[] | StoredPaymentMethod[],\n paymentMethodsConfiguration: PaymentMethodsConfiguration,\n commonProps,\n core: ICore\n): Promise<UIElement[]> => {\n const elements = optionallyFilterUpiSubTxVariants(paymentMethods)\n .filter(filterUnsupportedPaymentMethod)\n .map(paymentMethod => {\n const isStoredPaymentMethod = 'isStoredPaymentMethod' in paymentMethod && paymentMethod.isStoredPaymentMethod;\n const paymentMethodConfigurationProps = getComponentConfiguration(paymentMethod.type, paymentMethodsConfiguration, isStoredPaymentMethod);\n const PaymentMethodElement = core.getComponent(paymentMethod.type);\n\n if (!PaymentMethodElement) {\n console.warn(\n `\\nDropin: You support the payment method '${\n paymentMethod.type\n }' but this component has not been configured. Make sure to import the Class '${getComponentNameOfPaymentType(\n paymentMethod.type\n )}' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method.`\n );\n return null;\n }\n\n const elementProps = { ...paymentMethod, ...commonProps, ...paymentMethodConfigurationProps };\n\n return new PaymentMethodElement(core, elementProps);\n })\n .filter(filterPresent);\n\n return filterAvailable(elements);\n};\n\nexport default createElements;\n"],"names":["createElements","paymentMethods","paymentMethodsConfiguration","commonProps","core","elements","optionallyFilterUpiSubTxVariants","filter","filterUnsupportedPaymentMethod","map","paymentMethod","isStoredPaymentMethod","paymentMethodConfigurationProps","getComponentConfiguration","type","PaymentMethodElement","getComponent","console","warn","getComponentNameOfPaymentType","elementProps","filterPresent","filterAvailable"],"mappings":"mQAgBMA,MAAAA,EAAiB,CACnBC,EACAC,EACAC,EACAC,KAEA,MAAMC,EAAWC,EAAiCL,GAC7CM,OAAOC,GACPC,KAAIC,IACD,MAAMC,EAAwB,0BAA2BD,GAAiBA,EAAcC,sBAClFC,EAAkCC,EAA0BH,EAAcI,KAAMZ,EAA6BS,GAC7GI,EAAuBX,EAAKY,aAAaN,EAAcI,MAE7D,IAAKC,EAQD,OAPAE,QAAQC,KACJ,6CACIR,EAAcI,qFAC+DK,EAC7ET,EAAcI,+HAGf,KAGX,MAAMM,EAAe,IAAKV,KAAkBP,KAAgBS,GAE5D,OAAO,IAAIG,EAAqBX,EAAMgB,EAAAA,IAEzCb,OAAOc,GAEZ,OAAOC,EAAgBjB,EAAAA"}
@@ -1,2 +1,2 @@
1
- import t from"../../../utils/promiseTimeout.js";const e=["androidpay","samsungpay","clicktopay"],i=t=>!e.includes(t.constructor.type),r=t=>!!t,s=e=>{const i=e.map((e=>{const{promise:i}=t(5e3,e.isAvailable(),{});return i}));return Promise.allSettled(i).then((t=>e.filter(((e,i)=>"fulfilled"===t[i].status))))},o=t=>{if(!t.some((t=>"upi"===t?.type)))return t;const e=["upi_qr","upi_collect","upi_intent"];return t.filter((t=>!e.includes(t?.type)))};export{e as UNSUPPORTED_PAYMENT_METHODS,s as filterAvailable,r as filterPresent,i as filterUnsupported,o as optionallyFilterUpiSubTxVariants};
1
+ import t from"../../../utils/promiseTimeout.js";const e=["androidpay","samsungpay","clicktopay"],i=t=>!e.includes(t.type),r=t=>!!t,s=e=>{const i=e.map((e=>{const{promise:i}=t(5e3,e.isAvailable(),{});return i}));return Promise.allSettled(i).then((t=>e.filter(((e,i)=>"fulfilled"===t[i].status))))},l=t=>{if(!t.some((t=>"upi"===t?.type)))return t;const e=["upi_qr","upi_collect","upi_intent"];return t.filter((t=>!e.includes(t?.type)))};export{e as UNSUPPORTED_PAYMENT_METHODS,s as filterAvailable,r as filterPresent,i as filterUnsupportedPaymentMethod,l as optionallyFilterUpiSubTxVariants};
2
2
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sources":["../../../../../src/components/Dropin/elements/filters.ts"],"sourcesContent":["import promiseTimeout from '../../../utils/promiseTimeout';\nimport type { PaymentMethod, StoredPaymentMethod, UIElement } from '../../../types';\n\nexport const UNSUPPORTED_PAYMENT_METHODS = ['androidpay', 'samsungpay', 'clicktopay'];\n\n// filter payment methods that we don't support in the Drop-in\nexport const filterUnsupported = paymentMethod => !UNSUPPORTED_PAYMENT_METHODS.includes(paymentMethod.constructor['type']);\n\n// filter payment methods that we support (that are in the paymentMethods/index dictionary)\nexport const filterPresent = paymentMethod => !!paymentMethod;\n\n// filter payment methods that are available to the user\nexport const filterAvailable = (elements: UIElement[]) => {\n const elementIsAvailablePromises = elements.map(element => {\n const { promise } = promiseTimeout(5000, element.isAvailable(), {});\n return promise;\n });\n\n return Promise.allSettled(elementIsAvailablePromises).then(promiseResults => {\n return elements.filter((element, i) => promiseResults[i].status === 'fulfilled');\n });\n};\n\nexport const optionallyFilterUpiSubTxVariants = (paymentMethods: Array<PaymentMethod | StoredPaymentMethod>) => {\n const hasUpiParent = paymentMethods.some(pm => pm?.type === 'upi');\n // If we don't get the 'upi' parent, we render multiple upi components\n if (!hasUpiParent) return paymentMethods;\n\n // If we get the 'upi' parent, we remove upi sub tx_variant components\n const UPI_SUB_TX_VARIANTS = ['upi_qr', 'upi_collect', 'upi_intent'];\n return paymentMethods.filter(pm => !UPI_SUB_TX_VARIANTS.includes(pm?.type));\n};\n"],"names":["UNSUPPORTED_PAYMENT_METHODS","filterUnsupported","paymentMethod","includes","constructor","filterPresent","filterAvailable","elements","elementIsAvailablePromises","map","element","promise","promiseTimeout","isAvailable","Promise","allSettled","then","promiseResults","filter","i","status","optionallyFilterUpiSubTxVariants","paymentMethods","some","pm","type","UPI_SUB_TX_VARIANTS"],"mappings":"sDAGaA,EAA8B,CAAC,aAAc,aAAc,cAG3DC,EAAoBC,IAAkBF,EAA4BG,SAASD,EAAcE,YAAY,MAGrGC,EAAgBH,KAAmBA,EAGnCI,EAAmBC,IAC5B,MAAMC,EAA6BD,EAASE,KAAIC,IAC5C,MAAMC,QAAEA,GAAYC,EAAe,IAAMF,EAAQG,cAAe,CAAA,GAChE,OAAOF,CAAAA,IAGX,OAAOG,QAAQC,WAAWP,GAA4BQ,MAAKC,GAChDV,EAASW,QAAO,CAACR,EAASS,IAAmC,cAA7BF,EAAeE,GAAGC,UAC7D,EAGSC,EAAoCC,IAG7C,IAFqBA,EAAeC,MAAKC,GAAmB,QAAbA,GAAIC,OAEhC,OAAOH,EAG1B,MAAMI,EAAsB,CAAC,SAAU,cAAe,cACtD,OAAOJ,EAAeJ,QAAOM,IAAOE,EAAoBvB,SAASqB,GAAIC,OAAAA"}
1
+ {"version":3,"file":"filters.js","sources":["../../../../../src/components/Dropin/elements/filters.ts"],"sourcesContent":["import promiseTimeout from '../../../utils/promiseTimeout';\nimport type { PaymentMethod, StoredPaymentMethod, UIElement } from '../../../types';\n\nexport const UNSUPPORTED_PAYMENT_METHODS = ['androidpay', 'samsungpay', 'clicktopay'];\n\n/**\n * Filter out payment methods that are not supported by Drop-in\n * @param paymentMethod - Payment method object from /paymentMethods response\n */\nexport const filterUnsupportedPaymentMethod = (paymentMethod: PaymentMethod | StoredPaymentMethod) =>\n !UNSUPPORTED_PAYMENT_METHODS.includes(paymentMethod.type);\n\n// filter payment methods that we support (that are in the paymentMethods/index dictionary)\nexport const filterPresent = paymentMethod => !!paymentMethod;\n\n// filter payment methods that are available to the user\nexport const filterAvailable = (elements: UIElement[]) => {\n const elementIsAvailablePromises = elements.map(element => {\n const { promise } = promiseTimeout(5000, element.isAvailable(), {});\n return promise;\n });\n\n return Promise.allSettled(elementIsAvailablePromises).then(promiseResults => {\n return elements.filter((element, i) => promiseResults[i].status === 'fulfilled');\n });\n};\n\nexport const optionallyFilterUpiSubTxVariants = (paymentMethods: Array<PaymentMethod | StoredPaymentMethod>) => {\n const hasUpiParent = paymentMethods.some(pm => pm?.type === 'upi');\n // If we don't get the 'upi' parent, we render multiple upi components\n if (!hasUpiParent) return paymentMethods;\n\n // If we get the 'upi' parent, we remove upi sub tx_variant components\n const UPI_SUB_TX_VARIANTS = ['upi_qr', 'upi_collect', 'upi_intent'];\n return paymentMethods.filter(pm => !UPI_SUB_TX_VARIANTS.includes(pm?.type));\n};\n"],"names":["UNSUPPORTED_PAYMENT_METHODS","filterUnsupportedPaymentMethod","paymentMethod","includes","type","filterPresent","filterAvailable","elements","elementIsAvailablePromises","map","element","promise","promiseTimeout","isAvailable","Promise","allSettled","then","promiseResults","filter","i","status","optionallyFilterUpiSubTxVariants","paymentMethods","some","pm","UPI_SUB_TX_VARIANTS"],"mappings":"sDAGaA,EAA8B,CAAC,aAAc,aAAc,cAM3DC,EAAkCC,IAC1CF,EAA4BG,SAASD,EAAcE,MAG3CC,EAAgBH,KAAmBA,EAGnCI,EAAmBC,IAC5B,MAAMC,EAA6BD,EAASE,KAAIC,IAC5C,MAAMC,QAAEA,GAAYC,EAAe,IAAMF,EAAQG,cAAe,CAAA,GAChE,OAAOF,CAAAA,IAGX,OAAOG,QAAQC,WAAWP,GAA4BQ,MAAKC,GAChDV,EAASW,QAAO,CAACR,EAASS,IAAmC,cAA7BF,EAAeE,GAAGC,UAC7D,EAGSC,EAAoCC,IAG7C,IAFqBA,EAAeC,MAAKC,GAAmB,QAAbA,GAAIpB,OAEhC,OAAOkB,EAG1B,MAAMG,EAAsB,CAAC,SAAU,cAAe,cACtD,OAAOH,EAAeJ,QAAOM,IAAOC,EAAoBtB,SAASqB,GAAIpB,OAAAA"}
@@ -1,2 +1,2 @@
1
- import{TxVariants as a}from"./tx-variants.js";const o={[a.address]:"Address",[a.bankTransfer_IBAN]:"BankTransfer",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDD",[a.sepadirectdebit]:"Sepa",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.riverty]:"Riverty",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"Duitnow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function n(a){return o[a]}export{n as default};
1
+ import{TxVariants as a}from"./tx-variants.js";const o={[a.address]:"Address",[a.bankTransfer_IBAN]:"BankTransfer",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDirectDebit",[a.sepadirectdebit]:"Sepa",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.riverty]:"Riverty",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"Duitnow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function e(a){return o[a]}export{e as default};
2
2
  //# sourceMappingURL=components-name-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDD',\n [TxVariants.sepadirectdebit]: 'Sepa',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n [TxVariants.riverty]: 'Riverty',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'Duitnow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","riverty","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,KAAM,MAClB,CAACV,EAAWW,gBAAiB,SAC7B,CAACX,EAAWY,iBAAkB,OAI9B,CAACZ,EAAWa,QAAS,SACrB,CAACb,EAAWc,UAAW,WACvB,CAACd,EAAWe,kBAAmB,WAC/B,CAACf,EAAWgB,cAAe,cAC3B,CAAChB,EAAWiB,OAAQ,QACpB,CAACjB,EAAWkB,cAAe,cAC3B,CAAClB,EAAWmB,cAAe,cAC3B,CAACnB,EAAWoB,cAAe,cAC3B,CAACpB,EAAWqB,eAAgB,eAC5B,CAACrB,EAAWsB,eAAgB,eAC5B,CAACtB,EAAWuB,SAAU,UACtB,CAACvB,EAAWwB,qBAAsB,qBAClC,CAACxB,EAAWyB,SAAU,UAItB,CAACzB,EAAW0B,WAAY,YACxB,CAAC1B,EAAW2B,UAAW,WACvB,CAAC3B,EAAW4B,SAAU,aACtB,CAAC5B,EAAW6B,YAAa,aACzB,CAAC7B,EAAW8B,WAAY,YACxB,CAAC9B,EAAW+B,QAAS,SACrB,CAAC/B,EAAWgC,eAAgB,YAI5B,CAAChC,EAAWiC,gBAAiB,SAC7B,CAACjC,EAAWkC,qBAAsB,SAClC,CAA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W2E,YAAa,aACzB,CAAC3E,EAAW4E,UAAW,WACvB,CAAC5E,EAAW6E,OAAQ,QACpB,CAAC7E,EAAW8E,OAAQ,QACpB,CAAC9E,EAAW+E,SAAU,UAItB,CAAC/E,EAAWgF,QAAS,SACrB,CAAChF,EAAWiF,gBAAiB,SAC7B,CAACjF,EAAWkF,eAAgB,SAC5B,CAAClF,EAAWmF,YAAa,SAIzB,CAACnF,EAAWoF,aAAc,aAC1B,CAACpF,EAAWqF,gBAAiB,aAC7B,CAACrF,EAAWsF,KAAM,MAClB,CAACtF,EAAWuF,OAAQ,QACpB,CAACvF,EAAWwF,WAAY,SACxB,CAACxF,EAAWyF,aAAc,SAC1B,CAACzF,EAAW0F,WAAY,YACxB,CAAC1F,EAAW2F,QAAS,SACrB,CAAC3F,EAAW4F,SAAU,UAItB,CAAC5F,EAAW6F,MAAO,OACnB,CAAC7F,EAAW8F,OAAQ,QACpB,CAAC9F,EAAW+F,MAAO,OACnB,CAAC/F,EAAWgG,KAAM,MAClB,CAAChG,EAAWiG,QAAS,MACrB,CAACjG,EAAWkG,aAAc,MAC1B,CAAClG,EAAWmG,YAAa,MAIzB,CAACnG,EAAWoG,UAAW,WACvB,CAACpG,EAAWqG,wBAAyB,gBACrC,CAACrG,EAAWsG,uBAAwB,gBACpC,CAACtG,EAAWuG,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAO1G,EAAkB0G,EAC7B"}
1
+ {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDirectDebit',\n [TxVariants.sepadirectdebit]: 'Sepa',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n [TxVariants.riverty]: 'Riverty',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'Duitnow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","riverty","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,KAAM,MAClB,CAACV,EAAWW,gBAAiB,kBAC7B,CAACX,EAAWY,iBAAkB,OAI9B,CAACZ,EAAWa,QAAS,SACrB,CAACb,EAAWc,UAAW,WACvB,CAACd,EAAWe,kBAAmB,WAC/B,CAACf,EAA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B,CAAClG,EAAWmG,YAAa,MAIzB,CAACnG,EAAWoG,UAAW,WACvB,CAACpG,EAAWqG,wBAAyB,gBACrC,CAACrG,EAAWsG,uBAAwB,gBACpC,CAACtG,EAAWuG,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAO1G,EAAkB0G,EAC7B"}
@@ -1,2 +1,2 @@
1
- import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import s from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{ANALYTICS_RENDERED_STR as r}from"../../../core/Analytics/constants.js";import{on as n,off as i}from"../../../utils/listenerUtils.js";class a{_id=`${this.constructor.type}-${s()}`;core;props;state={};_component;_node=null;static defaultProps={};constructor(t,e){const s=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!s)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),s=!!e(this.props,"modules.analytics.getEnabled")?.()?e(this.props,"modules.analytics.getCheckoutAttemptId")?.():"do-not-track",o=this.state.order||this.props.order,r=this.formatData();if(r.paymentMethod&&s&&(r.paymentMethod.checkoutAttemptId=s),"riverty"!==this.props.type&&r.billingAddress){const{firstName:t,lastName:e,...s}=r.billingAddress;r.billingAddress={...s}}return{...t&&{riskData:{clientData:t}},...o&&{order:{orderData:o.orderData,pspReference:o.pspReference}},...r,clientStateDataIndicator:!0}}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error("Component could not mount. Root node was not found.");const o=!this._node;return this._node&&this.unmount(),this._node=s,n(this._node,"keypress",this.handleKeyPress),this._component=this.render(),t(this._component,s),o&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:s&&s.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:r})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return i(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}}export{a as default};
1
+ import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import s from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as r,ANALYTICS_RENDERED_STR as n}from"../../../core/Analytics/constants.js";import{on as i,off as p}from"../../../utils/listenerUtils.js";class a{_id=`${this.constructor.type}-${s()}`;core;props;state={};_component;_node=null;static defaultProps={};constructor(t,e){const s=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!s)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),s=e(this.props,"modules.analytics.getCheckoutAttemptId")?.()??r,o=this.state.order||this.props.order,n=this.formatData();if(n.paymentMethod&&s&&(n.paymentMethod.checkoutAttemptId=s),"riverty"!==this.props.type&&n.billingAddress){const{firstName:t,lastName:e,...s}=n.billingAddress;n.billingAddress={...s}}return{...t&&{riskData:{clientData:t}},...o&&{order:{orderData:o.orderData,pspReference:o.pspReference}},...n,clientStateDataIndicator:!0}}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error("Component could not mount. Root node was not found.");const o=!this._node;return this._node&&this.unmount(),this._node=s,i(this._node,"keypress",this.handleKeyPress),this._component=this.render(),t(this._component,s),o&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:s&&s.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:n})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return p(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}}export{a as default};
2
2
  //# sourceMappingURL=BaseElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_RENDERED_STR } from '../../../core/Analytics/constants';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport { off, on } from '../../../utils/listenerUtils';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const useAnalytics = !!getProp(this.props, 'modules.analytics.getEnabled')?.();\n const checkoutAttemptId = useAnalytics ? getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() : 'do-not-track';\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n // Workaround, to be fixed properly\n // Remove the firstName & lastName in the billingAddress for non Riverty components\n // @ts-ignore type exists\n if (this.props.type !== 'riverty' && componentData.billingAddress) {\n const { firstName, lastName, ...rest } = componentData.billingAddress;\n componentData.billingAddress = { ...rest };\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress);\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && node.offsetWidth,\n component: !this.props.isDropin ? this.constructor['analyticsType'] ?? this.constructor['type'] : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","_id","this","constructor","uuid","core","props","state","_component","_node","static","checkout","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","buildElementProps","handleKeyPress","bind","componentProps","formatProps","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","e","setState","newState","data","clientData","getProp","checkoutAttemptId","order","componentData","paymentMethod","type","billingAddress","firstName","lastName","rest","riskData","orderData","pspReference","clientStateDataIndicator","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","unmount","on","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","ANALYTICS_RENDERED_STR","update","off","remove"],"mappings":"sVAuBA,MAAeA,EACKC,IAAM,GAAGC,KAAKC,YAAmB,QAAIC,MACrCC,KAETC,MACAC,MAAa,CAAA,EACbC,WAEGC,MAAqB,KAE/BC,oBAAgC,CAAA,EAEhCP,WAAAA,CAAYQ,EAAiBL,GACzB,MAAMM,EAnBd,SAA8BD,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASE,YAAkE,mBAA9BF,EAASG,iBAEtF,CAe+BC,CAAqBJ,GAE5C,IAAKC,EACD,MAAM,IAAII,EACN,uBACA,uCAAuCd,KAAKC,YAAmB,6DAIvED,KAAKG,KAAOM,EACZT,KAAKe,kBAAkBX,GAEvBJ,KAAKgB,eAAiBhB,KAAKgB,eAAeC,KAAKjB,KACnD,CAEUe,iBAAAA,CAAkBG,GACxBlB,KAAKI,MAAQJ,KAAKmB,YAAY,IAAKnB,KAAKC,YAA2B,gBAAKiB,GAC5E,CAMUC,WAAAA,C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KAAKI,MAAMkD,QAAQC,WACzCvD,KAAKqB,eAAe,CAChBmC,eAAgBR,GAAQA,EAAKS,YAC7BC,UAAY1D,KAAKI,MAAMuD,SAA2E,SAAhE3D,KAAKC,2BAAgCD,KAAKC,iBAC5E2D,OAAS5D,KAAKI,MAAMuD,SAA0B,SAAf,eAChCE,MAAK,KAIC7D,KAAKI,MAAMuD,UACZ3D,KAAKuB,gBAAgB,CAAEY,KAAM2B,GACjC,IAKL9D,IACX,CAQO+D,MAAAA,CAAO3D,GAIV,OAHAJ,KAAKI,MAAQJ,KAAKmB,YAAY,IAAKnB,KAAKI,SAAUA,IAClDJ,KAAKK,MAAQ,GAENL,KAAKoD,UAAUN,MAAM9C,KAAKO,MACrC,CAKA,OAAA6C,GAQI,OANAY,EAAIhE,KAAKO,MAAO,WAAYP,KAAKgB,gBAE7BhB,KAAKO,OACLqC,EAAO,KAAM5C,KAAKO,OAGfP,IACX,CAMA,MAAAiE,GACIjE,KAAKoD,UAEDpD,KAAKG,MACLH,KAAKG,KAAK8D,OAAOjE,KAEzB"}
1
+ {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_RENDERED_STR, NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport { off, on } from '../../../utils/listenerUtils';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const checkoutAttemptId = getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() ?? NO_CHECKOUT_ATTEMPT_ID; // NOTE: we never expect to see this \"failed\" value, but, just in case...\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n // Workaround, to be fixed properly\n // Remove the firstName & lastName in the billingAddress for non Riverty components\n // @ts-ignore type exists\n if (this.props.type !== 'riverty' && componentData.billingAddress) {\n const { firstName, lastName, ...rest } = componentData.billingAddress;\n componentData.billingAddress = { ...rest };\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress);\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && node.offsetWidth,\n component: !this.props.isDropin ? (this.constructor['analyticsType'] ?? this.constructor['type']) : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","_id","this","constructor","uuid","core","props","state","_component","_node","static","checkout","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","buildElementProps","handleKeyPress","bind","componentProps","formatProps","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","e","setState","newState","data","clientData","getProp","checkoutAttemptId","NO_CHECKOUT_ATTEMPT_ID","order","componentData","paymentMethod","type","billingAddress","firstName","lastName","rest","riskData","orderData","pspReference","clientStateDataIndicator","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","unmount","on","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","ANALYTICS_RENDERED_STR","update","off","remove"],"mappings":"kXAuBA,MAAeA,EACKC,IAAM,GAAGC,KAAKC,YAAmB,QAAIC,MACrCC,KAETC,MACAC,MAAa,CAAA,EACbC,WAEGC,MAAqB,KAE/BC,oBAAgC,CAAA,EAEhCP,WAAAA,CAAYQ,EAAiBL,GACzB,MAAMM,EAnBd,SAA8BD,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASE,YAAkE,mBAA9BF,EAASG,iBAEtF,CAe+BC,CAAqBJ,GAE5C,IAAKC,EACD,MAAM,IAAII,EACN,uBACA,uCAAuCd,KAAKC,YAAmB,6DAIvED,KAAKG,KAAOM,EACZT,KAAKe,kBAAkBX,GAEvBJ,KAAKgB,eAAiBhB,KAAK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AKgB,gBAEhChB,KAAKM,WAAaN,KAAK6C,SAEvBA,EAAO7C,KAAKM,WAAY2C,GAGpBG,GACIpD,KAAKI,MAAMmD,SAAWvD,KAAKI,MAAMmD,QAAQC,WACzCxD,KAAKqB,eAAe,CAChBoC,eAAgBR,GAAQA,EAAKS,YAC7BC,UAAY3D,KAAKI,MAAMwD,SAA6E,SAAjE5D,KAAKC,2BAAgCD,KAAKC,iBAC7E4D,OAAS7D,KAAKI,MAAMwD,SAA0B,SAAf,eAChCE,MAAK,KAIC9D,KAAKI,MAAMwD,UACZ5D,KAAKuB,gBAAgB,CAAEa,KAAM2B,GACjC,IAKL/D,IACX,CAQOgE,MAAAA,CAAO5D,GAIV,OAHAJ,KAAKI,MAAQJ,KAAKmB,YAAY,IAAKnB,KAAKI,SAAUA,IAClDJ,KAAKK,MAAQ,GAENL,KAAKqD,UAAUN,MAAM/C,KAAKO,MACrC,CAKA,OAAA8C,GAQI,OANAY,EAAIjE,KAAKO,MAAO,WAAYP,KAAKgB,gBAE7BhB,KAAKO,OACLsC,EAAO,KAAM7C,KAAKO,OAGfP,IACX,CAMA,MAAAkE,GACIlE,KAAKqD,UAEDrD,KAAKG,MACLH,KAAKG,KAAK+D,OAAOlE,KAEzB"}
@@ -1,2 +1,2 @@
1
- import t from"../Services/analytics/collect-id.js";import e from"./EventsQueue.js";import{ANALYTICS_EVENT_INFO as n,ANALYTICS_INFO_TIMER_INTERVAL as a,ANALYTICS_EVENT_LOG as l,ANALYTICS_EVENT_ERROR as s,ANALYTICS_PATH as c}from"./constants.js";import{debounce as o}from"../../utils/debounce.js";import{processAnalyticsData as i,createAnalyticsObject as r}from"./utils.js";import{analyticsPreProcessor as u}from"./analyticsPreProcessor.js";let y=null,m=null;const d=({locale:d,clientKey:p,analytics:f,amount:b,analyticsContext:h,bundleType:j})=>{const v={enabled:!0,checkoutAttemptId:null,analyticsData:{},...f},A=t({analyticsContext:h,clientKey:p,locale:d,amount:b,analyticsPath:c,bundleType:j}),g=e({analyticsContext:h,clientKey:p,analyticsPath:c}),E=()=>y?g.run(y):Promise.resolve(null),P={setUp:async t=>{const{enabled:e,payload:n}=v,a=i(v.analyticsData);if(!0===e&&!y)try{const e=await A({...t,...n&&{...n},...Object.keys(a).length&&{...a}});y=e}catch(t){console.warn("Fetching checkoutAttemptId failed."+(t?` Error=${t}`:""))}},getCheckoutAttemptId:()=>y,getEventsQueue:()=>g,createAnalyticsEvent:({event:t,data:e})=>{const c=r({event:t,...e});return((t,e)=>{const c=t===n?t:`${t}s`;g.add(`${c}`,e),t===n&&(clearTimeout(m),m=setTimeout((()=>{E()}),a)),t!==l&&t!==s||(clearTimeout(m),o(E)())})(t,c),c},getEnabled:()=>v.enabled,sendAnalytics:null};return P.sendAnalytics=u(P),P};export{d as default};
1
+ import t from"../Services/analytics/collect-id.js";import e from"./EventsQueue.js";import{ANALYTICS_EVENT_INFO as n,ANALYTICS_INFO_TIMER_INTERVAL as a,ANALYTICS_EVENT_LOG as l,ANALYTICS_EVENT_ERROR as s,ANALYTICS_PATH as c}from"./constants.js";import{debounce as o}from"../../utils/debounce.js";import{processAnalyticsData as i,createAnalyticsObject as r}from"./utils.js";import{analyticsPreProcessor as u}from"./analyticsPreProcessor.js";let y=null,m=null;const d=({locale:d,clientKey:p,analytics:f,amount:b,analyticsContext:h,bundleType:j})=>{const v={enabled:!0,checkoutAttemptId:null,analyticsData:{},...f},A=t({analyticsContext:h,clientKey:p,locale:d,amount:b,analyticsPath:c,bundleType:j}),g=e({analyticsContext:h,clientKey:p,analyticsPath:c}),E=()=>y?g.run(y):Promise.resolve(null),P={setUp:async t=>{const{payload:e}=v,n=i(v.analyticsData);if(!y)try{const a=await A({...t,...e&&{...e},...Object.keys(n).length&&{...n}});y=a}catch(t){console.warn("Fetching checkoutAttemptId failed."+(t?` Error=${t}`:""))}},getCheckoutAttemptId:()=>y,getEventsQueue:()=>g,createAnalyticsEvent:({event:t,data:e})=>{if(!v.enabled)return;const c=r({event:t,...e});return((t,e)=>{const c=t===n?t:`${t}s`;g.add(`${c}`,e),t===n&&(clearTimeout(m),m=setTimeout((()=>{E()}),a)),t!==l&&t!==s||(clearTimeout(m),o(E)())})(t,c),c},getEnabled:()=>v.enabled,sendAnalytics:null};return P.sendAnalytics=!0===v.enabled?u(P):()=>{},P};export{d as default};
2
2
  //# sourceMappingURL=Analytics.js.map