From 47989cb3388f52cbb65ece396c9976bc404bb7a4 Mon Sep 17 00:00:00 2001 From: Can Demiralp Date: Fri, 2 Aug 2024 16:09:18 +0300 Subject: [PATCH] [ECP-9382] Include holderName in recurring payment requests (#526) * [ECP-9382] Add holderName to recurring card payment requests * [ECP-9382] Update frontend files * [ECP-9382] Add holderName conditionally * [ECP-9382] Make cardholder name required * [ECP-9382] Update frontend assets --------- Co-authored-by: Can Demiralp --- .../js/adyen-payment-shopware6/adyen-payment-shopware6.js | 2 +- .../app/storefront/src/checkout/confirm-order.plugin.js | 5 +++++ .../public/administration/css/adyen-payment-shopware6.css | 2 ++ .../public/administration/js/adyen-payment-shopware6.js | 3 ++- .../public/static/css/adyen-payment-shopware6.css.map | 1 + .../public/static/js/adyen-payment-shopware6.js.map | 1 + 6 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/Resources/public/static/css/adyen-payment-shopware6.css.map create mode 100644 src/Resources/public/static/js/adyen-payment-shopware6.js.map diff --git a/src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js b/src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js index 6b67b480..c5ae6f29 100644 --- a/src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js +++ b/src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js @@ -1 +1 @@ -(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==n},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s(Array.isArray(e)?[]:{},e,t):e}function r(e,t,n){return e.concat(t).map(function(e){return a(e,n)})}function i(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function s(e,n,d){(d=d||{}).arrayMerge=d.arrayMerge||r,d.isMergeableObject=d.isMergeableObject||t,d.cloneUnlessOtherwiseSpecified=a;var c,l,h=Array.isArray(n);return h!==Array.isArray(e)?a(n,d):h?d.arrayMerge(e,n,d):(l={},(c=d).isMergeableObject(e)&&i(e).forEach(function(t){l[t]=a(e[t],c)}),i(n).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(n[t])?l[t]=(function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s})(t,c)(e[t],n[t],c):l[t]=a(n[t],c))}),l)}s.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},e.exports=s}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e=n(857),t=n.n(e);class a{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let n=a.toUpperCamelCase(e,t);return a.lcFirst(n)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>a.ucFirst(e.toLowerCase())).join(""):a.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class r{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!r.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!1===r.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(n)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=t.replace(/^data(|-)/,""),o=a.toLowerCamelCase(i,"-");if(!r.isNode(e)){if(n)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(n)throw Error("This node doesn't support the dataset attribute!");return}let s=e.dataset[o];if(void 0===s){if(n)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return s}return a.parsePrimitive(s)}static querySelector(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let a=e.querySelector(t)||!1;if(n&&!1===a)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return a}static querySelectorAll(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let a=e.querySelectorAll(t);if(0===a.length&&(a=!1),n&&!1===a)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return a}}class i{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=new CustomEvent(e,{detail:t,cancelable:n});return this.el.dispatchEvent(a),a}subscribe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this,r=e.split("."),i=n.scope?t.bind(n.scope):t;if(n.once&&!0===n.once){let t=i;i=function(n){a.unsubscribe(e),t(n)}}return this.el.addEventListener(r[0],i),this.listeners.push({splitEventName:r,opts:n,cb:i}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,n)=>([...n.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(n.splitEventName[0],n.cb):e.push(n),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class o{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let n=a.toDashCase(this._pluginName),i=r.getDataAttribute(this.el,"data-".concat(n,"-config"),!1),o=r.getAttribute(this.el,"data-".concat(n,"-options"),!1),s=[this.constructor.options,this.options,e];i&&s.push(window.PluginConfigManager.get(this._pluginName,i));try{o&&s.push(JSON.parse(o))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(n,'-options" could not be parsed to json: ').concat(e.message))}return t().all(s.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},n=!1){if(!r.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new i(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}class s{get(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",a=this._createPreparedRequest("GET",e,n);return this._sendRequest(a,null,t)}post(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("POST",e,a);return this._sendRequest(r,t,n)}delete(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("DELETE",e,a);return this._sendRequest(r,t,n)}patch(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("PATCH",e,a);return this._sendRequest(r,t,n)}abort(){if(this._request)return this._request.abort()}_registerOnLoaded(e,t){t&&e.addEventListener("loadend",()=>{t(e.responseText,e)})}_sendRequest(e,t,n){return this._registerOnLoaded(e,n),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,n){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),n&&this._request.setRequestHeader("Content-type",n),this._request}constructor(){this._request=null}}class d{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var n of e.entries())t(n[1],n[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(n=>{t(e[n],n)});throw Error("The element type ".concat(typeof e," is not iterable!"))}}let c="loader",l={BEFORE:"before",INNER:"inner"};class h{create(){if(!this.exists()){if(this.position===l.INNER){this.parent.innerHTML=h.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),h.getTemplate())}}remove(){let e=this.parent.querySelectorAll(".".concat(c));d.iterate(e,e=>e.remove())}exists(){return this.parent.querySelectorAll(".".concat(c)).length>0}_getPosition(){return this.position===l.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'
\n Loading...\n
')}static SELECTOR_CLASS(){return c}constructor(e,t=l.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}}let u="element-loader-backdrop";class y extends h{static create(e){e.classList.add("has-element-loader"),y.exists(e)||(y.appendLoader(e),setTimeout(()=>{let t=e.querySelector(".".concat(u));t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(".".concat(u));t&&t.remove()}static exists(e){return e.querySelectorAll(".".concat(u)).length>0}static getTemplate(){return'\n
\n
\n Loading...\n
\n
\n ')}static appendLoader(e){e.insertAdjacentHTML("beforeend",y.getTemplate())}}class m{static serialize(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==e.nodeName){if(t)throw Error("The passed element is not a form!");return{}}return new FormData(e)}static serializeJson(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=m.serialize(e,t);if(n==={})return n;let a={};return d.iterate(n,(e,t)=>a[t]=e),a}}let p={updatablePaymentMethods:["scheme","ideal","sepadirectdebit","oneclick","dotpay","bcmc","bcmc_mobile","blik","klarna_b2b","eps","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","afterpay_default","ratepay","ratepay_directdebit","giftcard","paybright","affirm","multibanco","mbway","vipps","mobilepay","wechatpayQR","wechatpayWeb","paybybank"],componentsWithPayButton:{applepay:{extra:{},onClick:(e,t,n)=>n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},googlepay:{extra:{buttonSizeMode:"fill"},onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},onError:function(e,t,n){"CANCELED"!==e.statusCode&&("statusMessage"in e?console.log(e.statusMessage):console.log(e.statusCode))}},paypal:{extra:{},onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()},onError:function(e,t,n){t.setStatus("ready"),window.location.href=n.errorUrl.toString()},onCancel:function(e,t,n){t.setStatus("ready"),window.location.href=n.errorUrl.toString()},responseHandler:function(e,t){try{(t=JSON.parse(t)).isFinal&&(location.href=e.returnUrl),this.handleAction(t.action)}catch(e){console.error(e)}}},amazonpay:{extra:{productType:"PayAndShip",checkoutMode:"ProcessOrder",returnUrl:location.href},prePayRedirect:!0,sessionKey:"amazonCheckoutSessionId",onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},onError:(e,t)=>{console.log(e),t.setStatus("ready")}}},paymentMethodTypeHandlers:{scheme:"handler_adyen_cardspaymentmethodhandler",ideal:"handler_adyen_idealpaymentmethodhandler",klarna:"handler_adyen_klarnapaylaterpaymentmethodhandler",klarna_account:"handler_adyen_klarnaaccountpaymentmethodhandler",klarna_paynow:"handler_adyen_klarnapaynowpaymentmethodhandler",ratepay:"handler_adyen_ratepaypaymentmethodhandler",ratepay_directdebit:"handler_adyen_ratepaydirectdebitpaymentmethodhandler",sepadirectdebit:"handler_adyen_sepapaymentmethodhandler",sofort:"handler_adyen_sofortpaymentmethodhandler",paypal:"handler_adyen_paypalpaymentmethodhandler",oneclick:"handler_adyen_oneclickpaymentmethodhandler",giropay:"handler_adyen_giropaypaymentmethodhandler",applepay:"handler_adyen_applepaypaymentmethodhandler",googlepay:"handler_adyen_googlepaypaymentmethodhandler",dotpay:"handler_adyen_dotpaypaymentmethodhandler",bcmc:"handler_adyen_bancontactcardpaymentmethodhandler",bcmc_mobile:"handler_adyen_bancontactmobilepaymentmethodhandler",amazonpay:"handler_adyen_amazonpaypaymentmethodhandler",twint:"handler_adyen_twintpaymentmethodhandler",eps:"handler_adyen_epspaymentmethodhandler",swish:"handler_adyen_swishpaymentmethodhandler",alipay:"handler_adyen_alipaypaymentmethodhandler",alipay_hk:"handler_adyen_alipayhkpaymentmethodhandler",blik:"handler_adyen_blikpaymentmethodhandler",clearpay:"handler_adyen_clearpaypaymentmethodhandler",facilypay_3x:"handler_adyen_facilypay3xpaymentmethodhandler",facilypay_4x:"handler_adyen_facilypay4xpaymentmethodhandler",facilypay_6x:"handler_adyen_facilypay6xpaymentmethodhandler",facilypay_10x:"handler_adyen_facilypay10xpaymentmethodhandler",facilypay_12x:"handler_adyen_facilypay12xpaymentmethodhandler",afterpay_default:"handler_adyen_afterpaydefaultpaymentmethodhandler",trustly:"handler_adyen_trustlypaymentmethodhandler",paysafecard:"handler_adyen_paysafecardpaymentmethodhandler",giftcard:"handler_adyen_giftcardpaymentmethodhandler",mbway:"handler_adyen_mbwaypaymentmethodhandler",multibanco:"handler_adyen_multibancopaymentmethodhandler",wechatpayQR:"handler_adyen_wechatpayqrpaymentmethodhandler",wechatpayWeb:"handler_adyen_wechatpaywebpaymentmethodhandler",mobilepay:"handler_adyen_mobilepaypaymentmethodhandler",vipps:"handler_adyen_vippspaymentmethodhandler",affirm:"handler_adyen_affirmpaymentmethodhandler",paybright:"handler_adyen_paybrightpaymentmethodhandler",paybybank:"handler_adyen_openbankingpaymentmethodhandler",klarna_b2b:"handler_adyen_billiepaymentmethodhandler"}},f=window.PluginManager;f.register("CartPlugin",class extends o{init(){let e=this;this._client=new s,this.adyenCheckout=Promise,this.paymentMethodInstance=null,this.selectedGiftcard=null,this.initializeCheckoutComponent().then((function(){this.observeGiftcardSelection()}).bind(this)),this.adyenGiftcardDropDown=r.querySelectorAll(document,"#giftcardDropdown"),this.adyenGiftcard=r.querySelectorAll(document,".adyen-giftcard"),this.giftcardHeader=r.querySelector(document,".adyen-giftcard-header"),this.giftcardItem=r.querySelector(document,".adyen-giftcard-item"),this.giftcardComponentClose=r.querySelector(document,".adyen-close-giftcard-component"),this.minorUnitsQuotient=adyenGiftcardsConfiguration.totalInMinorUnits/adyenGiftcardsConfiguration.totalPrice,this.giftcardDiscount=adyenGiftcardsConfiguration.giftcardDiscount,this.remainingAmount=(adyenGiftcardsConfiguration.totalPrice-this.giftcardDiscount).toFixed(2),this.remainingGiftcardBalance=(adyenGiftcardsConfiguration.giftcardBalance/this.minorUnitsQuotient).toFixed(2),this.shoppingCartSummaryBlock=r.querySelectorAll(document,".checkout-aside-summary-list"),this.offCanvasSummaryDetails=null,this.shoppingCartSummaryDetails=null,this.giftcardComponentClose.onclick=function(t){t.currentTarget.style.display="none",e.selectedGiftcard=null,e.giftcardItem.innerHTML="",e.giftcardHeader.innerHTML=" ",e.paymentMethodInstance&&e.paymentMethodInstance.unmount()},document.getElementById("showGiftcardButton").addEventListener("click",function(){this.style.display="none",document.getElementById("giftcardDropdown").style.display="block"}),"interactive"==document.readyState?(this.fetchGiftcardsOnPageLoad(),this.setGiftcardsRemovalEvent()):(window.addEventListener("DOMContentLoaded",this.fetchGiftcardsOnPageLoad()),window.addEventListener("DOMContentLoaded",this.setGiftcardsRemovalEvent()))}fetchGiftcardsOnPageLoad(){parseInt(adyenGiftcardsConfiguration.giftcardDiscount,10)&&this.fetchRedeemedGiftcards()}setGiftcardsRemovalEvent(){document.getElementById("giftcardsContainer").addEventListener("click",e=>{if(e.target.classList.contains("adyen-remove-giftcard")){let t=e.target.getAttribute("dataid");this.removeGiftcard(t)}})}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,a={locale:e,clientKey:t,environment:n,amount:{currency:adyenGiftcardsConfiguration.currency,value:adyenGiftcardsConfiguration.totalInMinorUnits}};this.adyenCheckout=await AdyenCheckout(a)}observeGiftcardSelection(){let e=this,t=document.getElementById("giftcardDropdown"),n=document.querySelector(".btn-outline-info");t.addEventListener("change",function(){t.value&&(e.selectedGiftcard=JSON.parse(event.currentTarget.options[event.currentTarget.selectedIndex].dataset.giftcard),e.mountGiftcardComponent(e.selectedGiftcard),t.value="",n.style.display="none")})}mountGiftcardComponent(e){this.paymentMethodInstance&&this.paymentMethodInstance.unmount(),this.giftcardItem.innerHTML="",y.create(r.querySelector(document,"#adyen-giftcard-component"));var t=document.createElement("img");t.src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/"+e.brand+".svg",t.classList.add("adyen-giftcard-logo"),this.giftcardItem.insertBefore(t,this.giftcardItem.firstChild),this.giftcardHeader.innerHTML=e.name,this.giftcardComponentClose.style.display="block";let n=Object.assign({},e,{showPayButton:!0,onBalanceCheck:this.handleBalanceCheck.bind(this,e)});try{this.paymentMethodInstance=this.adyenCheckout.create("giftcard",n),this.paymentMethodInstance.mount("#adyen-giftcard-component")}catch(e){console.log("giftcard not available")}y.remove(r.querySelector(document,"#adyen-giftcard-component"))}handleBalanceCheck(e,t,n,a){let r={};r.paymentMethod=JSON.stringify(a.paymentMethod),r.amount=JSON.stringify({currency:adyenGiftcardsConfiguration.currency,value:adyenGiftcardsConfiguration.totalInMinorUnits}),this._client.post("".concat(adyenGiftcardsConfiguration.checkBalanceUrl),JSON.stringify(r),(function(t){if((t=JSON.parse(t)).hasOwnProperty("pspReference")){let n=t.transactionLimit?parseFloat(t.transactionLimit.value):parseFloat(t.balance.value);a.giftcard={currency:adyenGiftcardsConfiguration.currency,value:(n/this.minorUnitsQuotient).toFixed(2),title:e.name},this.saveGiftcardStateData(a)}else n(t.resultCode)}).bind(this))}fetchRedeemedGiftcards(){this._client.get(adyenGiftcardsConfiguration.fetchRedeemedGiftcardsUrl,(function(e){e=JSON.parse(e);let t=document.getElementById("giftcardsContainer"),n=document.querySelector(".btn-outline-info");t.innerHTML="",e.redeemedGiftcards.giftcards.forEach(function(e){let n=parseFloat(e.deductedAmount);n=n.toFixed(2);let a=adyenGiftcardsConfiguration.translationAdyenGiftcardDeductedBalance+": "+adyenGiftcardsConfiguration.currencySymbol+n,r=document.createElement("div");var i=document.createElement("img");i.src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/"+e.brand+".svg",i.classList.add("adyen-giftcard-logo");let o=document.createElement("a");o.href="#",o.textContent=adyenGiftcardsConfiguration.translationAdyenGiftcardRemove,o.setAttribute("dataid",e.stateDataId),o.classList.add("adyen-remove-giftcard"),o.style.display="block",r.appendChild(i),r.innerHTML+="".concat(e.title,""),r.appendChild(o),r.innerHTML+='

'.concat(a,"


"),t.appendChild(r)}),this.remainingAmount=e.redeemedGiftcards.remainingAmount,this.giftcardDiscount=e.redeemedGiftcards.totalDiscount,this.paymentMethodInstance&&this.paymentMethodInstance.unmount(),this.giftcardComponentClose.style.display="none",this.giftcardItem.innerHTML="",this.giftcardHeader.innerHTML=" ",this.appendGiftcardSummary(),this.remainingAmount>0?n.style.display="block":(this.adyenGiftcardDropDown.length>0&&(this.adyenGiftcardDropDown[0].style.display="none"),n.style.display="none"),document.getElementById("giftcardsContainer")}).bind(this))}saveGiftcardStateData(e){e=JSON.stringify(e),this._client.post(adyenGiftcardsConfiguration.setGiftcardUrl,JSON.stringify({stateData:e}),(function(e){"token"in(e=JSON.parse(e))&&(this.fetchRedeemedGiftcards(),y.remove(document.body))}).bind(this))}removeGiftcard(e){y.create(document.body),this._client.post(adyenGiftcardsConfiguration.removeGiftcardUrl,JSON.stringify({stateDataId:e}),e=>{"token"in(e=JSON.parse(e))&&(this.fetchRedeemedGiftcards(),y.remove(document.body))})}appendGiftcardSummary(){if(this.shoppingCartSummaryBlock.length){let e=this.shoppingCartSummaryBlock[0].querySelectorAll(".adyen-giftcard-summary");for(let t=0;t
'+adyenGiftcardsConfiguration.currencySymbol+e+'
'+adyenGiftcardsConfiguration.translationAdyenGiftcardRemainingAmount+'
'+adyenGiftcardsConfiguration.currencySymbol+t+"
";this.shoppingCartSummaryBlock[0].innerHTML+=n}}},"#adyen-giftcards-container"),f.register("ConfirmOrderPlugin",class extends o{init(){this._client=new s,this.selectedAdyenPaymentMethod=this.getSelectedPaymentMethodKey(),this.confirmOrderForm=r.querySelector(document,"#confirmOrderForm"),this.confirmFormSubmit=r.querySelector(document,'#confirmOrderForm button[type="submit"]'),this.shoppingCartSummaryBlock=r.querySelectorAll(document,".checkout-aside-summary-list"),this.minorUnitsQuotient=adyenCheckoutOptions.amount/adyenCheckoutOptions.totalPrice,this.giftcardDiscount=adyenCheckoutOptions.giftcardDiscount,this.remainingAmount=adyenCheckoutOptions.totalPrice-this.giftcardDiscount,this.responseHandler=this.handlePaymentAction,this.adyenCheckout=Promise,this.initializeCheckoutComponent().then((function(){if(adyenCheckoutOptions.selectedPaymentMethodPluginId===adyenCheckoutOptions.adyenPluginId){if(!adyenCheckoutOptions||!adyenCheckoutOptions.paymentStatusUrl||!adyenCheckoutOptions.checkoutOrderUrl||!adyenCheckoutOptions.paymentHandleUrl){console.error("Adyen payment configuration missing.");return}this.selectedAdyenPaymentMethod in p.componentsWithPayButton&&this.initializeCustomPayButton(),p.updatablePaymentMethods.includes(this.selectedAdyenPaymentMethod)&&!this.stateData?this.renderPaymentComponent(this.selectedAdyenPaymentMethod):this.confirmFormSubmit.addEventListener("click",this.onConfirmOrderSubmit.bind(this))}}).bind(this)),adyenCheckoutOptions.payInFullWithGiftcard>0?parseInt(adyenCheckoutOptions.giftcardDiscount,10)&&this.appendGiftcardSummary():this.appendGiftcardSummary()}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n,merchantAccount:a}=adyenCheckoutConfiguration,r=adyenCheckoutOptions.paymentMethodsResponse,i={locale:e,clientKey:t,environment:n,showPayButton:this.selectedAdyenPaymentMethod in p.componentsWithPayButton,hasHolderName:!0,paymentMethodsResponse:JSON.parse(r),onAdditionalDetails:this.handleOnAdditionalDetails.bind(this),countryCode:activeShippingAddress.country,paymentMethodsConfiguration:{card:{hasHolderName:!0,clickToPayConfiguration:{merchantDisplayName:a,shopperEmail:shopperDetails.shopperEmail}}}};this.adyenCheckout=await AdyenCheckout(i)}handleOnAdditionalDetails(e){this._client.post("".concat(adyenCheckoutOptions.paymentDetailsUrl),JSON.stringify({orderId:this.orderId,stateData:JSON.stringify(e.data)}),(function(e){if(200!==this._client._request.status){location.href=this.errorUrl.toString();return}this.responseHandler(e)}).bind(this))}onConfirmOrderSubmit(e){let t=r.querySelector(document,"#confirmOrderForm");if(!t.checkValidity())return;e.preventDefault(),y.create(document.body);let n=m.serialize(t);this.confirmOrder(n)}renderPaymentComponent(e){if("oneclick"===e){this.renderStoredPaymentMethodComponents();return}if("giftcard"===e)return;let t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(function(t){return t.type===e});if(0===t.length){"test"===this.adyenCheckout.options.environment&&console.error("Payment method configuration not found. ",e);return}let n=t[0];this.mountPaymentComponent(n,!1)}renderStoredPaymentMethodComponents(){this.adyenCheckout.paymentMethodsResponse.storedPaymentMethods.forEach(e=>{let t='[data-adyen-stored-payment-method-id="'.concat(e.id,'"]');this.mountPaymentComponent(e,!0,t)}),this.hideStorePaymentMethodComponents();let e=null;r.querySelectorAll(document,"[name=adyenStoredPaymentMethodId]").forEach(t=>{e||(e=t.value),t.addEventListener("change",this.showSelectedStoredPaymentMethod.bind(this))}),this.showSelectedStoredPaymentMethod(null,e)}showSelectedStoredPaymentMethod(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.hideStorePaymentMethodComponents(),t=e?e.target.value:t;let n='[data-adyen-stored-payment-method-id="'.concat(t,'"]');r.querySelector(document,n).style.display="block"}hideStorePaymentMethodComponents(){r.querySelectorAll(document,".stored-payment-component").forEach(e=>{e.style.display="none"})}confirmOrder(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=adyenCheckoutOptions.orderId;e.set("affiliateCode",adyenCheckoutOptions.affiliateCode),e.set("campaignCode",adyenCheckoutOptions.campaignCode),n?this.updatePayment(e,n,t):this.createOrder(e,t)}updatePayment(e,t,n){e.set("orderId",t),this._client.post(adyenCheckoutOptions.updatePaymentUrl,e,this.afterSetPayment.bind(this,n))}createOrder(e,t){this._client.post(adyenCheckoutOptions.checkoutOrderUrl,e,this.afterCreateOrder.bind(this,t))}afterCreateOrder(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;try{e=JSON.parse(n)}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",n);return}this.orderId=e.id,this.finishUrl=new URL(location.origin+adyenCheckoutOptions.paymentFinishUrl),this.finishUrl.searchParams.set("orderId",e.id),this.errorUrl=new URL(location.origin+adyenCheckoutOptions.paymentErrorUrl),this.errorUrl.searchParams.set("orderId",e.id);let a={orderId:this.orderId,finishUrl:this.finishUrl.toString(),errorUrl:this.errorUrl.toString()};for(let e in t)a[e]=t[e];this._client.post(adyenCheckoutOptions.paymentHandleUrl,JSON.stringify(a),this.afterPayOrder.bind(this,this.orderId))}afterSetPayment(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;try{JSON.parse(t).success&&this.afterCreateOrder(e,JSON.stringify({id:adyenCheckoutOptions.orderId}))}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",t);return}}afterPayOrder(e,t){try{t=JSON.parse(t),this.returnUrl=t.redirectUrl}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",t);return}this.returnUrl===this.errorUrl.toString()&&(location.href=this.returnUrl);try{this._client.post("".concat(adyenCheckoutOptions.paymentStatusUrl),JSON.stringify({orderId:e}),this.responseHandler.bind(this))}catch(e){console.log(e)}}handlePaymentAction(e){try{let t=JSON.parse(e);if((t.isFinal||"voucher"===t.action.type)&&(location.href=this.returnUrl),t.action){let e={};"threeDS2"===t.action.type&&(e.challengeWindowSize="05"),this.adyenCheckout.createFromAction(t.action,e).mount("[data-adyen-payment-action-container]"),["threeDS2","qrCode"].includes(t.action.type)&&(window.jQuery?$("[data-adyen-payment-action-modal]").modal({show:!0}):new bootstrap.Modal(document.getElementById("adyen-payment-action-modal"),{keyboard:!1}).show())}}catch(e){console.log(e)}}initializeCustomPayButton(){let e=p.componentsWithPayButton[this.selectedAdyenPaymentMethod];this.completePendingPayment(this.selectedAdyenPaymentMethod,e);let t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(e=>e.type===this.selectedAdyenPaymentMethod);if(t.length<1&&"googlepay"===this.selectedAdyenPaymentMethod&&(t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(e=>"paywithgoogle"===e.type)),t.length<1)return;let n=t[0];if(!adyenCheckoutOptions.amount){console.error("Failed to fetch Cart/Order total amount.");return}if(e.prePayRedirect){this.renderPrePaymentButton(e,n);return}let a=Object.assign(e.extra,n,{amount:{value:adyenCheckoutOptions.amount,currency:adyenCheckoutOptions.currency},data:{personalDetails:shopperDetails,billingAddress:activeBillingAddress,deliveryAddress:activeShippingAddress},onClick:(t,n)=>{if(!e.onClick(t,n,this))return!1;y.create(document.body)},onSubmit:(function(t,n){if(t.isValid){let a={stateData:JSON.stringify(t.data)},r=m.serialize(this.confirmOrderForm);"responseHandler"in e&&(this.responseHandler=e.responseHandler.bind(n,this)),this.confirmOrder(r,a)}else n.showValidation(),"test"===this.adyenCheckout.options.environment&&console.log("Payment failed: ",t)}).bind(this),onCancel:(t,n)=>{y.remove(document.body),e.onCancel(t,n,this)},onError:(t,n)=>{"PayPal"===n.props.name&&"CANCEL"===t.name&&this._client.post("".concat(adyenCheckoutOptions.cancelOrderTransactionUrl),JSON.stringify({orderId:this.orderId})),y.remove(document.body),e.onError(t,n,this),console.log(t)}}),r=this.adyenCheckout.create(n.type,a);try{"isAvailable"in r?r.isAvailable().then((function(){this.mountCustomPayButton(r)}).bind(this)).catch(e=>{console.log(n.type+" is not available",e)}):this.mountCustomPayButton(r)}catch(e){console.log(e)}}renderPrePaymentButton(e,t){"amazonpay"===t.type&&(e.extra=this.setAddressDetails(e.extra));let n=Object.assign(e.extra,t,{configuration:t.configuration,amount:{value:adyenCheckoutOptions.amount,currency:adyenCheckoutOptions.currency},onClick:(t,n)=>{if(!e.onClick(t,n,this))return!1;y.create(document.body)},onError:(t,n)=>{y.remove(document.body),e.onError(t,n,this),console.log(t)}}),a=this.adyenCheckout.create(t.type,n);this.mountCustomPayButton(a)}completePendingPayment(e,t){let n=new URL(location.href);if(n.searchParams.has(t.sessionKey)){y.create(document.body);let a=this.adyenCheckout.create(e,{[t.sessionKey]:n.searchParams.get(t.sessionKey),showOrderButton:!1,onSubmit:(function(e,t){if(e.isValid){let t={stateData:JSON.stringify(e.data)},n=m.serialize(this.confirmOrderForm);this.confirmOrder(n,t)}}).bind(this)});this.mountCustomPayButton(a),a.submit()}}getSelectedPaymentMethodKey(){return Object.keys(p.paymentMethodTypeHandlers).find(e=>p.paymentMethodTypeHandlers[e]===adyenCheckoutOptions.selectedPaymentMethodHandler)}mountCustomPayButton(e){let t=document.querySelector("#confirmOrderForm");if(t){let n=t.querySelector("button[type=submit]");if(n&&!n.disabled){let a=document.createElement("div");a.id="adyen-confirm-button",a.setAttribute("data-adyen-confirm-button",""),t.appendChild(a),e.mount(a),n.remove()}}}mountPaymentComponent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=Object.assign({},e,{data:{personalDetails:shopperDetails,billingAddress:activeBillingAddress,deliveryAddress:activeShippingAddress},onSubmit:(function(e,t){if(e.isValid){let t={stateData:JSON.stringify(e.data)},n=m.serialize(this.confirmOrderForm);y.create(document.body),this.confirmOrder(n,t)}else t.showValidation(),"test"===this.adyenCheckout.options.environment&&console.log("Payment failed: ",e)}).bind(this)});!t&&"scheme"===e.type&&adyenCheckoutOptions.displaySaveCreditCardOption&&(a.enableStoreDetails=!0);let i=t?n:"#"+this.el.id;try{let t=this.adyenCheckout.create(e.type,a);t.mount(i),this.confirmFormSubmit.addEventListener("click",(function(e){r.querySelector(document,"#confirmOrderForm").checkValidity()&&(e.preventDefault(),this.el.parentNode.scrollIntoView({behavior:"smooth",block:"start"}),t.submit())}).bind(this))}catch(t){return console.error(e.type,t),!1}}appendGiftcardSummary(){if(parseInt(adyenCheckoutOptions.giftcardDiscount,10)&&this.shoppingCartSummaryBlock.length){let e=parseFloat(this.giftcardDiscount).toFixed(2),t=parseFloat(this.remainingAmount).toFixed(2),n='
'+adyenCheckoutOptions.translationAdyenGiftcardDiscount+'
'+adyenCheckoutOptions.currencySymbol+e+'
'+adyenCheckoutOptions.translationAdyenGiftcardRemainingAmount+'
'+adyenCheckoutOptions.currencySymbol+t+"
";this.shoppingCartSummaryBlock[0].innerHTML+=n}}setAddressDetails(e){return""!==activeShippingAddress.phoneNumber?e.addressDetails={name:shopperDetails.firstName+" "+shopperDetails.lastName,addressLine1:activeShippingAddress.street,city:activeShippingAddress.city,postalCode:activeShippingAddress.postalCode,countryCode:activeShippingAddress.country,phoneNumber:activeShippingAddress.phoneNumber}:e.productType="PayOnly",e}},"#adyen-payment-checkout-mask"),f.register("AdyenGivingPlugin",class extends o{init(){this._client=new s,this.adyenCheckout=Promise,this.initializeCheckoutComponent().bind(this)}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,{currency:a,values:r,backgroundUrl:i,logoUrl:o,name:s,description:d,url:c}=adyenGivingConfiguration,l={amounts:{currency:a,values:r.split(",").map(e=>Number(e))},backgroundUrl:i,logoUrl:o,description:d,name:s,url:c,showCancelButton:!0,onDonate:this.handleOnDonate.bind(this),onCancel:this.handleOnCancel.bind(this)};this.adyenCheckout=await AdyenCheckout({locale:e,clientKey:t,environment:n}),this.adyenCheckout.create("donation",l).mount("#donation-container")}handleOnDonate(e,t){let n=adyenGivingConfiguration.orderId,a={stateData:JSON.stringify(e.data),orderId:n};a.returnUrl=window.location.href,this._client.post("".concat(adyenGivingConfiguration.donationEndpointUrl),JSON.stringify({...a}),(function(e){200!==this._client._request.status?t.setStatus("error"):t.setStatus("success")}).bind(this))}handleOnCancel(){let e=adyenGivingConfiguration.continueActionUrl;window.location=e}},"#adyen-giving-container"),f.register("AdyenSuccessAction",class extends o{init(){this.adyenCheckout=Promise,this.initializeCheckoutComponent().bind(this)}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,{action:a}=adyenSuccessActionConfiguration;this.adyenCheckout=await AdyenCheckout({locale:e,clientKey:t,environment:n}),this.adyenCheckout.createFromAction(JSON.parse(a)).mount("#success-action-container")}},"#adyen-success-action-container")})()})(); \ No newline at end of file +(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==n},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s(Array.isArray(e)?[]:{},e,t):e}function r(e,t,n){return e.concat(t).map(function(e){return a(e,n)})}function i(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function s(e,n,d){(d=d||{}).arrayMerge=d.arrayMerge||r,d.isMergeableObject=d.isMergeableObject||t,d.cloneUnlessOtherwiseSpecified=a;var c,l,h=Array.isArray(n);return h!==Array.isArray(e)?a(n,d):h?d.arrayMerge(e,n,d):(l={},(c=d).isMergeableObject(e)&&i(e).forEach(function(t){l[t]=a(e[t],c)}),i(n).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(n[t])?l[t]=(function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s})(t,c)(e[t],n[t],c):l[t]=a(n[t],c))}),l)}s.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},e.exports=s}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e=n(857),t=n.n(e);class a{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let n=a.toUpperCamelCase(e,t);return a.lcFirst(n)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>a.ucFirst(e.toLowerCase())).join(""):a.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class r{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!r.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!1===r.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(n)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=t.replace(/^data(|-)/,""),o=a.toLowerCamelCase(i,"-");if(!r.isNode(e)){if(n)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(n)throw Error("This node doesn't support the dataset attribute!");return}let s=e.dataset[o];if(void 0===s){if(n)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return s}return a.parsePrimitive(s)}static querySelector(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let a=e.querySelector(t)||!1;if(n&&!1===a)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return a}static querySelectorAll(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let a=e.querySelectorAll(t);if(0===a.length&&(a=!1),n&&!1===a)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return a}}class i{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=new CustomEvent(e,{detail:t,cancelable:n});return this.el.dispatchEvent(a),a}subscribe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this,r=e.split("."),i=n.scope?t.bind(n.scope):t;if(n.once&&!0===n.once){let t=i;i=function(n){a.unsubscribe(e),t(n)}}return this.el.addEventListener(r[0],i),this.listeners.push({splitEventName:r,opts:n,cb:i}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,n)=>([...n.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(n.splitEventName[0],n.cb):e.push(n),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class o{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let n=a.toDashCase(this._pluginName),i=r.getDataAttribute(this.el,"data-".concat(n,"-config"),!1),o=r.getAttribute(this.el,"data-".concat(n,"-options"),!1),s=[this.constructor.options,this.options,e];i&&s.push(window.PluginConfigManager.get(this._pluginName,i));try{o&&s.push(JSON.parse(o))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(n,'-options" could not be parsed to json: ').concat(e.message))}return t().all(s.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},n=!1){if(!r.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new i(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}class s{get(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",a=this._createPreparedRequest("GET",e,n);return this._sendRequest(a,null,t)}post(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("POST",e,a);return this._sendRequest(r,t,n)}delete(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("DELETE",e,a);return this._sendRequest(r,t,n)}patch(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";a=this._getContentType(t,a);let r=this._createPreparedRequest("PATCH",e,a);return this._sendRequest(r,t,n)}abort(){if(this._request)return this._request.abort()}_registerOnLoaded(e,t){t&&e.addEventListener("loadend",()=>{t(e.responseText,e)})}_sendRequest(e,t,n){return this._registerOnLoaded(e,n),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,n){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),n&&this._request.setRequestHeader("Content-type",n),this._request}constructor(){this._request=null}}class d{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var n of e.entries())t(n[1],n[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(n=>{t(e[n],n)});throw Error("The element type ".concat(typeof e," is not iterable!"))}}let c="loader",l={BEFORE:"before",INNER:"inner"};class h{create(){if(!this.exists()){if(this.position===l.INNER){this.parent.innerHTML=h.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),h.getTemplate())}}remove(){let e=this.parent.querySelectorAll(".".concat(c));d.iterate(e,e=>e.remove())}exists(){return this.parent.querySelectorAll(".".concat(c)).length>0}_getPosition(){return this.position===l.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'
\n Loading...\n
')}static SELECTOR_CLASS(){return c}constructor(e,t=l.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}}let u="element-loader-backdrop";class y extends h{static create(e){e.classList.add("has-element-loader"),y.exists(e)||(y.appendLoader(e),setTimeout(()=>{let t=e.querySelector(".".concat(u));t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(".".concat(u));t&&t.remove()}static exists(e){return e.querySelectorAll(".".concat(u)).length>0}static getTemplate(){return'\n
\n
\n Loading...\n
\n
\n ')}static appendLoader(e){e.insertAdjacentHTML("beforeend",y.getTemplate())}}class m{static serialize(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==e.nodeName){if(t)throw Error("The passed element is not a form!");return{}}return new FormData(e)}static serializeJson(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=m.serialize(e,t);if(n==={})return n;let a={};return d.iterate(n,(e,t)=>a[t]=e),a}}let p={updatablePaymentMethods:["scheme","ideal","sepadirectdebit","oneclick","dotpay","bcmc","bcmc_mobile","blik","klarna_b2b","eps","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","afterpay_default","ratepay","ratepay_directdebit","giftcard","paybright","affirm","multibanco","mbway","vipps","mobilepay","wechatpayQR","wechatpayWeb","paybybank"],componentsWithPayButton:{applepay:{extra:{},onClick:(e,t,n)=>n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},googlepay:{extra:{buttonSizeMode:"fill"},onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},onError:function(e,t,n){"CANCELED"!==e.statusCode&&("statusMessage"in e?console.log(e.statusMessage):console.log(e.statusCode))}},paypal:{extra:{},onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()},onError:function(e,t,n){t.setStatus("ready"),window.location.href=n.errorUrl.toString()},onCancel:function(e,t,n){t.setStatus("ready"),window.location.href=n.errorUrl.toString()},responseHandler:function(e,t){try{(t=JSON.parse(t)).isFinal&&(location.href=e.returnUrl),this.handleAction(t.action)}catch(e){console.error(e)}}},amazonpay:{extra:{productType:"PayAndShip",checkoutMode:"ProcessOrder",returnUrl:location.href},prePayRedirect:!0,sessionKey:"amazonCheckoutSessionId",onClick:function(e,t,n){return n.confirmOrderForm.checkValidity()?(e(),!0):(t(),!1)},onError:(e,t)=>{console.log(e),t.setStatus("ready")}}},paymentMethodTypeHandlers:{scheme:"handler_adyen_cardspaymentmethodhandler",ideal:"handler_adyen_idealpaymentmethodhandler",klarna:"handler_adyen_klarnapaylaterpaymentmethodhandler",klarna_account:"handler_adyen_klarnaaccountpaymentmethodhandler",klarna_paynow:"handler_adyen_klarnapaynowpaymentmethodhandler",ratepay:"handler_adyen_ratepaypaymentmethodhandler",ratepay_directdebit:"handler_adyen_ratepaydirectdebitpaymentmethodhandler",sepadirectdebit:"handler_adyen_sepapaymentmethodhandler",sofort:"handler_adyen_sofortpaymentmethodhandler",paypal:"handler_adyen_paypalpaymentmethodhandler",oneclick:"handler_adyen_oneclickpaymentmethodhandler",giropay:"handler_adyen_giropaypaymentmethodhandler",applepay:"handler_adyen_applepaypaymentmethodhandler",googlepay:"handler_adyen_googlepaypaymentmethodhandler",dotpay:"handler_adyen_dotpaypaymentmethodhandler",bcmc:"handler_adyen_bancontactcardpaymentmethodhandler",bcmc_mobile:"handler_adyen_bancontactmobilepaymentmethodhandler",amazonpay:"handler_adyen_amazonpaypaymentmethodhandler",twint:"handler_adyen_twintpaymentmethodhandler",eps:"handler_adyen_epspaymentmethodhandler",swish:"handler_adyen_swishpaymentmethodhandler",alipay:"handler_adyen_alipaypaymentmethodhandler",alipay_hk:"handler_adyen_alipayhkpaymentmethodhandler",blik:"handler_adyen_blikpaymentmethodhandler",clearpay:"handler_adyen_clearpaypaymentmethodhandler",facilypay_3x:"handler_adyen_facilypay3xpaymentmethodhandler",facilypay_4x:"handler_adyen_facilypay4xpaymentmethodhandler",facilypay_6x:"handler_adyen_facilypay6xpaymentmethodhandler",facilypay_10x:"handler_adyen_facilypay10xpaymentmethodhandler",facilypay_12x:"handler_adyen_facilypay12xpaymentmethodhandler",afterpay_default:"handler_adyen_afterpaydefaultpaymentmethodhandler",trustly:"handler_adyen_trustlypaymentmethodhandler",paysafecard:"handler_adyen_paysafecardpaymentmethodhandler",giftcard:"handler_adyen_giftcardpaymentmethodhandler",mbway:"handler_adyen_mbwaypaymentmethodhandler",multibanco:"handler_adyen_multibancopaymentmethodhandler",wechatpayQR:"handler_adyen_wechatpayqrpaymentmethodhandler",wechatpayWeb:"handler_adyen_wechatpaywebpaymentmethodhandler",mobilepay:"handler_adyen_mobilepaypaymentmethodhandler",vipps:"handler_adyen_vippspaymentmethodhandler",affirm:"handler_adyen_affirmpaymentmethodhandler",paybright:"handler_adyen_paybrightpaymentmethodhandler",paybybank:"handler_adyen_openbankingpaymentmethodhandler",klarna_b2b:"handler_adyen_billiepaymentmethodhandler"}},f=window.PluginManager;f.register("CartPlugin",class extends o{init(){let e=this;this._client=new s,this.adyenCheckout=Promise,this.paymentMethodInstance=null,this.selectedGiftcard=null,this.initializeCheckoutComponent().then((function(){this.observeGiftcardSelection()}).bind(this)),this.adyenGiftcardDropDown=r.querySelectorAll(document,"#giftcardDropdown"),this.adyenGiftcard=r.querySelectorAll(document,".adyen-giftcard"),this.giftcardHeader=r.querySelector(document,".adyen-giftcard-header"),this.giftcardItem=r.querySelector(document,".adyen-giftcard-item"),this.giftcardComponentClose=r.querySelector(document,".adyen-close-giftcard-component"),this.minorUnitsQuotient=adyenGiftcardsConfiguration.totalInMinorUnits/adyenGiftcardsConfiguration.totalPrice,this.giftcardDiscount=adyenGiftcardsConfiguration.giftcardDiscount,this.remainingAmount=(adyenGiftcardsConfiguration.totalPrice-this.giftcardDiscount).toFixed(2),this.remainingGiftcardBalance=(adyenGiftcardsConfiguration.giftcardBalance/this.minorUnitsQuotient).toFixed(2),this.shoppingCartSummaryBlock=r.querySelectorAll(document,".checkout-aside-summary-list"),this.offCanvasSummaryDetails=null,this.shoppingCartSummaryDetails=null,this.giftcardComponentClose.onclick=function(t){t.currentTarget.style.display="none",e.selectedGiftcard=null,e.giftcardItem.innerHTML="",e.giftcardHeader.innerHTML=" ",e.paymentMethodInstance&&e.paymentMethodInstance.unmount()},document.getElementById("showGiftcardButton").addEventListener("click",function(){this.style.display="none",document.getElementById("giftcardDropdown").style.display="block"}),"interactive"==document.readyState?(this.fetchGiftcardsOnPageLoad(),this.setGiftcardsRemovalEvent()):(window.addEventListener("DOMContentLoaded",this.fetchGiftcardsOnPageLoad()),window.addEventListener("DOMContentLoaded",this.setGiftcardsRemovalEvent()))}fetchGiftcardsOnPageLoad(){parseInt(adyenGiftcardsConfiguration.giftcardDiscount,10)&&this.fetchRedeemedGiftcards()}setGiftcardsRemovalEvent(){document.getElementById("giftcardsContainer").addEventListener("click",e=>{if(e.target.classList.contains("adyen-remove-giftcard")){let t=e.target.getAttribute("dataid");this.removeGiftcard(t)}})}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,a={locale:e,clientKey:t,environment:n,amount:{currency:adyenGiftcardsConfiguration.currency,value:adyenGiftcardsConfiguration.totalInMinorUnits}};this.adyenCheckout=await AdyenCheckout(a)}observeGiftcardSelection(){let e=this,t=document.getElementById("giftcardDropdown"),n=document.querySelector(".btn-outline-info");t.addEventListener("change",function(){t.value&&(e.selectedGiftcard=JSON.parse(event.currentTarget.options[event.currentTarget.selectedIndex].dataset.giftcard),e.mountGiftcardComponent(e.selectedGiftcard),t.value="",n.style.display="none")})}mountGiftcardComponent(e){this.paymentMethodInstance&&this.paymentMethodInstance.unmount(),this.giftcardItem.innerHTML="",y.create(r.querySelector(document,"#adyen-giftcard-component"));var t=document.createElement("img");t.src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/"+e.brand+".svg",t.classList.add("adyen-giftcard-logo"),this.giftcardItem.insertBefore(t,this.giftcardItem.firstChild),this.giftcardHeader.innerHTML=e.name,this.giftcardComponentClose.style.display="block";let n=Object.assign({},e,{showPayButton:!0,onBalanceCheck:this.handleBalanceCheck.bind(this,e)});try{this.paymentMethodInstance=this.adyenCheckout.create("giftcard",n),this.paymentMethodInstance.mount("#adyen-giftcard-component")}catch(e){console.log("giftcard not available")}y.remove(r.querySelector(document,"#adyen-giftcard-component"))}handleBalanceCheck(e,t,n,a){let r={};r.paymentMethod=JSON.stringify(a.paymentMethod),r.amount=JSON.stringify({currency:adyenGiftcardsConfiguration.currency,value:adyenGiftcardsConfiguration.totalInMinorUnits}),this._client.post("".concat(adyenGiftcardsConfiguration.checkBalanceUrl),JSON.stringify(r),(function(t){if((t=JSON.parse(t)).hasOwnProperty("pspReference")){let n=t.transactionLimit?parseFloat(t.transactionLimit.value):parseFloat(t.balance.value);a.giftcard={currency:adyenGiftcardsConfiguration.currency,value:(n/this.minorUnitsQuotient).toFixed(2),title:e.name},this.saveGiftcardStateData(a)}else n(t.resultCode)}).bind(this))}fetchRedeemedGiftcards(){this._client.get(adyenGiftcardsConfiguration.fetchRedeemedGiftcardsUrl,(function(e){e=JSON.parse(e);let t=document.getElementById("giftcardsContainer"),n=document.querySelector(".btn-outline-info");t.innerHTML="",e.redeemedGiftcards.giftcards.forEach(function(e){let n=parseFloat(e.deductedAmount);n=n.toFixed(2);let a=adyenGiftcardsConfiguration.translationAdyenGiftcardDeductedBalance+": "+adyenGiftcardsConfiguration.currencySymbol+n,r=document.createElement("div");var i=document.createElement("img");i.src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/"+e.brand+".svg",i.classList.add("adyen-giftcard-logo");let o=document.createElement("a");o.href="#",o.textContent=adyenGiftcardsConfiguration.translationAdyenGiftcardRemove,o.setAttribute("dataid",e.stateDataId),o.classList.add("adyen-remove-giftcard"),o.style.display="block",r.appendChild(i),r.innerHTML+="".concat(e.title,""),r.appendChild(o),r.innerHTML+='

'.concat(a,"


"),t.appendChild(r)}),this.remainingAmount=e.redeemedGiftcards.remainingAmount,this.giftcardDiscount=e.redeemedGiftcards.totalDiscount,this.paymentMethodInstance&&this.paymentMethodInstance.unmount(),this.giftcardComponentClose.style.display="none",this.giftcardItem.innerHTML="",this.giftcardHeader.innerHTML=" ",this.appendGiftcardSummary(),this.remainingAmount>0?n.style.display="block":(this.adyenGiftcardDropDown.length>0&&(this.adyenGiftcardDropDown[0].style.display="none"),n.style.display="none"),document.getElementById("giftcardsContainer")}).bind(this))}saveGiftcardStateData(e){e=JSON.stringify(e),this._client.post(adyenGiftcardsConfiguration.setGiftcardUrl,JSON.stringify({stateData:e}),(function(e){"token"in(e=JSON.parse(e))&&(this.fetchRedeemedGiftcards(),y.remove(document.body))}).bind(this))}removeGiftcard(e){y.create(document.body),this._client.post(adyenGiftcardsConfiguration.removeGiftcardUrl,JSON.stringify({stateDataId:e}),e=>{"token"in(e=JSON.parse(e))&&(this.fetchRedeemedGiftcards(),y.remove(document.body))})}appendGiftcardSummary(){if(this.shoppingCartSummaryBlock.length){let e=this.shoppingCartSummaryBlock[0].querySelectorAll(".adyen-giftcard-summary");for(let t=0;t
'+adyenGiftcardsConfiguration.currencySymbol+e+'
'+adyenGiftcardsConfiguration.translationAdyenGiftcardRemainingAmount+'
'+adyenGiftcardsConfiguration.currencySymbol+t+"
";this.shoppingCartSummaryBlock[0].innerHTML+=n}}},"#adyen-giftcards-container"),f.register("ConfirmOrderPlugin",class extends o{init(){this._client=new s,this.selectedAdyenPaymentMethod=this.getSelectedPaymentMethodKey(),this.confirmOrderForm=r.querySelector(document,"#confirmOrderForm"),this.confirmFormSubmit=r.querySelector(document,'#confirmOrderForm button[type="submit"]'),this.shoppingCartSummaryBlock=r.querySelectorAll(document,".checkout-aside-summary-list"),this.minorUnitsQuotient=adyenCheckoutOptions.amount/adyenCheckoutOptions.totalPrice,this.giftcardDiscount=adyenCheckoutOptions.giftcardDiscount,this.remainingAmount=adyenCheckoutOptions.totalPrice-this.giftcardDiscount,this.responseHandler=this.handlePaymentAction,this.adyenCheckout=Promise,this.initializeCheckoutComponent().then((function(){if(adyenCheckoutOptions.selectedPaymentMethodPluginId===adyenCheckoutOptions.adyenPluginId){if(!adyenCheckoutOptions||!adyenCheckoutOptions.paymentStatusUrl||!adyenCheckoutOptions.checkoutOrderUrl||!adyenCheckoutOptions.paymentHandleUrl){console.error("Adyen payment configuration missing.");return}this.selectedAdyenPaymentMethod in p.componentsWithPayButton&&this.initializeCustomPayButton(),p.updatablePaymentMethods.includes(this.selectedAdyenPaymentMethod)&&!this.stateData?this.renderPaymentComponent(this.selectedAdyenPaymentMethod):this.confirmFormSubmit.addEventListener("click",this.onConfirmOrderSubmit.bind(this))}}).bind(this)),adyenCheckoutOptions.payInFullWithGiftcard>0?parseInt(adyenCheckoutOptions.giftcardDiscount,10)&&this.appendGiftcardSummary():this.appendGiftcardSummary()}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n,merchantAccount:a}=adyenCheckoutConfiguration,r=adyenCheckoutOptions.paymentMethodsResponse,i={locale:e,clientKey:t,environment:n,showPayButton:this.selectedAdyenPaymentMethod in p.componentsWithPayButton,hasHolderName:!0,paymentMethodsResponse:JSON.parse(r),onAdditionalDetails:this.handleOnAdditionalDetails.bind(this),countryCode:activeShippingAddress.country,paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,clickToPayConfiguration:{merchantDisplayName:a,shopperEmail:shopperDetails.shopperEmail}}}};this.adyenCheckout=await AdyenCheckout(i)}handleOnAdditionalDetails(e){this._client.post("".concat(adyenCheckoutOptions.paymentDetailsUrl),JSON.stringify({orderId:this.orderId,stateData:JSON.stringify(e.data)}),(function(e){if(200!==this._client._request.status){location.href=this.errorUrl.toString();return}this.responseHandler(e)}).bind(this))}onConfirmOrderSubmit(e){let t=r.querySelector(document,"#confirmOrderForm");if(!t.checkValidity())return;e.preventDefault(),y.create(document.body);let n=m.serialize(t);this.confirmOrder(n)}renderPaymentComponent(e){if("oneclick"===e){this.renderStoredPaymentMethodComponents();return}if("giftcard"===e)return;let t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(function(t){return t.type===e});if(0===t.length){"test"===this.adyenCheckout.options.environment&&console.error("Payment method configuration not found. ",e);return}let n=t[0];this.mountPaymentComponent(n,!1)}renderStoredPaymentMethodComponents(){this.adyenCheckout.paymentMethodsResponse.storedPaymentMethods.forEach(e=>{let t='[data-adyen-stored-payment-method-id="'.concat(e.id,'"]');this.mountPaymentComponent(e,!0,t)}),this.hideStorePaymentMethodComponents();let e=null;r.querySelectorAll(document,"[name=adyenStoredPaymentMethodId]").forEach(t=>{e||(e=t.value),t.addEventListener("change",this.showSelectedStoredPaymentMethod.bind(this))}),this.showSelectedStoredPaymentMethod(null,e)}showSelectedStoredPaymentMethod(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.hideStorePaymentMethodComponents(),t=e?e.target.value:t;let n='[data-adyen-stored-payment-method-id="'.concat(t,'"]');r.querySelector(document,n).style.display="block"}hideStorePaymentMethodComponents(){r.querySelectorAll(document,".stored-payment-component").forEach(e=>{e.style.display="none"})}confirmOrder(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=adyenCheckoutOptions.orderId;e.set("affiliateCode",adyenCheckoutOptions.affiliateCode),e.set("campaignCode",adyenCheckoutOptions.campaignCode),n?this.updatePayment(e,n,t):this.createOrder(e,t)}updatePayment(e,t,n){e.set("orderId",t),this._client.post(adyenCheckoutOptions.updatePaymentUrl,e,this.afterSetPayment.bind(this,n))}createOrder(e,t){this._client.post(adyenCheckoutOptions.checkoutOrderUrl,e,this.afterCreateOrder.bind(this,t))}afterCreateOrder(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;try{e=JSON.parse(n)}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",n);return}this.orderId=e.id,this.finishUrl=new URL(location.origin+adyenCheckoutOptions.paymentFinishUrl),this.finishUrl.searchParams.set("orderId",e.id),this.errorUrl=new URL(location.origin+adyenCheckoutOptions.paymentErrorUrl),this.errorUrl.searchParams.set("orderId",e.id);let a={orderId:this.orderId,finishUrl:this.finishUrl.toString(),errorUrl:this.errorUrl.toString()};for(let e in t)a[e]=t[e];this._client.post(adyenCheckoutOptions.paymentHandleUrl,JSON.stringify(a),this.afterPayOrder.bind(this,this.orderId))}afterSetPayment(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;try{JSON.parse(t).success&&this.afterCreateOrder(e,JSON.stringify({id:adyenCheckoutOptions.orderId}))}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",t);return}}afterPayOrder(e,t){try{t=JSON.parse(t),this.returnUrl=t.redirectUrl}catch(e){y.remove(document.body),console.log("Error: invalid response from Shopware API",t);return}this.returnUrl===this.errorUrl.toString()&&(location.href=this.returnUrl);try{this._client.post("".concat(adyenCheckoutOptions.paymentStatusUrl),JSON.stringify({orderId:e}),this.responseHandler.bind(this))}catch(e){console.log(e)}}handlePaymentAction(e){try{let t=JSON.parse(e);if((t.isFinal||"voucher"===t.action.type)&&(location.href=this.returnUrl),t.action){let e={};"threeDS2"===t.action.type&&(e.challengeWindowSize="05"),this.adyenCheckout.createFromAction(t.action,e).mount("[data-adyen-payment-action-container]"),["threeDS2","qrCode"].includes(t.action.type)&&(window.jQuery?$("[data-adyen-payment-action-modal]").modal({show:!0}):new bootstrap.Modal(document.getElementById("adyen-payment-action-modal"),{keyboard:!1}).show())}}catch(e){console.log(e)}}initializeCustomPayButton(){let e=p.componentsWithPayButton[this.selectedAdyenPaymentMethod];this.completePendingPayment(this.selectedAdyenPaymentMethod,e);let t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(e=>e.type===this.selectedAdyenPaymentMethod);if(t.length<1&&"googlepay"===this.selectedAdyenPaymentMethod&&(t=this.adyenCheckout.paymentMethodsResponse.paymentMethods.filter(e=>"paywithgoogle"===e.type)),t.length<1)return;let n=t[0];if(!adyenCheckoutOptions.amount){console.error("Failed to fetch Cart/Order total amount.");return}if(e.prePayRedirect){this.renderPrePaymentButton(e,n);return}let a=Object.assign(e.extra,n,{amount:{value:adyenCheckoutOptions.amount,currency:adyenCheckoutOptions.currency},data:{personalDetails:shopperDetails,billingAddress:activeBillingAddress,deliveryAddress:activeShippingAddress},onClick:(t,n)=>{if(!e.onClick(t,n,this))return!1;y.create(document.body)},onSubmit:(function(t,n){if(t.isValid){let a={stateData:JSON.stringify(t.data)},r=m.serialize(this.confirmOrderForm);"responseHandler"in e&&(this.responseHandler=e.responseHandler.bind(n,this)),this.confirmOrder(r,a)}else n.showValidation(),"test"===this.adyenCheckout.options.environment&&console.log("Payment failed: ",t)}).bind(this),onCancel:(t,n)=>{y.remove(document.body),e.onCancel(t,n,this)},onError:(t,n)=>{"PayPal"===n.props.name&&"CANCEL"===t.name&&this._client.post("".concat(adyenCheckoutOptions.cancelOrderTransactionUrl),JSON.stringify({orderId:this.orderId})),y.remove(document.body),e.onError(t,n,this),console.log(t)}}),r=this.adyenCheckout.create(n.type,a);try{"isAvailable"in r?r.isAvailable().then((function(){this.mountCustomPayButton(r)}).bind(this)).catch(e=>{console.log(n.type+" is not available",e)}):this.mountCustomPayButton(r)}catch(e){console.log(e)}}renderPrePaymentButton(e,t){"amazonpay"===t.type&&(e.extra=this.setAddressDetails(e.extra));let n=Object.assign(e.extra,t,{configuration:t.configuration,amount:{value:adyenCheckoutOptions.amount,currency:adyenCheckoutOptions.currency},onClick:(t,n)=>{if(!e.onClick(t,n,this))return!1;y.create(document.body)},onError:(t,n)=>{y.remove(document.body),e.onError(t,n,this),console.log(t)}}),a=this.adyenCheckout.create(t.type,n);this.mountCustomPayButton(a)}completePendingPayment(e,t){let n=new URL(location.href);if(n.searchParams.has(t.sessionKey)){y.create(document.body);let a=this.adyenCheckout.create(e,{[t.sessionKey]:n.searchParams.get(t.sessionKey),showOrderButton:!1,onSubmit:(function(e,t){if(e.isValid){let t={stateData:JSON.stringify(e.data)},n=m.serialize(this.confirmOrderForm);this.confirmOrder(n,t)}}).bind(this)});this.mountCustomPayButton(a),a.submit()}}getSelectedPaymentMethodKey(){return Object.keys(p.paymentMethodTypeHandlers).find(e=>p.paymentMethodTypeHandlers[e]===adyenCheckoutOptions.selectedPaymentMethodHandler)}mountCustomPayButton(e){let t=document.querySelector("#confirmOrderForm");if(t){let n=t.querySelector("button[type=submit]");if(n&&!n.disabled){let a=document.createElement("div");a.id="adyen-confirm-button",a.setAttribute("data-adyen-confirm-button",""),t.appendChild(a),e.mount(a),n.remove()}}}mountPaymentComponent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=Object.assign({},e,{data:{personalDetails:shopperDetails,billingAddress:activeBillingAddress,deliveryAddress:activeShippingAddress},onSubmit:(function(n,a){if(n.isValid){if(t){var r;n.data.paymentMethod.holderName=(r=e.holderName)!==null&&void 0!==r?r:""}let a={stateData:JSON.stringify(n.data)},i=m.serialize(this.confirmOrderForm);y.create(document.body),this.confirmOrder(i,a)}else a.showValidation(),"test"===this.adyenCheckout.options.environment&&console.log("Payment failed: ",n)}).bind(this)});!t&&"scheme"===e.type&&adyenCheckoutOptions.displaySaveCreditCardOption&&(a.enableStoreDetails=!0);let i=t?n:"#"+this.el.id;try{let t=this.adyenCheckout.create(e.type,a);t.mount(i),this.confirmFormSubmit.addEventListener("click",(function(e){r.querySelector(document,"#confirmOrderForm").checkValidity()&&(e.preventDefault(),this.el.parentNode.scrollIntoView({behavior:"smooth",block:"start"}),t.submit())}).bind(this))}catch(t){return console.error(e.type,t),!1}}appendGiftcardSummary(){if(parseInt(adyenCheckoutOptions.giftcardDiscount,10)&&this.shoppingCartSummaryBlock.length){let e=parseFloat(this.giftcardDiscount).toFixed(2),t=parseFloat(this.remainingAmount).toFixed(2),n='
'+adyenCheckoutOptions.translationAdyenGiftcardDiscount+'
'+adyenCheckoutOptions.currencySymbol+e+'
'+adyenCheckoutOptions.translationAdyenGiftcardRemainingAmount+'
'+adyenCheckoutOptions.currencySymbol+t+"
";this.shoppingCartSummaryBlock[0].innerHTML+=n}}setAddressDetails(e){return""!==activeShippingAddress.phoneNumber?e.addressDetails={name:shopperDetails.firstName+" "+shopperDetails.lastName,addressLine1:activeShippingAddress.street,city:activeShippingAddress.city,postalCode:activeShippingAddress.postalCode,countryCode:activeShippingAddress.country,phoneNumber:activeShippingAddress.phoneNumber}:e.productType="PayOnly",e}},"#adyen-payment-checkout-mask"),f.register("AdyenGivingPlugin",class extends o{init(){this._client=new s,this.adyenCheckout=Promise,this.initializeCheckoutComponent().bind(this)}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,{currency:a,values:r,backgroundUrl:i,logoUrl:o,name:s,description:d,url:c}=adyenGivingConfiguration,l={amounts:{currency:a,values:r.split(",").map(e=>Number(e))},backgroundUrl:i,logoUrl:o,description:d,name:s,url:c,showCancelButton:!0,onDonate:this.handleOnDonate.bind(this),onCancel:this.handleOnCancel.bind(this)};this.adyenCheckout=await AdyenCheckout({locale:e,clientKey:t,environment:n}),this.adyenCheckout.create("donation",l).mount("#donation-container")}handleOnDonate(e,t){let n=adyenGivingConfiguration.orderId,a={stateData:JSON.stringify(e.data),orderId:n};a.returnUrl=window.location.href,this._client.post("".concat(adyenGivingConfiguration.donationEndpointUrl),JSON.stringify({...a}),(function(e){200!==this._client._request.status?t.setStatus("error"):t.setStatus("success")}).bind(this))}handleOnCancel(){let e=adyenGivingConfiguration.continueActionUrl;window.location=e}},"#adyen-giving-container"),f.register("AdyenSuccessAction",class extends o{init(){this.adyenCheckout=Promise,this.initializeCheckoutComponent().bind(this)}async initializeCheckoutComponent(){let{locale:e,clientKey:t,environment:n}=adyenCheckoutConfiguration,{action:a}=adyenSuccessActionConfiguration;this.adyenCheckout=await AdyenCheckout({locale:e,clientKey:t,environment:n}),this.adyenCheckout.createFromAction(JSON.parse(a)).mount("#success-action-container")}},"#adyen-success-action-container")})()})(); \ No newline at end of file diff --git a/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js b/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js index 2d713f93..023f06b0 100644 --- a/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js +++ b/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js @@ -93,6 +93,7 @@ export default class ConfirmOrderPlugin extends Plugin { paymentMethodsConfiguration: { card: { hasHolderName: true, + holderNameRequired: true, clickToPayConfiguration: { merchantDisplayName: merchantAccount, shopperEmail: shopperDetails.shopperEmail @@ -521,6 +522,10 @@ export default class ConfirmOrderPlugin extends Plugin { }, onSubmit: function(state, component) { if (state.isValid) { + if (isOneClick) { + state.data.paymentMethod.holderName = paymentMethod.holderName ?? ''; + } + let extraParams = { stateData: JSON.stringify(state.data) }; diff --git a/src/Resources/public/administration/css/adyen-payment-shopware6.css b/src/Resources/public/administration/css/adyen-payment-shopware6.css index 90b0ba2e..42edc958 100644 --- a/src/Resources/public/administration/css/adyen-payment-shopware6.css +++ b/src/Resources/public/administration/css/adyen-payment-shopware6.css @@ -1,2 +1,4 @@ .adyen-capture-card-header{display:flex;height:30px;margin-bottom:15px}.adyen-capture-card-header-first{margin-top:auto;width:100%} .adyen-refund-card-header{display:flex;height:30px;margin-bottom:15px}.adyen-refund-card-header-first{margin-top:auto;width:100%} + +/*# sourceMappingURL=adyen-payment-shopware6.css.map*/ \ No newline at end of file diff --git a/src/Resources/public/administration/js/adyen-payment-shopware6.js b/src/Resources/public/administration/js/adyen-payment-shopware6.js index 985373b0..ad6fb0e9 100644 --- a/src/Resources/public/administration/js/adyen-payment-shopware6.js +++ b/src/Resources/public/administration/js/adyen-payment-shopware6.js @@ -1 +1,2 @@ -(function(){var e={405:function(){},951:function(){},465:function(){let{Component:e}=Shopware,{Criteria:t}=Shopware.Data;e.extend("sw-entity-single-select-override","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){let e=new t(1,this.resultLimit);return e.addFilter(t.equals("stateMachine.technicalName","order_delivery.state")),e}}}})},918:function(){let e=Shopware.Classes.ApiService,{Application:t}=Shopware;class n extends e{constructor(e,t,n="adyen"){super(e,t,n),this.headers=this.getBasicHeaders({})}check(t){let n=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/verify`,t,{headers:n}).then(t=>e.handleResponse(t))}capture(t){return this.httpClient.post(this.getApiBasePath()+"/capture",{orderId:t},{headers:this.headers}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during capture request: "+e.message),e})}getCaptureRequests(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/captures",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during capture request: "+e.message),e})}isCaptureAllowed(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/is-capture-allowed",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during is-capture-allowed request: "+e.message),e})}isManualCaptureEnabled(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/is-manual-capture-enabled",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during is-capture-allowed request: "+e.message),e})}getRefunds(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/refunds",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during refunds request: "+e.message),e})}postRefund(t,n){let a=this.getBasicHeaders({});return this.httpClient.post(this.getApiBasePath()+"/refunds",{orderId:t,refundAmount:n},{headers:a}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during post refund request: "+e.message),e})}fetchNotifications(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/notifications",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}rescheduleNotification(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/reschedule-notification/"+t,{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}isAdyenOrder(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t.id+"/is-adyen-order",{headers:n}).then(t=>e.handleResponse(t)).then(e=>e.status).catch(e=>(console.error("An error occurred: "+e.message),!1))}fetchAdyenPartialPayments(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/partial-payments",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}}t.addServiceProvider("adyenService",e=>new n(t.getContainer("init").httpClient,e.loginService))},597:function(e,t,n){var a=n(405);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("252611c6",a,!0,{})},842:function(e,t,n){var a=n(951);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("3c1af017",a,!0,{})},346:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},s=0;sn.parts.length&&(a.parts.length=n.parts.length)}else{for(var i=[],s=0;s\n Test Configuration\n\n',inject:["adyenService"],mixins:[t.getByName("notification")],data(){return{isLoading:!1,isSaveSuccessful:!1}},computed:{pluginConfig(){let e=this.$parent;for(;void 0===e.actualConfigData;)e=e.$parent;let t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t])}},methods:{saveFinish(){this.isSaveSuccessful=!1},check(){this.isLoading=!0,this.adyenService.check(this.pluginConfig).then(e=>{e.success?(this.isSaveSuccessful=!0,this.createNotificationSuccess({title:this.$tc("adyen.configTestTitle"),message:this.$tc("adyen.configTestSuccess")})):this.createNotificationError({title:this.$tc("adyen.configTestTitle"),message:this.$tc(e.message?e.message:"adyen.configTestFail")}),this.isLoading=!1})}}}),n(597);let{Component:a,Mixin:s}=Shopware;a.register("adyen-payment-capture",{template:'{% block adyen_capture %}\n \n
\n
\n
\n {{ $tc(\'adyen.noCaptureRequests\') }}\n
\n
\n \n {{ $tc(\'adyen.sendCaptureRequest\') }}\n \n
\n \n \n \n
\n \n \n
\n
\n {{ $tc(\'adyen.error\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService","systemConfigApiService"],mixins:[s.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],showModal:!1,captureRequests:[],allowCapture:!1,captureEnabled:!1,errorOccurred:!1,isLoading:!0,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onSubmitCapture(){this.isLoading=!0,this.adyenService.capture(this.order.id).then(e=>{e.success?(this.fetchCaptureRequests(),this.createNotificationSuccess({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.captureSuccessful")})):this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoading=!1,this.showModal=!1})},fetchCaptureRequests(){this.isLoading=!0,this.adyenService.getCaptureRequests(this.order.id).then(e=>{this.captureRequests=e,this.isCaptureAllowed()}).catch(()=>{this.errorOccurred=!0,this.captureRequests=[]}).finally(()=>{this.isLoading=!1})},isManualCaptureEnabled(){this.isLoading=!0,this.adyenService.isManualCaptureEnabled(this.order.id).then(e=>{this.captureEnabled=e,this.showWidget=this.adyenService.isAdyenOrder(this.order)&&this.captureEnabled}).catch(()=>{this.errorOccurred=!0,this.captureEnabled=!1}).finally(()=>{this.isLoading=!1})},isCaptureAllowed(){this.isLoading=!0,this.adyenService.isCaptureAllowed(this.order.id).then(e=>{this.allowCapture=e}).catch(()=>{this.errorOccurred=!0,this.allowCapture=!1}).finally(()=>{this.isLoading=!1})}},beforeMount(){this.isManualCaptureEnabled(),this.fetchCaptureRequests()}}),n(842);let{Component:r,Mixin:i}=Shopware;r.register("adyen-refund",{template:'{% block adyen_refund %}\n \n
\n
\n
\n {{ $tc(\'adyen.noRefundsCreated\') }}\n
\n
\n \n {{ $tc(\'sw-order.documentCard.labelCreateNew\') }}\n \n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n {{ $tc(\'adyen.refundFetchError\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService"],mixins:[i.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],refundAmount:0,showModal:!1,refunds:[],allowRefund:!0,isLoadingTable:!0,errorOccurred:!1,isLoadingRefund:!1,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onRefund(){this.isLoadingRefund=!0,this.adyenService.postRefund(this.order.id,this.refundAmount).then(e=>{e.success?(this.fetchRefunds(),this.createNotificationSuccess({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.refundSuccessful")})):this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoadingRefund=!1,this.showModal=!1})},fetchRefunds(){this.isLoadingTable=!0,this.adyenService.getRefunds(this.order.id).then(e=>{this.refunds=e,this.isRefundAllowed()}).catch(()=>{this.errorOccurred=!0,this.refunds=[]}).finally(()=>{this.isLoadingTable=!1})},isRefundAllowed(){let e=0;for(let t of this.refunds)"Failed"!==t.status&&(e+=t.rawAmount);this.allowRefund=this.order.amountTotal>e/100}},async beforeMount(){this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchRefunds()}});let{Component:d,Mixin:o}=Shopware;d.register("adyen-notifications",{template:'{% block adyen_notifications %}\n
\n \n \n {% block sw_data_grid_body_columns %}\n {% block sw_data_grid_column_actions %}\n \n {% endblock %}\n {% endblock %}\n \n

{{ $tc(\'adyen.noNotificationsReceived\') }}

\n
\n
\n{% endblock %}\n',inject:["adyenService"],mixins:[o.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{notifications:[],columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"eventCode",label:this.$tc("adyen.columnHeaders.event")},{property:"success",label:this.$tc("adyen.columnHeaders.success")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")},{property:"errorCount",label:this.$tc("adyen.columnHeaders.errorCount")},{property:"errorMessage",label:this.$tc("adyen.columnHeaders.errorMessage")}],showWidget:!1}},methods:{fetchNotifications(){this.adyenService.fetchNotifications(this.order.id).then(e=>{this.notifications=e})},onReschedule(e){this.adyenService.rescheduleNotification(e.notificationId).then(e=>{this.createNotificationSuccess({title:this.$tc("adyen.reprocessNotification"),message:this.$tc("adyen.notificationRescheduleSuccess")}),this.fetchNotifications()})}},async beforeMount(){this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchNotifications()}});let c={};c.isVersionOlderThan65=()=>{var e,t;return -1===(t="6.5.0.0",(e=Shopware.Context.app.config.version).startsWith(t+"-")?-1:t.startsWith(e+"-")?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"}))};var l=c;let{Component:u}=Shopware;u.register("adyen-partial-payments",{template:'
\n
    \n
    {{ $tc(\'adyen.authorisedPayments\') }}
    \n
    \n {{ payment.pspReference }} -\n {{ payment.method }} -\n {{ payment.amount }}\n
    \n
    {{ errorMessage }}
    \n
\n
    \n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n PSP Reference\n
    \n
    \n
    \n Payment Method\n
    \n
    \n
    \n Amount\n
    \n
    \n \n \n
    \n {{ payment.method }}\n
    \n
    \n
    \n {{ payment.amount }}\n
    \n
    \n
    \n
    \n {{ errorMessage }}\n
\n
\n',inject:["adyenService"],props:{order:{type:Object,required:!0}},methods:{fetchAdyenPartialPayments(){this.adyenService.fetchAdyenPartialPayments(this.order.id).then(e=>{e.length>0?this.partialPayments=e:this.errorMessage=this.$tc("adyen.pendingWebhook")})}},data(){return{errorMessage:"",partialPayments:[],showWidget:!1,isVersionOlderThan65:!1}},async beforeMount(){this.isVersionOlderThan65=l.isVersionOlderThan65(),this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchAdyenPartialPayments()}}),Shopware.Component.override("sw-order-detail-general",{template:'{% block sw_order_detail_general_line_items_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-base",{template:'{% block sw_order_detail_base_custom_fields %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-user-card",{template:'{% block sw_order_detail_base_secondary_info_payment %}\n {% parent %}\n\n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-details",{template:'{% block sw_order_detail_details_payment_method_select %}\n {% parent %}\n\n \n{% endblock %}\n'}),n(465);var h=JSON.parse('{"adyen":{"configTestTitle":"Configuration test","configTestSuccess":"Configuration is successfully tested","configTestFail":"There\'s an issue in your configuration","adyenRefunds":"Adyen Refunds","refundTitle":"Refund","refundSuccessful":"A refund has been successfully submitted.","invalidRefundAmount":"Refund amount exceeds order total","error":"An error has occurred. Please check the logs.","refundFetchError":"An error has occurred while attempting to get linked refunds.","refundConfirm":"Create refund for order","createRefund":"Create Refund","noRefundsCreated":"No refunds created","columnHeaders":{"pspReference":"PSP Reference","amount":"Amount","status":"Status","event":"Event","success":"Success","created":"Created","updated":"Updated","errorCount":"Error Count","errorMessage":"Error Message"},"reprocessNotification":"Reprocess Notification","notificationRescheduleSuccess":"Notification will be processed again.","notificationsTitle":"Adyen Webhook Notifications","noNotificationsReceived":"No webhook notifications received.","adyenPaymentCaptureTitle":"Adyen Capture Requests","noCaptureRequests":"No capture requests have been sent","sendCaptureRequest":"Send Capture Request","captureConfirm":"Capture payment for order","captureSuccessful":"Capture request has been successfully sent","pendingWebhook":"Order is pending webhook.","authorisedPayments":"Authorised Payments"}}');Shopware.Locale.extend("en-GB",h)}()})(); \ No newline at end of file +(function(){var e={405:function(){},951:function(){},465:function(){let{Component:e}=Shopware,{Criteria:t}=Shopware.Data;e.extend("sw-entity-single-select-override","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){let e=new t(1,this.resultLimit);return e.addFilter(t.equals("stateMachine.technicalName","order_delivery.state")),e}}}})},918:function(){let e=Shopware.Classes.ApiService,{Application:t}=Shopware;class n extends e{constructor(e,t,n="adyen"){super(e,t,n),this.headers=this.getBasicHeaders({})}check(t){let n=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/verify`,t,{headers:n}).then(t=>e.handleResponse(t))}capture(t){return this.httpClient.post(this.getApiBasePath()+"/capture",{orderId:t},{headers:this.headers}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during capture request: "+e.message),e})}getCaptureRequests(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/captures",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during capture request: "+e.message),e})}isCaptureAllowed(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/is-capture-allowed",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during is-capture-allowed request: "+e.message),e})}isManualCaptureEnabled(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/is-manual-capture-enabled",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during is-capture-allowed request: "+e.message),e})}getRefunds(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/refunds",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during refunds request: "+e.message),e})}postRefund(t,n){let a=this.getBasicHeaders({});return this.httpClient.post(this.getApiBasePath()+"/refunds",{orderId:t,refundAmount:n},{headers:a}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred during post refund request: "+e.message),e})}fetchNotifications(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/notifications",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}rescheduleNotification(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/reschedule-notification/"+t,{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}isAdyenOrder(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t.id+"/is-adyen-order",{headers:n}).then(t=>e.handleResponse(t)).then(e=>e.status).catch(e=>(console.error("An error occurred: "+e.message),!1))}fetchAdyenPartialPayments(t){let n=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+t+"/partial-payments",{headers:n}).then(t=>e.handleResponse(t)).catch(e=>{throw console.error("An error occurred: "+e.message),e})}}t.addServiceProvider("adyenService",e=>new n(t.getContainer("init").httpClient,e.loginService))},597:function(e,t,n){var a=n(405);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("252611c6",a,!0,{})},842:function(e,t,n){var a=n(951);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("3c1af017",a,!0,{})},346:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},s=0;sn.parts.length&&(a.parts.length=n.parts.length)}else{for(var i=[],s=0;s\n Test Configuration\n\n',inject:["adyenService"],mixins:[t.getByName("notification")],data(){return{isLoading:!1,isSaveSuccessful:!1}},computed:{pluginConfig(){let e=this.$parent;for(;void 0===e.actualConfigData;)e=e.$parent;let t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t])}},methods:{saveFinish(){this.isSaveSuccessful=!1},check(){this.isLoading=!0,this.adyenService.check(this.pluginConfig).then(e=>{e.success?(this.isSaveSuccessful=!0,this.createNotificationSuccess({title:this.$tc("adyen.configTestTitle"),message:this.$tc("adyen.configTestSuccess")})):this.createNotificationError({title:this.$tc("adyen.configTestTitle"),message:this.$tc(e.message?e.message:"adyen.configTestFail")}),this.isLoading=!1})}}}),n(597);let{Component:a,Mixin:s}=Shopware;a.register("adyen-payment-capture",{template:'{% block adyen_capture %}\n \n
\n
\n
\n {{ $tc(\'adyen.noCaptureRequests\') }}\n
\n
\n \n {{ $tc(\'adyen.sendCaptureRequest\') }}\n \n
\n \n \n \n
\n \n \n
\n
\n {{ $tc(\'adyen.error\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService","systemConfigApiService"],mixins:[s.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],showModal:!1,captureRequests:[],allowCapture:!1,captureEnabled:!1,errorOccurred:!1,isLoading:!0,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onSubmitCapture(){this.isLoading=!0,this.adyenService.capture(this.order.id).then(e=>{e.success?(this.fetchCaptureRequests(),this.createNotificationSuccess({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.captureSuccessful")})):this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoading=!1,this.showModal=!1})},fetchCaptureRequests(){this.isLoading=!0,this.adyenService.getCaptureRequests(this.order.id).then(e=>{this.captureRequests=e,this.isCaptureAllowed()}).catch(()=>{this.errorOccurred=!0,this.captureRequests=[]}).finally(()=>{this.isLoading=!1})},isManualCaptureEnabled(){this.isLoading=!0,this.adyenService.isManualCaptureEnabled(this.order.id).then(e=>{this.captureEnabled=e,this.showWidget=this.adyenService.isAdyenOrder(this.order)&&this.captureEnabled}).catch(()=>{this.errorOccurred=!0,this.captureEnabled=!1}).finally(()=>{this.isLoading=!1})},isCaptureAllowed(){this.isLoading=!0,this.adyenService.isCaptureAllowed(this.order.id).then(e=>{this.allowCapture=e}).catch(()=>{this.errorOccurred=!0,this.allowCapture=!1}).finally(()=>{this.isLoading=!1})}},beforeMount(){this.isManualCaptureEnabled(),this.fetchCaptureRequests()}}),n(842);let{Component:r,Mixin:i}=Shopware;r.register("adyen-refund",{template:'{% block adyen_refund %}\n \n
\n
\n
\n {{ $tc(\'adyen.noRefundsCreated\') }}\n
\n
\n \n {{ $tc(\'sw-order.documentCard.labelCreateNew\') }}\n \n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n {{ $tc(\'adyen.refundFetchError\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService"],mixins:[i.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],refundAmount:0,showModal:!1,refunds:[],allowRefund:!0,isLoadingTable:!0,errorOccurred:!1,isLoadingRefund:!1,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onRefund(){this.isLoadingRefund=!0,this.adyenService.postRefund(this.order.id,this.refundAmount).then(e=>{e.success?(this.fetchRefunds(),this.createNotificationSuccess({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.refundSuccessful")})):this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoadingRefund=!1,this.showModal=!1})},fetchRefunds(){this.isLoadingTable=!0,this.adyenService.getRefunds(this.order.id).then(e=>{this.refunds=e,this.isRefundAllowed()}).catch(()=>{this.errorOccurred=!0,this.refunds=[]}).finally(()=>{this.isLoadingTable=!1})},isRefundAllowed(){let e=0;for(let t of this.refunds)"Failed"!==t.status&&(e+=t.rawAmount);this.allowRefund=this.order.amountTotal>e/100}},async beforeMount(){this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchRefunds()}});let{Component:d,Mixin:o}=Shopware;d.register("adyen-notifications",{template:'{% block adyen_notifications %}\n
\n \n \n {% block sw_data_grid_body_columns %}\n {% block sw_data_grid_column_actions %}\n \n {% endblock %}\n {% endblock %}\n \n

{{ $tc(\'adyen.noNotificationsReceived\') }}

\n
\n
\n{% endblock %}\n',inject:["adyenService"],mixins:[o.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{notifications:[],columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"eventCode",label:this.$tc("adyen.columnHeaders.event")},{property:"success",label:this.$tc("adyen.columnHeaders.success")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")},{property:"errorCount",label:this.$tc("adyen.columnHeaders.errorCount")},{property:"errorMessage",label:this.$tc("adyen.columnHeaders.errorMessage")}],showWidget:!1}},methods:{fetchNotifications(){this.adyenService.fetchNotifications(this.order.id).then(e=>{this.notifications=e})},onReschedule(e){this.adyenService.rescheduleNotification(e.notificationId).then(e=>{this.createNotificationSuccess({title:this.$tc("adyen.reprocessNotification"),message:this.$tc("adyen.notificationRescheduleSuccess")}),this.fetchNotifications()})}},async beforeMount(){this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchNotifications()}});let c={};c.isVersionOlderThan65=()=>{var e,t;return -1===(t="6.5.0.0",(e=Shopware.Context.app.config.version).startsWith(t+"-")?-1:t.startsWith(e+"-")?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"}))};var l=c;let{Component:u}=Shopware;u.register("adyen-partial-payments",{template:'
\n
    \n
    {{ $tc(\'adyen.authorisedPayments\') }}
    \n
    \n {{ payment.pspReference }} -\n {{ payment.method }} -\n {{ payment.amount }}\n
    \n
    {{ errorMessage }}
    \n
\n
    \n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n PSP Reference\n
    \n
    \n
    \n Payment Method\n
    \n
    \n
    \n Amount\n
    \n
    \n \n \n
    \n {{ payment.method }}\n
    \n
    \n
    \n {{ payment.amount }}\n
    \n
    \n
    \n
    \n {{ errorMessage }}\n
\n
\n',inject:["adyenService"],props:{order:{type:Object,required:!0}},methods:{fetchAdyenPartialPayments(){this.adyenService.fetchAdyenPartialPayments(this.order.id).then(e=>{e.length>0?this.partialPayments=e:this.errorMessage=this.$tc("adyen.pendingWebhook")})}},data(){return{errorMessage:"",partialPayments:[],showWidget:!1,isVersionOlderThan65:!1}},async beforeMount(){this.isVersionOlderThan65=l.isVersionOlderThan65(),this.showWidget=await this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchAdyenPartialPayments()}}),Shopware.Component.override("sw-order-detail-general",{template:'{% block sw_order_detail_general_line_items_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-base",{template:'{% block sw_order_detail_base_custom_fields %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-user-card",{template:'{% block sw_order_detail_base_secondary_info_payment %}\n {% parent %}\n\n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-details",{template:'{% block sw_order_detail_details_payment_method_select %}\n {% parent %}\n\n \n{% endblock %}\n'}),n(465);var h=JSON.parse('{"adyen":{"configTestTitle":"Configuration test","configTestSuccess":"Configuration is successfully tested","configTestFail":"There\'s an issue in your configuration","adyenRefunds":"Adyen Refunds","refundTitle":"Refund","refundSuccessful":"A refund has been successfully submitted.","invalidRefundAmount":"Refund amount exceeds order total","error":"An error has occurred. Please check the logs.","refundFetchError":"An error has occurred while attempting to get linked refunds.","refundConfirm":"Create refund for order","createRefund":"Create Refund","noRefundsCreated":"No refunds created","columnHeaders":{"pspReference":"PSP Reference","amount":"Amount","status":"Status","event":"Event","success":"Success","created":"Created","updated":"Updated","errorCount":"Error Count","errorMessage":"Error Message"},"reprocessNotification":"Reprocess Notification","notificationRescheduleSuccess":"Notification will be processed again.","notificationsTitle":"Adyen Webhook Notifications","noNotificationsReceived":"No webhook notifications received.","adyenPaymentCaptureTitle":"Adyen Capture Requests","noCaptureRequests":"No capture requests have been sent","sendCaptureRequest":"Send Capture Request","captureConfirm":"Capture payment for order","captureSuccessful":"Capture request has been successfully sent","pendingWebhook":"Order is pending webhook.","authorisedPayments":"Authorised Payments"}}');Shopware.Locale.extend("en-GB",h)}()})(); +//# sourceMappingURL=adyen-payment-shopware6.js.map \ No newline at end of file diff --git a/src/Resources/public/static/css/adyen-payment-shopware6.css.map b/src/Resources/public/static/css/adyen-payment-shopware6.css.map new file mode 100644 index 00000000..773987d4 --- /dev/null +++ b/src/Resources/public/static/css/adyen-payment-shopware6.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/adyen-payment-shopware6.css","mappings":"AAsBA,2BACI,aACA,YACA,mBAGJ,iCACI,gBACA,W;ACRJ,0BACI,aACA,YACA,mBAGJ,gCACI,gBACA,W","sources":["webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-payment-capture/adyen-payment-capture.scss","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.scss"],"sourcesContent":["/**\n * ######\n * ######\n * ############ ####( ###### #####. ###### ############ ############\n * ############# #####( ###### #####. ###### ############# #############\n * ###### #####( ###### #####. ###### ##### ###### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ######\n * ############# ############# ############# ############# ##### ######\n * ############ ############ ############# ############ ##### ######\n * ######\n * #############\n * ############\n *\n * Adyen plugin for Shopware 6\n *\n * Copyright (c) 2022 Adyen N.V.\n * This file is open source and available under the MIT license.\n * See the LICENSE file for more info.\n *\n */\n\n.adyen-capture-card-header {\n display: flex;\n height: 30px;\n margin-bottom: 15px;\n}\n\n.adyen-capture-card-header-first {\n margin-top: auto;\n width: 100%;\n}\n","/**\n * ######\n * ######\n * ############ ####( ###### #####. ###### ############ ############\n * ############# #####( ###### #####. ###### ############# #############\n * ###### #####( ###### #####. ###### ##### ###### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ######\n * ############# ############# ############# ############# ##### ######\n * ############ ############ ############# ############ ##### ######\n * ######\n * #############\n * ############\n *\n * Adyen plugin for Shopware 6\n *\n * Copyright (c) 2021 Adyen B.V.\n * This file is open source and available under the MIT license.\n * See the LICENSE file for more info.\n *\n */\n\n.adyen-refund-card-header {\n display: flex;\n height: 30px;\n margin-bottom: 15px;\n}\n\n.adyen-refund-card-header-first {\n margin-top: auto;\n width: 100%;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/src/Resources/public/static/js/adyen-payment-shopware6.js.map b/src/Resources/public/static/js/adyen-payment-shopware6.js.map new file mode 100644 index 00000000..c0e3b1c1 --- /dev/null +++ b/src/Resources/public/static/js/adyen-payment-shopware6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/adyen-payment-shopware6.js","mappings":"oEAAA,GAAM,CAAEA,UAAAA,CAAS,CAAE,CAAGC,SAChB,CAAEC,SAAAA,CAAQ,CAAE,CAAGD,SAASE,IAAI,CAElCH,EAAUI,MAAM,CAAC,mCAAoC,0BAA2B,CAC5EC,MAAO,CACHC,SAAU,CACNC,KAAMC,OACNC,SAAU,GACVC,UACI,IAAMJ,EAAW,IAAIJ,EAAS,EAAG,IAAI,CAACS,WAAW,EAEjD,OADAL,EAASM,SAAS,CAACV,EAASW,MAAM,CAAC,6BAA8B,yBAC1DP,CACX,CACJ,CACJ,CACJ,E,iBCOA,IAAMQ,EAAab,SAASc,OAAO,CAACD,UAAU,CACxC,CAAEE,YAAAA,CAAW,CAAE,CAAGf,QAExB,OAAMgB,UAAkBH,EACpBI,YAAYC,CAAU,CAAEC,CAAY,CAAEC,EAAc,OAAO,CAAE,CACzD,KAAK,CAACF,EAAYC,EAAcC,GAChC,IAAI,CAACC,OAAO,CAAG,IAAI,CAACC,eAAe,CAAC,CAAC,EACzC,CAEAC,MAAMC,CAAM,CAAE,CACV,IAAMH,EAAU,IAAI,CAACC,eAAe,CAAC,CAAC,GAEtC,OAAO,IAAI,CAACJ,UAAU,CACjBO,IAAI,CAAC,CAAC,QAAQ,EAAE,IAAI,CAACC,cAAc,GAAG,OAAO,CAAC,CAAEF,EAAO,CACpDH,QAAAA,CACJ,GACCM,IAAI,CAAC,GACKd,EAAWe,cAAc,CAACC,GAE7C,CAEAC,QAAQC,CAAO,CAAE,CACb,OAAO,IAAI,CAACb,UAAU,CAACO,IAAI,CACvB,IAAI,CAACC,cAAc,GAAK,WACxB,CAAEK,QAAAA,CAAQ,EACV,CAAEV,QAAS,IAAI,CAACA,OAAO,GACzBM,I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tC,CACJ,GEjEAlD,SAASD,SAAS,CAACuO,QAAQ,CAAC,0BAA2B,CACnDrE,SCHW,+QDIf,GEFAjK,SAASD,SAAS,CAACuO,QAAQ,CAAC,uBAAwB,CAChDrE,SCHW,0QDIf,GEFAjK,SAASD,SAAS,CAACuO,QAAQ,CAAC,qBAAsB,CAC9CrE,SCHW,4KDIf,GEFAjK,SAASD,SAAS,CAACuO,QAAQ,CAAC,0BAA2B,CACnDrE,SCHW,uKDIf,G,o5CEgCAjK,SAASuO,MAAM,CAACpO,MAAM,CAAC,QAASqO,E","sources":["webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/entity/sw-entity-single-select-override/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/service/adyenService.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-payment-capture/adyen-payment-capture.scss?b32f","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.scss?fb2e","webpack://administration/./node_modules/vue-style-loader/lib/listToStyles.js","webpack://administration/./node_modules/vue-style-loader/lib/addStylesClient.js","webpack://administration/webpack/bootstrap","webpack://administration/webpack/runtime/define property getters","webpack://administration/webpack/runtime/hasOwnProperty shorthand","webpack://administration/webpack/runtime/publicPath","webpack://administration/data:text/javascript;charset=utf-8;base64,CiAgICAgICAgICAgIGlmICh3aW5kb3c/Ll9fc3dfXz8uYXNzZXRQYXRoKSB7CiAgICAgICAgICAgICAgICBfX3dlYnBhY2tfcHVibGljX3BhdGhfXyA9IHdpbmRvdy5fX3N3X18uYXNzZXRQYXRoICsgJy9idW5kbGVzL2FkeWVucGF5bWVudHNob3B3YXJlNi8nOwogICAgICAgICAgICB9CiAgICAgICAg","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-config-check-button/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-config-check-button/adyen-config-check-button.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-payment-capture/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-payment-capture/adyen-payment-capture.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-refund/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-notifications/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-notifications/adyen-notifications.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/helper/versionHelper.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-partial-payments/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/component/adyen-partial-payments/adyen-partial-payments.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-general-override/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-general-override/sw-order-detail-general.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-base-override/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-base-override/sw-order-detail-base.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-user-card-override/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-user-card-override/sw-order-user-card.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-details-override/index.js","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/sw-order-detail-details-override/sw-order-detail-details.html.twig","webpack://administration/../../../../../adyen/adyen-shopware6/src/Resources/app/administration/src/main.js"],"sourcesContent":["const { Component } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.extend('sw-entity-single-select-override', 'sw-entity-single-select', {\n props: {\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, this.resultLimit);\n criteria.addFilter(Criteria.equals('stateMachine.technicalName', 'order_delivery.state'));\n return criteria;\n }\n },\n }\n});\n","/**\n * ######\n * ######\n * ############ ####( ###### #####. ###### ############ ############\n * ############# #####( ###### #####. ###### ############# #############\n * ###### #####( ###### #####. ###### ##### ###### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######\n * ###### ###### #####( ###### #####. ###### ##### ##### ######\n * ############# ############# ############# ############# ##### ######\n * ############ ############ ############# ############ ##### ######\n * ######\n * #############\n * ############\n *\n * Adyen plugin for Shopware 6\n *\n * Copyright (c) 2021 Adyen B.V.\n * This file is open source and available under the MIT license.\n * See the LICENSE file for more info.\n *\n */\n\nconst ApiService = Shopware.Classes.ApiService;\nconst { Application } = Shopware;\n\nclass ApiClient extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'adyen') {\n super(httpClient, loginService, apiEndpoint);\n this.headers = this.getBasicHeaders({});\n }\n\n check(values) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/verify`, values,{\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n capture(orderId) {\n return this.httpClient.post(\n this.getApiBasePath() + '/capture',\n { orderId },\n { headers: this.headers }\n ).then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during capture request: ' + error.message);\n throw error;\n });\n }\n\n getCaptureRequests(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/captures', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during capture request: ' + error.message);\n throw error;\n });\n }\n\n isCaptureAllowed(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/is-capture-allowed', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during is-capture-allowed request: ' + error.message);\n throw error;\n });\n }\n\n isManualCaptureEnabled(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/is-manual-capture-enabled', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during is-capture-allowed request: ' + error.message);\n throw error;\n });\n }\n\n getRefunds(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/refunds', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during refunds request: ' + error.message);\n throw error;\n });\n }\n\n postRefund(orderId, refundAmount) {\n const headers = this.getBasicHeaders({});\n return this.httpClient\n .post(this.getApiBasePath() + '/refunds', {orderId: orderId, refundAmount: refundAmount}, {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n\n }).catch((error) => {\n console.error('An error occurred during post refund request: ' + error.message);\n throw error;\n });\n }\n\n fetchNotifications(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/notifications', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n\n rescheduleNotification(notificationId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/reschedule-notification/' + notificationId , {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n\n isAdyenOrder(order){\n const headers = this.getBasicHeaders({});\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + order.id + '/is-adyen-order', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n })\n .then((response) => {\n return response.status\n })\n .catch((error) => {\n console.error('An error occurred: ' + error.message);\n return false;\n });\n }\n\n fetchAdyenPartialPayments(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/partial-payments', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n}\n\nApplication.addServiceProvider('adyenService', (container) => {\n const initContainer = Application.getContainer('init');\n return new ApiClient(initContainer.httpClient, container.loginService);\n});\n","// style-loader: Adds some css to the DOM by adding a