diff --git a/composer.json b/composer.json index 6fb6381..bc1c32b 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "heidelpay/shopware-6", "description": "Heidelpay payment integration for Shopware 6", - "version": "v0.0.1", + "version": "0.0.1.1", "type": "shopware-platform-plugin", "license": "MIT", "minimum-stability": "dev", @@ -18,7 +18,7 @@ }, "require": { "php": "^7.2", - "heidelpay/heidelpay-php": "~1.2.0", + "heidelpay/heidelpay-php": "~1.2.8.0", "shopware/core": "*", "shopware/administration": "*", "shopware/storefront": "*" diff --git a/composer.lock b/composer.lock index 3b3b371..f848d39 100644 --- a/composer.lock +++ b/composer.lock @@ -8,7 +8,7 @@ "packages": [ { "name": "heidelpay/heidelpay-php", - "version": "1.2.5.1", + "version": "1.2.8.0", "source": { "type": "git", "url": "https://github.com/heidelpay/heidelpayPHP.git", diff --git a/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order-create-details-footer/index.js b/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order-create-details-footer/index.js index 7465b0e..1920bf1 100644 --- a/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order-create-details-footer/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order-create-details-footer/index.js @@ -10,15 +10,19 @@ Component.override('sw-order-create-details-footer', { computed: { paymentMethodCriteria() { /** @var {Criteria} paymentCriteria */ - const paymentCriteria = this.salesChannelCriteria; + const criteria = new Criteria(); - paymentCriteria.addFilter( + if (this.salesChannelId) { + criteria.addFilter(Criteria.equals('salesChannels.id', this.salesChannelId)); + } + + criteria.addFilter( Criteria.not('AND', [ Criteria.contains('handlerIdentifier', heidelPaymentHandler) ]) ); - return paymentCriteria; + return criteria; } } }); diff --git a/src/Resources/app/storefront/dist/storefront/js/heidel-payment6.js b/src/Resources/app/storefront/dist/storefront/js/heidel-payment6.js index fe173c4..93d8f25 100644 --- a/src/Resources/app/storefront/dist/storefront/js/heidel-payment6.js +++ b/src/Resources/app/storefront/dist/storefront/js/heidel-payment6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["heidel-payment6"],{"8LlO":function(e,t,n){"use strict";n.r(t);var i=n("FGIj");function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),i=document.querySelectorAll(this.options.errorContentSelector)[0];t&&""!==i.innerText?i.innerText="".concat(i.innerText,"\n").concat(e.message):i.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0)}},{key:"renderErrorToElement",value:function(e,t){var n=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText=e.message,n.hidden=!1,t.appendChild(n)}},{key:"_registerEvents",value:function(){this.submitButton.addEventListener("click",this._onSubmitButtonClick.bind(this))}},{key:"_onSubmitButtonClick",value:function(e){e.preventDefault(),this._validateForm()?(this.setSubmitButtonActive(!1),this.$emitter.publish("heidelpayBase_createResource")):this.setSubmitButtonActive(!0)}},{key:"_validateForm",value:function(){var e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(var n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,i.labels[0].innerText)},!0),e=!1):i.classList.remove("is-invalid")}return e}},{key:"_clearErrorMessage",value:function(){var e=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText="",e.hidden=!0}},{key:"getB2bCustomerObject",value:function(e){return{firstname:e.firstName,lastname:e.lastName,company:e.activeBillingAddress.company,salutation:e.salutation.salutationKey,birthDate:e.lastName.birthday,email:e.email,billingAddress:{street:e.activeBillingAddress.street,zip:e.activeBillingAddress.zipcode,city:e.activeBillingAddress.city,country:e.activeBillingAddress.country.name},shippingAddress:{street:e.activeShippingAddress.street,zip:e.activeShippingAddress.zipcode,city:e.activeShippingAddress.city,country:e.activeShippingAddress.country.name}}}}])&&o(n.prototype,i),r&&o(n,r),t}(i.a);c(l,"options",{publicKey:null,submitButtonId:"confirmFormSubmit",disabledClass:"disabled",resourceIdElementId:"heidelpayResourceId",confirmFormId:"confirmOrderForm",errorWrapperClass:"heidelpay-error-wrapper",errorContentSelector:".heidelpay-error-wrapper .alert-content",errorShouldNotBeEmpty:"%field% should not be empty",isOrderEdit:!1}),c(l,"heidelpayInstance",null);var h=n("gHbT");function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),i=document.querySelectorAll(this.options.errorContentSelector)[0];t&&""!==i.innerText?i.innerText="".concat(i.innerText,"\n").concat(e.message):i.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0)}},{key:"renderErrorToElement",value:function(e,t){var n=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText=e.message,n.hidden=!1,t.appendChild(n)}},{key:"_registerEvents",value:function(){this.submitButton.addEventListener("click",this._onSubmitButtonClick.bind(this))}},{key:"_onSubmitButtonClick",value:function(e){e.preventDefault(),this._validateForm()?(this.setSubmitButtonActive(!1),this.$emitter.publish("heidelpayBase_createResource")):this.setSubmitButtonActive(!0)}},{key:"_validateForm",value:function(){var e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(var n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,i.labels[0].innerText)},!0),e=!1):i.classList.remove("is-invalid")}return e}},{key:"_clearErrorMessage",value:function(){var e=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText="",e.hidden=!0}},{key:"getB2bCustomerObject",value:function(e){return{firstname:e.firstName,lastname:e.lastName,company:e.activeBillingAddress.company,salutation:e.salutation.salutationKey,birthDate:e.lastName.birthday,email:e.email,billingAddress:{street:e.activeBillingAddress.street,zip:e.activeBillingAddress.zipcode,city:e.activeBillingAddress.city,country:e.activeBillingAddress.country.name},shippingAddress:{street:e.activeShippingAddress.street,zip:e.activeShippingAddress.zipcode,city:e.activeShippingAddress.city,country:e.activeShippingAddress.country.name}}}}])&&o(n.prototype,i),r&&o(n,r),t}(i.a);c(l,"options",{publicKey:null,submitButtonId:"confirmFormSubmit",disabledClass:"disabled",resourceIdElementId:"heidelpayResourceId",confirmFormId:"confirmOrderForm",errorWrapperClass:"heidelpay-error-wrapper",errorContentSelector:".heidelpay-error-wrapper .alert-content",errorShouldNotBeEmpty:"%field% should not be empty",isOrderEdit:!1}),c(l,"heidelpayInstance",null);var h=n("gHbT");function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;ni.handleResponse(e))}registerWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}clearWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}}n.addServiceProvider("HeidelPaymentConfigurationService",e=>{const t=n.getContainer("init");return new s(t.httpClient,e.loginService)})},"1iz7":function(e,t,n){},"4aeB":function(e,t){e.exports='{% block heidel_payment_settings %}\n\n {% block heidel_payment_settings_header %}\n \n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n \n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}\n'},"5j/b":function(e,t){e.exports="{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.currency') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}
\n
{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}
\n
{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}
\n
{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}
\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}
\n
{{ paymentResource.shortId }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.id') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.state') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n"},"6E3l":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n \n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n \n{% endblock %}\n"},"6gNM":function(e,t,n){},BzwZ:function(e,t,n){var i=n("1iz7");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,n("SZ7m").default)("0d46815a",i,!0,{})},Eq9y:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","shortId":"Short-ID","id":"Payment-ID","state":"State","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)"},"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 occoured!","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."}}},"heidel-payment-settings":{"module":{"title":"Heidelpay","description":"Heidelpay"},"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"},"modal":{"close":"Close","webhook":{"title":"Webhooks","submit":{"register":"Register webhooks","clear":"Clear 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 occured","message":"Please contact us for more information"}}}}')},EsnK:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)"},"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"}}},"heidel-payment-settings":{"module":{"title":"Heidelpay","description":"Heidelpay"},"form":{"message":{"success":{"title":"Test erfolgreich","message":"Die angegebenen API-Zugangsdaten sind korrekt!"},"error":{"title":"Test fehlgeschlagen","message":"Die angegebenen API-Zugangsdaten sind nicht korret! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},"testButton":"API Zugangsdaten testen","webhookButton":"Webhooks registrieren testen"},"modal":{"close":"Schließen","webhook":{"title":"Webhooks","submit":{"register":"Webhooks registrieren","clear":"Webhooks entfernen"}}},"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"}}}}')},Gaz2:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'},KEl0:function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},KmwY:function(e,t){e.exports='{% block sw_order_create_details_footer_payment_method %}\n \n \n{% endblock %}\n'},PMv5:function(e,t){const{Application:n}=Shopware,i=Shopware.Classes.ApiService;class s extends i{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}chargeTransaction(e,t,n){const s=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}refundTransaction(e,t,n){const s=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new s(t.httpClient,e.loginService)})},R5Kq:function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},SAZ9:function(e,t,n){"use strict";n.r(t);var i=n("KEl0"),s=n.n(i);const{Component:a,Mixin:o}=Shopware;a.register("heidel-payment-actions",{template:s.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1,transactionAmount:0}),props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type},refundAmount:function(){return this.paymentResource.calculatedAmounts.charged-this.paymentResource.calculatedAmounts.cancelled},chargeAmount:function(){return this.paymentResource.calculatedAmounts.remaining},maxTransactionAmount(){let e=0;return this.isRefundPossible?e=this.refundAmount:this.isChargePossible&&(e=this.chargeAmount),e}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("5j/b"),c=n.n(r);const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t?t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage"):"invoice-missing-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.invoiceNotFoundMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var h=n("fpPm"),m=n.n(h);const{Component:p}=Shopware;p.register("heidel-payment-history",{template:m.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.transactions.forEach(t=>{const n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),i=this.$options.filters.date(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:i,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("nmHs"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var b=n("Gaz2"),f=n.n(b);const{Component:w}=Shopware;w.register("heidel-payment-basket",{template:f.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{const n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),i=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:i})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var k=n("R5Kq"),_=n.n(k);const{Component:S,Context:v}=Shopware,{Criteria:C}=Shopware.Data;S.override("sw-order-detail",{template:_.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new C(1,1);t.addAssociation("transactions"),e.get(this.orderId,v.api,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var D=n("KmwY"),R=n.n(D);const{Component:$,Context:T}=Shopware,{Criteria:A}=Shopware.Data;$.override("sw-order-create-details-footer",{template:R.a,computed:{paymentMethodCriteria(){const e=this.salesChannelCriteria;return e.addFilter(A.not("AND",[A.contains("handlerIdentifier","HeidelPayment6\\Components")])),e}}});var P=n("xTmB"),B=n.n(P);const{Component:x,StateDeprecated:E}=Shopware;x.register("heidel-payment-tab",{template:B.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>E.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(this.calculateAmounts(e))}).catch(()=>{this.isLoading=!1})})})})},calculateAmounts:e=>(e.calculatedAmounts={remaining:e.basket.amountTotalGross,charged:0,cancelled:0},e.transactions.forEach(t=>{"cancellation"===t.type?e.calculatedAmounts.cancelled+=t.amount:"charge"===t.type&&(e.calculatedAmounts.charged+=t.amount,e.calculatedAmounts.remaining-=t.amount)}),e)}});var M=n("EsnK"),L=n("Eq9y");const{Module:W}=Shopware;W.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",snippets:{"de-DE":M,"en-GB":L},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});var H=n("ectR"),N=n.n(H);n("vrVC");Shopware.Component.register("heidel-payment-register-webhook",{template:N.a,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","HeidelPaymentConfigurationService"],computed:{salesChannelDomainColumns:()=>[{property:"id",dataIndex:"id",label:"ID"},{property:"url",dataIndex:"url",label:"URL"}],salesChannelDomainRepository(){return this.repositoryFactory.create("sales_channel_domain")}},data:()=>({showWebhookModal:!1,isLoading:!1,isRegistering:!1,isRegistrationSuccessful:!1,isClearing:!1,isClearingSuccessful:!1,salesChannelDomains:{},selection:[]}),created(){this.salesChannelDomainRepository.search(new Shopware.Data.Criteria,Shopware.Context.api).then(e=>{this.salesChannelDomains=e})},methods:{openModal(){this.showWebhookModal=!0},closeModal(){this.showWebhookModal=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.isLoading=!0,this.HeidelPaymentConfigurationService.registerWebhooks({selection:this.selection}).then(t=>{e.isRegistrationSuccessful=!0,void 0!==t&&e.messageGeneration(t)}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.webhook.globalError.title"),message:this.$tc("heidel-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isLoading=!1,e.isRegistering=!1})},clearWebhooks(){const e=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.HeidelPaymentConfigurationService.clearWebhooks({selection:this.selection}).then(t=>{e.isClearingSuccessful=!0,void 0!==t&&e.messageGeneration(t)}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.webhook.globalError.title"),message:this.$tc("heidel-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isLoading=!1,e.isClearing=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1},onClearingFinished(){this.isClearingSuccessful=!1},onSelectItem(e){this.selection=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("heidel-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("heidel-payment-settings.webhook.messagePrefix",t)+n})})}}});var I=n("6E3l"),F=n.n(I);const{Component:z}=Shopware;z.override("sw-plugin-list",{template:F.a});var V=n("4aeB"),q=n.n(V);const{Component:G,Mixin:j}=Shopware,{Criteria:K}=Shopware.Data;G.register("heidel-payment-settings",{template:q.a,mixins:[j.getByName("notification"),j.getByName("sw-inline-snippet")],inject:["repositoryFactory","HeidelPaymentConfigurationService"],data:()=>({isLoading:!1,isTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},showWebhookModal:!1}),metaInfo:()=>({title:"Heidelpay"}),computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")}},methods:{getConfigValue(e){const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`HeidelPayment6.settings.${e}`]||t[`HeidelPayment6.settings.${e}`]},onValidateCredentials(){this.isTestSuccessful=!1,this.isTesting=!0;const e={publicKey:this.getConfigValue("publicKey"),privateKey:this.getConfigValue("privateKey"),salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.HeidelPaymentConfigurationService.validateCredentials(e).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment-settings.form.message.success.title"),message:this.$tc("heidel-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.form.message.error.title"),message:this.$tc("heidel-payment-settings.form.message.error.message")}),this.isTesting=!1})},onTestFinished(){this.isTestSuccessful=!1},onSave(){this.isLoading=!0,this.$refs.systemConfig.saveAll().then(()=>{this.createNotificationSuccess({title:this.$tc("sw-plugin-config.titleSaveSuccess"),message:this.$tc("sw-plugin-config.messageSaveSuccess")}),this.isLoading=!1}).catch(e=>{this.createNotificationError({title:this.$tc("sw-plugin-config.titleSaveError"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e},getBind(e,t){return t!==this.config&&(this.config=t),e},getDeliveryStatusCriteria(){const e=new K(1,100);return e.addFilter(K.equals("stateMachine.technicalName","order_delivery.state")),e},openWebhookModal(){this.showWebhookModal=!0},closeWebhookModal(){this.showWebhookModal=!1}}});const{Module:Z}=Shopware;Z.register("heidel-payment-configuration",{type:"plugin",name:"HeidelPayment",title:"heidel-payment-settings.module.title",description:"heidel-payment-settings.module.description",version:"0.0.1",targetVersion:"0.0.1",snippets:{"de-DE":M,"en-GB":L},routes:{settings:{component:"heidel-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}}});n("PMv5"),n("+kxS"),n("BzwZ")},ectR:function(e,t){e.exports='{% block heidel_payment_payment_register_webhook %}\n
\n \n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n \n \n \n \n\n \n \n
\n{% endblock %}\n'},fpPm:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},nmHs:function(e,t){e.exports='{% block heidel_payment_metadata %}\n \n{% endblock %}\n'},vrVC:function(e,t,n){var i=n("6gNM");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,n("SZ7m").default)("eb0a43b4",i,!0,{})},xTmB:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'}},[["SAZ9","runtime","vendors-node"]]]); \ No newline at end of file + +(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment6"],{"+k6L":function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},"5Wb7":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n \n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n \n{% endblock %}\n"},D4rn:function(e,t,n){"use strict";n.r(t);var i=n("+k6L"),s=n.n(i);const{Component:a,Mixin:o}=Shopware;a.register("heidel-payment-actions",{template:s.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1,transactionAmount:0}),props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type},refundAmount:function(){return this.paymentResource.calculatedAmounts.charged-this.paymentResource.calculatedAmounts.cancelled},chargeAmount:function(){return this.paymentResource.calculatedAmounts.remaining},maxTransactionAmount(){let e=0;return this.isRefundPossible?e=this.refundAmount:this.isChargePossible&&(e=this.chargeAmount),e}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("gQ1j"),c=n.n(r);const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t?t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage"):"invoice-missing-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.invoiceNotFoundMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var h=n("ofTY"),m=n.n(h);const{Component:p}=Shopware;p.register("heidel-payment-history",{template:m.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.transactions.forEach(t=>{const n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),i=this.$options.filters.date(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:i,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("thoX"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var b=n("zXXx"),f=n.n(b);const{Component:k}=Shopware;k.register("heidel-payment-basket",{template:f.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{const n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),i=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:i})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var w=n("TXG+"),_=n.n(w);const{Component:S,Context:v}=Shopware,{Criteria:D}=Shopware.Data;S.override("sw-order-detail",{template:_.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new D(1,1);t.addAssociation("transactions"),e.get(this.orderId,v.api,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var C=n("IGRu"),R=n.n(C);const{Component:$,Context:T}=Shopware,{Criteria:A}=Shopware.Data;$.override("sw-order-create-details-footer",{template:R.a,computed:{paymentMethodCriteria(){const e=this.salesChannelCriteria;return e.addFilter(A.not("AND",[A.contains("handlerIdentifier","HeidelPayment6\\Components")])),e}}});var P=n("btqN"),x=n.n(P);const{Component:B,StateDeprecated:M}=Shopware;B.register("heidel-payment-tab",{template:x.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>M.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(this.calculateAmounts(e))}).catch(()=>{this.isLoading=!1})})})})},calculateAmounts:e=>(e.calculatedAmounts={remaining:e.basket.amountTotalGross,charged:0,cancelled:0},e.transactions.forEach(t=>{"cancellation"===t.type?e.calculatedAmounts.cancelled+=t.amount:"charge"===t.type&&(e.calculatedAmounts.charged+=t.amount,e.calculatedAmounts.remaining-=t.amount)}),e)}});var L=n("yZy9"),E=n("Q9fF");const{Module:W}=Shopware;W.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",snippets:{"de-DE":L,"en-GB":E},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});var N=n("bmxS"),H=n.n(N);n("GDrB");Shopware.Component.register("heidel-payment-register-webhook",{template:H.a,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","HeidelPaymentConfigurationService"],computed:{salesChannelDomainColumns:()=>[{property:"id",dataIndex:"id",label:"ID"},{property:"url",dataIndex:"url",label:"URL"}],salesChannelDomainRepository(){return this.repositoryFactory.create("sales_channel_domain")}},data:()=>({showWebhookModal:!1,isLoading:!1,isRegistering:!1,isRegistrationSuccessful:!1,isClearing:!1,isClearingSuccessful:!1,salesChannelDomains:{},selection:[]}),created(){this.salesChannelDomainRepository.search(new Shopware.Data.Criteria,Shopware.Context.api).then(e=>{this.salesChannelDomains=e})},methods:{openModal(){this.showWebhookModal=!0},closeModal(){this.showWebhookModal=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.isLoading=!0,this.HeidelPaymentConfigurationService.registerWebhooks({selection:this.selection}).then(t=>{e.isRegistrationSuccessful=!0,void 0!==t&&e.messageGeneration(t)}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.webhook.globalError.title"),message:this.$tc("heidel-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isLoading=!1,e.isRegistering=!1})},clearWebhooks(){const e=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.HeidelPaymentConfigurationService.clearWebhooks({selection:this.selection}).then(t=>{e.isClearingSuccessful=!0,void 0!==t&&e.messageGeneration(t)}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.webhook.globalError.title"),message:this.$tc("heidel-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isLoading=!1,e.isClearing=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1},onClearingFinished(){this.isClearingSuccessful=!1},onSelectItem(e){this.selection=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("heidel-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("heidel-payment-settings.webhook.messagePrefix",t)+n})})}}});var F=n("5Wb7"),I=n.n(F);const{Component:z}=Shopware;z.override("sw-plugin-list",{template:I.a});var G=n("QtAk"),q=n.n(G);const{Component:V,Mixin:j}=Shopware,{Criteria:Z}=Shopware.Data;V.register("heidel-payment-settings",{template:q.a,mixins:[j.getByName("notification"),j.getByName("sw-inline-snippet")],inject:["repositoryFactory","HeidelPaymentConfigurationService"],data:()=>({isLoading:!1,isTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},showWebhookModal:!1}),metaInfo:()=>({title:"Heidelpay"}),computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")}},methods:{getConfigValue(e){const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`HeidelPayment6.settings.${e}`]||t[`HeidelPayment6.settings.${e}`]},onValidateCredentials(){this.isTestSuccessful=!1,this.isTesting=!0;const e={publicKey:this.getConfigValue("publicKey"),privateKey:this.getConfigValue("privateKey"),salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.HeidelPaymentConfigurationService.validateCredentials(e).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment-settings.form.message.success.title"),message:this.$tc("heidel-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("heidel-payment-settings.form.message.error.title"),message:this.$tc("heidel-payment-settings.form.message.error.message")}),this.isTesting=!1})},onTestFinished(){this.isTestSuccessful=!1},onSave(){this.isLoading=!0,this.$refs.systemConfig.saveAll().then(()=>{this.createNotificationSuccess({title:this.$tc("sw-plugin-config.titleSaveSuccess"),message:this.$tc("sw-plugin-config.messageSaveSuccess")}),this.isLoading=!1}).catch(e=>{this.createNotificationError({title:this.$tc("sw-plugin-config.titleSaveError"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e},getBind(e,t){return t!==this.config&&(this.config=t),e},getDeliveryStatusCriteria(){const e=new Z(1,100);return e.addFilter(Z.equals("stateMachine.technicalName","order_delivery.state")),e},openWebhookModal(){this.showWebhookModal=!0},closeWebhookModal(){this.showWebhookModal=!1}}});const{Module:O}=Shopware;O.register("heidel-payment-configuration",{type:"plugin",name:"HeidelPayment",title:"heidel-payment-settings.module.title",description:"heidel-payment-settings.module.description",version:"0.0.1",targetVersion:"0.0.1",snippets:{"de-DE":L,"en-GB":E},routes:{settings:{component:"heidel-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}}});n("mAjF"),n("quVS"),n("ycwP")},GDrB:function(e,t,n){var i=n("qz9Q");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,n("SZ7m").default)("1494dfff",i,!0,{})},IGRu:function(e,t){e.exports='{% block sw_order_create_details_footer_payment_method %}\n \n \n{% endblock %}\n'},Q9fF:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","shortId":"Short-ID","id":"Payment-ID","state":"State","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)"},"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 occoured!","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."}}},"heidel-payment-settings":{"module":{"title":"Heidelpay","description":"Heidelpay"},"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"},"modal":{"close":"Close","webhook":{"title":"Webhooks","submit":{"register":"Register webhooks","clear":"Clear 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 occured","message":"Please contact us for more information"}}}}')},QtAk:function(e,t){e.exports='{% block heidel_payment_settings %}\n\n {% block heidel_payment_settings_header %}\n \n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n \n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}\n'},"TXG+":function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},bmxS:function(e,t){e.exports='{% block heidel_payment_payment_register_webhook %}\n
\n \n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n \n \n \n \n\n \n \n
\n{% endblock %}\n'},btqN:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'},gQ1j:function(e,t){e.exports="{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.currency') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}
\n
{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}
\n
{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}
\n
{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}
\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}
\n
{{ paymentResource.shortId }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.id') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc('heidel-payment.paymentDetails.detail.state') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n"},mAjF:function(e,t){const{Application:n}=Shopware,i=Shopware.Classes.ApiService;class s extends i{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}chargeTransaction(e,t,n){const s=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}refundTransaction(e,t,n){const s=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new s(t.httpClient,e.loginService)})},ofTY:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},quVS:function(e,t){const{Application:n}=Shopware,i=Shopware.Classes.ApiService;class s extends i{constructor(e,t,n="heidel_payment"){super(e,t,n)}validateCredentials(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,e,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}registerWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}clearWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>i.handleResponse(e))}}n.addServiceProvider("HeidelPaymentConfigurationService",e=>{const t=n.getContainer("init");return new s(t.httpClient,e.loginService)})},qz9Q:function(e,t,n){},thoX:function(e,t){e.exports='{% block heidel_payment_metadata %}\n \n{% endblock %}\n'},yZy9:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)"},"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"}}},"heidel-payment-settings":{"module":{"title":"Heidelpay","description":"Heidelpay"},"form":{"message":{"success":{"title":"Test erfolgreich","message":"Die angegebenen API-Zugangsdaten sind korrekt!"},"error":{"title":"Test fehlgeschlagen","message":"Die angegebenen API-Zugangsdaten sind nicht korret! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},"testButton":"API Zugangsdaten testen","webhookButton":"Webhooks registrieren testen"},"modal":{"close":"Schließen","webhook":{"title":"Webhooks","submit":{"register":"Webhooks registrieren","clear":"Webhooks entfernen"}}},"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"}}}}')},ycwP:function(e,t,n){var i=n("zRs7");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,n("SZ7m").default)("767f10c8",i,!0,{})},zRs7:function(e,t,n){},zXXx:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'}},[["D4rn","runtime","vendors-node"]]]); + diff --git a/src/Resources/views/storefront/component/heidelpay/frames/paypal.html.twig b/src/Resources/views/storefront/component/heidelpay/frames/paypal.html.twig index 08b1ebd..bce3e3c 100644 --- a/src/Resources/views/storefront/component/heidelpay/frames/paypal.html.twig +++ b/src/Resources/views/storefront/component/heidelpay/frames/paypal.html.twig @@ -1,4 +1,5 @@ {% block heidelpay_frame_paypal_account %} + {# PayPal with stored account #} {% if page.extensions.heidelpayPayPal.displayPayPalAccountSelection and page.extensions.heidelpayPayPal.payPalAccounts|length > 0 %} {% block heidelpay_checkout_confirm_frame_card_body_title %}
@@ -9,7 +10,7 @@