diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index cbee5c47..6fb69599 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,8 @@ +# 7.1.6 +* Verbesserung: Shopware-Bestellnummer wird nun in den Zahlungsdetails gespeichert, um das Tracking von Unzer Paylater-Zahlungen zu verbessern +* Fehlerbehebung: Zahlungsarten für Rechnung und Ratenzahlung wurden auf die neuen offiziellen Bezeichnungen aktualisiert (nur Deutsch). Betrifft nur Neuinstallationen +* Fehlerbehebung: In einigen Fällen wurde bei erfolgreichen Click-to-Pay-Zahlungen fälschlicherweise eine Fehlermeldung angezeigt + # 7.1.5 * Aktualisierung iDEAL Payment Naming diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md index 660623b1..f8e25d7b 100644 --- a/CHANGELOG_en-GB.md +++ b/CHANGELOG_en-GB.md @@ -1,3 +1,8 @@ +# 7.1.6 +* Improvement: Save Shopware Order Number in payment details for Unzer Paylater payment tracking +* Fix: Changed payment method names for Invoice and Installment to the new official brands (German only). This will only affect new installs +* Fix: Sometimes Click to pay payments would display an error for succesfull payments. + # 7.1.5 * Updated iDEAL Payment naming diff --git a/composer.json b/composer.json index c9e66bde..98e4d5c2 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "unzerdev/shopware6", "description": "Unzer payment integration for Shopware 6", - "version": "7.1.5", + "version": "7.1.6", "type": "shopware-platform-plugin", "license": "Apache-2.0", "minimum-stability": "dev", diff --git a/src/Components/PaymentHandler/AbstractUnzerPaymentHandler.php b/src/Components/PaymentHandler/AbstractUnzerPaymentHandler.php index 6104d1fe..ce7b665e 100755 --- a/src/Components/PaymentHandler/AbstractUnzerPaymentHandler.php +++ b/src/Components/PaymentHandler/AbstractUnzerPaymentHandler.php @@ -105,7 +105,7 @@ public function pay( ); $this->unzerBasket = $this->basketHydrator->hydrateObject($orderTransaction); - $this->unzerMetadata = $this->metadataHydrator->hydrateObject($context); + $this->unzerMetadata = $this->metadataHydrator->hydrateObject($context, $orderTransaction); $this->metadataHydrator->setIsExpress($this->unzerMetadata, $this->isExpress); $this->unzerCustomer = $this->getUnzerCustomer($request->get('unzerCustomerId', ''), $orderTransaction->getPaymentMethodId(), $orderTransaction, $context); diff --git a/src/Components/PaymentHandler/Traits/CanAuthorize.php b/src/Components/PaymentHandler/Traits/CanAuthorize.php index c7ff0c25..eca63e6f 100644 --- a/src/Components/PaymentHandler/Traits/CanAuthorize.php +++ b/src/Components/PaymentHandler/Traits/CanAuthorize.php @@ -35,6 +35,9 @@ public function authorize( ); $authorization->setOrderId($this->unzerBasket->getOrderId()); + if (!empty($this->unzerMetadata) && !empty($this->unzerMetadata->getMetadata('shopwareOrderNumber'))) { + $authorization->setInvoiceId($this->unzerMetadata->getMetadata('shopwareOrderNumber')); + } $authorization->setCard3ds(true); if ($recurrenceType !== null) { diff --git a/src/Components/PaymentHandler/Traits/CanCharge.php b/src/Components/PaymentHandler/Traits/CanCharge.php index 3cf158b0..785019d5 100644 --- a/src/Components/PaymentHandler/Traits/CanCharge.php +++ b/src/Components/PaymentHandler/Traits/CanCharge.php @@ -38,6 +38,9 @@ public function charge( ); $charge->setOrderId($this->unzerBasket->getOrderId()); + if (!empty($this->unzerMetadata) && !empty($this->unzerMetadata->getMetadata('shopwareOrderNumber'))) { + $charge->setInvoiceId($this->unzerMetadata->getMetadata('shopwareOrderNumber')); + } $charge->setCard3ds(true); if ($recurrenceType !== null) { diff --git a/src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php b/src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php index 2720bea7..2f44162c 100644 --- a/src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php +++ b/src/Components/PaymentHandler/UnzerPayPalPaymentHandler.php @@ -256,6 +256,7 @@ private function payExpress( $unzerBasket->getCurrencyCode(), $transaction->getReturnUrl() ); + $authorization->setInvoiceId($orderTransaction->getOrder()->getOrderNumber()); $unzerClient->updateAuthorization($payment->getId(), $authorization); } else { $charge = new Charge( @@ -263,6 +264,7 @@ private function payExpress( $unzerBasket->getCurrencyCode(), $transaction->getReturnUrl() ); + $charge->setInvoiceId($orderTransaction->getOrder()->getOrderNumber()); $unzerClient->updateCharge($payment->getId(), $charge); } $this->persistPaymentInformation( diff --git a/src/Components/PaymentTransitionMapper/CreditCardTransitionMapper.php b/src/Components/PaymentTransitionMapper/CreditCardTransitionMapper.php index 46c299a7..4730f6a6 100644 --- a/src/Components/PaymentTransitionMapper/CreditCardTransitionMapper.php +++ b/src/Components/PaymentTransitionMapper/CreditCardTransitionMapper.php @@ -9,6 +9,7 @@ use UnzerPayment6\Components\PaymentTransitionMapper\Traits\IsBasicPaymentMethodTransitionMapperWithBookingMode; use UnzerSDK\Resources\PaymentTypes\BasePaymentType; use UnzerSDK\Resources\PaymentTypes\Card; +use UnzerSDK\Resources\PaymentTypes\Clicktopay; class CreditCardTransitionMapper extends AbstractTransitionMapper { @@ -19,7 +20,7 @@ class CreditCardTransitionMapper extends AbstractTransitionMapper public function supports(BasePaymentType $paymentType): bool { - return $paymentType instanceof Card; + return $paymentType instanceof Card || $paymentType instanceof Clicktopay; } protected function getResourceName(): string diff --git a/src/Components/ResourceHydrator/MetadataResourceHydrator.php b/src/Components/ResourceHydrator/MetadataResourceHydrator.php index 49835ee9..857c54b0 100755 --- a/src/Components/ResourceHydrator/MetadataResourceHydrator.php +++ b/src/Components/ResourceHydrator/MetadataResourceHydrator.php @@ -4,6 +4,8 @@ namespace UnzerPayment6\Components\ResourceHydrator; +use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity; +use Shopware\Core\Checkout\Order\OrderEntity; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; @@ -21,7 +23,8 @@ public function __construct( } public function hydrateObject( - Context $context + Context $context, + ?OrderTransactionEntity $transaction = null, ): Metadata { $pluginData = $this->getPluginData($context); @@ -30,6 +33,10 @@ public function hydrateObject( $unzerMetadata->setShopVersion($this->shopwareVersion); $unzerMetadata->addMetadata('pluginType', 'unzerdev/shopware6'); + if ($transaction instanceof OrderTransactionEntity && $transaction->getOrder() instanceof OrderEntity) { + $unzerMetadata->addMetadata('shopwareOrderNumber', $transaction->getOrder()->getOrderNumber()); + } + if ($pluginData !== null) { $unzerMetadata->addMetadata('pluginVersion', $pluginData->getVersion()); } diff --git a/src/Installer/PaymentInstaller.php b/src/Installer/PaymentInstaller.php index 9433656d..447c5f23 100755 --- a/src/Installer/PaymentInstaller.php +++ b/src/Installer/PaymentInstaller.php @@ -154,16 +154,16 @@ class PaymentInstaller implements InstallerInterface [ 'id' => self::PAYMENT_ID_IDEAL, 'handlerIdentifier' => UnzerIdealPaymentHandler::class, - 'name' => 'iDEAL', + 'name' => 'iDEAL | Wero', 'technicalName' => 'unzer_ideal', 'translations' => [ 'de-DE' => [ - 'name' => 'iDEAL', - 'description' => 'iDEAL Zahlungen mit Unzer payments', + 'name' => 'iDEAL | Wero', + 'description' => 'iDEAL | Wero Zahlungen mit Unzer payments', ], 'en-GB' => [ - 'name' => 'iDEAL', - 'description' => 'iDEAL payments with Unzer payments', + 'name' => 'iDEAL | Wero', + 'description' => 'iDEAL | Wero payments with Unzer payments', ], ], ], @@ -174,12 +174,12 @@ class PaymentInstaller implements InstallerInterface 'technicalName' => 'unzer_installment', 'translations' => [ 'de-DE' => [ - 'name' => 'Ratenkauf', - 'description' => 'Unzer Ratenkauf', + 'name' => 'Ratenzahlung', + 'description' => 'Ratenzahlung mit Unzer payments', ], 'en-GB' => [ 'name' => 'Installment', - 'description' => 'Unzer Installment', + 'description' => 'Installment with Unzer payments', ], ], ], @@ -302,8 +302,8 @@ class PaymentInstaller implements InstallerInterface 'technicalName' => 'unzer_invoice', 'translations' => [ 'de-DE' => [ - 'name' => 'Rechnungskauf', - 'description' => 'Rechnungskauf mit Unzer payments', + 'name' => 'Rechnung', + 'description' => 'Zahlung auf Rechnung mit Unzer payments', ], 'en-GB' => [ 'name' => 'Invoice', diff --git a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js index 592721f7..1b8afee3 100644 --- a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js +++ b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js @@ -15,6 +15,7 @@ Component.register('unzer-payment-tab', { paymentResources: [], loadedResources: 0, isLoading: true, + order: null, }; }, diff --git a/src/Resources/app/storefront/dist/storefront/js/unzer-payment6/unzer-payment6.js b/src/Resources/app/storefront/dist/storefront/js/unzer-payment6/unzer-payment6.js index 58fe748c..9c59ed59 100644 --- a/src/Resources/app/storefront/dist/storefront/js/unzer-payment6/unzer-payment6.js +++ b/src/Resources/app/storefront/dist/storefront/js/unzer-payment6/unzer-payment6.js @@ -1,2 +1,2 @@ (()=>{"use strict";let e=window.PluginBaseClass;class t extends e{static #e=this.options={publicKey:null,shopLocale:null,unzerCustomer:null,submitButtonId:"confirmFormSubmit",disabledClass:"disabled",resourceIdElementId:"unzerResourceId",threatMetrixIdElementId:"unzerThreatMetrixId",confirmFormId:"confirmOrderForm",errorWrapperClass:"unzer-payment--error-wrapper",errorContentSelector:".unzer-payment--error-wrapper .alert-content-container",errorShouldNotBeEmpty:"%field% should not be empty",isOrderEdit:!1,savedDeviceRadioButtonSelector:'*[name="savedPaymentDevice"]',savedDeviceRadioButtonNewAccountId:"device-new",savedDeviceSelectedRadioButtonSelector:'*[name="savedPaymentDevice"]:checked'};static #t=this.submitting=!1;init(){this._registerElements(),this._registerEvents()}_registerElements(){this.submitButton=this.getSubmitButton()}getSubmitButton(){let e=document.getElementById(this.options.submitButtonId);return e||(e=document.getElementById(this.options.confirmFormId).getElementsByTagName("button")[0]),e||null}_registerEvents(){this.submitButton.addEventListener("click",this._onSubmitButtonClick.bind(this)),this.options.unzerCustomer&&Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&(console.log("set customer data",this.options.unzerCustomer),e.setCustomerData(this.options.unzerCustomer))})}setSubmitButtonActive(e){e?(this.submitButton.classList.remove(this.options.disabledClass),this.submitButton.disabled=!1):(this.submitButton.classList.add(this.options.disabledClass),this.submitButton.disabled=!0)}submitTypeId(e,t){if(document.getElementById(this.options.resourceIdElementId).value=e,t){let e=document.getElementById(this.options.threatMetrixIdElementId);e&&(e.value=t)}this.setSubmitButtonActive(!0),this.submitButton.click(),this.setSubmitButtonActive(!1)}showError(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),s=document.querySelectorAll(this.options.errorContentSelector)[0];t&&""!==s.innerText?s.innerText=`${s.innerText} -${e.message}`:s.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0),this.submitting=!1}renderErrorToElement(e,t){let n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),s=document.querySelectorAll(this.options.errorContentSelector)[0];n.hidden=!1,s.innerText=e.message,t.appendChild(n)}async _onSubmitButtonClick(e){if(!0===this.submitting)return;if(this.submitting=!0,e.preventDefault(),!this._validateForm()){this.submitting=!1,this.setSubmitButtonActive(!0);return}this.setSubmitButtonActive(!1);let t=document.querySelector(this.options.savedDeviceSelectedRadioButtonSelector);if(t&&t.id!==this.options.savedDeviceRadioButtonNewAccountId)this.submitTypeId(t.value,null);else{let e=document.getElementById("unzer-payment-component");if(e)try{let t=await e.submit();t.submitResponse?!0===t.submitResponse.success?(console.log("submit response: ",t.submitResponse),this.submitTypeId(t.submitResponse.data.id,t.threatMetrixId||null)):this.showError({message:"GENERAL ERROR"}):this.showError({message:"EXCEPTIONAL ERROR"})}catch(t){e.scrollIntoView({block:"end",behavior:"smooth"}),this.submitting=!1,this.setSubmitButtonActive(!0)}else this.setSubmitButtonActive(!0),this.submitButton.click(),this.setSubmitButtonActive(!1)}}_validateForm(){let e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(let n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,s.labels[0].innerText)},!0),e=!1):s.classList.remove("is-invalid")}return e}_clearErrorMessage(){let e=document.getElementsByClassName(this.options.errorWrapperClass).item(0),t=document.querySelectorAll(this.options.errorContentSelector)[0];e.hidden=!0,t.innerText=""}getB2bCustomerObject(e){let t=`${e.firstName} ${e.lastName}`,n=e.birthday?new Date(e.birthday):null,s={firstname:e.firstName,lastname:e.lastName,email:e.email,company:e.activeBillingAddress.company,salutation:e.salutation.salutationKey,billingAddress:{name:t,street:e.activeBillingAddress.street,zip:e.activeBillingAddress.zipcode,city:e.activeBillingAddress.city,country:e.activeBillingAddress.country.iso},shippingAddress:{name:t,street:e.activeShippingAddress.street,zip:e.activeShippingAddress.zipcode,city:e.activeShippingAddress.city,country:e.activeShippingAddress.country.iso}};return n&&(s.birthDate=n.getFullYear()+"-"+(n.getMonth()+1).toString().padStart(2,"0")+"-"+n.getDay().toString().padStart(2,"0")),s}}let n=window.PluginBaseClass;class s extends n{static #e=this._unzerPaymentPlugin=null;init(){this._unzerPaymentPlugin=window.PluginManager.getPluginInstances("UnzerPaymentBase")[0]}_handleError(e){this._unzerPaymentPlugin.showError(e)}_setSubmitButtonActive(e){this._unzerPaymentPlugin.setSubmitButtonActive(e)}_getSubmitButton(){return this._unzerPaymentPlugin.getSubmitButton()}}window.PluginBaseClass;class o extends s{static #e=this.options={elementWrapperSelector:".unzer-payment-create-component-container",radioButtonSelector:'*[name="savedPaymentDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedPaymentDevice"]:checked',hasSavedDevices:!1};init(){super.init(),this._registerEvents()}_registerEvents(){if(this.options.hasSavedDevices){let e=this.el.querySelectorAll(this.options.radioButtonSelector);for(let t=0;tthis._onRadioButtonChange(e));document.querySelector(this.options.selectedRadioButtonSelector).dispatchEvent(new Event("change"))}}_onRadioButtonChange(e){let t=e.target;this.el.querySelector(this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewAccountId}}window.PluginBaseClass;class i extends s{static #e=this.options={countryCode:"DE",currency:"EUR",shopName:"Unzer GmbH",amount:"0.0",applePayButtonSelector:".apple-pay-button",checkoutConfirmButtonSelector:"#confirmFormSubmit",applePayMethodSelector:".unzer-payment-apple-pay-v2-method-wrapper",authorizePaymentUrl:"",merchantValidationUrl:"",noApplePayMessage:"",supportedNetworks:["masterCard","visa"]};init(){super.init(),this._hasCapability()?(this._createForm(),this._hideBuyButton()):this._disableApplePay()}_hasCapability(){return window.ApplePaySession&&window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(6)}_disableApplePay(){document.querySelector(this.options.applePayMethodSelector).remove(),document.querySelectorAll("[data-unzer-payment-apple-pay-v2]").forEach(e=>e.remove()),this._handleError({message:this.options.noApplePayMessage}),this._unzerPaymentPlugin.setSubmitButtonActive(!1)}_createForm(){Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&(e.setApplePayData(this._getApplePayPaymentRequest()),document.getElementById("unzer-checkout-component").onPaymentSubmit=t=>{t.submitResponse&&t.submitResponse.success&&this._unzerPaymentPlugin._validateForm()&&(e.style.display="none",this._unzerPaymentPlugin.submitting=!0,this._unzerPaymentPlugin.submitTypeId(t.submitResponse.data.id))})})}_getApplePayPaymentRequest(){return{countryCode:this.options.countryCode,currencyCode:this.options.currency,supportedNetworks:this.options.supportedNetworks,merchantCapabilities:this.options.merchantCapabilities,total:{label:this.options.shopName,amount:this.options.amount}}}_hideBuyButton(){document.querySelector(this.options.checkoutConfirmButtonSelector).style.display="none"}}class a extends s{static #e=this.options={countryIso:"",paylaterInstallmentAmount:"",paylaterInstallmentCurrency:""};init(){super.init(),Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&e.setBasketData({amount:this.options.paylaterInstallmentAmount,currencyType:this.options.paylaterInstallmentCurrency,country:this.options.countryIso})})}}class r extends s{static #e=this.options={googlePayButtonId:"unzer-google-pay-button",merchantName:"",merchantId:"",gatewayMerchantId:"",currency:"EUR",amount:"0.0",countryCode:"DE",allowedCardNetworks:[],allowCreditCards:!0,allowPrepaidCards:!0,buttonColor:"default",buttonSizeMode:"fill"};static #t=this.submitting=!1;init(){super.init(),this._registerGooglePayButton(),this._hideBuyButton()}_registerGooglePayButton(){Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&(e.setGooglePayData({gatewayMerchantId:this.options.gatewayMerchantId,merchantInfo:{merchantName:this.options.merchantName,merchantId:this.options.merchantId},transactionInfo:{currencyCode:this.options.currency,countryCode:this.options.countryCode,totalPriceStatus:"ESTIMATED",totalPrice:String(this.options.amount)},buttonOptions:{buttonColor:this.options.buttonColor,buttonSizeMode:this.options.buttonSizeMode},allowedCardNetworks:this.options.allowedCardNetworks,allowCreditCards:this.options.allowCreditCards,allowPrepaidCards:this.options.allowPrepaidCards}),document.getElementById("unzer-checkout-component").onPaymentSubmit=t=>{t.submitResponse&&t.submitResponse.success?!this._unzerPaymentPlugin._validateForm()||(e.style.display="none",this._unzerPaymentPlugin.submitting=!0,this._unzerPaymentPlugin.submitTypeId(t.submitResponse.data.id)):console.log("ERROR",t)})})}_hideBuyButton(){this._getSubmitButton().style.display="none"}}let l=window.PluginBaseClass;class u extends l{static #e=this.options={googlePay:{},applePay:{}};init(){this.includeJs(),this.registerActions()}includeJs(){if(!document.querySelector('script[src*="static-v2.unzer.com/v2/ui-components/index.js"]')){let e=document.createElement("script");e.type="module",e.src="https://static-v2.unzer.com/v2/ui-components/index.js",document.head.appendChild(e)}}registerActions(){Promise.all([customElements.whenDefined("unzer-payment"),customElements.whenDefined("unzer-google-pay"),customElements.whenDefined("unzer-paypal-express"),customElements.whenDefined("unzer-apple-pay")]).then(()=>{let e=this.el.querySelector(".unzer-express-payment"),t=this.el.querySelector(".unzer-paypal-express"),n=this.el.querySelector(".unzer-google-pay"),s=this.el.querySelector(".unzer-apple-pay");e&&(t&&this.registerPaypalExpress(t,e),n&&this.registerGooglePay(n,e),s&&this.registerApplePay(s,e))})}registerPaypalExpress(e,t){e.id="unzer-paypal-button-"+Math.floor(1e4*Math.random()),e.addEventListener("click",async e=>{e.stopPropagation();let n=await t.submit();n.submitResponse&&n.submitResponse.success&&fetch("/unzer/paypal-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:n.submitResponse.data.id})}).then(e=>e.json()).then(e=>{location.href=e.redirectUrl})})}registerGooglePay(e,t){t.setGooglePayData({gatewayMerchantId:this.options.googlePay.gatewayMerchantId,merchantInfo:{merchantName:this.options.googlePay.merchantName,merchantId:this.options.googlePay.merchantId},transactionInfo:{currencyCode:this.options.googlePay.currency,countryCode:this.options.googlePay.countryCode,totalPriceStatus:"ESTIMATED",checkoutOption:"DEFAULT",totalPrice:String(this.options.googlePay.amount)},buttonOptions:{buttonColor:this.options.googlePay.buttonColor,buttonSizeMode:this.options.googlePay.buttonSizeMode},allowedCardNetworks:this.options.googlePay.allowedCardNetworks,allowCreditCards:this.options.googlePay.allowCreditCards,allowPrepaidCards:this.options.googlePay.allowPrepaidCards,billingAddressParameters:{format:"MIN"},billingAddressRequired:!0,emailRequired:!0,onPaymentDataChangedCallback:()=>({}),shippingOptionParameters:{},onPaymentAuthorizedCallback:async(e,n,s)=>{console.log("paymentData:",e);let o=await t.submit(),i=o.submitResponse.data.id;console.log(o,"--- success paymentTypeId",i),console.log("submit response: ",o),fetch("/unzer/google-pay-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:i,paymentData:e})}).then(e=>e.json()).then(e=>{console.log(JSON.stringify(e)),location.href=e.redirectUrl})},shippingAddressRequired:!0,shippingOptionRequired:!1})}registerApplePay(e,t){let n={countryCode:this.options.applePay.countryCode,currencyCode:this.options.applePay.currency,supportedNetworks:this.options.applePay.supportedNetworks,merchantCapabilities:this.options.applePay.merchantCapabilities,total:{label:this.options.applePay.shopName,amount:String(this.options.applePay.amount)},requiredShippingContactFields:["postalAddress","name","email","phone"],requiredBillingContactFields:["postalAddress","name","email","phone"],onPaymentAuthorizedCallback:async(e,n,s,o)=>{console.log("paymentData:",e);let i=o.payment.shippingContact,a=o.payment.billingContact;console.log(i),console.log(a);let r=await t.submit();r.submitResponse.success?n():s();let l=r.submitResponse.data.id;console.log(r,"--- success paymentTypeId",l),console.log("submit response: ",r),fetch("/unzer/applepay-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:l,paymentData:e,shippingContact:i,billingContact:a})}).then(e=>e.json()).then(e=>{console.log(JSON.stringify(e)),location.href=e.redirectUrl})}};n.initApplePaySession=e=>{},t?.setApplePayData(n)}}window.PluginManager.register("UnzerPaymentBase",t,"[data-unzer-payment-base]"),window.PluginManager.register("UnzerPaymentCreditCard",class extends o{},"[data-unzer-payment-credit-card]"),window.PluginManager.register("UnzerPaymentPayPal",class extends o{},"[data-unzer-payment-paypal]"),window.PluginManager.register("UnzerPaymentSepaDirectDebit",class extends o{},"[data-unzer-payment-sepa-direct-debit]"),window.PluginManager.register("UnzerPaymentApplePayV2",i,"[data-unzer-payment-apple-pay-v2]"),window.PluginManager.register("UnzerPaymentPaylaterInvoice",class extends s{},"[data-unzer-payment-paylater-invoice]"),window.PluginManager.register("UnzerPaymentPaylaterInstallment",a,"[data-unzer-payment-paylater-installment]"),window.PluginManager.register("UnzerPaymentPaylaterDirectDebitSecured",class extends s{},"[data-unzer-payment-paylater-direct-debit-secured]"),window.PluginManager.register("UnzerPaymentGooglePay",r,"[data-unzer-payment-google-pay]"),window.PluginManager.register("UnzerPaymentExpressButtons",u,"[data-unzer-payment-express-buttons]")})(); \ No newline at end of file +${e.message}`:s.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0),this.submitting=!1}renderErrorToElement(e,t){let n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),s=document.querySelectorAll(this.options.errorContentSelector)[0];n.hidden=!1,s.innerText=e.message,t.appendChild(n)}async _onSubmitButtonClick(e){if(!0===this.submitting)return;if(this.submitting=!0,e.preventDefault(),!this._validateForm()){this.submitting=!1,this.setSubmitButtonActive(!0);return}this.setSubmitButtonActive(!1);let t=document.querySelector(this.options.savedDeviceSelectedRadioButtonSelector);if(t&&t.id!==this.options.savedDeviceRadioButtonNewAccountId)this.submitTypeId(t.value,null);else{let e=document.getElementById("unzer-payment-component");if(e)try{let t=await e.submit();t.submitResponse?!0===t.submitResponse.success?(console.log("submit response: ",t.submitResponse),this.submitTypeId(t.submitResponse.data.id,t.threatMetrixId||null)):this.showError({message:"GENERAL ERROR"}):this.showError({message:"EXCEPTIONAL ERROR"})}catch(t){e.scrollIntoView({block:"end",behavior:"smooth"}),this.submitting=!1,this.setSubmitButtonActive(!0)}else this.setSubmitButtonActive(!0),this.submitButton.click(),this.setSubmitButtonActive(!1)}}_validateForm(){let e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(let n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,s.labels[0].innerText)},!0),e=!1):s.classList.remove("is-invalid")}return e}_clearErrorMessage(){let e=document.getElementsByClassName(this.options.errorWrapperClass).item(0),t=document.querySelectorAll(this.options.errorContentSelector)[0];e.hidden=!0,t.innerText=""}getB2bCustomerObject(e){let t=`${e.firstName} ${e.lastName}`,n=e.birthday?new Date(e.birthday):null,s={firstname:e.firstName,lastname:e.lastName,email:e.email,company:e.activeBillingAddress.company,salutation:e.salutation.salutationKey,billingAddress:{name:t,street:e.activeBillingAddress.street,zip:e.activeBillingAddress.zipcode,city:e.activeBillingAddress.city,country:e.activeBillingAddress.country.iso},shippingAddress:{name:t,street:e.activeShippingAddress.street,zip:e.activeShippingAddress.zipcode,city:e.activeShippingAddress.city,country:e.activeShippingAddress.country.iso}};return n&&(s.birthDate=n.getFullYear()+"-"+(n.getMonth()+1).toString().padStart(2,"0")+"-"+n.getDay().toString().padStart(2,"0")),s}}let n=window.PluginBaseClass;class s extends n{static #e=this._unzerPaymentPlugin=null;init(){this._unzerPaymentPlugin=window.PluginManager.getPluginInstances("UnzerPaymentBase")[0]}_handleError(e){this._unzerPaymentPlugin.showError(e)}_setSubmitButtonActive(e){this._unzerPaymentPlugin.setSubmitButtonActive(e)}_getSubmitButton(){return this._unzerPaymentPlugin.getSubmitButton()}}window.PluginBaseClass;class o extends s{static #e=this.options={elementWrapperSelector:".unzer-payment-create-component-container",radioButtonSelector:'*[name="savedPaymentDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedPaymentDevice"]:checked',hasSavedDevices:!1};init(){super.init(),this._registerEvents()}_registerEvents(){if(this.options.hasSavedDevices){let e=this.el.querySelectorAll(this.options.radioButtonSelector);for(let t=0;tthis._onRadioButtonChange(e));document.querySelector(this.options.selectedRadioButtonSelector).dispatchEvent(new Event("change"))}}_onRadioButtonChange(e){let t=e.target;this.el.querySelector(this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewAccountId}}window.PluginBaseClass;class i extends s{static #e=this.options={countryCode:"DE",currency:"EUR",shopName:"Unzer GmbH",amount:"0.0",applePayButtonSelector:".apple-pay-button",checkoutConfirmButtonSelector:"#confirmFormSubmit",applePayMethodSelector:".unzer-payment-apple-pay-v2-method-wrapper",authorizePaymentUrl:"",merchantValidationUrl:"",noApplePayMessage:"",supportedNetworks:["masterCard","visa"]};init(){super.init(),this._createForm(),this._hideBuyButton()}_disableApplePay(){document.querySelector(this.options.applePayMethodSelector).remove(),document.querySelectorAll("[data-unzer-payment-apple-pay-v2]").forEach(e=>e.remove()),this._handleError({message:this.options.noApplePayMessage}),this._unzerPaymentPlugin.setSubmitButtonActive(!1)}_createForm(){Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&(e.setApplePayData(this._getApplePayPaymentRequest()),document.getElementById("unzer-checkout-component").onPaymentSubmit=t=>{t.submitResponse&&t.submitResponse.success&&this._unzerPaymentPlugin._validateForm()&&(e.style.display="none",this._unzerPaymentPlugin.submitting=!0,this._unzerPaymentPlugin.submitTypeId(t.submitResponse.data.id))})})}_getApplePayPaymentRequest(){return{countryCode:this.options.countryCode,currencyCode:this.options.currency,supportedNetworks:this.options.supportedNetworks,merchantCapabilities:this.options.merchantCapabilities,total:{label:this.options.shopName,amount:this.options.amount}}}_hideBuyButton(){document.querySelector(this.options.checkoutConfirmButtonSelector).style.display="none"}}class a extends s{static #e=this.options={countryIso:"",paylaterInstallmentAmount:"",paylaterInstallmentCurrency:""};init(){super.init(),Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&e.setBasketData({amount:this.options.paylaterInstallmentAmount,currencyType:this.options.paylaterInstallmentCurrency,country:this.options.countryIso})})}}class r extends s{static #e=this.options={googlePayButtonId:"unzer-google-pay-button",merchantName:"",merchantId:"",gatewayMerchantId:"",currency:"EUR",amount:"0.0",countryCode:"DE",allowedCardNetworks:[],allowCreditCards:!0,allowPrepaidCards:!0,buttonColor:"default",buttonSizeMode:"fill"};static #t=this.submitting=!1;init(){super.init(),this._registerGooglePayButton(),this._hideBuyButton()}_registerGooglePayButton(){Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{let e=document.getElementById("unzer-payment-component");e&&(e.setGooglePayData({gatewayMerchantId:this.options.gatewayMerchantId,merchantInfo:{merchantName:this.options.merchantName,merchantId:this.options.merchantId},transactionInfo:{currencyCode:this.options.currency,countryCode:this.options.countryCode,totalPriceStatus:"ESTIMATED",totalPrice:String(this.options.amount)},buttonOptions:{buttonColor:this.options.buttonColor,buttonSizeMode:this.options.buttonSizeMode},allowedCardNetworks:this.options.allowedCardNetworks,allowCreditCards:this.options.allowCreditCards,allowPrepaidCards:this.options.allowPrepaidCards}),document.getElementById("unzer-checkout-component").onPaymentSubmit=t=>{t.submitResponse&&t.submitResponse.success?!this._unzerPaymentPlugin._validateForm()||(e.style.display="none",this._unzerPaymentPlugin.submitting=!0,this._unzerPaymentPlugin.submitTypeId(t.submitResponse.data.id)):console.log("ERROR",t)})})}_hideBuyButton(){this._getSubmitButton().style.display="none"}}let l=window.PluginBaseClass;class u extends l{static #e=this.options={googlePay:{},applePay:{}};init(){this.includeJs(),this.registerActions()}includeJs(){if(!document.querySelector('script[src*="static-v2.unzer.com/v2/ui-components/index.js"]')){let e=document.createElement("script");e.type="module",e.src="https://static-v2.unzer.com/v2/ui-components/index.js",document.head.appendChild(e)}}registerActions(){Promise.all([customElements.whenDefined("unzer-payment"),customElements.whenDefined("unzer-google-pay"),customElements.whenDefined("unzer-paypal-express"),customElements.whenDefined("unzer-apple-pay")]).then(()=>{let e=this.el.querySelector(".unzer-express-payment"),t=this.el.querySelector(".unzer-paypal-express"),n=this.el.querySelector(".unzer-google-pay"),s=this.el.querySelector(".unzer-apple-pay");e&&(t&&this.registerPaypalExpress(t,e),n&&this.registerGooglePay(n,e),s&&this.registerApplePay(s,e))})}registerPaypalExpress(e,t){e.id="unzer-paypal-button-"+Math.floor(1e4*Math.random()),e.addEventListener("click",async e=>{e.stopPropagation();let n=await t.submit();n.submitResponse&&n.submitResponse.success&&fetch("/unzer/paypal-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:n.submitResponse.data.id})}).then(e=>e.json()).then(e=>{location.href=e.redirectUrl})})}registerGooglePay(e,t){t.setGooglePayData({gatewayMerchantId:this.options.googlePay.gatewayMerchantId,merchantInfo:{merchantName:this.options.googlePay.merchantName,merchantId:this.options.googlePay.merchantId},transactionInfo:{currencyCode:this.options.googlePay.currency,countryCode:this.options.googlePay.countryCode,totalPriceStatus:"ESTIMATED",checkoutOption:"DEFAULT",totalPrice:String(this.options.googlePay.amount)},buttonOptions:{buttonColor:this.options.googlePay.buttonColor,buttonSizeMode:this.options.googlePay.buttonSizeMode},allowedCardNetworks:this.options.googlePay.allowedCardNetworks,allowCreditCards:this.options.googlePay.allowCreditCards,allowPrepaidCards:this.options.googlePay.allowPrepaidCards,billingAddressParameters:{format:"MIN"},billingAddressRequired:!0,emailRequired:!0,onPaymentDataChangedCallback:()=>({}),shippingOptionParameters:{},onPaymentAuthorizedCallback:async(e,n,s)=>{console.log("paymentData:",e);let o=await t.submit(),i=o.submitResponse.data.id;console.log(o,"--- success paymentTypeId",i),console.log("submit response: ",o),fetch("/unzer/google-pay-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:i,paymentData:e})}).then(e=>e.json()).then(e=>{console.log(JSON.stringify(e)),location.href=e.redirectUrl})},shippingAddressRequired:!0,shippingOptionRequired:!1})}registerApplePay(e,t){let n={countryCode:this.options.applePay.countryCode,currencyCode:this.options.applePay.currency,supportedNetworks:this.options.applePay.supportedNetworks,merchantCapabilities:this.options.applePay.merchantCapabilities,total:{label:this.options.applePay.shopName,amount:String(this.options.applePay.amount)},requiredShippingContactFields:["postalAddress","name","email","phone"],requiredBillingContactFields:["postalAddress","name","email","phone"],onPaymentAuthorizedCallback:async(e,n,s,o)=>{console.log("paymentData:",e);let i=o.payment.shippingContact,a=o.payment.billingContact;console.log(i),console.log(a);let r=await t.submit();r.submitResponse.success?n():s();let l=r.submitResponse.data.id;console.log(r,"--- success paymentTypeId",l),console.log("submit response: ",r),fetch("/unzer/applepay-express",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentTypeId:l,paymentData:e,shippingContact:i,billingContact:a})}).then(e=>e.json()).then(e=>{console.log(JSON.stringify(e)),location.href=e.redirectUrl})}};n.initApplePaySession=e=>{},t?.setApplePayData(n)}}window.PluginManager.register("UnzerPaymentBase",t,"[data-unzer-payment-base]"),window.PluginManager.register("UnzerPaymentCreditCard",class extends o{},"[data-unzer-payment-credit-card]"),window.PluginManager.register("UnzerPaymentPayPal",class extends o{},"[data-unzer-payment-paypal]"),window.PluginManager.register("UnzerPaymentSepaDirectDebit",class extends o{},"[data-unzer-payment-sepa-direct-debit]"),window.PluginManager.register("UnzerPaymentApplePayV2",i,"[data-unzer-payment-apple-pay-v2]"),window.PluginManager.register("UnzerPaymentPaylaterInvoice",class extends s{},"[data-unzer-payment-paylater-invoice]"),window.PluginManager.register("UnzerPaymentPaylaterInstallment",a,"[data-unzer-payment-paylater-installment]"),window.PluginManager.register("UnzerPaymentPaylaterDirectDebitSecured",class extends s{},"[data-unzer-payment-paylater-direct-debit-secured]"),window.PluginManager.register("UnzerPaymentGooglePay",r,"[data-unzer-payment-google-pay]"),window.PluginManager.register("UnzerPaymentExpressButtons",u,"[data-unzer-payment-express-buttons]")})(); \ No newline at end of file diff --git a/src/Resources/app/storefront/src/unzer/unzer-payment.apple-pay-v2.plugin.js b/src/Resources/app/storefront/src/unzer/unzer-payment.apple-pay-v2.plugin.js index 24e85ce8..892ae38e 100755 --- a/src/Resources/app/storefront/src/unzer/unzer-payment.apple-pay-v2.plugin.js +++ b/src/Resources/app/storefront/src/unzer/unzer-payment.apple-pay-v2.plugin.js @@ -17,21 +17,8 @@ export default class UnzerPaymentApplePayPlugin extends UnzerPaymentBaseParent { init() { super.init(); - if (this._hasCapability()) { - this._createForm(); - // this._registerEvents(); - this._hideBuyButton(); - } else { - this._disableApplePay(); - } - } - - _hasCapability() { - return ( - window.ApplePaySession && - window.ApplePaySession.canMakePayments() && - window.ApplePaySession.supportsVersion(6) - ); + this._createForm(); + this._hideBuyButton(); } _disableApplePay() { @@ -89,6 +76,7 @@ export default class UnzerPaymentApplePayPlugin extends UnzerPaymentBaseParent { }, }; } + /** * @private */ diff --git a/src/Resources/public/administration/.vite/entrypoints.json b/src/Resources/public/administration/.vite/entrypoints.json index dda77da5..7d0ca985 100644 --- a/src/Resources/public/administration/.vite/entrypoints.json +++ b/src/Resources/public/administration/.vite/entrypoints.json @@ -7,7 +7,7 @@ ], "dynamic": [], "js": [ - "/bundles/unzerpayment6/administration/assets/unzer-payment6-Bl5RLTQD.js" + "/bundles/unzerpayment6/administration/assets/unzer-payment6-BQCfNp1T.js" ], "legacy": false, "preload": [] diff --git a/src/Resources/public/administration/.vite/manifest.json b/src/Resources/public/administration/.vite/manifest.json index 36f23add..663cf133 100644 --- a/src/Resources/public/administration/.vite/manifest.json +++ b/src/Resources/public/administration/.vite/manifest.json @@ -1,6 +1,6 @@ { "main.js": { - "file": "assets/unzer-payment6-Bl5RLTQD.js", + "file": "assets/unzer-payment6-BQCfNp1T.js", "name": "unzer-payment6", "src": "main.js", "isEntry": true, diff --git a/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js b/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js new file mode 100644 index 00000000..9f3da250 --- /dev/null +++ b/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js @@ -0,0 +1,2 @@ +const w=`{% block unzer_payment_actions %} {% block unzer_payment_actions_amount_field %}
{% endblock %}
{% block unzer_payment_actions_charge_button %} {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }} {% endblock %} {% block unzer_payment_actions_cancel_button %} {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }} {% endblock %} {% block unzer_payment_actions_reason_field %} {% endblock %} {% block unzer_payment_actions_refund_button %} {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }} {% endblock %} {% block unzer_payment_actions_button_container_inner %}{% endblock %}
{{ $tc('unzer-payment.paymentDetails.actions.noActions') }}
{% endblock %}`,{Component:z,Mixin:C}=Shopware,d={CANCEL:"CANCEL",RETURN:"RETURN",CREDIT:"CREDIT"};z.register("unzer-payment-actions",{template:w,inject:["UnzerPaymentService"],mixins:[C.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return this.transactionResource.type==="authorization"&&this.transactionResource.state!=="error"},isRefundPossible:function(){return this.transactionResource.type==="charge"&&this.transactionResource.state!=="error"&&!(this.transactionResource.isFirst&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a"&&this.paymentResource.state.name!=="pending"&&this.paymentResource.state.name!=="partly")},maxTransactionAmount(){let e=0,t=this.isRefundPossible&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a";return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),this.transactionResource.isFirst&&t&&(e=this.paymentResource.amount.remaining),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:d.CANCEL},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:d.CREDIT},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:d.RETURN}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),t==="paylater-invoice-document-required"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});const S=`{% block unzer_payment_detail %}
{% block unzer_payment_detail_container %} {% block unzer_payment_detail_container_left %}
{{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}
{{ formatCurrency(remainingAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}
{{ formatCurrency(cancelledAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}
{{ formatCurrency(chargedAmount) }}
{% block unzer_payment_detail_container_left_inner %}{% endblock %}
{% endblock %} {% block unzer_payment_detail_container_right %}
{{ $tc('unzer-payment.paymentDetails.detail.shortId') }}
{{ paymentResource.shortId }}
{{ $tc('unzer-payment.paymentDetails.detail.id') }}
{{ paymentResource.id }}
{{ $tc('unzer-payment.paymentDetails.detail.state') }}
{{ paymentResource.state.name }}
{{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}
{{ paymentResource.descriptor }}
{% block unzer_payment_detail_container_right_inner %}{% endblock %}
{% endblock %}
{% endblock %}
{% block unzer_payment_detail_footer %} {% endblock %}
{% endblock %}`,{Component:v,Mixin:_,Module:$}=Shopware;v.register("unzer-payment-detail",{template:S,inject:["UnzerPaymentService"],mixins:[_.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=$.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},remainingAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision)},cancelledAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision)},chargedAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision)}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderTransactionId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):t==="invoice-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):t==="documentdate-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):t==="payment-missing-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});const D=`{% block unzer_payment_history %} {% block unzer_payment_history_container %} {% endblock %} {% endblock %}`,{Component:P,Module:R,Mixin:M}=Shopware;P.register("unzer-payment-history",{template:D,inject:["repositoryFactory","UnzerPaymentService"],mixins:[M.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=R.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return!this.paymentResource||!this.paymentResource.amount||!this.paymentResource.amount.decimalPrecision?this.unzerMaxDigits:Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision)},data:function(){const e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{const n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderTransactionId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1,this.reload()})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const E=`{% block unzer_payment_metadata %} {% endblock %}`,{Component:A}=Shopware;A.register("unzer-payment-metadata",{template:E,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});const I=`{% block unzer_payment_basket %} {% endblock %}`,{Component:T}=Shopware;T.register("unzer-payment-basket",{template:I,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(parseFloat(t.amountDiscount.toFixed(2))*-1),a=this.formatCurrency(parseFloat((t.amountDiscount-t.amountVat).toFixed(2))*-1)),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const B=`{% block sw_order_create_details_footer_payment_method %} {% endblock %}`,{Criteria:c}=Shopware.Data,x=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:B,computed:{paymentMethodCriteria(){const e=new c;return this.salesChannelId&&e.addFilter(c.equals("salesChannels.id",this.salesChannelId)),e.addFilter(c.not("AND",[c.equalsAny("id",x)])),e}}});const K=`{% block sw_order_detail_content_tabs_general %} {% parent() %} {% block unzer_payment_payment_tab %} {{ $tc('unzer-payment.tabTitle') }} {% endblock %} {% endblock %}`,{Component:L,Context:F}=Shopware,{Criteria:W}=Shopware.Data;L.override("sw-order-detail",{template:K,data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}const e=this.repositoryFactory.create("order"),t=new W(1,1);t.addAssociation("transactions"),e.get(this.orderId,F.api,t).then(n=>{n.transactions.forEach(a=>{a.customFields&&(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction||(this.isUnzerPayment=!0))})})},immediate:!0}}});const U='{% block sw_order_list_grid_columns %} {% parent() %} {% block unzer_payment_column_transaction %} {% endblock %} {% endblock %}';Shopware.Component.override("sw-order-list",{template:U,methods:{getOrderColumns(){const e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});const N='{% block unzer_payment_payment_details %}
{% block unzer_payment_payment_details_content %} {% endblock %}
{% endblock %}',{Component:G,Context:O,Mixin:q}=Shopware,{Criteria:u}=Shopware.Data;G.register("unzer-payment-tab",{template:N,inject:["UnzerPaymentService","repositoryFactory"],mixins:[q.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0,order:null}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id,t=new u;t.getAssociation("transactions").addSorting(u.sort("createdAt","DESC")),this.orderRepository.get(e,O.api,t).then(n=>{this.order=n,n.transactions&&n.transactions.forEach((a,s)=>{if(!a.customFields){this.loadedResources++;return}if(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(a.id).then(i=>{this.paymentResources[s]=i,this.paymentResources[s].orderTransactionId=a.id,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){const t="sw-order-detail",n=e.$parent;if(n===void 0)return null;if(n.$options.name!==t)return this.findOrderDetailComponentAndReInit(n);if(n.isOrderEditing)return null;n.createdComponent()}}});const{Module:H}=Shopware;H.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,routeMiddleware(e,t){t.name==="sw.order.detail"&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}});const j=`{% block unzer_payment_payment_register_webhook %}
{% block unzer_payment_payment_register_webhook_button %} {{ $tc('unzer-payment-settings.form.webhookButton') }} {% endblock %} {% block unzer_payment_payment_register_webhook_modal %} {% endblock %}
{% endblock %}`,l=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:j,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;this.isDataLoading=!0;let a=new l(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(s=>{n.salesChannels=s,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,t!==void 0&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1;const n=this.getSalesChannelById(e);return this.webhooks.length?(n.domains.forEach(a=>{this.webhooks.forEach(s=>{if(s.url.indexOf(a.url)>-1)return t=!0,!0})}),t):!1},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new l;return t.addFilter(l.prefix("url","https://")),t.addFilter(l.equals("salesChannelId",e)),t}}});const V=` {{ $tc('unzer-payment-settings.webhook.empty') }}
{{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}
`,{Component:Z,Mixin:J,Context:ye}=Shopware;Z.register("unzer-webhooks-modal",{template:V,mixins:[J.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){const t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),n!==void 0&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}});const{Component:Q}=Shopware,{Criteria:m}=Shopware.Data;Q.extend("unzer-entity-single-select-delivery-status","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){const e=new m(1,100);return e.addFilter(m.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const{Component:Y,Service:X}=Shopware,{Criteria:h,EntityCollection:ge}=Shopware.Data;Y.extend("unzer-entity-multi-select-delivery-status","sw-entity-multi-id-select",{props:{repository:{type:Object,required:!0,default(){return X("repositoryFactory").create("state_machine_state")}},criteria:{type:Object,required:!1,default(){const e=new h(1,100);return e.addFilter(h.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const ee=` `,{Component:te}=Shopware;te.register("unzer-google-pay-gateway-merchant-id",{template:ee,inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:""}},props:{currentSalesChannelId:{type:String,required:!0}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId()}},created(){this.getUnzerGooglePayGatewayMerchantId(),document.addEventListener("unzer-settings-saved",this.getUnzerGooglePayGatewayMerchantId)},methods:{getUnzerGooglePayGatewayMerchantId(){console.log("get",this.currentSalesChannelId),this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}});const ne=`{% block unzer_plugin_icon %} {% endblock %}`,{Component:ae}=Shopware;ae.register("unzer-payment-plugin-icon",{template:ne,computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});const se='{% block unzer_settings_subheading %}
{{ label }}
{% endblock %}',{Component:ie}=Shopware;ie.register("unzer-settings-subheading",{template:se,computed:{label(){const e=this.$attrs.name.split("."),t=e[e.length-1];return this.$tc("unzer-payment-settings.subheadings."+t)}}});const{Component:re}=Shopware;re.override("sw-system-config",{watch:{currentSalesChannelId(){this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}}});const oe=`{% block unzer_payment_settings %} {% block unzer_payment_settings_header %} {% endblock %} {% block unzer_payment_settings_actions %} {% endblock %} {% block unzer_payment_settings_content %} {% endblock %} {% endblock %}`,{Component:ce,Mixin:p,Context:le}=Shopware;ce.register("unzer-payment-settings",{template:oe,mixins:[p.getByName("notification"),p.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,isAdditionalKeysExpanded:!1,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return le.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;const t=this.getArrayKeyOfKeyPairSetting(e);let n=e;t!==-1&&(n=this.keyPairSettings[t]);const a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(!t||!t.privateKey||!t.publicKey||e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");e==="sw-plugin-config.messageSaveSuccess"&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),document.dispatchEvent(new CustomEvent("unzer-settings-saved",{}))}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(a=>{a.elements.forEach(s=>{if(s.name===e.name){n=s;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},keyPairSettingGroupTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.main`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){const e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(n=>{e.keyPairSettings.forEach((a,s,i)=>{a.group===n.group&&a.key===n.key&&(i[s]=n)})})})},toggleAdditionalKeys(){this.isAdditionalKeysExpanded=!this.isAdditionalKeysExpanded}}});const f={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Zahlungsverlauf",column:{type:"Typ",amount:"Betrag",date:"Datum"},type:{authorization:"Reservierung",charge:"Einzug",shipment:"Versandmitteilung",refund:"Rückerstattung",cancellation:"Stornierung",default:""}},actions:{reason:{placeholder:"Grund",cancel:"Abgebrochen",credit:"Gutschrift",return:"Rückgabe"},chargeButton:"Einziehen",shipButton:"Versandmitteilung",refundButton:"Rückerstatten",defaultButton:"Erledigt",cancelButton:"Stornieren",noActions:"Keine Aktionen möglich",confirmCancelModal:{text:"Möchten Sie wirklich die Reservierung über den angegebenen Betrag stornieren?",amountLabel:"Betrag:",yesButton:"Ja",noButton:"Nein"}},detail:{cardTitle:"Zahlungsdetails",shortId:"Short-ID",id:"Zahlungs-ID",state:"Status",amountRemaining:"Betrag (Rest)",amountCancelled:"Betrag (Rückerstattet)",amountCharged:"Betrag (Eingezogen)",descriptor:"Verwendungszweck"},metadata:{cardTitle:"Metadaten",column:{key:"Schlüssel",value:"Wert"}},basket:{cardTitle:"Warenkorb",column:{quantity:"Anzahl",title:"Titel",amountGross:"Betrag (brutto)",amountNet:"Betrag (netto)"}},notifications:{genericErrorMessage:"Es ist ein Fehler aufgetreten!",refundSuccessTitle:"Rückerstatten",refundSuccessMessage:"Die Rückerstattung wurde erfolgreich durchgeführt.",refundErrorTitle:"Rückerstatten",chargeSuccessTitle:"Einziehen",chargeSuccessMessage:"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.",chargeErrorTitle:"Einziehen",shipSuccessTitle:"Versandmitteilung",shipSuccessMessage:"Die Versandmitteilung wurde erfolgreich gesendet.",shipErrorTitle:"Versandmitteilung",invoiceNotFoundMessage:"Zu dieser Bestellung wurde keine Rechnung gefunden",couldNotRetrieveMessage:"Die Zahlungsdetails konnten nicht abgerufen werden, bitte prüfen Sie die Logdateien für weitere Informationen.",documentDateMissingError:"Das Datum der Rechnung ist leer.",paymentMissingError:"Die Zahlung konnte nicht gefunden werden",paylaterInvoiceDocumentRequiredErrorMessage:"Bitte erstellen oder hinterlegen Sie zunächst eine Rechnung für die Bestellung.",cancelSuccessTitle:"Stornierung",cancelErrorTitle:"Stornierung",cancelSuccessMessage:"Die Stornierung wurde erfolgreich durchgeführt.",cancelErrorMessage:"Die Stornierung konnte nicht durchgeführt werden."}},"order-list":{transactionId:"Unzer Transaktions ID"},methods:{paylaterInvoice:{main:"Rechnungskauf","b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},paylaterInstallment:{main:"Ratenkauf","b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},paylaterDirectDebitSecured:{main:"Lastschrift","b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Buchungsmodus",paymentSettingsSaveDevices:"Zahlungsmittel speichern",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Händler ID"},form:{message:{success:{title:"Test erfolgreich",message:"Die angegebenen API-Zugangsdaten sind korrekt!"},error:{title:"Test fehlgeschlagen",message:"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},testButton:"API Zugangsdaten testen",webhookButton:"Webhooks registrieren",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys für weitere Zahlungsarten",additionalKeysHelpText:"Wenn die Felder für zusätzliche Schlüsselpaare leer sind, werden standardmäßig die Hauptschlüsselpaare übernommen."},modal:{close:"Schließen",webhook:{title:"Webhooks",httpsInfo:"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.",registered:"Webhook ist bereits registriert",placeholder:"Bitte wählen Sie eine Domain aus",submit:{register:"Webhooks registrieren",clear:"Webhooks auswählen | Ausgewählten Webhook entfernen | Entferne {count} Webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registriert | Webhooks registriert",error:"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},clear:{done:"Webhook entfernt | Webhooks entfernt",error:"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},missing:{fields:"Nicht alle benötigten Felder sind vorhanden",context:"Der Kontext konnte nicht aktualisiert werden",selection:"Es wurden keine Domains selektiert"},notFound:{salesChannelDomain:"Die spezifizierte Domain wurde nicht gefunden"},globalError:{title:"Ein Fehler ist aufgetreten",message:"Bitte kontaktieren sie uns für mehr Informationen"},empty:"Für diesen Private Key sind keine Webhooks registriert. Bitte prüfen Sie ob dieser valide ist und ob Konfigurationen für dedizierte Verkaufskanäle vorgenommen wurden.",show:"Webhooks anzeigen"}},"sw-payment-card":{deprecated:"Veraltet"}},b={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Payment History",column:{type:"Type",amount:"Amount",date:"Date"},type:{authorization:"Authorization",charge:"Charging",shipment:"Shipping notification",refund:"Refund",cancellation:"Cancel",default:""}},actions:{reason:{placeholder:"Reason",cancel:"Cancel",credit:"Credit",return:"Return"},chargeButton:"Charge",shipButton:"Shipping notice",refundButton:"Refund",defaultButton:"Done",cancelButton:"Cancel",noActions:"No actions possible",confirmCancelModal:{text:"Do you really want to cancel the authorization of the selected amount?",amountLabel:"Amount:",yesButton:"Yes",noButton:"No"}},detail:{cardTitle:"Payment Details",shortId:"Short-ID",id:"Payment-ID",state:"State",amountRemaining:"Amount (Remaining)",amountCancelled:"Amount (Cancelled)",amountCharged:"Amount (Charged)",descriptor:"Descriptor"},metadata:{cardTitle:"Metadata",column:{key:"Key",value:"Value"}},basket:{cardTitle:"Basket",column:{quantity:"Quantity",title:"Title",amountGross:"Amount (gross)",amountNet:"Amount (net)"}},notifications:{genericErrorMessage:"An error has occurred!",refundSuccessTitle:"Refund",refundSuccessMessage:"The reimbursement was successfully completed.",refundErrorTitle:"Refund",chargeSuccessTitle:"Charge",chargeSuccessMessage:"The collection of the payment was carried out successfully.",chargeErrorTitle:"Charge",shipSuccessTitle:"Shipping notice",shipSuccessMessage:"The shipping notification was successfully sent.",shipErrorTitle:"Shipping notice",invoiceNotFoundMessage:"No invoice was found for this order.",couldNotRetrieveMessage:"The payment details could not be retrieved, please check the log files for more information.",documentDateMissingError:"Document date for invoice is empty.",paymentMissingError:"Payment could not be found",paylaterInvoiceDocumentRequiredErrorMessage:"Please create or upload an invoice for the order first.",cancelSuccessTitle:"Cancel",cancelErrorTitle:"Cancel",cancelSuccessMessage:"The reversal was successfully completed.",cancelErrorMessage:"The reversal could not be performed."}},"order-list":{transactionId:"Unzer transaction ID"},methods:{paylaterInvoice:{main:"Invoice","b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},paylaterInstallment:{main:"Installment","b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},paylaterDirectDebitSecured:{main:"Direct Debit","b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Booking Modes",paymentSettingsSaveDevices:"Save Payment Details",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Merchant ID"},form:{message:{success:{title:"Test succeeded",message:"The provided credentials are valid!"},error:{title:"Test failed",message:"API Credentials are invalid, please correct them and try again!"}},testButton:"Test API credentials",webhookButton:"Register webhooks",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys for additional payment methods",additionalKeysHelpText:"If additional keypairs fields are empty, main keypairs will be inherited by default."},modal:{close:"Close",webhook:{title:"Webhooks",httpsInfo:"Only one HTTPS domain per sales channel can be registered.",registered:"Webhook is already registered",placeholder:"Please select a domain",submit:{register:"Register webhooks",clear:"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registered | Webhooks registered",error:"Webhook could not be registered | Webhooks could not be registered"},clear:{done:"Webhook cleared | Webhooks cleared",error:"Webhook could not be cleared | Webhooks could not be cleared"},missing:{fields:"Some mandatory fields are missing",context:"The context could not be refreshed",selection:"No domain was selected"},notFound:{salesChannelDomain:"The selected domain could not be found"},globalError:{title:"An error has occurred!",message:"Please contact us for more information"},empty:"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.",show:"Show webhooks"}},"sw-payment-card":{deprecated:"Deprecated"}},{Module:de}=Shopware,ue={type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":f,"en-GB":b},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},extensionEntryRoute:{extensionName:"UnzerPayment6",route:"unzer.payment.configuration.settings"},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}};de.register("unzer-payment-configuration",ue);const{Application:y}=Shopware,r=Shopware.Classes.ApiService;class me extends r{constructor(t,n,a="unzer-payment"){super(t,n,a)}fetchPaymentDetails(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/details`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}chargeTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/charge/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}refundTransaction(t,n,a,s=null){let i=`_action/${this.getApiBasePath()}/transaction/${t}/refund/${n}/${a}`;return s!==null&&(i=`${i}/${s}`),this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(k=>r.handleResponse(k))}cancelTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/cancel/${n}/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}ship(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/ship`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}}y.addServiceProvider("UnzerPaymentService",e=>{const t=y.getContainer("init");return new me(t.httpClient,e.loginService)});const{Application:g}=Shopware,o=Shopware.Classes.ApiService;class he extends o{constructor(t,n,a="unzer-payment"){super(t,n,a)}validateCredentials(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}registerWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}clearWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/get-webhooks`,{privateKey:t},{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getGooglePayGatewayMerchantId(t){return this.httpClient.get(`_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${t||""}`,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}}g.addServiceProvider("UnzerPaymentConfigurationService",e=>{const t=g.getContainer("init");return new he(t.httpClient,e.loginService)});const pe=`{% block sw_payment_card_description %}
{{ $tc('sw-payment-card.deprecated') }}
{% endblock %}`;Shopware.Component.override("sw-payment-card",{template:pe,snippets:{"de-DE":f,"en-GB":b}}); +//# sourceMappingURL=unzer-payment6-BQCfNp1T.js.map diff --git a/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js.map b/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js.map new file mode 100644 index 00000000..c02f9a29 --- /dev/null +++ b/src/Resources/public/administration/assets/unzer-payment6-BQCfNp1T.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unzer-payment6-BQCfNp1T.js","sources":["../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/unzer-payment-actions.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/unzer-payment-detail.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/unzer-payment-history.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/unzer-payment-metadata.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/unzer-payment-basket.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/sw-order-create-details-footer.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/sw-order-detail.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/sw-order-list.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/index.js","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js","../../../app/administration/src/module/unzer-payment/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/register-webhook.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/unzer-webhooks-modal.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-single-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-multi-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/unzer-google-pay-gateway-merchant-id.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/unzer-payment-plugin-icon.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/unzer-settings-subheading.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/index.js","../../../app/administration/src/module/unzer-payment-configuration/extension/sw-system-config/index.js","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/unzer-payment-settings.html.twig","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/index.js","../../../app/administration/src/module/unzer-payment-configuration/index.js","../../../app/administration/src/api/unzer-payment.service.js","../../../app/administration/src/api/unzer-payment-configuration.service.js","../../../app/administration/src/extension/sw-payment-card/sw-payment-card.html.twig","../../../app/administration/src/extension/sw-payment-card/index.js"],"sourcesContent":["{% block unzer_payment_actions %}\n \n {% block unzer_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n
\n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }}\n \n {% endblock %}\n \n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }}\n \n {% endblock %}\n \n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n\n
\n {{ $tc('unzer-payment.paymentDetails.actions.noActions') }}\n
\n{% endblock %}","import template from './unzer-payment-actions.html.twig';\nimport './unzer-payment-actions.scss';\n\nconst { Component, Mixin } = Shopware;\nconst reasonCodes = {\n CANCEL: 'CANCEL',\n RETURN: 'RETURN',\n CREDIT: 'CREDIT',\n};\n\nComponent.register('unzer-payment-actions', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n transactionAmount: 0.0,\n reasonCode: null,\n };\n },\n\n props: {\n transactionResource: {\n type: Object,\n required: true,\n },\n\n paymentResource: {\n type: Object,\n required: true,\n },\n\n decimalPrecision: {\n type: Number,\n required: true,\n default: 4,\n },\n },\n\n computed: {\n isChargePossible: function () {\n return (\n this.transactionResource.type === 'authorization' &&\n this.transactionResource.state !== 'error'\n );\n },\n\n isRefundPossible: function () {\n return (\n this.transactionResource.type === 'charge' &&\n this.transactionResource.state !== 'error' &&\n !(\n this.transactionResource.isFirst &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a' &&\n this.paymentResource.state.name !== 'pending' &&\n this.paymentResource.state.name !== 'partly'\n )\n );\n },\n\n maxTransactionAmount() {\n let amount = 0;\n\n let isAmountForPrepaymentRefund =\n this.isRefundPossible &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a';\n\n if (this.isRefundPossible) {\n amount = this.transactionResource.amount;\n }\n\n if (this.isChargePossible) {\n amount = this.paymentResource.amount.remaining;\n }\n\n if ('remainingAmount' in this.transactionResource) {\n amount = this.transactionResource.remainingAmount;\n }\n\n if (\n this.transactionResource.isFirst &&\n isAmountForPrepaymentRefund\n ) {\n amount = this.paymentResource.amount.remaining;\n }\n\n return amount / 10 ** this.paymentResource.amount.decimalPrecision;\n },\n\n reasonCodeSelection() {\n return [\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.cancel'\n ),\n value: reasonCodes.CANCEL,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.credit'\n ),\n value: reasonCodes.CREDIT,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.return'\n ),\n value: reasonCodes.RETURN,\n },\n ];\n },\n },\n\n created() {\n this.transactionAmount = this.maxTransactionAmount;\n },\n\n methods: {\n charge() {\n this.isLoading = true;\n\n this.UnzerPaymentService.chargeTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n if (message === 'paylater-invoice-document-required') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n refund() {\n this.isLoading = true;\n\n this.UnzerPaymentService.refundTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount,\n this.reasonCode\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n startCancel() {\n this.$emit('cancel', this.transactionAmount);\n },\n },\n});\n","{% block unzer_payment_detail %}\n \n
\n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}\n
\n
\n {{ formatCurrency(remainingAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}\n
\n
\n {{ formatCurrency(cancelledAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}\n
\n
\n {{ formatCurrency(chargedAmount) }}\n
\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n
\n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.shortId') }}\n
\n
{{ paymentResource.shortId }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.id') }}\n
\n
{{ paymentResource.id }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.state') }}\n
\n
\n {{ paymentResource.state.name }}\n
\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}\n
\n
\n {{ paymentResource.descriptor }}\n
\n \n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n
\n {% endblock %}\n \n {% endblock %}\n
\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.shipButton') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-detail.html.twig';\n\nconst { Component, Mixin, Module } = Shopware;\n\nComponent.register('unzer-payment-detail', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n paylaterPaymentMethods: [\n '09588ffee8064f168e909ff31889dd7f', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE\n '12fbfbce271a43a89b3783453b88e9a6', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT\n '6d6adcd4b7bf40499873c294a85f32ed', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED\n ],\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n remainingAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.remaining,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n cancelledAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.cancelled,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n chargedAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.charged,\n this.paymentResource.amount.decimalPrecision\n );\n },\n },\n\n methods: {\n reloadOrderDetail() {\n this.$emit('reloadOrderDetails');\n },\n\n ship() {\n this.isLoading = true;\n\n this.UnzerPaymentService.ship(\n this.paymentResource.orderTransactionId\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n } else if (message === 'invoice-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage'\n );\n } else if (message === 'documentdate-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.documentDateMissingError'\n );\n } else if (message === 'payment-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paymentMissingError'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n formatAmount(cents, decimalPrecision) {\n return (\n cents / 10 ** Math.min(this.unzerMaxDigits, decimalPrecision)\n );\n },\n\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n\n isPaylaterPaymentMethod(paymentMethodId) {\n return this.paylaterPaymentMethods.indexOf(paymentMethodId) >= 0;\n },\n },\n});\n","{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-history.html.twig';\n\nconst { Component, Module, Mixin } = Shopware;\n\nComponent.register('unzer-payment-history', {\n template,\n\n inject: ['repositoryFactory', 'UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n showCancelModal: false,\n isCancelLoading: false,\n cancelAmount: 0,\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n orderTransactionRepository: function () {\n return this.repositoryFactory.create('order_transaction');\n },\n\n decimalPrecision() {\n if (\n !this.paymentResource ||\n !this.paymentResource.amount ||\n !this.paymentResource.amount.decimalPrecision\n ) {\n return this.unzerMaxDigits;\n }\n\n return Math.min(\n this.unzerMaxDigits,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n data: function () {\n const data = [];\n\n Object.values(this.paymentResource.transactions).forEach(\n (transaction) => {\n // const amount = this.$options.filters.currency(\n // this.formatAmount(parseFloat(transaction.amount), this.decimalPrecision),\n // this.paymentResource.currency\n // );\n const amount = this.formatCurrency(\n this.formatAmount(\n parseFloat(transaction.amount),\n this.decimalPrecision\n )\n );\n const date = Shopware.Filter.getByName('date')(\n transaction.date,\n {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }\n );\n\n data.push({\n type: this.transactionTypeRenderer(transaction.type),\n amount: amount,\n date: date,\n resource: transaction,\n });\n }\n );\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'type',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.type'\n ),\n rawData: true,\n },\n {\n property: 'amount',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.amount'\n ),\n rawData: true,\n },\n {\n property: 'date',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.date'\n ),\n rawData: true,\n },\n ];\n },\n },\n\n methods: {\n transactionTypeRenderer: function (value) {\n switch (value) {\n case 'authorization':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.authorization'\n );\n case 'charge':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.charge'\n );\n case 'shipment':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.shipment'\n );\n case 'refund':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.refund'\n );\n case 'cancellation':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.cancellation'\n );\n default:\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.default'\n );\n }\n },\n\n reload: function () {\n this.$emit('reload');\n this.$emit('reloadOrderDetails');\n },\n\n formatAmount(cents, decimalPrecision) {\n return cents / 10 ** decimalPrecision;\n },\n\n openCancelModal(item, cancelAmount) {\n this.showCancelModal = item.resource.id;\n this.cancelAmount = cancelAmount;\n },\n\n closeCancelModal() {\n this.showCancelModal = false;\n this.cancelAmount = 0;\n },\n\n cancel() {\n this.isCancelLoading = true;\n\n this.UnzerPaymentService.cancelTransaction(\n this.paymentResource.orderTransactionId,\n this.paymentResource.id,\n this.cancelAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessMessage'\n ),\n });\n\n this.reload();\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorTitle'\n ),\n message: message,\n });\n\n this.isCancelLoading = false;\n this.reload();\n });\n },\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block unzer_payment_metadata %}\n \n \n \n{% endblock %}","import template from './unzer-payment-metadata.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-metadata', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.metadata.forEach((meta) => {\n data.push({\n key: meta.key,\n value: meta.value,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'key',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.key'\n ),\n rawData: true,\n },\n {\n property: 'value',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.value'\n ),\n rawData: true,\n },\n ];\n },\n },\n});\n","{% block unzer_payment_basket %}\n \n \n \n{% endblock %}","import template from './unzer-payment-basket.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-basket', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.basket.basketItems.forEach((basketItem) => {\n let amountGross = this.formatCurrency(\n parseFloat(basketItem.amountGross.toFixed(2))\n );\n let amountNet = this.formatCurrency(\n parseFloat(basketItem.amountNet.toFixed(2))\n );\n\n if (basketItem.amountDiscount > 0) {\n amountGross = this.formatCurrency(\n parseFloat(basketItem.amountDiscount.toFixed(2)) * -1\n );\n\n amountNet = this.formatCurrency(\n parseFloat(\n (\n basketItem.amountDiscount - basketItem.amountVat\n ).toFixed(2)\n ) * -1\n );\n }\n\n data.push({\n quantity: basketItem.quantity,\n title: basketItem.title,\n amountGross: amountGross,\n amountNet: amountNet,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'quantity',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.quantity'\n ),\n rawData: true,\n },\n {\n property: 'title',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.title'\n ),\n rawData: true,\n },\n {\n property: 'amountGross',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountGross'\n ),\n rawData: true,\n },\n {\n property: 'amountNet',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountNet'\n ),\n rawData: true,\n },\n ];\n },\n },\n methods: {\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}","import template from './sw-order-create-details-footer.html.twig';\n\nconst { Criteria } = Shopware.Data;\nconst unzerPaymentIds = [\n 'bc4c2cbfb5fda0bf549e4807440d0a54', //PAYMENT_ID_ALIPAY\n '4673044aff79424a938d42e9847693c3', //PAYMENT_ID_CREDIT_CARD\n '713c7a332b432dcd4092701eda522a7e', //PAYMENT_ID_DIRECT_DEBIT\n '5123af5ce94a4a286641973e8de7eb60', //PAYMENT_ID_DIRECT_DEBIT_SECURED\n '17830aa7e6a00b99eab27f0e45ac5e0d', //PAYMENT_ID_EPS\n '4ebb99451f36ba01f13d5871a30bce2c', //PAYMENT_ID_FLEXIPAY\n 'd4b90a17af62c1bb2f6c3b1fed339425', //PAYMENT_ID_GIROPAY\n '4b9f8d08b46a83839fd0eb14fe00efe6', //PAYMENT_ID_INSTALLMENT_SECURED\n '08fb8d9a72ab4ca62b811e74f2eca79f', //PAYMENT_ID_INVOICE\n '6cc3b56ce9b0f80bd44039c047282a41', //PAYMENT_ID_INVOICE_SECURED\n '614ad722a03ee96baa2446793143215b', //PAYMENT_ID_IDEAL\n '409fe641d6d62a4416edd6307d758791', //PAYMENT_ID_PAYPAL\n '085b64d0028a8bd447294e03c4eb411a', //PAYMENT_ID_PRE_PAYMENT\n 'cd6f59d572e6c90dff77a48ce16b44db', //PAYMENT_ID_PRZELEWY24\n 'fd96d03535a46d197f5adac17c9f8bac', //PAYMENT_ID_WE_CHAT\n '09588ffee8064f168e909ff31889dd7f', //PAYMENT_ID_PAYLATER_INVOICE\n];\n\nShopware.Component.override('sw-order-create-details-footer', {\n template,\n\n computed: {\n paymentMethodCriteria() {\n /** @var {Criteria} paymentCriteria */\n const criteria = new Criteria();\n\n if (this.salesChannelId) {\n criteria.addFilter(\n Criteria.equals('salesChannels.id', this.salesChannelId)\n );\n }\n\n criteria.addFilter(\n Criteria.not('AND', [Criteria.equalsAny('id', unzerPaymentIds)])\n );\n\n return criteria;\n },\n },\n});\n","{% block sw_order_detail_content_tabs_general %}\n {% parent() %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-detail.html.twig';\n\nconst { Component, Context } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.override('sw-order-detail', {\n template,\n\n data() {\n return {\n isUnzerPayment: false,\n };\n },\n\n computed: {\n showTabs() {\n return true; // TODO remove with PT-10455\n },\n },\n\n watch: {\n orderId: {\n deep: true,\n handler() {\n if (!this.orderId) {\n this.isUnzerPayment = false;\n\n return;\n }\n\n const orderRepository = this.repositoryFactory.create('order');\n const orderCriteria = new Criteria(1, 1);\n orderCriteria.addAssociation('transactions');\n\n orderRepository\n .get(this.orderId, Context.api, orderCriteria)\n .then((order) => {\n order.transactions.forEach((orderTransaction) => {\n if (!orderTransaction.customFields) {\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n return;\n }\n\n this.isUnzerPayment = true;\n });\n });\n },\n immediate: true,\n },\n },\n});\n","{% block sw_order_list_grid_columns %}\n {% parent() %}\n\n {% block unzer_payment_column_transaction %}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-list.html.twig';\n\nShopware.Component.override('sw-order-list', {\n template,\n\n methods: {\n getOrderColumns() {\n const baseColumns = this.$super('getOrderColumns');\n\n baseColumns.splice(1, 0, {\n property: 'unzerPaymentTransactionId',\n label: 'unzer-payment.order-list.transactionId',\n allowResize: true,\n });\n\n return baseColumns;\n },\n },\n});\n","{% block unzer_payment_payment_details %}\n
\n
\n {% block unzer_payment_payment_details_content %}\n \n {% endblock %}\n
\n \n
\n{% endblock %}","import template from './unzer-payment-tab.html.twig';\n\nconst { Component, Context, Mixin } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.register('unzer-payment-tab', {\n template,\n\n inject: ['UnzerPaymentService', 'repositoryFactory'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n paymentResources: [],\n loadedResources: 0,\n isLoading: true,\n order: null,\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n computed: {\n orderRepository() {\n return this.repositoryFactory.create('order');\n },\n },\n\n watch: {\n $route() {\n this.resetDataAttributes();\n this.createdComponent();\n },\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n resetDataAttributes() {\n this.paymentResources = [];\n this.loadedResources = 0;\n this.isLoading = true;\n },\n\n reloadPaymentDetails() {\n this.resetDataAttributes();\n this.loadData();\n },\n\n loadData() {\n const orderId = this.$route.params.id;\n const criteria = new Criteria();\n criteria\n .getAssociation('transactions')\n .addSorting(Criteria.sort('createdAt', 'DESC'));\n\n this.orderRepository\n .get(orderId, Context.api, criteria)\n .then((order) => {\n this.order = order;\n\n if (!order.transactions) {\n return;\n }\n\n order.transactions.forEach((orderTransaction, index) => {\n if (!orderTransaction.customFields) {\n this.loadedResources++;\n\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n this.loadedResources++;\n\n return;\n }\n\n this.UnzerPaymentService.fetchPaymentDetails(\n orderTransaction.id\n )\n .then((response) => {\n this.paymentResources[index] = response;\n this.paymentResources[\n index\n ].orderTransactionId = orderTransaction.id;\n this.loadedResources++;\n\n this.isLoading =\n this.order.transactions.length !==\n this.loadedResources;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage'\n ),\n });\n\n this.isLoading = false;\n });\n });\n });\n },\n\n reloadOrderDetails() {\n //we cannot know, when the webhook is called, but 5 seconds should be enough to wait for most cases\n setTimeout(() => {\n this.findOrderDetailComponentAndReInit();\n }, 5000);\n },\n\n async findOrderDetailComponentAndReInit(base = this) {\n const componentName = 'sw-order-detail';\n const parent = base.$parent;\n\n if (parent === undefined) {\n return null;\n }\n\n if (parent.$options.name !== componentName) {\n return this.findOrderDetailComponentAndReInit(parent);\n }\n\n if (parent.isOrderEditing) {\n return null;\n }\n\n // we reinitialize the orderDetail component, because there is no other way to update it is not updating the order state\n parent.createdComponent();\n },\n },\n});\n","import './component/unzer-payment-actions';\nimport './component/unzer-payment-detail';\nimport './component/unzer-payment-history';\nimport './component/unzer-payment-metadata';\nimport './component/unzer-payment-basket';\nimport './extension/sw-order-create-details-footer';\nimport './extension/sw-order-detail';\nimport './extension/sw-order-list';\nimport './page/unzer-payment-tab';\n\nconst { Module } = Shopware;\n\nModule.register('unzer-payment', {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment.general.title',\n description: 'unzer-payment.general.descriptionTextModule',\n version: '0.0.1',\n targetVersion: '0.0.1',\n maxDigits: 4,\n\n routeMiddleware(next, currentRoute) {\n if (currentRoute.name === 'sw.order.detail') {\n currentRoute.children.push({\n component: 'unzer-payment-tab',\n name: 'unzer-payment.payment.detail',\n path: '/sw/order/detail/:id/unzer-payment',\n isChildren: true,\n meta: {\n parentPath: 'sw.order.index',\n },\n });\n }\n\n next(currentRoute);\n },\n});\n","{% block unzer_payment_payment_register_webhook %}\n
\n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc('unzer-payment-settings.form.webhookButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n \n\n \n \n {% endblock %}\n
\n{% endblock %}","import template from './register-webhook.html.twig';\nimport './style.scss';\n\nconst Criteria = Shopware.Data.Criteria;\n\nShopware.Component.register('unzer-payment-register-webhook', {\n template,\n\n mixins: [Shopware.Mixin.getByName('notification')],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n props: {\n webhooks: {\n type: Array,\n required: true,\n },\n isLoading: {\n type: Boolean,\n required: false,\n },\n selectedSalesChannelId: {\n type: String,\n required: false,\n },\n privateKey: {\n type: String,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n required: false,\n },\n },\n\n computed: {\n salesChannelRepository() {\n return this.repositoryFactory.create('sales_channel');\n },\n },\n\n data() {\n return {\n isModalActive: false,\n isRegistering: false,\n isRegistrationSuccessful: false,\n isDataLoading: false,\n selection: {},\n selectedDomain: null,\n entitySelection: {},\n salesChannels: {},\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n loadData(page, limit) {\n let me = this;\n\n this.isDataLoading = true;\n\n let criteria = new Criteria(page, limit);\n criteria.addAssociation('domains');\n\n this.salesChannelRepository\n .search(criteria, Shopware.Context.api)\n .then((result) => {\n me.salesChannels = result;\n me.isDataLoading = false;\n });\n },\n\n onPageChange(args) {\n this.loadData(args.page, args.limit);\n },\n\n openModal() {\n this.$emit('modal-open');\n this.isModalActive = true;\n },\n\n closeModal() {\n this.isModalActive = false;\n },\n\n registerWebhooks() {\n const me = this;\n this.isRegistrationSuccessful = false;\n this.isRegistering = true;\n\n this.UnzerPaymentConfigurationService.registerWebhooks({\n selection: this.entitySelection,\n })\n .then((response) => {\n me.isRegistrationSuccessful = true;\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n\n this.$emit('webhook-registered', response);\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isRegistering = false;\n });\n },\n\n onRegistrationFinished() {\n this.isRegistrationSuccessful = false;\n this.selection = {};\n },\n\n onSelectItem(domainId, domain) {\n if (!domain) {\n return;\n }\n\n domain['privateKey'] = this.privateKey;\n\n this.entitySelection[domain.salesChannelId] = domain;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((domain) => {\n if (data[domain].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n }\n });\n },\n\n isWebhookRegisteredForSalesChannel(salesChannelId) {\n let result = false;\n\n const salesChannel = this.getSalesChannelById(salesChannelId);\n\n if (!this.webhooks.length) {\n return false;\n }\n\n salesChannel.domains.forEach((domain) => {\n this.webhooks.forEach((webhook) => {\n if (webhook.url.indexOf(domain.url) > -1) {\n result = true;\n return true;\n }\n });\n });\n\n return result;\n },\n\n getSalesChannelById(salesChannelId) {\n let result = null;\n\n this.salesChannels.forEach((salesChannel) => {\n if (salesChannel.id === salesChannelId) {\n result = salesChannel;\n return true;\n }\n });\n\n return result;\n },\n\n getSalesChannelDomainCriteria(salesChannelId) {\n let criteria = new Criteria();\n\n criteria.addFilter(Criteria.prefix('url', 'https://'));\n criteria.addFilter(\n Criteria.equals('salesChannelId', salesChannelId)\n );\n\n return criteria;\n },\n },\n});\n","\n \n {{ $tc('unzer-payment-settings.webhook.empty') }}\n \n
\n \n \n \n {{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n","import template from './unzer-webhooks-modal.html.twig';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-webhooks-modal', {\n template,\n\n mixins: [Mixin.getByName('notification')],\n\n inject: ['UnzerPaymentConfigurationService'],\n\n props: {\n keyPair: {\n type: Array,\n required: true,\n },\n webhooks: {\n type: Array,\n required: true,\n },\n isLoadingWebhooks: {\n type: Boolean,\n },\n },\n\n data() {\n return {\n isClearing: false,\n isClearingSuccessful: false,\n webhookSelection: null,\n webhookSelectionLength: 0,\n };\n },\n\n computed: {\n webhookColumns() {\n return [\n {\n property: 'event',\n dataIndex: 'event',\n label: 'Event',\n },\n {\n property: 'url',\n dataIndex: 'url',\n label: 'URL',\n },\n ];\n },\n },\n\n methods: {\n clearWebhooks(privateKey) {\n const me = this;\n this.isClearingSuccessful = false;\n this.isClearing = true;\n this.isLoading = true;\n\n this.UnzerPaymentConfigurationService.clearWebhooks({\n privateKey: privateKey,\n selection: this.webhookSelection,\n })\n .then((response) => {\n me.isClearingSuccessful = true;\n me.webhookSelection = [];\n me.webhookSelectionLength = 0;\n\n me.$refs.webhookDataGrid.resetSelection();\n\n me.$emit('load-webhooks', privateKey);\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isLoading = false;\n me.isClearing = false;\n });\n },\n\n onClearingFinished() {\n this.isClearingSuccessful = false;\n this.isClearing = false;\n },\n\n onSelectWebhook(selectedItems) {\n this.webhookSelectionLength = Object.keys(selectedItems).length;\n this.webhookSelection = selectedItems;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((url) => {\n if (data[url].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n }\n });\n },\n },\n});\n","const { Component } = Shopware;\nconst { Criteria } = Shopware.Data;\n\n// extend the existing component `sw-entity-single-select` by\n// overwriting the default criteria\nComponent.extend(\n 'unzer-entity-single-select-delivery-status',\n 'sw-entity-single-select',\n {\n props: {\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","const { Component, Service } = Shopware;\nconst { Criteria, EntityCollection } = Shopware.Data;\n\nComponent.extend(\n 'unzer-entity-multi-select-delivery-status',\n 'sw-entity-multi-id-select',\n {\n props: {\n repository: {\n type: Object,\n required: true,\n default() {\n return Service('repositoryFactory').create(\n 'state_machine_state'\n );\n },\n },\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","\n","const { Component } = Shopware;\n\nimport template from './unzer-google-pay-gateway-merchant-id.html.twig';\n\nComponent.register('unzer-google-pay-gateway-merchant-id', {\n template,\n inject: ['UnzerPaymentConfigurationService'],\n data() {\n return {\n readOnlyUnzerGooglePayGatewayMerchantId: '',\n };\n },\n props: {\n currentSalesChannelId: {\n type: String,\n required: true,\n },\n },\n watch: {\n currentSalesChannelId() {\n this.getUnzerGooglePayGatewayMerchantId();\n },\n },\n created() {\n this.getUnzerGooglePayGatewayMerchantId();\n document.addEventListener(\n 'unzer-settings-saved',\n this.getUnzerGooglePayGatewayMerchantId\n );\n },\n methods: {\n getUnzerGooglePayGatewayMerchantId() {\n console.log('get', this.currentSalesChannelId);\n this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(\n this.currentSalesChannelId\n )\n .then((response) => {\n this.readOnlyUnzerGooglePayGatewayMerchantId =\n response.gatewayMerchantId;\n })\n .catch(() => {});\n },\n },\n});\n","{% block unzer_plugin_icon %}\n \n{% endblock %}","import template from './unzer-payment-plugin-icon.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-plugin-icon', {\n template,\n computed: {\n assetFilter() {\n return Shopware.Filter.getByName('asset');\n },\n },\n});\n","{% block unzer_settings_subheading %}\n
{{ label }}
\n{% endblock %}","import template from './unzer-settings-subheading.html.twig';\nimport './style.scss';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-settings-subheading', {\n template,\n computed: {\n label() {\n // get part after last dot\n const parts = this.$attrs.name.split('.');\n const key = parts[parts.length - 1];\n return this.$tc('unzer-payment-settings.subheadings.' + key);\n },\n },\n});\n","const { Component } = Shopware;\n\nComponent.override('sw-system-config', {\n watch: {\n currentSalesChannelId() {\n this.$emit(\n 'sales-channel-changed',\n this.actualConfigData[this.currentSalesChannelId],\n this.currentSalesChannelId\n );\n },\n },\n});\n","{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-settings.html.twig';\nimport './unzer-payment-settings.scss';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-payment-settings', {\n template,\n\n mixins: [\n Mixin.getByName('notification'),\n Mixin.getByName('sw-inline-snippet'),\n ],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n data() {\n return {\n isLoading: true,\n isLoadingWebhooks: true,\n isAdditionalKeysExpanded: false,\n selectedKeyPairForTesting: false,\n isTestSuccessful: false,\n isSaveSuccessful: false,\n config: {},\n webhooks: [],\n loadedWebhooksPrivateKey: false,\n selectedSalesChannelId: null,\n keyPairSettings: [\n {\n key: 'b2b-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2b-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterDirectDebitSecured',\n },\n ],\n openModalKeyPair: null,\n };\n },\n\n metaInfo() {\n return {\n title: 'UnzerPayment',\n };\n },\n\n computed: {\n paymentMethodRepository() {\n return this.repositoryFactory.create('payment_method');\n },\n\n arrowIconName() {\n const match = Context.app.config.version.match(\n /((\\d+)\\.?(\\d+?)\\.?(\\d+)?\\.?(\\d*))-?([A-z]+?\\d+)?/i\n );\n\n if (match[3] >= 5) {\n return 'regular-chevron-right-xs';\n }\n\n return 'small-arrow-medium-right';\n },\n\n defaultKeyPair() {\n return {\n privateKey: this.getConfigValue('privateKey'),\n publicKey: this.getConfigValue('publicKey'),\n };\n },\n },\n\n watch: {\n openModalKeyPair(val) {\n if (val && val.privateKey !== this.loadedWebhooksPrivateKey) {\n this.loadWebhooks(val.privateKey);\n }\n },\n },\n\n methods: {\n getConfigValue(field) {\n if (\n !this.config ||\n !this.$refs.systemConfig ||\n !this.$refs.systemConfig.actualConfigData ||\n !this.$refs.systemConfig.actualConfigData.null\n ) {\n return '';\n }\n\n const defaultConfig = this.$refs.systemConfig.actualConfigData.null;\n\n return (\n this.config[`UnzerPayment6.settings.${field}`] ||\n defaultConfig[`UnzerPayment6.settings.${field}`]\n );\n },\n\n onValidateCredentials(keyPairSetting) {\n this.isTestSuccessful = false;\n this.selectedKeyPairForTesting = keyPairSetting;\n const keyPairIndex =\n this.getArrayKeyOfKeyPairSetting(keyPairSetting);\n let keyPairValues = keyPairSetting;\n if (keyPairIndex !== -1) {\n keyPairValues = this.keyPairSettings[keyPairIndex];\n }\n\n const credentials = {\n publicKey: keyPairValues.publicKey,\n privateKey: keyPairValues.privateKey,\n salesChannel: this.$refs.systemConfig.currentSalesChannelId,\n };\n\n this.UnzerPaymentConfigurationService.validateCredentials(\n credentials\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment-settings.form.message.success.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.success.message'\n ),\n });\n\n this.isTestSuccessful = true;\n this.selectedKeyPairForTesting = false;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.form.message.error.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.error.message'\n ),\n });\n\n this.onTestFinished();\n });\n },\n\n onTestFinished() {\n this.selectedKeyPairForTesting = false;\n this.isTestSuccessful = false;\n },\n\n getArrayKeyOfKeyPairSetting(keyPairSetting) {\n return this.keyPairSettings.findIndex((keyPairSettingItem) => {\n return (\n keyPairSettingItem.key === keyPairSetting.key &&\n keyPairSettingItem.group === keyPairSetting.group\n );\n });\n },\n\n onSave() {\n this.isLoading = true;\n\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n this.config[`UnzerPayment6.settings.${group}`] = [];\n });\n this.keyPairSettings.reduce((config, keyPairSetting) => {\n if (\n !keyPairSetting ||\n !keyPairSetting.privateKey ||\n !keyPairSetting.publicKey\n ) {\n return config;\n }\n\n config[`UnzerPayment6.settings.${keyPairSetting.group}`].push(\n keyPairSetting\n );\n\n return config;\n }, this.config);\n\n this.$refs.systemConfig\n .saveAll()\n .then(() => {\n this.isSaveSuccessful = true;\n\n let messageSaveSuccess = this.$tc(\n 'sw-plugin-config.messageSaveSuccess'\n );\n\n if (\n messageSaveSuccess ===\n 'sw-plugin-config.messageSaveSuccess'\n ) {\n messageSaveSuccess = this.$tc(\n 'sw-extension-store.component.sw-extension-config.messageSaveSuccess'\n );\n }\n\n this.createNotificationSuccess({\n title: this.$tc('global.default.success'),\n message: messageSaveSuccess,\n });\n\n document.dispatchEvent(\n new CustomEvent('unzer-settings-saved', {})\n );\n })\n .catch((err) => {\n this.isSaveSuccessful = false;\n\n this.createNotificationError({\n title: this.$tc('global.default.error'),\n message: err,\n });\n\n this.isLoading = false;\n });\n },\n\n onConfigChange(config) {\n this.config = config;\n this.isLoading = false;\n this.syncKeyPairConfig();\n },\n\n onLoadingChanged(value) {\n this.isLoading = value;\n },\n\n onSalesChannelChanged(config, salesChannelId) {\n if (config) {\n this.onConfigChange(config);\n }\n\n this.selectedSalesChannelId = salesChannelId;\n },\n\n onWebhookRegistered(privateKey) {\n this.loadWebhooks(privateKey);\n },\n\n loadWebhooks(privateKey) {\n this.isLoadingWebhooks = true;\n\n this.UnzerPaymentConfigurationService.getWebhooks(privateKey)\n .then((response) => {\n this.webhooks = response;\n this.webhookSelection = null;\n this.webhookSelectionLength = 0;\n this.loadedWebhooksPrivateKey = privateKey;\n })\n .catch(() => {\n this.webhooks = [];\n this.loadedWebhooksPrivateKey = false;\n })\n .finally(() => {\n this.isLoadingWebhooks = false;\n this.isClearingSuccessful = false;\n });\n },\n\n getBind(element, config) {\n let originalElement;\n\n if (config !== this.config) {\n this.config = config;\n }\n\n this.$refs.systemConfig.config.forEach((configElement) => {\n configElement.elements.forEach((child) => {\n if (child.name === element.name) {\n originalElement = child;\n return;\n }\n });\n });\n\n return originalElement || element;\n },\n\n keyPairSettingTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.${keyPairSetting.key}`\n );\n },\n\n keyPairSettingGroupTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.main`\n );\n },\n\n isShowWebhooksButtonEnabled(keyPairSetting) {\n return (\n keyPairSetting &&\n keyPairSetting.privateKey &&\n keyPairSetting.publicKey\n );\n },\n\n isRegisterWebhooksButtonEnabled(keyPairSetting) {\n return (\n !this.isLoading && keyPairSetting && keyPairSetting.privateKey\n );\n },\n\n syncKeyPairConfig() {\n const me = this;\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n if (!this.config[`UnzerPayment6.settings.${group}`]) {\n return;\n }\n this.config[`UnzerPayment6.settings.${group}`].forEach(\n (configKeyPairSetting) => {\n me.keyPairSettings.forEach(\n (keyPairSetting, index, collection) => {\n if (\n keyPairSetting.group ===\n configKeyPairSetting.group &&\n keyPairSetting.key ===\n configKeyPairSetting.key\n ) {\n collection[index] = configKeyPairSetting;\n }\n }\n );\n }\n );\n });\n },\n\n toggleAdditionalKeys() {\n this.isAdditionalKeysExpanded = !this.isAdditionalKeysExpanded;\n },\n },\n});\n","import './component/register-webhook';\nimport './component/unzer-webhooks-modal';\nimport './component/unzer-entity-single-select-delivery-status';\nimport './component/unzer-entity-multi-select-delivery-status';\nimport './component/unzer-google-pay-gateway-merchant-id';\nimport './component/unzer-payment-plugin-icon';\nimport './component/unzer-settings-subheading';\nimport './extension/sw-system-config';\n\nimport './page/unzer-payment-settings';\n\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nconst { Module } = Shopware;\n\nconst configuration = {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment-settings.module.title',\n description: 'unzer-payment-settings.module.description',\n version: '1.1.0',\n targetVersion: '1.1.0',\n\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n\n routes: {\n settings: {\n component: 'unzer-payment-settings',\n path: 'settings',\n meta: {\n parentPath: 'sw.settings.index',\n },\n },\n },\n\n extensionEntryRoute: {\n extensionName: 'UnzerPayment6',\n route: 'unzer.payment.configuration.settings',\n },\n\n settingsItem: {\n name: 'unzer-payment-configuration',\n to: 'unzer.payment.configuration.settings',\n label: 'unzer-payment-settings.module.title',\n group: 'plugins',\n iconComponent: 'unzer-payment-plugin-icon',\n backgroundEnabled: false,\n },\n};\n\nModule.register('unzer-payment-configuration', configuration);\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n fetchPaymentDetails(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/details`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n chargeTransaction(transaction, payment, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/charge/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n refundTransaction(transaction, charge, amount, reasonCode = null) {\n let apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/refund/${charge}/${amount}`;\n\n if (reasonCode !== null) {\n apiRoute = `${apiRoute}/${reasonCode}`;\n }\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n cancelTransaction(transaction, authorize, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/cancel/${authorize}/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n ship(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/ship`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider('UnzerPaymentService', (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentService(\n initContainer.httpClient,\n container.loginService\n );\n});\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentConfigurationService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n validateCredentials(credentials) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/validate-credentials`,\n credentials,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n registerWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/register-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n clearWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/clear-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getWebhooks(privateKey) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/get-webhooks`,\n { privateKey: privateKey },\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getGooglePayGatewayMerchantId(salesChannelId) {\n return this.httpClient\n .get(\n `_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${salesChannelId || ''}`,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider(\n 'UnzerPaymentConfigurationService',\n (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentConfigurationService(\n initContainer.httpClient,\n container.loginService\n );\n }\n);\n","{% block sw_payment_card_description %}\n
\n \n \n {{ $tc('sw-payment-card.deprecated') }}\n \n
\n
\n \n{% endblock %}","import template from './sw-payment-card.html.twig';\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nShopware.Component.override('sw-payment-card', {\n template,\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n});\n"],"names":["template$f","Component","Mixin","reasonCodes","template","amount","isAmountForPrepaymentRefund","errorResponse","message","template$e","Module","unzerPaymentModule","cents","decimalPrecision","value","paymentMethodId","template$d","data","transaction","date","item","cancelAmount","template$c","meta","template$b","basketItem","amountGross","amountNet","template$a","Criteria","unzerPaymentIds","criteria","template$9","Context","orderRepository","orderCriteria","order","orderTransaction","template$8","baseColumns","template$7","orderId","index","response","base","componentName","parent","next","currentRoute","template$6","page","limit","me","result","args","domainId","domain","domainAmount","salesChannelId","salesChannel","webhook","template$5","privateKey","selectedItems","url","Service","EntityCollection","template$4","template$3","template$2","parts","key","template$1","val","field","defaultConfig","keyPairSetting","keyPairIndex","keyPairValues","credentials","keyPairSettingItem","group","config","messageSaveSuccess","err","element","originalElement","configElement","child","configKeyPairSetting","collection","configuration","deDE","enGB","Application","ApiService","UnzerPaymentService","httpClient","loginService","apiEndpoint","apiRoute","payment","charge","reasonCode","authorize","container","initContainer","UnzerPaymentConfigurationService"],"mappings":"AAAA,MAAeA,EAAA,ijECGT,WAAEC,EAAS,MAAEC,CAAK,EAAK,SACvBC,EAAc,CAChB,OAAQ,SACR,OAAQ,SACR,OAAQ,QACZ,EAEAF,EAAU,SAAS,wBAAyB,CAC5C,SAAIG,EAEA,OAAQ,CAAC,qBAAqB,EAE9B,OAAQ,CAACF,EAAM,UAAU,cAAc,CAAC,EAExC,MAAO,CACH,MAAO,CACH,UAAW,GACX,aAAc,GACd,kBAAmB,EACnB,WAAY,IACf,CACJ,EAED,MAAO,CACH,oBAAqB,CACjB,KAAM,OACN,SAAU,EACb,EAED,gBAAiB,CACb,KAAM,OACN,SAAU,EACb,EAED,iBAAkB,CACd,KAAM,OACN,SAAU,GACV,QAAS,CACZ,CACJ,EAED,SAAU,CACN,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,iBAClC,KAAK,oBAAoB,QAAU,OAE1C,EAED,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,UAClC,KAAK,oBAAoB,QAAU,SACnC,EACI,K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T,QAASC,CACZ,CACL,CAAC"} \ No newline at end of file diff --git a/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js b/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js deleted file mode 100644 index 006d959b..00000000 --- a/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js +++ /dev/null @@ -1,2 +0,0 @@ -const w=`{% block unzer_payment_actions %} {% block unzer_payment_actions_amount_field %}
{% endblock %}
{% block unzer_payment_actions_charge_button %} {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }} {% endblock %} {% block unzer_payment_actions_cancel_button %} {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }} {% endblock %} {% block unzer_payment_actions_reason_field %} {% endblock %} {% block unzer_payment_actions_refund_button %} {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }} {% endblock %} {% block unzer_payment_actions_button_container_inner %}{% endblock %}
{{ $tc('unzer-payment.paymentDetails.actions.noActions') }}
{% endblock %}`,{Component:z,Mixin:C}=Shopware,d={CANCEL:"CANCEL",RETURN:"RETURN",CREDIT:"CREDIT"};z.register("unzer-payment-actions",{template:w,inject:["UnzerPaymentService"],mixins:[C.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return this.transactionResource.type==="authorization"&&this.transactionResource.state!=="error"},isRefundPossible:function(){return this.transactionResource.type==="charge"&&this.transactionResource.state!=="error"&&!(this.transactionResource.isFirst&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a"&&this.paymentResource.state.name!=="pending"&&this.paymentResource.state.name!=="partly")},maxTransactionAmount(){let e=0,t=this.isRefundPossible&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a";return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),this.transactionResource.isFirst&&t&&(e=this.paymentResource.amount.remaining),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:d.CANCEL},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:d.CREDIT},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:d.RETURN}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),t==="paylater-invoice-document-required"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});const S=`{% block unzer_payment_detail %}
{% block unzer_payment_detail_container %} {% block unzer_payment_detail_container_left %}
{{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}
{{ formatCurrency(remainingAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}
{{ formatCurrency(cancelledAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}
{{ formatCurrency(chargedAmount) }}
{% block unzer_payment_detail_container_left_inner %}{% endblock %}
{% endblock %} {% block unzer_payment_detail_container_right %}
{{ $tc('unzer-payment.paymentDetails.detail.shortId') }}
{{ paymentResource.shortId }}
{{ $tc('unzer-payment.paymentDetails.detail.id') }}
{{ paymentResource.id }}
{{ $tc('unzer-payment.paymentDetails.detail.state') }}
{{ paymentResource.state.name }}
{{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}
{{ paymentResource.descriptor }}
{% block unzer_payment_detail_container_right_inner %}{% endblock %}
{% endblock %}
{% endblock %}
{% block unzer_payment_detail_footer %} {% endblock %}
{% endblock %}`,{Component:v,Mixin:_,Module:$}=Shopware;v.register("unzer-payment-detail",{template:S,inject:["UnzerPaymentService"],mixins:[_.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=$.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},remainingAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision)},cancelledAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision)},chargedAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision)}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderTransactionId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):t==="invoice-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):t==="documentdate-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):t==="payment-missing-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});const D=`{% block unzer_payment_history %} {% block unzer_payment_history_container %} {% endblock %} {% endblock %}`,{Component:P,Module:R,Mixin:M}=Shopware;P.register("unzer-payment-history",{template:D,inject:["repositoryFactory","UnzerPaymentService"],mixins:[M.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=R.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return!this.paymentResource||!this.paymentResource.amount||!this.paymentResource.amount.decimalPrecision?this.unzerMaxDigits:Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision)},data:function(){const e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{const n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderTransactionId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1,this.reload()})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const E=`{% block unzer_payment_metadata %} {% endblock %}`,{Component:A}=Shopware;A.register("unzer-payment-metadata",{template:E,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});const I=`{% block unzer_payment_basket %} {% endblock %}`,{Component:T}=Shopware;T.register("unzer-payment-basket",{template:I,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(parseFloat(t.amountDiscount.toFixed(2))*-1),a=this.formatCurrency(parseFloat((t.amountDiscount-t.amountVat).toFixed(2))*-1)),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const B=`{% block sw_order_create_details_footer_payment_method %} {% endblock %}`,{Criteria:c}=Shopware.Data,x=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:B,computed:{paymentMethodCriteria(){const e=new c;return this.salesChannelId&&e.addFilter(c.equals("salesChannels.id",this.salesChannelId)),e.addFilter(c.not("AND",[c.equalsAny("id",x)])),e}}});const K=`{% block sw_order_detail_content_tabs_general %} {% parent() %} {% block unzer_payment_payment_tab %} {{ $tc('unzer-payment.tabTitle') }} {% endblock %} {% endblock %}`,{Component:L,Context:F}=Shopware,{Criteria:W}=Shopware.Data;L.override("sw-order-detail",{template:K,data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}const e=this.repositoryFactory.create("order"),t=new W(1,1);t.addAssociation("transactions"),e.get(this.orderId,F.api,t).then(n=>{n.transactions.forEach(a=>{a.customFields&&(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction||(this.isUnzerPayment=!0))})})},immediate:!0}}});const U='{% block sw_order_list_grid_columns %} {% parent() %} {% block unzer_payment_column_transaction %} {% endblock %} {% endblock %}';Shopware.Component.override("sw-order-list",{template:U,methods:{getOrderColumns(){const e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});const N='{% block unzer_payment_payment_details %}
{% block unzer_payment_payment_details_content %} {% endblock %}
{% endblock %}',{Component:G,Context:O,Mixin:q}=Shopware,{Criteria:u}=Shopware.Data;G.register("unzer-payment-tab",{template:N,inject:["UnzerPaymentService","repositoryFactory"],mixins:[q.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id,t=new u;t.getAssociation("transactions").addSorting(u.sort("createdAt","DESC")),this.orderRepository.get(e,O.api,t).then(n=>{this.order=n,n.transactions&&n.transactions.forEach((a,s)=>{if(!a.customFields){this.loadedResources++;return}if(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(a.id).then(i=>{this.paymentResources[s]=i,this.paymentResources[s].orderTransactionId=a.id,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){const t="sw-order-detail",n=e.$parent;if(n===void 0)return null;if(n.$options.name!==t)return this.findOrderDetailComponentAndReInit(n);if(n.isOrderEditing)return null;n.createdComponent()}}});const{Module:H}=Shopware;H.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,routeMiddleware(e,t){t.name==="sw.order.detail"&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}});const j=`{% block unzer_payment_payment_register_webhook %}
{% block unzer_payment_payment_register_webhook_button %} {{ $tc('unzer-payment-settings.form.webhookButton') }} {% endblock %} {% block unzer_payment_payment_register_webhook_modal %} {% endblock %}
{% endblock %}`,l=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:j,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;this.isDataLoading=!0;let a=new l(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(s=>{n.salesChannels=s,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,t!==void 0&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1;const n=this.getSalesChannelById(e);return this.webhooks.length?(n.domains.forEach(a=>{this.webhooks.forEach(s=>{if(s.url.indexOf(a.url)>-1)return t=!0,!0})}),t):!1},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new l;return t.addFilter(l.prefix("url","https://")),t.addFilter(l.equals("salesChannelId",e)),t}}});const V=` {{ $tc('unzer-payment-settings.webhook.empty') }}
{{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}
`,{Component:Z,Mixin:J,Context:ye}=Shopware;Z.register("unzer-webhooks-modal",{template:V,mixins:[J.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){const t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),n!==void 0&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}});const{Component:Q}=Shopware,{Criteria:m}=Shopware.Data;Q.extend("unzer-entity-single-select-delivery-status","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){const e=new m(1,100);return e.addFilter(m.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const{Component:Y,Service:X}=Shopware,{Criteria:h,EntityCollection:ge}=Shopware.Data;Y.extend("unzer-entity-multi-select-delivery-status","sw-entity-multi-id-select",{props:{repository:{type:Object,required:!0,default(){return X("repositoryFactory").create("state_machine_state")}},criteria:{type:Object,required:!1,default(){const e=new h(1,100);return e.addFilter(h.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const ee=` `,{Component:te}=Shopware;te.register("unzer-google-pay-gateway-merchant-id",{template:ee,inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:""}},props:{currentSalesChannelId:{type:String,required:!0}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId()}},created(){this.getUnzerGooglePayGatewayMerchantId(),document.addEventListener("unzer-settings-saved",this.getUnzerGooglePayGatewayMerchantId)},methods:{getUnzerGooglePayGatewayMerchantId(){console.log("get",this.currentSalesChannelId),this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}});const ne=`{% block unzer_plugin_icon %} {% endblock %}`,{Component:ae}=Shopware;ae.register("unzer-payment-plugin-icon",{template:ne,computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});const se='{% block unzer_settings_subheading %}
{{ label }}
{% endblock %}',{Component:ie}=Shopware;ie.register("unzer-settings-subheading",{template:se,computed:{label(){const e=this.$attrs.name.split("."),t=e[e.length-1];return this.$tc("unzer-payment-settings.subheadings."+t)}}});const{Component:re}=Shopware;re.override("sw-system-config",{watch:{currentSalesChannelId(){this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}}});const oe=`{% block unzer_payment_settings %} {% block unzer_payment_settings_header %} {% endblock %} {% block unzer_payment_settings_actions %} {% endblock %} {% block unzer_payment_settings_content %} {% endblock %} {% endblock %}`,{Component:ce,Mixin:p,Context:le}=Shopware;ce.register("unzer-payment-settings",{template:oe,mixins:[p.getByName("notification"),p.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,isAdditionalKeysExpanded:!1,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return le.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;const t=this.getArrayKeyOfKeyPairSetting(e);let n=e;t!==-1&&(n=this.keyPairSettings[t]);const a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(!t||!t.privateKey||!t.publicKey||e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");e==="sw-plugin-config.messageSaveSuccess"&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),document.dispatchEvent(new CustomEvent("unzer-settings-saved",{}))}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(a=>{a.elements.forEach(s=>{if(s.name===e.name){n=s;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},keyPairSettingGroupTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.main`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){const e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(n=>{e.keyPairSettings.forEach((a,s,i)=>{a.group===n.group&&a.key===n.key&&(i[s]=n)})})})},toggleAdditionalKeys(){this.isAdditionalKeysExpanded=!this.isAdditionalKeysExpanded}}});const f={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Zahlungsverlauf",column:{type:"Typ",amount:"Betrag",date:"Datum"},type:{authorization:"Reservierung",charge:"Einzug",shipment:"Versandmitteilung",refund:"Rückerstattung",cancellation:"Stornierung",default:""}},actions:{reason:{placeholder:"Grund",cancel:"Abgebrochen",credit:"Gutschrift",return:"Rückgabe"},chargeButton:"Einziehen",shipButton:"Versandmitteilung",refundButton:"Rückerstatten",defaultButton:"Erledigt",cancelButton:"Stornieren",noActions:"Keine Aktionen möglich",confirmCancelModal:{text:"Möchten Sie wirklich die Reservierung über den angegebenen Betrag stornieren?",amountLabel:"Betrag:",yesButton:"Ja",noButton:"Nein"}},detail:{cardTitle:"Zahlungsdetails",shortId:"Short-ID",id:"Zahlungs-ID",state:"Status",amountRemaining:"Betrag (Rest)",amountCancelled:"Betrag (Rückerstattet)",amountCharged:"Betrag (Eingezogen)",descriptor:"Verwendungszweck"},metadata:{cardTitle:"Metadaten",column:{key:"Schlüssel",value:"Wert"}},basket:{cardTitle:"Warenkorb",column:{quantity:"Anzahl",title:"Titel",amountGross:"Betrag (brutto)",amountNet:"Betrag (netto)"}},notifications:{genericErrorMessage:"Es ist ein Fehler aufgetreten!",refundSuccessTitle:"Rückerstatten",refundSuccessMessage:"Die Rückerstattung wurde erfolgreich durchgeführt.",refundErrorTitle:"Rückerstatten",chargeSuccessTitle:"Einziehen",chargeSuccessMessage:"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.",chargeErrorTitle:"Einziehen",shipSuccessTitle:"Versandmitteilung",shipSuccessMessage:"Die Versandmitteilung wurde erfolgreich gesendet.",shipErrorTitle:"Versandmitteilung",invoiceNotFoundMessage:"Zu dieser Bestellung wurde keine Rechnung gefunden",couldNotRetrieveMessage:"Die Zahlungsdetails konnten nicht abgerufen werden, bitte prüfen Sie die Logdateien für weitere Informationen.",documentDateMissingError:"Das Datum der Rechnung ist leer.",paymentMissingError:"Die Zahlung konnte nicht gefunden werden",paylaterInvoiceDocumentRequiredErrorMessage:"Bitte erstellen oder hinterlegen Sie zunächst eine Rechnung für die Bestellung.",cancelSuccessTitle:"Stornierung",cancelErrorTitle:"Stornierung",cancelSuccessMessage:"Die Stornierung wurde erfolgreich durchgeführt.",cancelErrorMessage:"Die Stornierung konnte nicht durchgeführt werden."}},"order-list":{transactionId:"Unzer Transaktions ID"},methods:{paylaterInvoice:{main:"Rechnungskauf","b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},paylaterInstallment:{main:"Ratenkauf","b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},paylaterDirectDebitSecured:{main:"Lastschrift","b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Buchungsmodus",paymentSettingsSaveDevices:"Zahlungsmittel speichern",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Händler ID"},form:{message:{success:{title:"Test erfolgreich",message:"Die angegebenen API-Zugangsdaten sind korrekt!"},error:{title:"Test fehlgeschlagen",message:"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},testButton:"API Zugangsdaten testen",webhookButton:"Webhooks registrieren",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys für weitere Zahlungsarten",additionalKeysHelpText:"Wenn die Felder für zusätzliche Schlüsselpaare leer sind, werden standardmäßig die Hauptschlüsselpaare übernommen."},modal:{close:"Schließen",webhook:{title:"Webhooks",httpsInfo:"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.",registered:"Webhook ist bereits registriert",placeholder:"Bitte wählen Sie eine Domain aus",submit:{register:"Webhooks registrieren",clear:"Webhooks auswählen | Ausgewählten Webhook entfernen | Entferne {count} Webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registriert | Webhooks registriert",error:"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},clear:{done:"Webhook entfernt | Webhooks entfernt",error:"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},missing:{fields:"Nicht alle benötigten Felder sind vorhanden",context:"Der Kontext konnte nicht aktualisiert werden",selection:"Es wurden keine Domains selektiert"},notFound:{salesChannelDomain:"Die spezifizierte Domain wurde nicht gefunden"},globalError:{title:"Ein Fehler ist aufgetreten",message:"Bitte kontaktieren sie uns für mehr Informationen"},empty:"Für diesen Private Key sind keine Webhooks registriert. Bitte prüfen Sie ob dieser valide ist und ob Konfigurationen für dedizierte Verkaufskanäle vorgenommen wurden.",show:"Webhooks anzeigen"}},"sw-payment-card":{deprecated:"Veraltet"}},b={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Payment History",column:{type:"Type",amount:"Amount",date:"Date"},type:{authorization:"Authorization",charge:"Charging",shipment:"Shipping notification",refund:"Refund",cancellation:"Cancel",default:""}},actions:{reason:{placeholder:"Reason",cancel:"Cancel",credit:"Credit",return:"Return"},chargeButton:"Charge",shipButton:"Shipping notice",refundButton:"Refund",defaultButton:"Done",cancelButton:"Cancel",noActions:"No actions possible",confirmCancelModal:{text:"Do you really want to cancel the authorization of the selected amount?",amountLabel:"Amount:",yesButton:"Yes",noButton:"No"}},detail:{cardTitle:"Payment Details",shortId:"Short-ID",id:"Payment-ID",state:"State",amountRemaining:"Amount (Remaining)",amountCancelled:"Amount (Cancelled)",amountCharged:"Amount (Charged)",descriptor:"Descriptor"},metadata:{cardTitle:"Metadata",column:{key:"Key",value:"Value"}},basket:{cardTitle:"Basket",column:{quantity:"Quantity",title:"Title",amountGross:"Amount (gross)",amountNet:"Amount (net)"}},notifications:{genericErrorMessage:"An error has occurred!",refundSuccessTitle:"Refund",refundSuccessMessage:"The reimbursement was successfully completed.",refundErrorTitle:"Refund",chargeSuccessTitle:"Charge",chargeSuccessMessage:"The collection of the payment was carried out successfully.",chargeErrorTitle:"Charge",shipSuccessTitle:"Shipping notice",shipSuccessMessage:"The shipping notification was successfully sent.",shipErrorTitle:"Shipping notice",invoiceNotFoundMessage:"No invoice was found for this order.",couldNotRetrieveMessage:"The payment details could not be retrieved, please check the log files for more information.",documentDateMissingError:"Document date for invoice is empty.",paymentMissingError:"Payment could not be found",paylaterInvoiceDocumentRequiredErrorMessage:"Please create or upload an invoice for the order first.",cancelSuccessTitle:"Cancel",cancelErrorTitle:"Cancel",cancelSuccessMessage:"The reversal was successfully completed.",cancelErrorMessage:"The reversal could not be performed."}},"order-list":{transactionId:"Unzer transaction ID"},methods:{paylaterInvoice:{main:"Invoice","b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},paylaterInstallment:{main:"Installment","b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},paylaterDirectDebitSecured:{main:"Direct Debit","b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Booking Modes",paymentSettingsSaveDevices:"Save Payment Details",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Merchant ID"},form:{message:{success:{title:"Test succeeded",message:"The provided credentials are valid!"},error:{title:"Test failed",message:"API Credentials are invalid, please correct them and try again!"}},testButton:"Test API credentials",webhookButton:"Register webhooks",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys for additional payment methods",additionalKeysHelpText:"If additional keypairs fields are empty, main keypairs will be inherited by default."},modal:{close:"Close",webhook:{title:"Webhooks",httpsInfo:"Only one HTTPS domain per sales channel can be registered.",registered:"Webhook is already registered",placeholder:"Please select a domain",submit:{register:"Register webhooks",clear:"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registered | Webhooks registered",error:"Webhook could not be registered | Webhooks could not be registered"},clear:{done:"Webhook cleared | Webhooks cleared",error:"Webhook could not be cleared | Webhooks could not be cleared"},missing:{fields:"Some mandatory fields are missing",context:"The context could not be refreshed",selection:"No domain was selected"},notFound:{salesChannelDomain:"The selected domain could not be found"},globalError:{title:"An error has occurred!",message:"Please contact us for more information"},empty:"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.",show:"Show webhooks"}},"sw-payment-card":{deprecated:"Deprecated"}},{Module:de}=Shopware,ue={type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":f,"en-GB":b},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},extensionEntryRoute:{extensionName:"UnzerPayment6",route:"unzer.payment.configuration.settings"},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}};de.register("unzer-payment-configuration",ue);const{Application:y}=Shopware,r=Shopware.Classes.ApiService;class me extends r{constructor(t,n,a="unzer-payment"){super(t,n,a)}fetchPaymentDetails(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/details`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}chargeTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/charge/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}refundTransaction(t,n,a,s=null){let i=`_action/${this.getApiBasePath()}/transaction/${t}/refund/${n}/${a}`;return s!==null&&(i=`${i}/${s}`),this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(k=>r.handleResponse(k))}cancelTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/cancel/${n}/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}ship(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/ship`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}}y.addServiceProvider("UnzerPaymentService",e=>{const t=y.getContainer("init");return new me(t.httpClient,e.loginService)});const{Application:g}=Shopware,o=Shopware.Classes.ApiService;class he extends o{constructor(t,n,a="unzer-payment"){super(t,n,a)}validateCredentials(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}registerWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}clearWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/get-webhooks`,{privateKey:t},{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getGooglePayGatewayMerchantId(t){return this.httpClient.get(`_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${t||""}`,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}}g.addServiceProvider("UnzerPaymentConfigurationService",e=>{const t=g.getContainer("init");return new he(t.httpClient,e.loginService)});const pe=`{% block sw_payment_card_description %}
{{ $tc('sw-payment-card.deprecated') }}
{% endblock %}`;Shopware.Component.override("sw-payment-card",{template:pe,snippets:{"de-DE":f,"en-GB":b}}); -//# sourceMappingURL=unzer-payment6-Bl5RLTQD.js.map diff --git a/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js.map b/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js.map deleted file mode 100644 index a71fb79a..00000000 --- a/src/Resources/public/administration/assets/unzer-payment6-Bl5RLTQD.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unzer-payment6-Bl5RLTQD.js","sources":["../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/unzer-payment-actions.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/unzer-payment-detail.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/unzer-payment-history.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/unzer-payment-metadata.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/unzer-payment-basket.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/sw-order-create-details-footer.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/sw-order-detail.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/sw-order-list.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/index.js","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js","../../../app/administration/src/module/unzer-payment/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/register-webhook.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/unzer-webhooks-modal.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-single-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-multi-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/unzer-google-pay-gateway-merchant-id.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/unzer-payment-plugin-icon.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/unzer-settings-subheading.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/index.js","../../../app/administration/src/module/unzer-payment-configuration/extension/sw-system-config/index.js","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/unzer-payment-settings.html.twig","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/index.js","../../../app/administration/src/module/unzer-payment-configuration/index.js","../../../app/administration/src/api/unzer-payment.service.js","../../../app/administration/src/api/unzer-payment-configuration.service.js","../../../app/administration/src/extension/sw-payment-card/sw-payment-card.html.twig","../../../app/administration/src/extension/sw-payment-card/index.js"],"sourcesContent":["{% block unzer_payment_actions %}\n \n {% block unzer_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n
\n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }}\n \n {% endblock %}\n \n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }}\n \n {% endblock %}\n \n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n\n
\n {{ $tc('unzer-payment.paymentDetails.actions.noActions') }}\n
\n{% endblock %}","import template from './unzer-payment-actions.html.twig';\nimport './unzer-payment-actions.scss';\n\nconst { Component, Mixin } = Shopware;\nconst reasonCodes = {\n CANCEL: 'CANCEL',\n RETURN: 'RETURN',\n CREDIT: 'CREDIT',\n};\n\nComponent.register('unzer-payment-actions', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n transactionAmount: 0.0,\n reasonCode: null,\n };\n },\n\n props: {\n transactionResource: {\n type: Object,\n required: true,\n },\n\n paymentResource: {\n type: Object,\n required: true,\n },\n\n decimalPrecision: {\n type: Number,\n required: true,\n default: 4,\n },\n },\n\n computed: {\n isChargePossible: function () {\n return (\n this.transactionResource.type === 'authorization' &&\n this.transactionResource.state !== 'error'\n );\n },\n\n isRefundPossible: function () {\n return (\n this.transactionResource.type === 'charge' &&\n this.transactionResource.state !== 'error' &&\n !(\n this.transactionResource.isFirst &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a' &&\n this.paymentResource.state.name !== 'pending' &&\n this.paymentResource.state.name !== 'partly'\n )\n );\n },\n\n maxTransactionAmount() {\n let amount = 0;\n\n let isAmountForPrepaymentRefund =\n this.isRefundPossible &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a';\n\n if (this.isRefundPossible) {\n amount = this.transactionResource.amount;\n }\n\n if (this.isChargePossible) {\n amount = this.paymentResource.amount.remaining;\n }\n\n if ('remainingAmount' in this.transactionResource) {\n amount = this.transactionResource.remainingAmount;\n }\n\n if (\n this.transactionResource.isFirst &&\n isAmountForPrepaymentRefund\n ) {\n amount = this.paymentResource.amount.remaining;\n }\n\n return amount / 10 ** this.paymentResource.amount.decimalPrecision;\n },\n\n reasonCodeSelection() {\n return [\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.cancel'\n ),\n value: reasonCodes.CANCEL,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.credit'\n ),\n value: reasonCodes.CREDIT,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.return'\n ),\n value: reasonCodes.RETURN,\n },\n ];\n },\n },\n\n created() {\n this.transactionAmount = this.maxTransactionAmount;\n },\n\n methods: {\n charge() {\n this.isLoading = true;\n\n this.UnzerPaymentService.chargeTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n if (message === 'paylater-invoice-document-required') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n refund() {\n this.isLoading = true;\n\n this.UnzerPaymentService.refundTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount,\n this.reasonCode\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n startCancel() {\n this.$emit('cancel', this.transactionAmount);\n },\n },\n});\n","{% block unzer_payment_detail %}\n \n
\n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}\n
\n
\n {{ formatCurrency(remainingAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}\n
\n
\n {{ formatCurrency(cancelledAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}\n
\n
\n {{ formatCurrency(chargedAmount) }}\n
\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n
\n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.shortId') }}\n
\n
{{ paymentResource.shortId }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.id') }}\n
\n
{{ paymentResource.id }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.state') }}\n
\n
\n {{ paymentResource.state.name }}\n
\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}\n
\n
\n {{ paymentResource.descriptor }}\n
\n \n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n
\n {% endblock %}\n \n {% endblock %}\n
\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.shipButton') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-detail.html.twig';\n\nconst { Component, Mixin, Module } = Shopware;\n\nComponent.register('unzer-payment-detail', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n paylaterPaymentMethods: [\n '09588ffee8064f168e909ff31889dd7f', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE\n '12fbfbce271a43a89b3783453b88e9a6', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT\n '6d6adcd4b7bf40499873c294a85f32ed', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED\n ],\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n remainingAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.remaining,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n cancelledAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.cancelled,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n chargedAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.charged,\n this.paymentResource.amount.decimalPrecision\n );\n },\n },\n\n methods: {\n reloadOrderDetail() {\n this.$emit('reloadOrderDetails');\n },\n\n ship() {\n this.isLoading = true;\n\n this.UnzerPaymentService.ship(\n this.paymentResource.orderTransactionId\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n } else if (message === 'invoice-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage'\n );\n } else if (message === 'documentdate-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.documentDateMissingError'\n );\n } else if (message === 'payment-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paymentMissingError'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n formatAmount(cents, decimalPrecision) {\n return (\n cents / 10 ** Math.min(this.unzerMaxDigits, decimalPrecision)\n );\n },\n\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n\n isPaylaterPaymentMethod(paymentMethodId) {\n return this.paylaterPaymentMethods.indexOf(paymentMethodId) >= 0;\n },\n },\n});\n","{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-history.html.twig';\n\nconst { Component, Module, Mixin } = Shopware;\n\nComponent.register('unzer-payment-history', {\n template,\n\n inject: ['repositoryFactory', 'UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n showCancelModal: false,\n isCancelLoading: false,\n cancelAmount: 0,\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n orderTransactionRepository: function () {\n return this.repositoryFactory.create('order_transaction');\n },\n\n decimalPrecision() {\n if (\n !this.paymentResource ||\n !this.paymentResource.amount ||\n !this.paymentResource.amount.decimalPrecision\n ) {\n return this.unzerMaxDigits;\n }\n\n return Math.min(\n this.unzerMaxDigits,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n data: function () {\n const data = [];\n\n Object.values(this.paymentResource.transactions).forEach(\n (transaction) => {\n // const amount = this.$options.filters.currency(\n // this.formatAmount(parseFloat(transaction.amount), this.decimalPrecision),\n // this.paymentResource.currency\n // );\n const amount = this.formatCurrency(\n this.formatAmount(\n parseFloat(transaction.amount),\n this.decimalPrecision\n )\n );\n const date = Shopware.Filter.getByName('date')(\n transaction.date,\n {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }\n );\n\n data.push({\n type: this.transactionTypeRenderer(transaction.type),\n amount: amount,\n date: date,\n resource: transaction,\n });\n }\n );\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'type',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.type'\n ),\n rawData: true,\n },\n {\n property: 'amount',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.amount'\n ),\n rawData: true,\n },\n {\n property: 'date',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.date'\n ),\n rawData: true,\n },\n ];\n },\n },\n\n methods: {\n transactionTypeRenderer: function (value) {\n switch (value) {\n case 'authorization':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.authorization'\n );\n case 'charge':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.charge'\n );\n case 'shipment':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.shipment'\n );\n case 'refund':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.refund'\n );\n case 'cancellation':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.cancellation'\n );\n default:\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.default'\n );\n }\n },\n\n reload: function () {\n this.$emit('reload');\n this.$emit('reloadOrderDetails');\n },\n\n formatAmount(cents, decimalPrecision) {\n return cents / 10 ** decimalPrecision;\n },\n\n openCancelModal(item, cancelAmount) {\n this.showCancelModal = item.resource.id;\n this.cancelAmount = cancelAmount;\n },\n\n closeCancelModal() {\n this.showCancelModal = false;\n this.cancelAmount = 0;\n },\n\n cancel() {\n this.isCancelLoading = true;\n\n this.UnzerPaymentService.cancelTransaction(\n this.paymentResource.orderTransactionId,\n this.paymentResource.id,\n this.cancelAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessMessage'\n ),\n });\n\n this.reload();\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorTitle'\n ),\n message: message,\n });\n\n this.isCancelLoading = false;\n this.reload();\n });\n },\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block unzer_payment_metadata %}\n \n \n \n{% endblock %}","import template from './unzer-payment-metadata.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-metadata', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.metadata.forEach((meta) => {\n data.push({\n key: meta.key,\n value: meta.value,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'key',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.key'\n ),\n rawData: true,\n },\n {\n property: 'value',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.value'\n ),\n rawData: true,\n },\n ];\n },\n },\n});\n","{% block unzer_payment_basket %}\n \n \n \n{% endblock %}","import template from './unzer-payment-basket.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-basket', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.basket.basketItems.forEach((basketItem) => {\n let amountGross = this.formatCurrency(\n parseFloat(basketItem.amountGross.toFixed(2))\n );\n let amountNet = this.formatCurrency(\n parseFloat(basketItem.amountNet.toFixed(2))\n );\n\n if (basketItem.amountDiscount > 0) {\n amountGross = this.formatCurrency(\n parseFloat(basketItem.amountDiscount.toFixed(2)) * -1\n );\n\n amountNet = this.formatCurrency(\n parseFloat(\n (\n basketItem.amountDiscount - basketItem.amountVat\n ).toFixed(2)\n ) * -1\n );\n }\n\n data.push({\n quantity: basketItem.quantity,\n title: basketItem.title,\n amountGross: amountGross,\n amountNet: amountNet,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'quantity',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.quantity'\n ),\n rawData: true,\n },\n {\n property: 'title',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.title'\n ),\n rawData: true,\n },\n {\n property: 'amountGross',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountGross'\n ),\n rawData: true,\n },\n {\n property: 'amountNet',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountNet'\n ),\n rawData: true,\n },\n ];\n },\n },\n methods: {\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}","import template from './sw-order-create-details-footer.html.twig';\n\nconst { Criteria } = Shopware.Data;\nconst unzerPaymentIds = [\n 'bc4c2cbfb5fda0bf549e4807440d0a54', //PAYMENT_ID_ALIPAY\n '4673044aff79424a938d42e9847693c3', //PAYMENT_ID_CREDIT_CARD\n '713c7a332b432dcd4092701eda522a7e', //PAYMENT_ID_DIRECT_DEBIT\n '5123af5ce94a4a286641973e8de7eb60', //PAYMENT_ID_DIRECT_DEBIT_SECURED\n '17830aa7e6a00b99eab27f0e45ac5e0d', //PAYMENT_ID_EPS\n '4ebb99451f36ba01f13d5871a30bce2c', //PAYMENT_ID_FLEXIPAY\n 'd4b90a17af62c1bb2f6c3b1fed339425', //PAYMENT_ID_GIROPAY\n '4b9f8d08b46a83839fd0eb14fe00efe6', //PAYMENT_ID_INSTALLMENT_SECURED\n '08fb8d9a72ab4ca62b811e74f2eca79f', //PAYMENT_ID_INVOICE\n '6cc3b56ce9b0f80bd44039c047282a41', //PAYMENT_ID_INVOICE_SECURED\n '614ad722a03ee96baa2446793143215b', //PAYMENT_ID_IDEAL\n '409fe641d6d62a4416edd6307d758791', //PAYMENT_ID_PAYPAL\n '085b64d0028a8bd447294e03c4eb411a', //PAYMENT_ID_PRE_PAYMENT\n 'cd6f59d572e6c90dff77a48ce16b44db', //PAYMENT_ID_PRZELEWY24\n 'fd96d03535a46d197f5adac17c9f8bac', //PAYMENT_ID_WE_CHAT\n '09588ffee8064f168e909ff31889dd7f', //PAYMENT_ID_PAYLATER_INVOICE\n];\n\nShopware.Component.override('sw-order-create-details-footer', {\n template,\n\n computed: {\n paymentMethodCriteria() {\n /** @var {Criteria} paymentCriteria */\n const criteria = new Criteria();\n\n if (this.salesChannelId) {\n criteria.addFilter(\n Criteria.equals('salesChannels.id', this.salesChannelId)\n );\n }\n\n criteria.addFilter(\n Criteria.not('AND', [Criteria.equalsAny('id', unzerPaymentIds)])\n );\n\n return criteria;\n },\n },\n});\n","{% block sw_order_detail_content_tabs_general %}\n {% parent() %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-detail.html.twig';\n\nconst { Component, Context } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.override('sw-order-detail', {\n template,\n\n data() {\n return {\n isUnzerPayment: false,\n };\n },\n\n computed: {\n showTabs() {\n return true; // TODO remove with PT-10455\n },\n },\n\n watch: {\n orderId: {\n deep: true,\n handler() {\n if (!this.orderId) {\n this.isUnzerPayment = false;\n\n return;\n }\n\n const orderRepository = this.repositoryFactory.create('order');\n const orderCriteria = new Criteria(1, 1);\n orderCriteria.addAssociation('transactions');\n\n orderRepository\n .get(this.orderId, Context.api, orderCriteria)\n .then((order) => {\n order.transactions.forEach((orderTransaction) => {\n if (!orderTransaction.customFields) {\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n return;\n }\n\n this.isUnzerPayment = true;\n });\n });\n },\n immediate: true,\n },\n },\n});\n","{% block sw_order_list_grid_columns %}\n {% parent() %}\n\n {% block unzer_payment_column_transaction %}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-list.html.twig';\n\nShopware.Component.override('sw-order-list', {\n template,\n\n methods: {\n getOrderColumns() {\n const baseColumns = this.$super('getOrderColumns');\n\n baseColumns.splice(1, 0, {\n property: 'unzerPaymentTransactionId',\n label: 'unzer-payment.order-list.transactionId',\n allowResize: true,\n });\n\n return baseColumns;\n },\n },\n});\n","{% block unzer_payment_payment_details %}\n
\n
\n {% block unzer_payment_payment_details_content %}\n \n {% endblock %}\n
\n \n
\n{% endblock %}","import template from './unzer-payment-tab.html.twig';\n\nconst { Component, Context, Mixin } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.register('unzer-payment-tab', {\n template,\n\n inject: ['UnzerPaymentService', 'repositoryFactory'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n paymentResources: [],\n loadedResources: 0,\n isLoading: true,\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n computed: {\n orderRepository() {\n return this.repositoryFactory.create('order');\n },\n },\n\n watch: {\n $route() {\n this.resetDataAttributes();\n this.createdComponent();\n },\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n resetDataAttributes() {\n this.paymentResources = [];\n this.loadedResources = 0;\n this.isLoading = true;\n },\n\n reloadPaymentDetails() {\n this.resetDataAttributes();\n this.loadData();\n },\n\n loadData() {\n const orderId = this.$route.params.id;\n const criteria = new Criteria();\n criteria\n .getAssociation('transactions')\n .addSorting(Criteria.sort('createdAt', 'DESC'));\n\n this.orderRepository\n .get(orderId, Context.api, criteria)\n .then((order) => {\n this.order = order;\n\n if (!order.transactions) {\n return;\n }\n\n order.transactions.forEach((orderTransaction, index) => {\n if (!orderTransaction.customFields) {\n this.loadedResources++;\n\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n this.loadedResources++;\n\n return;\n }\n\n this.UnzerPaymentService.fetchPaymentDetails(\n orderTransaction.id\n )\n .then((response) => {\n this.paymentResources[index] = response;\n this.paymentResources[\n index\n ].orderTransactionId = orderTransaction.id;\n this.loadedResources++;\n\n this.isLoading =\n this.order.transactions.length !==\n this.loadedResources;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage'\n ),\n });\n\n this.isLoading = false;\n });\n });\n });\n },\n\n reloadOrderDetails() {\n //we cannot know, when the webhook is called, but 5 seconds should be enough to wait for most cases\n setTimeout(() => {\n this.findOrderDetailComponentAndReInit();\n }, 5000);\n },\n\n async findOrderDetailComponentAndReInit(base = this) {\n const componentName = 'sw-order-detail';\n const parent = base.$parent;\n\n if (parent === undefined) {\n return null;\n }\n\n if (parent.$options.name !== componentName) {\n return this.findOrderDetailComponentAndReInit(parent);\n }\n\n if (parent.isOrderEditing) {\n return null;\n }\n\n // we reinitialize the orderDetail component, because there is no other way to update it is not updating the order state\n parent.createdComponent();\n },\n },\n});\n","import './component/unzer-payment-actions';\nimport './component/unzer-payment-detail';\nimport './component/unzer-payment-history';\nimport './component/unzer-payment-metadata';\nimport './component/unzer-payment-basket';\nimport './extension/sw-order-create-details-footer';\nimport './extension/sw-order-detail';\nimport './extension/sw-order-list';\nimport './page/unzer-payment-tab';\n\nconst { Module } = Shopware;\n\nModule.register('unzer-payment', {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment.general.title',\n description: 'unzer-payment.general.descriptionTextModule',\n version: '0.0.1',\n targetVersion: '0.0.1',\n maxDigits: 4,\n\n routeMiddleware(next, currentRoute) {\n if (currentRoute.name === 'sw.order.detail') {\n currentRoute.children.push({\n component: 'unzer-payment-tab',\n name: 'unzer-payment.payment.detail',\n path: '/sw/order/detail/:id/unzer-payment',\n isChildren: true,\n meta: {\n parentPath: 'sw.order.index',\n },\n });\n }\n\n next(currentRoute);\n },\n});\n","{% block unzer_payment_payment_register_webhook %}\n
\n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc('unzer-payment-settings.form.webhookButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n \n\n \n \n {% endblock %}\n
\n{% endblock %}","import template from './register-webhook.html.twig';\nimport './style.scss';\n\nconst Criteria = Shopware.Data.Criteria;\n\nShopware.Component.register('unzer-payment-register-webhook', {\n template,\n\n mixins: [Shopware.Mixin.getByName('notification')],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n props: {\n webhooks: {\n type: Array,\n required: true,\n },\n isLoading: {\n type: Boolean,\n required: false,\n },\n selectedSalesChannelId: {\n type: String,\n required: false,\n },\n privateKey: {\n type: String,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n required: false,\n },\n },\n\n computed: {\n salesChannelRepository() {\n return this.repositoryFactory.create('sales_channel');\n },\n },\n\n data() {\n return {\n isModalActive: false,\n isRegistering: false,\n isRegistrationSuccessful: false,\n isDataLoading: false,\n selection: {},\n selectedDomain: null,\n entitySelection: {},\n salesChannels: {},\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n loadData(page, limit) {\n let me = this;\n\n this.isDataLoading = true;\n\n let criteria = new Criteria(page, limit);\n criteria.addAssociation('domains');\n\n this.salesChannelRepository\n .search(criteria, Shopware.Context.api)\n .then((result) => {\n me.salesChannels = result;\n me.isDataLoading = false;\n });\n },\n\n onPageChange(args) {\n this.loadData(args.page, args.limit);\n },\n\n openModal() {\n this.$emit('modal-open');\n this.isModalActive = true;\n },\n\n closeModal() {\n this.isModalActive = false;\n },\n\n registerWebhooks() {\n const me = this;\n this.isRegistrationSuccessful = false;\n this.isRegistering = true;\n\n this.UnzerPaymentConfigurationService.registerWebhooks({\n selection: this.entitySelection,\n })\n .then((response) => {\n me.isRegistrationSuccessful = true;\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n\n this.$emit('webhook-registered', response);\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isRegistering = false;\n });\n },\n\n onRegistrationFinished() {\n this.isRegistrationSuccessful = false;\n this.selection = {};\n },\n\n onSelectItem(domainId, domain) {\n if (!domain) {\n return;\n }\n\n domain['privateKey'] = this.privateKey;\n\n this.entitySelection[domain.salesChannelId] = domain;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((domain) => {\n if (data[domain].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n }\n });\n },\n\n isWebhookRegisteredForSalesChannel(salesChannelId) {\n let result = false;\n\n const salesChannel = this.getSalesChannelById(salesChannelId);\n\n if (!this.webhooks.length) {\n return false;\n }\n\n salesChannel.domains.forEach((domain) => {\n this.webhooks.forEach((webhook) => {\n if (webhook.url.indexOf(domain.url) > -1) {\n result = true;\n return true;\n }\n });\n });\n\n return result;\n },\n\n getSalesChannelById(salesChannelId) {\n let result = null;\n\n this.salesChannels.forEach((salesChannel) => {\n if (salesChannel.id === salesChannelId) {\n result = salesChannel;\n return true;\n }\n });\n\n return result;\n },\n\n getSalesChannelDomainCriteria(salesChannelId) {\n let criteria = new Criteria();\n\n criteria.addFilter(Criteria.prefix('url', 'https://'));\n criteria.addFilter(\n Criteria.equals('salesChannelId', salesChannelId)\n );\n\n return criteria;\n },\n },\n});\n","\n \n {{ $tc('unzer-payment-settings.webhook.empty') }}\n \n
\n \n \n \n {{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n","import template from './unzer-webhooks-modal.html.twig';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-webhooks-modal', {\n template,\n\n mixins: [Mixin.getByName('notification')],\n\n inject: ['UnzerPaymentConfigurationService'],\n\n props: {\n keyPair: {\n type: Array,\n required: true,\n },\n webhooks: {\n type: Array,\n required: true,\n },\n isLoadingWebhooks: {\n type: Boolean,\n },\n },\n\n data() {\n return {\n isClearing: false,\n isClearingSuccessful: false,\n webhookSelection: null,\n webhookSelectionLength: 0,\n };\n },\n\n computed: {\n webhookColumns() {\n return [\n {\n property: 'event',\n dataIndex: 'event',\n label: 'Event',\n },\n {\n property: 'url',\n dataIndex: 'url',\n label: 'URL',\n },\n ];\n },\n },\n\n methods: {\n clearWebhooks(privateKey) {\n const me = this;\n this.isClearingSuccessful = false;\n this.isClearing = true;\n this.isLoading = true;\n\n this.UnzerPaymentConfigurationService.clearWebhooks({\n privateKey: privateKey,\n selection: this.webhookSelection,\n })\n .then((response) => {\n me.isClearingSuccessful = true;\n me.webhookSelection = [];\n me.webhookSelectionLength = 0;\n\n me.$refs.webhookDataGrid.resetSelection();\n\n me.$emit('load-webhooks', privateKey);\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isLoading = false;\n me.isClearing = false;\n });\n },\n\n onClearingFinished() {\n this.isClearingSuccessful = false;\n this.isClearing = false;\n },\n\n onSelectWebhook(selectedItems) {\n this.webhookSelectionLength = Object.keys(selectedItems).length;\n this.webhookSelection = selectedItems;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((url) => {\n if (data[url].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n }\n });\n },\n },\n});\n","const { Component } = Shopware;\nconst { Criteria } = Shopware.Data;\n\n// extend the existing component `sw-entity-single-select` by\n// overwriting the default criteria\nComponent.extend(\n 'unzer-entity-single-select-delivery-status',\n 'sw-entity-single-select',\n {\n props: {\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","const { Component, Service } = Shopware;\nconst { Criteria, EntityCollection } = Shopware.Data;\n\nComponent.extend(\n 'unzer-entity-multi-select-delivery-status',\n 'sw-entity-multi-id-select',\n {\n props: {\n repository: {\n type: Object,\n required: true,\n default() {\n return Service('repositoryFactory').create(\n 'state_machine_state'\n );\n },\n },\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","\n\n","const { Component } = Shopware;\n\nimport template from './unzer-google-pay-gateway-merchant-id.html.twig';\n\nComponent.register('unzer-google-pay-gateway-merchant-id', {\n template,\n inject: ['UnzerPaymentConfigurationService'],\n data() {\n return {\n readOnlyUnzerGooglePayGatewayMerchantId: '',\n };\n },\n props: {\n currentSalesChannelId: {\n type: String,\n required: true,\n },\n },\n watch: {\n currentSalesChannelId() {\n this.getUnzerGooglePayGatewayMerchantId();\n },\n },\n created() {\n this.getUnzerGooglePayGatewayMerchantId();\n document.addEventListener(\n 'unzer-settings-saved',\n this.getUnzerGooglePayGatewayMerchantId\n );\n },\n methods: {\n getUnzerGooglePayGatewayMerchantId() {\n console.log('get', this.currentSalesChannelId);\n this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(\n this.currentSalesChannelId\n )\n .then((response) => {\n this.readOnlyUnzerGooglePayGatewayMerchantId =\n response.gatewayMerchantId;\n })\n .catch(() => {});\n },\n },\n});\n","{% block unzer_plugin_icon %}\n \n{% endblock %}","import template from './unzer-payment-plugin-icon.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-plugin-icon', {\n template,\n computed: {\n assetFilter() {\n return Shopware.Filter.getByName('asset');\n },\n },\n});\n","{% block unzer_settings_subheading %}\n
{{ label }}
\n{% endblock %}","import template from './unzer-settings-subheading.html.twig';\nimport './style.scss';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-settings-subheading', {\n template,\n computed: {\n label() {\n // get part after last dot\n const parts = this.$attrs.name.split('.');\n const key = parts[parts.length - 1];\n return this.$tc('unzer-payment-settings.subheadings.' + key);\n },\n },\n});\n","const { Component } = Shopware;\n\nComponent.override('sw-system-config', {\n watch: {\n currentSalesChannelId() {\n this.$emit(\n 'sales-channel-changed',\n this.actualConfigData[this.currentSalesChannelId],\n this.currentSalesChannelId\n );\n },\n },\n});\n","{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-settings.html.twig';\nimport './unzer-payment-settings.scss';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-payment-settings', {\n template,\n\n mixins: [\n Mixin.getByName('notification'),\n Mixin.getByName('sw-inline-snippet'),\n ],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n data() {\n return {\n isLoading: true,\n isLoadingWebhooks: true,\n isAdditionalKeysExpanded: false,\n selectedKeyPairForTesting: false,\n isTestSuccessful: false,\n isSaveSuccessful: false,\n config: {},\n webhooks: [],\n loadedWebhooksPrivateKey: false,\n selectedSalesChannelId: null,\n keyPairSettings: [\n {\n key: 'b2b-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2b-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterDirectDebitSecured',\n },\n ],\n openModalKeyPair: null,\n };\n },\n\n metaInfo() {\n return {\n title: 'UnzerPayment',\n };\n },\n\n computed: {\n paymentMethodRepository() {\n return this.repositoryFactory.create('payment_method');\n },\n\n arrowIconName() {\n const match = Context.app.config.version.match(\n /((\\d+)\\.?(\\d+?)\\.?(\\d+)?\\.?(\\d*))-?([A-z]+?\\d+)?/i\n );\n\n if (match[3] >= 5) {\n return 'regular-chevron-right-xs';\n }\n\n return 'small-arrow-medium-right';\n },\n\n defaultKeyPair() {\n return {\n privateKey: this.getConfigValue('privateKey'),\n publicKey: this.getConfigValue('publicKey'),\n };\n },\n },\n\n watch: {\n openModalKeyPair(val) {\n if (val && val.privateKey !== this.loadedWebhooksPrivateKey) {\n this.loadWebhooks(val.privateKey);\n }\n },\n },\n\n methods: {\n getConfigValue(field) {\n if (\n !this.config ||\n !this.$refs.systemConfig ||\n !this.$refs.systemConfig.actualConfigData ||\n !this.$refs.systemConfig.actualConfigData.null\n ) {\n return '';\n }\n\n const defaultConfig = this.$refs.systemConfig.actualConfigData.null;\n\n return (\n this.config[`UnzerPayment6.settings.${field}`] ||\n defaultConfig[`UnzerPayment6.settings.${field}`]\n );\n },\n\n onValidateCredentials(keyPairSetting) {\n this.isTestSuccessful = false;\n this.selectedKeyPairForTesting = keyPairSetting;\n const keyPairIndex =\n this.getArrayKeyOfKeyPairSetting(keyPairSetting);\n let keyPairValues = keyPairSetting;\n if (keyPairIndex !== -1) {\n keyPairValues = this.keyPairSettings[keyPairIndex];\n }\n\n const credentials = {\n publicKey: keyPairValues.publicKey,\n privateKey: keyPairValues.privateKey,\n salesChannel: this.$refs.systemConfig.currentSalesChannelId,\n };\n\n this.UnzerPaymentConfigurationService.validateCredentials(\n credentials\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment-settings.form.message.success.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.success.message'\n ),\n });\n\n this.isTestSuccessful = true;\n this.selectedKeyPairForTesting = false;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.form.message.error.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.error.message'\n ),\n });\n\n this.onTestFinished();\n });\n },\n\n onTestFinished() {\n this.selectedKeyPairForTesting = false;\n this.isTestSuccessful = false;\n },\n\n getArrayKeyOfKeyPairSetting(keyPairSetting) {\n return this.keyPairSettings.findIndex((keyPairSettingItem) => {\n return (\n keyPairSettingItem.key === keyPairSetting.key &&\n keyPairSettingItem.group === keyPairSetting.group\n );\n });\n },\n\n onSave() {\n this.isLoading = true;\n\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n this.config[`UnzerPayment6.settings.${group}`] = [];\n });\n this.keyPairSettings.reduce((config, keyPairSetting) => {\n if (\n !keyPairSetting ||\n !keyPairSetting.privateKey ||\n !keyPairSetting.publicKey\n ) {\n return config;\n }\n\n config[`UnzerPayment6.settings.${keyPairSetting.group}`].push(\n keyPairSetting\n );\n\n return config;\n }, this.config);\n\n this.$refs.systemConfig\n .saveAll()\n .then(() => {\n this.isSaveSuccessful = true;\n\n let messageSaveSuccess = this.$tc(\n 'sw-plugin-config.messageSaveSuccess'\n );\n\n if (\n messageSaveSuccess ===\n 'sw-plugin-config.messageSaveSuccess'\n ) {\n messageSaveSuccess = this.$tc(\n 'sw-extension-store.component.sw-extension-config.messageSaveSuccess'\n );\n }\n\n this.createNotificationSuccess({\n title: this.$tc('global.default.success'),\n message: messageSaveSuccess,\n });\n\n document.dispatchEvent(\n new CustomEvent('unzer-settings-saved', {})\n );\n })\n .catch((err) => {\n this.isSaveSuccessful = false;\n\n this.createNotificationError({\n title: this.$tc('global.default.error'),\n message: err,\n });\n\n this.isLoading = false;\n });\n },\n\n onConfigChange(config) {\n this.config = config;\n this.isLoading = false;\n this.syncKeyPairConfig();\n },\n\n onLoadingChanged(value) {\n this.isLoading = value;\n },\n\n onSalesChannelChanged(config, salesChannelId) {\n if (config) {\n this.onConfigChange(config);\n }\n\n this.selectedSalesChannelId = salesChannelId;\n },\n\n onWebhookRegistered(privateKey) {\n this.loadWebhooks(privateKey);\n },\n\n loadWebhooks(privateKey) {\n this.isLoadingWebhooks = true;\n\n this.UnzerPaymentConfigurationService.getWebhooks(privateKey)\n .then((response) => {\n this.webhooks = response;\n this.webhookSelection = null;\n this.webhookSelectionLength = 0;\n this.loadedWebhooksPrivateKey = privateKey;\n })\n .catch(() => {\n this.webhooks = [];\n this.loadedWebhooksPrivateKey = false;\n })\n .finally(() => {\n this.isLoadingWebhooks = false;\n this.isClearingSuccessful = false;\n });\n },\n\n getBind(element, config) {\n let originalElement;\n\n if (config !== this.config) {\n this.config = config;\n }\n\n this.$refs.systemConfig.config.forEach((configElement) => {\n configElement.elements.forEach((child) => {\n if (child.name === element.name) {\n originalElement = child;\n return;\n }\n });\n });\n\n return originalElement || element;\n },\n\n keyPairSettingTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.${keyPairSetting.key}`\n );\n },\n\n keyPairSettingGroupTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.main`\n );\n },\n\n isShowWebhooksButtonEnabled(keyPairSetting) {\n return (\n keyPairSetting &&\n keyPairSetting.privateKey &&\n keyPairSetting.publicKey\n );\n },\n\n isRegisterWebhooksButtonEnabled(keyPairSetting) {\n return (\n !this.isLoading && keyPairSetting && keyPairSetting.privateKey\n );\n },\n\n syncKeyPairConfig() {\n const me = this;\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n if (!this.config[`UnzerPayment6.settings.${group}`]) {\n return;\n }\n this.config[`UnzerPayment6.settings.${group}`].forEach(\n (configKeyPairSetting) => {\n me.keyPairSettings.forEach(\n (keyPairSetting, index, collection) => {\n if (\n keyPairSetting.group ===\n configKeyPairSetting.group &&\n keyPairSetting.key ===\n configKeyPairSetting.key\n ) {\n collection[index] = configKeyPairSetting;\n }\n }\n );\n }\n );\n });\n },\n\n toggleAdditionalKeys() {\n this.isAdditionalKeysExpanded = !this.isAdditionalKeysExpanded;\n },\n },\n});\n","import './component/register-webhook';\nimport './component/unzer-webhooks-modal';\nimport './component/unzer-entity-single-select-delivery-status';\nimport './component/unzer-entity-multi-select-delivery-status';\nimport './component/unzer-google-pay-gateway-merchant-id';\nimport './component/unzer-payment-plugin-icon';\nimport './component/unzer-settings-subheading';\nimport './extension/sw-system-config';\n\nimport './page/unzer-payment-settings';\n\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nconst { Module } = Shopware;\n\nconst configuration = {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment-settings.module.title',\n description: 'unzer-payment-settings.module.description',\n version: '1.1.0',\n targetVersion: '1.1.0',\n\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n\n routes: {\n settings: {\n component: 'unzer-payment-settings',\n path: 'settings',\n meta: {\n parentPath: 'sw.settings.index',\n },\n },\n },\n\n extensionEntryRoute: {\n extensionName: 'UnzerPayment6',\n route: 'unzer.payment.configuration.settings',\n },\n\n settingsItem: {\n name: 'unzer-payment-configuration',\n to: 'unzer.payment.configuration.settings',\n label: 'unzer-payment-settings.module.title',\n group: 'plugins',\n iconComponent: 'unzer-payment-plugin-icon',\n backgroundEnabled: false,\n },\n};\n\nModule.register('unzer-payment-configuration', configuration);\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n fetchPaymentDetails(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/details`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n chargeTransaction(transaction, payment, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/charge/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n refundTransaction(transaction, charge, amount, reasonCode = null) {\n let apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/refund/${charge}/${amount}`;\n\n if (reasonCode !== null) {\n apiRoute = `${apiRoute}/${reasonCode}`;\n }\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n cancelTransaction(transaction, authorize, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/cancel/${authorize}/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n ship(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/ship`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider('UnzerPaymentService', (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentService(\n initContainer.httpClient,\n container.loginService\n );\n});\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentConfigurationService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n validateCredentials(credentials) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/validate-credentials`,\n credentials,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n registerWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/register-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n clearWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/clear-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getWebhooks(privateKey) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/get-webhooks`,\n { privateKey: privateKey },\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getGooglePayGatewayMerchantId(salesChannelId) {\n return this.httpClient\n .get(\n `_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${salesChannelId || ''}`,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider(\n 'UnzerPaymentConfigurationService',\n (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentConfigurationService(\n initContainer.httpClient,\n container.loginService\n );\n }\n);\n","{% block sw_payment_card_description %}\n
\n \n \n {{ $tc('sw-payment-card.deprecated') }}\n \n
\n
\n \n{% endblock %}","import template from './sw-payment-card.html.twig';\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nShopware.Component.override('sw-payment-card', {\n template,\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n});\n"],"names":["template$f","Component","Mixin","reasonCodes","template","amount","isAmountForPrepaymentRefund","errorResponse","message","template$e","Module","unzerPaymentModule","cents","decimalPrecision","value","paymentMethodId","template$d","data","transaction","date","item","cancelAmount","template$c","meta","template$b","basketItem","amountGross","amountNet","template$a","Criteria","unzerPaymentIds","criteria","template$9","Context","orderRepository","orderCriteria","order","orderTransaction","template$8","baseColumns","template$7","orderId","index","response","base","componentName","parent","next","currentRoute","template$6","page","limit","me","result","args","domainId","domain","domainAmount","salesChannelId","salesChannel","webhook","template$5","privateKey","selectedItems","url","Service","EntityCollection","template$4","template$3","template$2","parts","key","template$1","val","field","defaultConfig","keyPairSetting","keyPairIndex","keyPairValues","credentials","keyPairSettingItem","group","config","messageSaveSuccess","err","element","originalElement","configElement","child","configKeyPairSetting","collection","configuration","deDE","enGB","Application","ApiService","UnzerPaymentService","httpClient","loginService","apiEndpoint","apiRoute","payment","charge","reasonCode","authorize","container","initContainer","UnzerPaymentConfigurationService"],"mappings":"AAAA,MAAeA,EAAA,ijECGT,WAAEC,EAAS,MAAEC,CAAK,EAAK,SACvBC,EAAc,CAChB,OAAQ,SACR,OAAQ,SACR,OAAQ,QACZ,EAEAF,EAAU,SAAS,wBAAyB,CAC5C,SAAIG,EAEA,OAAQ,CAAC,qBAAqB,EAE9B,OAAQ,CAACF,EAAM,UAAU,cAAc,CAAC,EAExC,MAAO,CACH,MAAO,CACH,UAAW,GACX,aAAc,GACd,kBAAmB,EACnB,WAAY,IACf,CACJ,EAED,MAAO,CACH,oBAAqB,CACjB,KAAM,OACN,SAAU,EACb,EAED,gBAAiB,CACb,KAAM,OACN,SAAU,EACb,EAED,iBAAkB,CACd,KAAM,OACN,SAAU,GACV,QAAS,CACZ,CACJ,EAED,SAAU,CACN,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,iBAClC,KAAK,oBAAoB,QAAU,OAE1C,EAED,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,UAClC,KAAK,oBAAoB,QAAU,SACnC,EACI,KAAK,oBAAoB,SACzB,KAAK,gBAAgB,kBACjB,oCACJ,KAAK,gBAAgB,MAAM,OAAS,WACpC,KAAK,gBAAgB,MAAM,OAAS,SAG/C,EAED,sBAAuB,CACnB,IAAIG,EAAS,EAETC,EACA,KAAK,kBACL,KAAK,gBAAgB,kBACjB,mCAER,OAAI,KAAK,mBACLD,EAAS,KAAK,oBAAoB,QAGlC,KAAK,mBACLA,EAAS,KAAK,gBAAgB,OAAO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