From 3a59749e5caec726dd378449557b5e87fdff4821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= <n.goedde@kellerkinder.de> Date: Mon, 20 Jul 2020 10:22:17 +0200 Subject: [PATCH 1/6] [HEIDELPAYSUPPORT-11] Fix order creation in administration --- .../extension/sw-order-create-details-footer/index.js | 10 +++++++--- .../public/administration/js/heidel-payment6.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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/public/administration/js/heidel-payment6.js b/src/Resources/public/administration/js/heidel-payment6.js index f42a6dd..3be525c 100644 --- a/src/Resources/public/administration/js/heidel-payment6.js +++ b/src/Resources/public/administration/js/heidel-payment6.js @@ -1 +1 @@ -(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment6"],{"+kxS":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)})},"1iz7":function(e,t,n){},"4aeB":function(e,t){e.exports='{% block heidel_payment_settings %}\n<sw-page class="heidel-payment-settings">\n {% block heidel_payment_settings_header %}\n <template slot="smart-bar-header">\n <h2>\n {{ $tc(\'sw-settings.index.title\') }}\n <sw-icon name="small-arrow-medium-right" small></sw-icon>\n {{ $tc(\'heidel-payment-settings.module.title\') }}\n </h2>\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n <template slot="smart-bar-actions">\n {% block heidel_payment_settings_actions_save %}\n <sw-button-process\n class="sw-settings-login-registration__save-action"\n :isLoading="isLoading"\n :processSuccess="isSaveSuccessful"\n :disabled="isLoading || isTesting"\n variant="primary"\n @click="onSave">\n {{ $tc(\'global.default.save\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_test %}\n <sw-button-process\n :isLoading="isTesting"\n :processSuccess="isTestSuccessful"\n @process-finish="onTestFinished()"\n :disabled="isLoading"\n @click="onValidateCredentials">\n {{ $tc(\'heidel-payment-settings.form.testButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_register_webhooks %}\n <heidel-payment-register-webhook></heidel-payment-register-webhook>\n {% endblock %}\n\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n <template slot="content">\n <sw-card-view>\n <sw-system-config\n ref="systemConfig"\n salesChannelSwitchable\n inherit\n @config-changed="onConfigChange"\n domain="HeidelPayment6.settings">\n\n <template #card-element="{ element, config }">\n <div>\n <sw-form-field-renderer\n :config="{\n componentName: \'sw-entity-single-select\',\n label: getInlineSnippet(element.config.label),\n helpText: getInlineSnippet(element.config.helpText),\n entity: \'state_machine_state\',\n criteria: getDeliveryStatusCriteria(),\n }"\n v-model="config[element.name]"\n v-if="element.name.endsWith(\'statusForAutomaticShippingNotification\')">\n </sw-form-field-renderer>\n\n <sw-form-field-renderer\n v-bind="getBind(element, config)"\n v-model="config[element.name]"\n v-else>\n </sw-form-field-renderer>\n </div>\n </template>\n </sw-system-config>\n </sw-card-view>\n </template>\n {% endblock %}\n</sw-page>\n{% endblock %}\n'},"5j/b":function(e,t){e.exports="{% block heidel_payment_detail %}\n <sw-card class=\"heidel-payment-detail\" :title=\"$tc('heidel-payment.paymentDetails.detail.cardTitle')\">\n {% block heidel_payment_detail_container %}\n <sw-container columns=\"1fr 1fr 1fr\" gap=\"0 20px\">\n {% block heidel_payment_detail_container_left %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.currency') }}</dt>\n <dd>{{ paymentResource.currency }}</dd>\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}</dd>\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}</dt>\n <dd>{{ paymentResource.shortId }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.id') }}</dt>\n <dd>{{ paymentResource.id }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.state') }}</dt>\n <dd>{{ paymentResource.state.name }}</dd>\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n <sw-container v-if=\"paymentResource.isGuaranteed\" columns=\"1fr\" justify=\"left\">\n <sw-button-process :isLoading=\"isLoading\" :processSuccess=\"isSuccessful\" @click=\"ship\">\n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n </sw-button-process>\n </sw-container>\n {% endblock %}\n </sw-card>\n{% endblock %}\n"},"6E3l":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n <template v-if=\"item.composerName === 'heidelpay/shopware-6'\">\n <sw-context-menu-item :routerLink=\"{ name: 'heidel.payment.configuration.settings' }\">\n {{ $tc('sw-plugin.list.config') }}\n </sw-context-menu-item>\n </template>\n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n <template v-if=\"item.composerName !== 'heidel/payment6'\">\n {% parent %}\n </template>\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 <sw-card class="heidel-payment-basket" :title="$tc(\'heidel-payment.paymentDetails.basket.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_basket_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\n{% endblock %}\n'},KEl0:function(e,t){e.exports='{% block heidel_payment_actions %}\n <sw-container columns="1fr 1fr" gap="0 10px" v-on:click.native.stop>\n {% block heidel_payment_actions_amount_field %}\n <div class="heidel-payment-actions--input">\n <sw-number-field\n :min="0.01"\n :max="maxTransactionAmount"\n v-model="transactionAmount">\n </sw-number-field>\n </div>\n {% endblock %}\n\n <div class="heidel-payment-actions--button">\n {% block heidel_payment_actions_charge_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isChargePossible" @click="charge">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isRefundPossible" @click="refund">\n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n <sw-button :disabled="true" v-if="!isChargePossible && !isRefundPossible">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button>\n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n </div>\n </sw-container>\n{% endblock %}\n'},KmwY:function(e,t){e.exports='{% block sw_order_create_details_footer_payment_method %}\n <sw-entity-single-select\n size="small"\n entity="payment_method"\n v-model="context.paymentMethodId"\n class="sw-order-create-details-footer__item"\n :disabled="!isCustomerActive"\n :criteria="paymentMethodCriteria"\n :label="$tc(\'sw-order.createBase.detailsFooter.labelPaymentMethod\')"\n :placeholder="$tc(\'sw-order.createBase.detailsFooter.placeholderPaymentMethod\')">\n </sw-entity-single-select>\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 <sw-tabs-item v-if=\"isHeidelpayPayment\"\n :route=\"{ name: 'heidel-payment.payment.detail', params: { id: $route.params.id } }\"\n :title=\"$tc('heidel-payment.tabTitle')\">\n {{ $tc('heidel-payment.tabTitle') }}\n </sw-tabs-item>\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<div class="register-webhook--container">\n <sw-button-process\n :isLoading="isRegistering"\n :processSuccess="isRegistrationSuccessful"\n @process-finish="onRegistrationFinished()"\n :disabled="isLoading"\n @click="openModal">\n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n </sw-button-process>\n <sw-modal v-if="showWebhookModal" @modal-close="closeModal"\n :title="$tc(`heidel-payment-settings.modal.webhook.title`)" class="heidel-payment-detail--webhook-modal">\n <sw-data-grid\n v-on:select-item="onSelectItem"\n :dataSource="salesChannelDomains"\n :columns="salesChannelDomainColumns"\n :showActions="false"\n :showSelection="true">\n </sw-data-grid>\n\n <template slot="modal-footer">\n <sw-button :disabled="isLoading" @click="closeModal">\n {{ $tc(\'heidel-payment-settings.modal.close\') }}\n </sw-button>\n\n <sw-button-process\n @click="clearWebhooks"\n @process-finish="onClearingFinished()"\n :isLoading="isLoading" :processSuccess="isClearingSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.clear\') }}\n </sw-button-process>\n\n <sw-button-process\n @click="registerWebhooks"\n @process-finish="onRegistrationFinished()"\n :isLoading="isLoading" :processSuccess="isRegistrationSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.register\') }}\n </sw-button-process>\n </template>\n </sw-modal>\n</div>\n{% endblock %}\n'},fpPm:function(e,t){e.exports='{% block heidel_payment_history %}\n <sw-card :title="$tc(\'heidel-payment.paymentDetails.history.cardTitle\')">\n {% block heidel_payment_history_container %}\n <sw-container slot="grid" type="row">\n {% block heidel_payment_history_data_grid %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false">\n\n {% block heidel_payment_history_actions %}\n <template slot="actions" slot-scope="{ item }">\n {% block heidel_payment_history_data_grid_item_actions %}\n <heidel-payment-actions\n :transactionResource="item.resource"\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-actions>\n {% endblock %}\n </template>\n {% endblock %}\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n {% endblock %}\n </sw-card>\n{% endblock %}\n'},nmHs:function(e,t){e.exports='{% block heidel_payment_metadata %}\n <sw-card class="heidel-payment-metadata" :title="$tc(\'heidel-payment.paymentDetails.metadata.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_metadata_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\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 <div class="heidel-payment-detail">\n <div v-if="!isLoading">\n {% block heidel_payment_payment_details_content %}\n <template v-for="paymentResource in paymentResources">\n {% block heidel_payment_payment_details_content_payment_detail %}\n <heidel-payment-detail\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-detail>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_history %}\n <heidel-payment-history\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-history>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_basket %}\n <heidel-payment-basket\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-basket>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_metadata %}\n <heidel-payment-metadata\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-metadata>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_inner %}{% endblock %}\n </template>\n {% endblock %}\n </div>\n\n <sw-loader v-if="isLoading"></sw-loader>\n </div>\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 <sw-container columns="1fr 1fr" gap="0 10px" v-on:click.native.stop>\n {% block heidel_payment_actions_amount_field %}\n <div class="heidel-payment-actions--input">\n <sw-number-field\n :min="0.01"\n :max="maxTransactionAmount"\n v-model="transactionAmount">\n </sw-number-field>\n </div>\n {% endblock %}\n\n <div class="heidel-payment-actions--button">\n {% block heidel_payment_actions_charge_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isChargePossible" @click="charge">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isRefundPossible" @click="refund">\n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n <sw-button :disabled="true" v-if="!isChargePossible && !isRefundPossible">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button>\n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n </div>\n </sw-container>\n{% endblock %}\n'},"5Wb7":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n <template v-if=\"item.composerName === 'heidelpay/shopware-6'\">\n <sw-context-menu-item :routerLink=\"{ name: 'heidel.payment.configuration.settings' }\">\n {{ $tc('sw-plugin.list.config') }}\n </sw-context-menu-item>\n </template>\n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n <template v-if=\"item.composerName !== 'heidelpay/showpare-6'\">\n {% parent %}\n </template>\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=new A;return this.salesChannelId&&e.addFilter(A.equals("salesChannels.id",this.salesChannelId)),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 q=n("QtAk"),G=n.n(q);const{Component:V,Mixin:j}=Shopware,{Criteria:Z}=Shopware.Data;V.register("heidel-payment-settings",{template:G.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 <sw-entity-single-select\n size="small"\n entity="payment_method"\n v-model="context.paymentMethodId"\n class="sw-order-create-details-footer__item"\n :disabled="!isCustomerActive"\n :criteria="paymentMethodCriteria"\n :label="$tc(\'sw-order.createBase.detailsFooter.labelPaymentMethod\')"\n :placeholder="$tc(\'sw-order.createBase.detailsFooter.placeholderPaymentMethod\')">\n </sw-entity-single-select>\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<sw-page class="heidel-payment-settings">\n {% block heidel_payment_settings_header %}\n <template slot="smart-bar-header">\n <h2>\n {{ $tc(\'sw-settings.index.title\') }}\n <sw-icon name="small-arrow-medium-right" small></sw-icon>\n {{ $tc(\'heidel-payment-settings.module.title\') }}\n </h2>\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n <template slot="smart-bar-actions">\n {% block heidel_payment_settings_actions_save %}\n <sw-button-process\n class="sw-settings-login-registration__save-action"\n :isLoading="isLoading"\n :processSuccess="isSaveSuccessful"\n :disabled="isLoading || isTesting"\n variant="primary"\n @click="onSave">\n {{ $tc(\'global.default.save\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_test %}\n <sw-button-process\n :isLoading="isTesting"\n :processSuccess="isTestSuccessful"\n @process-finish="onTestFinished()"\n :disabled="isLoading"\n @click="onValidateCredentials">\n {{ $tc(\'heidel-payment-settings.form.testButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_register_webhooks %}\n <heidel-payment-register-webhook></heidel-payment-register-webhook>\n {% endblock %}\n\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n <template slot="content">\n <sw-card-view>\n <sw-system-config\n ref="systemConfig"\n salesChannelSwitchable\n inherit\n @config-changed="onConfigChange"\n domain="HeidelPayment6.settings">\n\n <template #card-element="{ element, config }">\n <div>\n <sw-form-field-renderer\n :config="{\n componentName: \'sw-entity-single-select\',\n label: getInlineSnippet(element.config.label),\n helpText: getInlineSnippet(element.config.helpText),\n entity: \'state_machine_state\',\n criteria: getDeliveryStatusCriteria(),\n }"\n v-model="config[element.name]"\n v-if="element.name.endsWith(\'statusForAutomaticShippingNotification\')">\n </sw-form-field-renderer>\n\n <sw-form-field-renderer\n v-bind="getBind(element, config)"\n v-model="config[element.name]"\n v-else>\n </sw-form-field-renderer>\n </div>\n </template>\n </sw-system-config>\n </sw-card-view>\n </template>\n {% endblock %}\n</sw-page>\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 <sw-tabs-item v-if=\"isHeidelpayPayment\"\n :route=\"{ name: 'heidel-payment.payment.detail', params: { id: $route.params.id } }\"\n :title=\"$tc('heidel-payment.tabTitle')\">\n {{ $tc('heidel-payment.tabTitle') }}\n </sw-tabs-item>\n {% endblock %}\n{% endblock %}"},bmxS:function(e,t){e.exports='{% block heidel_payment_payment_register_webhook %}\n<div class="register-webhook--container">\n <sw-button-process\n :isLoading="isRegistering"\n :processSuccess="isRegistrationSuccessful"\n @process-finish="onRegistrationFinished()"\n :disabled="isLoading"\n @click="openModal">\n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n </sw-button-process>\n <sw-modal v-if="showWebhookModal" @modal-close="closeModal"\n :title="$tc(`heidel-payment-settings.modal.webhook.title`)" class="heidel-payment-detail--webhook-modal">\n <sw-data-grid\n v-on:select-item="onSelectItem"\n :dataSource="salesChannelDomains"\n :columns="salesChannelDomainColumns"\n :showActions="false"\n :showSelection="true">\n </sw-data-grid>\n\n <template slot="modal-footer">\n <sw-button :disabled="isLoading" @click="closeModal">\n {{ $tc(\'heidel-payment-settings.modal.close\') }}\n </sw-button>\n\n <sw-button-process\n @click="clearWebhooks"\n @process-finish="onClearingFinished()"\n :isLoading="isLoading" :processSuccess="isClearingSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.clear\') }}\n </sw-button-process>\n\n <sw-button-process\n @click="registerWebhooks"\n @process-finish="onRegistrationFinished()"\n :isLoading="isLoading" :processSuccess="isRegistrationSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.register\') }}\n </sw-button-process>\n </template>\n </sw-modal>\n</div>\n{% endblock %}\n'},btqN:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n <div class="heidel-payment-detail">\n <div v-if="!isLoading">\n {% block heidel_payment_payment_details_content %}\n <template v-for="paymentResource in paymentResources">\n {% block heidel_payment_payment_details_content_payment_detail %}\n <heidel-payment-detail\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-detail>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_history %}\n <heidel-payment-history\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-history>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_basket %}\n <heidel-payment-basket\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-basket>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_metadata %}\n <heidel-payment-metadata\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-metadata>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_inner %}{% endblock %}\n </template>\n {% endblock %}\n </div>\n\n <sw-loader v-if="isLoading"></sw-loader>\n </div>\n{% endblock %}\n'},gQ1j:function(e,t){e.exports="{% block heidel_payment_detail %}\n <sw-card class=\"heidel-payment-detail\" :title=\"$tc('heidel-payment.paymentDetails.detail.cardTitle')\">\n {% block heidel_payment_detail_container %}\n <sw-container columns=\"1fr 1fr 1fr\" gap=\"0 20px\">\n {% block heidel_payment_detail_container_left %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.currency') }}</dt>\n <dd>{{ paymentResource.currency }}</dd>\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}</dd>\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}</dt>\n <dd>{{ paymentResource.shortId }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.id') }}</dt>\n <dd>{{ paymentResource.id }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.state') }}</dt>\n <dd>{{ paymentResource.state.name }}</dd>\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n <sw-container v-if=\"paymentResource.isGuaranteed\" columns=\"1fr\" justify=\"left\">\n <sw-button-process :isLoading=\"isLoading\" :processSuccess=\"isSuccessful\" @click=\"ship\">\n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n </sw-button-process>\n </sw-container>\n {% endblock %}\n </sw-card>\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 <sw-card :title="$tc(\'heidel-payment.paymentDetails.history.cardTitle\')">\n {% block heidel_payment_history_container %}\n <sw-container slot="grid" type="row">\n {% block heidel_payment_history_data_grid %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false">\n\n {% block heidel_payment_history_actions %}\n <template slot="actions" slot-scope="{ item }">\n {% block heidel_payment_history_data_grid_item_actions %}\n <heidel-payment-actions\n :transactionResource="item.resource"\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-actions>\n {% endblock %}\n </template>\n {% endblock %}\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n {% endblock %}\n </sw-card>\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 <sw-card class="heidel-payment-metadata" :title="$tc(\'heidel-payment.paymentDetails.metadata.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_metadata_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\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 <sw-card class="heidel-payment-basket" :title="$tc(\'heidel-payment.paymentDetails.basket.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_basket_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\n{% endblock %}\n'}},[["D4rn","runtime","vendors-node"]]]); \ No newline at end of file From b3d43ca505e3a02eedf7521bfa316190b68b9e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= <n.goedde@kellerkinder.de> Date: Mon, 20 Jul 2020 10:34:43 +0200 Subject: [PATCH 2/6] Add auto package for support tickets --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4225ee6..31b0bfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,6 +64,7 @@ package: - tags - master - integration* + - bugfix/HEIDELPAYSUPPORT* services: - mysql:5.7 script: From b789d055c78f1c6cc910d95e95575dd7b2c5e814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= <n.goedde@kellerkinder.de> Date: Mon, 20 Jul 2020 10:37:09 +0200 Subject: [PATCH 3/6] Remove package creation for support tickets --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31b0bfa..4225ee6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,7 +64,6 @@ package: - tags - master - integration* - - bugfix/HEIDELPAYSUPPORT* services: - mysql:5.7 script: From 1e279143197d7c658eb6d5d0f998fa83e5f25ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= <n.goedde@kellerkinder.de> Date: Thu, 23 Jul 2020 16:11:56 +0200 Subject: [PATCH 4/6] Fix paypal checkout if accounts should be stored --- .../storefront/dist/storefront/js/heidel-payment6.js | 2 +- .../public/administration/js/heidel-payment6.js | 2 +- .../component/heidelpay/frames/paypal.html.twig | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,u(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayInstance=new window.heidelpay(this.options.publicKey),this.options.isOrderEdit?this.submitButton=document.getElementById(this.options.confirmFormId).getElementsByTagName("button")[0]:this.submitButton=document.getElementById(this.options.submitButtonId),this.confirmForm=document.getElementById(this.options.confirmFormId),this._registerEvents()}},{key:"setSubmitButtonActive",value:function(e){e?(this.submitButton.classList.remove(this.options.disabledClass),this.submitButton.disabled=!1):(this.submitButton.classList.add(this.options.disabledClass),this.submitButton.disabled=!0)}},{key:"submitResource",value:function(e){document.getElementById(this.options.resourceIdElementId).value=e.id,this.confirmForm.submit()}},{key:"submitTypeId",value:function(e){document.getElementById(this.options.resourceIdElementId).value=e,this.confirmForm.submit()}},{key:"showError",value:function(e){var t=arguments.length>1&&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;n<t.length;n++){var i=t[n];i.required&&""===i.value?(i.classList.add("is-invalid"),0===i.labels.length&&e?i.scrollIntoView({block:"end",behavior:"smooth"}):i.labels.length>0&&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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,f(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this._createForm(),this._registerEvents(),this.options.hasSavedCards?h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0:this._heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_createForm",value:function(){this.creditCard=this._heidelpayPlugin.heidelpayInstance.Card(),this.creditCard.create("number",{containerId:this.options.numberFieldInputId,onlyIframe:!0}),this.creditCard.create("expiry",{containerId:this.options.expiryFieldId,onlyIframe:!0}),this.creditCard.create("cvc",{containerId:this.options.cvcFieldId,onlyIframe:!0}),this.creditCard.addEventListener("change",this._onChangeForm.bind(this))}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSavedCards)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this._heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target;h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewId,t.id===this.options.radioButtonNewId?this._heidelpayPlugin.setSubmitButtonActive(!0===this.cvcValid&&!0===this.numberValid&&!0===this.expiryValid):this._heidelpayPlugin.setSubmitButtonActive(!0)}},{key:"_onChangeForm",value:function(e){if(e.cardType){var t=this.options.placeholderBrandImageUrl;return"unknown"!==e.cardType.type&&(t=this._getBrandImageUrl(e.cardType.type)),void(document.getElementById(this.options.iconFieldId).src=t)}if(e.type&&!this.submitting){var n=this._getInputElementByEvent(e),i=this._getErrorElementByEvent(e);!1===e.success?(n.classList.add(this.options.invalidClass),i.hidden=!1):!0===e.success&&(n.classList.remove(this.options.invalidClass),i.hidden=!0),e.error&&(i.getElementsByClassName("heidelpay-error-message")[0].innerText=e.error),"cvc"===e.type?this.cvcValid=e.success:"number"===e.type?this.numberValid=e.success:"expiry"===e.type&&(this.expiryValid=e.success),this._heidelpayPlugin.setSubmitButtonActive(!0===this.cvcValid&&!0===this.numberValid&&!0===this.expiryValid)}}},{key:"_onCreateResource",value:function(){var e=this,t=null;this.options.hasSavedCards&&(t=h.a.querySelector(this.el,this.options.selectedRadioButtonSelector)),this.submitting=!0,this._heidelpayPlugin.setSubmitButtonActive(!1),null===t||t.id===this.options.radioButtonNewId?this.creditCard.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)})):this._heidelpayPlugin.submitTypeId(t.value)}},{key:"_getInputElementByEvent",value:function(e){var t="#heidelpay-credit-card-".concat(e.type);return h.a.querySelector(this.el,t)}},{key:"_getErrorElementByEvent",value:function(e){var t="#heidelpay-credit-card-".concat(e.type,"-error");return h.a.querySelector(this.el,t)}},{key:"_submitPayment",value:function(e){this._heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this._heidelpayPlugin.showError(e)}},{key:"_getBrandImageUrl",value:function(e){return"https://static.heidelpay.com/assets/images/brands/".concat(e,".svg")}}])&&p(n.prototype,i),r&&p(n,r),t}(i.a);function g(e){return(g="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 _(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function P(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}m(v,"options",{numberFieldId:"heidelpay-credit-card-number",numberFieldInputId:"heidelpay-credit-card-number-input",expiryFieldId:"heidelpay-credit-card-expiry",cvcFieldId:"heidelpay-credit-card-cvc",iconFieldId:"heidelpay-credit-card-icon",invalidClass:"is-invalid",elementWrapperSelector:".heidelpay-credit-card-wrapper-elements",radioButtonSelector:'*[name="savedCreditCard"]',radioButtonNewId:"card-new",selectedRadioButtonSelector:'*[name="savedCreditCard"]:checked',hasSavedCards:!1,placeholderBrandImageUrl:"https://static.heidelpay.com/assets/images/common/group-5.svg"}),m(v,"creditCard",void 0),m(v,"submitting",!1),m(v,"_heidelpayPlugin",null);var E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),P(this,S(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._hideHeidelpayCard(),this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoice=this.heidelpayPlugin.heidelpayInstance.Invoice(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.invoice.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}},{key:"_hideHeidelpayCard",value:function(){document.getElementById(this.options.heidelpayCardId).hidden=!0}}])&&_(n.prototype,i),r&&_(n,r),t}(i.a);function I(e){return(I="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 C(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function O(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}w(E,"options",{heidelpayCardId:"heidelpay-card"}),w(E,"invoice",void 0),w(E,"heidelpayPlugin",null);var A=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),O(this,k(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoiceGuaranteed=this.heidelpayPlugin.heidelpayInstance.InvoiceGuaranteed(),this.options.isB2BCustomer&&this._createB2bForm(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_createB2bForm",value:function(){var e=this;this.b2bCustomerProvider=this.heidelpayPlugin.heidelpayInstance.B2BCustomer(),this.b2bCustomerProvider.b2bCustomerEventHandler=function(t){return e._onValidateB2bForm(t)},this.b2bCustomerProvider.initFormFields(this.heidelpayPlugin.getB2bCustomerObject(this.options.customerInfo)),this.b2bCustomerProvider.create({containerId:"heidelpay-b2b-form"})}},{key:"_onValidateB2bForm",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.options.isB2BCustomer?this.b2bCustomerProvider.createCustomer().then((function(t){return e._onB2bCustomerCreated(t.id)})).catch((function(t){return e._handleError(t)})):this.invoiceGuaranteed.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_onB2bCustomerCreated",value:function(e){var t=this;document.getElementById("heidelpayCustomerId").value=e,this.invoiceGuaranteed.createResource().then((function(e){return t._submitPayment(e)})).catch((function(e){return t._handleError(e)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&C(n.prototype,i),r&&C(n,r),t}(i.a);function F(e){return(F="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 T(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function D(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}R(A,"options",{isB2BCustomer:!1,customerInfo:null}),R(A,"invoiceGuaranteed",void 0),R(A,"heidelpayPlugin",null),R(A,"b2bCustomerProvider",null);var L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,x(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&H(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoiceFactoring=this.heidelpayPlugin.heidelpayInstance.InvoiceFactoring(),this.options.isB2BCustomer&&this._createB2bForm(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_createB2bForm",value:function(){var e=this;this.b2bCustomerProvider=this.heidelpayPlugin.heidelpayInstance.B2BCustomer(),this.b2bCustomerProvider.b2bCustomerEventHandler=function(t){return e._onValidateB2bForm(t)},this.b2bCustomerProvider.initFormFields(this.heidelpayPlugin.getB2bCustomerObject(this.options.customerInfo)),this.b2bCustomerProvider.create({containerId:"heidelpay-b2b-form"})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.options.isB2BCustomer?this.b2bCustomerProvider.createCustomer().then((function(t){return e._onB2bCustomerCreated(t.id)})).catch((function(t){return e._handleError(t)})):this.invoiceFactoring.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_onB2bCustomerCreated",value:function(e){var t=this;document.getElementById("heidelpayCustomerId").value=e,this.invoiceFactoring.createResource().then((function(e){return t._submitPayment(e)})).catch((function(e){return t._handleError(e)}))}},{key:"_onValidateB2bForm",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&T(n.prototype,i),r&&T(n,r),t}(i.a);function q(e){return(q="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 M(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function V(e,t){return!t||"object"!==q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t){return($=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}N(L,"options",{isB2BCustomer:!1,customerInfo:null}),N(L,"invoiceFactoring",void 0),N(L,"heidelpayPlugin",null),N(L,"b2bCustomerProvider",null);var z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,W(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.eps=this.heidelpayPlugin.heidelpayInstance.EPS(),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){this.eps.create("eps",{containerId:"heidelpay-eps-container"})}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.eps.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&M(n.prototype,i),r&&M(n,r),t}(i.a);function U(e){return(U="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 K(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function J(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}G(z,"eps",void 0),G(z,"heidelpayPlugin",null);var Z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,Q(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&X(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.ideal=this.heidelpayPlugin.heidelpayInstance.Ideal(),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){this.ideal.create("ideal",{containerId:"heidelpay-ideal-container"}),this.heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this}),this.ideal&&this.ideal.addEventListener("change",(function(t){return e._onFormChange(t)}),{scope:this})}},{key:"_onFormChange",value:function(e){e.value&&this.heidelpayPlugin.setSubmitButtonActive(!0)}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.ideal.createResource().then((function(t){return e.heidelpayPlugin.submitResource(t)})).catch((function(t){return e.heidelpayPlugin.showError(t)}))}}])&&K(n.prototype,i),r&&K(n,r),t}(i.a);function ee(e){return(ee="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 te(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ne(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ie(e){return(ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Y(Z,"ideal",void 0),Y(Z,"heidelpayPlugin",null);var ae=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ne(this,ie(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&re(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.sepa=this.heidelpayPlugin.heidelpayInstance.SepaDirectDebit(),this._createForm(),this._registerEvents(),this.options.hasSepaDevices?h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0:this.heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_createForm",value:function(){this.sepa.create("sepa-direct-debit",{containerId:"heidelpay-sepa-container"})}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSepaDevices)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this.sepa.addEventListener("change",(function(t){return e._onFormChange(t)})),this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target;h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewAccountId,t&&t.id!==this.options.radioButtonNewAccountId?this.heidelpayPlugin.setSubmitButtonActive(!0):this.heidelpayPlugin.setSubmitButtonActive(this.sepa.validated)}},{key:"_onFormChange",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this,t=document.getElementById(this.options.acceptMandateId),n=document.querySelector(this.options.selectedRadioButtonSelector);if(this.options.hasSepaDevices&&n&&n.id!==this.options.radioButtonNewAccountId)this.heidelpayPlugin.setSubmitButtonActive(!1),this._submitDevicePayment(n.value);else{if(!t.checked)return this._handleError({message:this.options.mandateNotAcceptedError}),void t.classList.add("is-invalid");this.heidelpayPlugin.setSubmitButtonActive(!1),this.sepa.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_submitDevicePayment",value:function(e){this.heidelpayPlugin.submitTypeId(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&te(n.prototype,i),r&&te(n,r),t}(i.a);function ue(e){return(ue="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 se(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ce(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function he(e,t){return(he=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}oe(ae,"options",{acceptMandateId:"acceptSepaMandate",mandateNotAcceptedError:"Please accept the SEPA direct debit mandate in order to continue.",elementWrapperSelector:".heidelpay-sepa-wrapper-elements",radioButtonSelector:'*[name="savedDirectDebitDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedDirectDebitDevice"]:checked',hasSepaDevices:!1}),oe(ae,"sepa",void 0),oe(ae,"heidelpayPlugin",null);var pe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ce(this,le(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&he(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){var e=document.getElementById(this.options.birthDateFieldId);this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.sepa=this.heidelpayPlugin.heidelpayInstance.SepaDirectDebitGuaranteed(),this._createForm(),this._registerEvents(),this.options.hasSepaDevices?(h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0,e.required=!1):(e.required=!0,this.heidelpayPlugin.setSubmitButtonActive(!1))}},{key:"_createForm",value:function(){this.sepa.create("sepa-direct-debit-guaranteed",{containerId:"heidelpay-sepa-container"})}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSepaDevices)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this.sepa.addEventListener("change",(function(t){return e._onFormChange(t)})),this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target,n=h.a.querySelector(this.el,this.options.elementWrapperSelector),i=document.getElementById(this.options.birthDateFieldId);n.hidden=t.id!==this.options.radioButtonNewAccountId,t&&t.id!==this.options.radioButtonNewAccountId?(this.heidelpayPlugin.setSubmitButtonActive(!0),i.required=!1):(this.heidelpayPlugin.setSubmitButtonActive(this.sepa.validated),i.required=!0)}},{key:"_onFormChange",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this,t=document.getElementById(this.options.acceptMandateId),n=document.querySelector(this.options.selectedRadioButtonSelector);if(this.options.hasSepaDevices&&n&&n.id!==this.options.radioButtonNewAccountId)this.heidelpayPlugin.setSubmitButtonActive(!1),this._submitDevicePayment(n.value);else{if(!t.checked)return this._handleError({message:this.options.mandateNotAcceptedError}),void t.classList.add("is-invalid");this.heidelpayPlugin.setSubmitButtonActive(!1),this.sepa.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_submitDevicePayment",value:function(e){this.heidelpayPlugin.submitTypeId(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&se(n.prototype,i),r&&se(n,r),t}(i.a);de(pe,"options",{birthDateFieldId:"heidelpayBirthday",acceptMandateId:"acceptSepaMandate",mandateNotAcceptedError:"Please accept the SEPA direct debit mandate in order to continue.",elementWrapperSelector:".heidelpay-sepa-wrapper-elements",radioButtonSelector:'*[name="savedDirectDebitDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedDirectDebitDevice"]:checked'}),de(pe,"sepa",void 0),de(pe,"heidelpayPlugin",null);var ye=n("u0Tz");function fe(e){return(fe="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 be(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function me(e,t){return!t||"object"!==fe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),me(this,ve(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ge(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.hirePurchase=this.heidelpayPlugin.heidelpayInstance.HirePurchase(),this.heidelpayPlugin.setSubmitButtonActive(!1),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){var e=this,t=document.getElementById(this.options.formLoadingIndicatorElementId);ye.a.create(t),this.hirePurchase.create({containerId:"heidelpay-hire-purchase-container",amount:this.options.hirePurchaseAmount.toFixed(4),currency:this.options.hirePurchaseCurrency,effectiveInterest:this.options.hirePurchaseEffectiveInterest,orderDate:this.options.hirePurchaseOrderDate}).then((function(){t.hidden=!0})).catch((function(n){e.heidelpayPlugin.renderErrorToElement(n,t),e.heidelpayPlugin.setSubmitButtonActive(!1)})).finally((function(){ye.a.remove(t)}))}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this}),this.hirePurchase.addEventListener("hirePurchaseEvent",(function(t){return e._onChangeHirePurchaseForm(t)}))}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.hirePurchase.createResource().then((function(t){return e.heidelpayPlugin.submitResource(t)})).catch((function(t){return e.heidelpayPlugin.showError(t)}))}},{key:"_onChangeHirePurchaseForm",value:function(e){if("validate"===e.action&&(e.success?this.heidelpayPlugin.setSubmitButtonActive(!0):this.heidelpayPlugin.setSubmitButtonActive(!1)),"plan-detail"===e.currentStep){var t=document.getElementById(this.options.installmentsTotalValueElementId),n=document.getElementById(this.options.installmentsInterestValueElementId);t.innerText=this._formatCurrency(this.hirePurchase.selectedInstallmentPlan.totalAmount)+this.options.starSymbol,n.innerText=this._formatCurrency(this.hirePurchase.selectedInstallmentPlan.totalInterestAmount)+this.options.starSymbol}}},{key:"_formatCurrency",value:function(e){return e.toLocaleString(this.options.currencyFormatLocale,{style:"currency",currency:this.options.currencyIso})}}])&&be(n.prototype,i),r&&be(n,r),t}(i.a);function Se(e){return(Se="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 Be(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function we(e,t){return!t||"object"!==Se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_e(Pe,"options",{hirePurchaseAmount:0,hirePurchaseCurrency:"",hirePurchaseEffectiveInterest:0,hirePurchaseOrderDate:"",installmentsTotalValueElementId:"heidelpay-installments-total",installmentsInterestValueElementId:"heidelpay-installments-interest",formLoadingIndicatorElementId:"element-loader",currencyIso:"EUR",currencyFormatLocale:"en-GB",starSymbol:"*"}),_e(Pe,"hirePurchase",void 0),_e(Pe,"heidelpayPlugin",null);var Oe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),we(this,Ee(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ie(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this._heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=null;this._heidelpayPlugin.setSubmitButtonActive(!1),this.options.hasSavedAccounts&&(e=document.querySelectorAll(this.options.selectedRadioButtonSelector)[0]),null===e||"new"===e.value?document.getElementById(this._heidelpayPlugin.options.confirmFormId).submit():this._heidelpayPlugin.submitTypeId(e.value)}}])&&Be(n.prototype,i),r&&Be(n,r),t}(i.a);Ce(Oe,"options",{radioButtonSelector:'input[name="savedPayPalAccount"]',selectedRadioButtonSelector:'input[name="savedPayPalAccount"]:checked',radioButtonNewSelector:"#new",hasSavedAccounts:!1}),Ce(Oe,"submitting",!1),Ce(Oe,"_heidelpayPlugin",null);var ke=window.PluginManager;ke.register("HeidelpayBase",l,"[data-heidelpay-base]"),ke.register("HeidelpayCreditCard",v,"[data-heidelpay-credit-card]"),ke.register("HeidelpayInvoice",E,"[data-heidelpay-invoice]"),ke.register("HeidelpayInvoiceGuaranteed",A,"[data-heidelpay-invoice-guaranteed]"),ke.register("HeidelpayInvoiceFactoring",L,"[data-heidelpay-invoice-factoring]"),ke.register("HeidelpayEps",z,"[data-heidelpay-eps]"),ke.register("HeidelpayIdeal",Z,"[data-heidelpay-ideal]"),ke.register("HeidelpaySepaDirectDebit",ae,"[data-heidelpay-sepa-direct-debit]"),ke.register("HeidelpaySepaDirectDebitGuaranteed",pe,"[data-heidelpay-sepa-direct-debit-guaranteed]"),ke.register("HeidelpayHirePurchase",Pe,"[data-heidelpay-hire-purchase]"),ke.register("HeidelpayPaypal",Oe,"[data-heidelpay-paypal]")}},[["8LlO","runtime","vendor-node","vendor-shared"]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([["heidel-payment6"],{XtTf: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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,u(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayInstance=new window.heidelpay(this.options.publicKey),this.options.isOrderEdit?this.submitButton=document.getElementById(this.options.confirmFormId).getElementsByTagName("button")[0]:this.submitButton=document.getElementById(this.options.submitButtonId),this.confirmForm=document.getElementById(this.options.confirmFormId),this._registerEvents()}},{key:"setSubmitButtonActive",value:function(e){e?(this.submitButton.classList.remove(this.options.disabledClass),this.submitButton.disabled=!1):(this.submitButton.classList.add(this.options.disabledClass),this.submitButton.disabled=!0)}},{key:"submitResource",value:function(e){document.getElementById(this.options.resourceIdElementId).value=e.id,this.confirmForm.submit()}},{key:"submitTypeId",value:function(e){document.getElementById(this.options.resourceIdElementId).value=e,this.confirmForm.submit()}},{key:"showError",value:function(e){var t=arguments.length>1&&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;n<t.length;n++){var i=t[n];i.required&&""===i.value?(i.classList.add("is-invalid"),0===i.labels.length&&e?i.scrollIntoView({block:"end",behavior:"smooth"}):i.labels.length>0&&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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,f(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this._createForm(),this._registerEvents(),this.options.hasSavedCards?h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0:this._heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_createForm",value:function(){this.creditCard=this._heidelpayPlugin.heidelpayInstance.Card(),this.creditCard.create("number",{containerId:this.options.numberFieldInputId,onlyIframe:!0}),this.creditCard.create("expiry",{containerId:this.options.expiryFieldId,onlyIframe:!0}),this.creditCard.create("cvc",{containerId:this.options.cvcFieldId,onlyIframe:!0}),this.creditCard.addEventListener("change",this._onChangeForm.bind(this))}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSavedCards)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this._heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target;h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewId,t.id===this.options.radioButtonNewId?this._heidelpayPlugin.setSubmitButtonActive(!0===this.cvcValid&&!0===this.numberValid&&!0===this.expiryValid):this._heidelpayPlugin.setSubmitButtonActive(!0)}},{key:"_onChangeForm",value:function(e){if(e.cardType){var t=this.options.placeholderBrandImageUrl;return"unknown"!==e.cardType.type&&(t=this._getBrandImageUrl(e.cardType.type)),void(document.getElementById(this.options.iconFieldId).src=t)}if(e.type&&!this.submitting){var n=this._getInputElementByEvent(e),i=this._getErrorElementByEvent(e);!1===e.success?(n.classList.add(this.options.invalidClass),i.hidden=!1):!0===e.success&&(n.classList.remove(this.options.invalidClass),i.hidden=!0),e.error&&(i.getElementsByClassName("heidelpay-error-message")[0].innerText=e.error),"cvc"===e.type?this.cvcValid=e.success:"number"===e.type?this.numberValid=e.success:"expiry"===e.type&&(this.expiryValid=e.success),this._heidelpayPlugin.setSubmitButtonActive(!0===this.cvcValid&&!0===this.numberValid&&!0===this.expiryValid)}}},{key:"_onCreateResource",value:function(){var e=this,t=null;this.options.hasSavedCards&&(t=h.a.querySelector(this.el,this.options.selectedRadioButtonSelector)),this.submitting=!0,this._heidelpayPlugin.setSubmitButtonActive(!1),null===t||t.id===this.options.radioButtonNewId?this.creditCard.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)})):this._heidelpayPlugin.submitTypeId(t.value)}},{key:"_getInputElementByEvent",value:function(e){var t="#heidelpay-credit-card-".concat(e.type);return h.a.querySelector(this.el,t)}},{key:"_getErrorElementByEvent",value:function(e){var t="#heidelpay-credit-card-".concat(e.type,"-error");return h.a.querySelector(this.el,t)}},{key:"_submitPayment",value:function(e){this._heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this._heidelpayPlugin.showError(e)}},{key:"_getBrandImageUrl",value:function(e){return"https://static.heidelpay.com/assets/images/brands/".concat(e,".svg")}}])&&p(n.prototype,i),r&&p(n,r),t}(i.a);function g(e){return(g="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 _(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function P(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}m(v,"options",{numberFieldId:"heidelpay-credit-card-number",numberFieldInputId:"heidelpay-credit-card-number-input",expiryFieldId:"heidelpay-credit-card-expiry",cvcFieldId:"heidelpay-credit-card-cvc",iconFieldId:"heidelpay-credit-card-icon",invalidClass:"is-invalid",elementWrapperSelector:".heidelpay-credit-card-wrapper-elements",radioButtonSelector:'*[name="savedCreditCard"]',radioButtonNewId:"card-new",selectedRadioButtonSelector:'*[name="savedCreditCard"]:checked',hasSavedCards:!1,placeholderBrandImageUrl:"https://static.heidelpay.com/assets/images/common/group-5.svg"}),m(v,"creditCard",void 0),m(v,"submitting",!1),m(v,"_heidelpayPlugin",null);var E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),P(this,S(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._hideHeidelpayCard(),this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoice=this.heidelpayPlugin.heidelpayInstance.Invoice(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.invoice.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}},{key:"_hideHeidelpayCard",value:function(){document.getElementById(this.options.heidelpayCardId).hidden=!0}}])&&_(n.prototype,i),r&&_(n,r),t}(i.a);function I(e){return(I="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 C(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function O(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}w(E,"options",{heidelpayCardId:"heidelpay-card"}),w(E,"invoice",void 0),w(E,"heidelpayPlugin",null);var A=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),O(this,k(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoiceGuaranteed=this.heidelpayPlugin.heidelpayInstance.InvoiceGuaranteed(),this.options.isB2BCustomer&&this._createB2bForm(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_createB2bForm",value:function(){var e=this;this.b2bCustomerProvider=this.heidelpayPlugin.heidelpayInstance.B2BCustomer(),this.b2bCustomerProvider.b2bCustomerEventHandler=function(t){return e._onValidateB2bForm(t)},this.b2bCustomerProvider.initFormFields(this.heidelpayPlugin.getB2bCustomerObject(this.options.customerInfo)),this.b2bCustomerProvider.create({containerId:"heidelpay-b2b-form"})}},{key:"_onValidateB2bForm",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.options.isB2BCustomer?this.b2bCustomerProvider.createCustomer().then((function(t){return e._onB2bCustomerCreated(t.id)})).catch((function(t){return e._handleError(t)})):this.invoiceGuaranteed.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_onB2bCustomerCreated",value:function(e){var t=this;document.getElementById("heidelpayCustomerId").value=e,this.invoiceGuaranteed.createResource().then((function(e){return t._submitPayment(e)})).catch((function(e){return t._handleError(e)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&C(n.prototype,i),r&&C(n,r),t}(i.a);function F(e){return(F="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 T(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function D(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}R(A,"options",{isB2BCustomer:!1,customerInfo:null}),R(A,"invoiceGuaranteed",void 0),R(A,"heidelpayPlugin",null),R(A,"b2bCustomerProvider",null);var q=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,x(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&H(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.invoiceFactoring=this.heidelpayPlugin.heidelpayInstance.InvoiceFactoring(),this.options.isB2BCustomer&&this._createB2bForm(),this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_createB2bForm",value:function(){var e=this;this.b2bCustomerProvider=this.heidelpayPlugin.heidelpayInstance.B2BCustomer(),this.b2bCustomerProvider.b2bCustomerEventHandler=function(t){return e._onValidateB2bForm(t)},this.b2bCustomerProvider.initFormFields(this.heidelpayPlugin.getB2bCustomerObject(this.options.customerInfo)),this.b2bCustomerProvider.create({containerId:"heidelpay-b2b-form"})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.options.isB2BCustomer?this.b2bCustomerProvider.createCustomer().then((function(t){return e._onB2bCustomerCreated(t.id)})).catch((function(t){return e._handleError(t)})):this.invoiceFactoring.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_onB2bCustomerCreated",value:function(e){var t=this;document.getElementById("heidelpayCustomerId").value=e,this.invoiceFactoring.createResource().then((function(e){return t._submitPayment(e)})).catch((function(e){return t._handleError(e)}))}},{key:"_onValidateB2bForm",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&T(n.prototype,i),r&&T(n,r),t}(i.a);function L(e){return(L="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 M(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function V(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t){return($=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}N(q,"options",{isB2BCustomer:!1,customerInfo:null}),N(q,"invoiceFactoring",void 0),N(q,"heidelpayPlugin",null),N(q,"b2bCustomerProvider",null);var z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,W(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.eps=this.heidelpayPlugin.heidelpayInstance.EPS(),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){this.eps.create("eps",{containerId:"heidelpay-eps-container"})}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.eps.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&M(n.prototype,i),r&&M(n,r),t}(i.a);function U(e){return(U="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 K(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function J(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function X(e){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}G(z,"eps",void 0),G(z,"heidelpayPlugin",null);var Z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,X(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.ideal=this.heidelpayPlugin.heidelpayInstance.Ideal(),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){this.ideal.create("ideal",{containerId:"heidelpay-ideal-container"}),this.heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this}),this.ideal&&this.ideal.addEventListener("change",(function(t){return e._onFormChange(t)}),{scope:this})}},{key:"_onFormChange",value:function(e){e.value&&this.heidelpayPlugin.setSubmitButtonActive(!0)}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.ideal.createResource().then((function(t){return e.heidelpayPlugin.submitResource(t)})).catch((function(t){return e.heidelpayPlugin.showError(t)}))}}])&&K(n.prototype,i),r&&K(n,r),t}(i.a);function ee(e){return(ee="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 te(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ne(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ie(e){return(ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Y(Z,"ideal",void 0),Y(Z,"heidelpayPlugin",null);var ae=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ne(this,ie(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&re(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.sepa=this.heidelpayPlugin.heidelpayInstance.SepaDirectDebit(),this._createForm(),this._registerEvents(),this.options.hasSepaDevices?h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0:this.heidelpayPlugin.setSubmitButtonActive(!1)}},{key:"_createForm",value:function(){this.sepa.create("sepa-direct-debit",{containerId:"heidelpay-sepa-container"})}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSepaDevices)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this.sepa.addEventListener("change",(function(t){return e._onFormChange(t)})),this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target;h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=t.id!==this.options.radioButtonNewAccountId,t&&t.id!==this.options.radioButtonNewAccountId?this.heidelpayPlugin.setSubmitButtonActive(!0):this.heidelpayPlugin.setSubmitButtonActive(this.sepa.validated)}},{key:"_onFormChange",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this,t=document.getElementById(this.options.acceptMandateId),n=document.querySelector(this.options.selectedRadioButtonSelector);if(this.options.hasSepaDevices&&n&&n.id!==this.options.radioButtonNewAccountId)this.heidelpayPlugin.setSubmitButtonActive(!1),this._submitDevicePayment(n.value);else{if(!t.checked)return this._handleError({message:this.options.mandateNotAcceptedError}),void t.classList.add("is-invalid");this.heidelpayPlugin.setSubmitButtonActive(!1),this.sepa.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_submitDevicePayment",value:function(e){this.heidelpayPlugin.submitTypeId(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&te(n.prototype,i),r&&te(n,r),t}(i.a);function ue(e){return(ue="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 se(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ce(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function he(e,t){return(he=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}oe(ae,"options",{acceptMandateId:"acceptSepaMandate",mandateNotAcceptedError:"Please accept the SEPA direct debit mandate in order to continue.",elementWrapperSelector:".heidelpay-sepa-wrapper-elements",radioButtonSelector:'*[name="savedDirectDebitDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedDirectDebitDevice"]:checked',hasSepaDevices:!1}),oe(ae,"sepa",void 0),oe(ae,"heidelpayPlugin",null);var pe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ce(this,le(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&he(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){var e=document.getElementById(this.options.birthDateFieldId);this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.sepa=this.heidelpayPlugin.heidelpayInstance.SepaDirectDebitGuaranteed(),this._createForm(),this._registerEvents(),this.options.hasSepaDevices?(h.a.querySelector(this.el,this.options.elementWrapperSelector).hidden=!0,e.required=!1):(e.required=!0,this.heidelpayPlugin.setSubmitButtonActive(!1))}},{key:"_createForm",value:function(){this.sepa.create("sepa-direct-debit-guaranteed",{containerId:"heidelpay-sepa-container"})}},{key:"_registerEvents",value:function(){var e=this;if(this.options.hasSepaDevices)for(var t=h.a.querySelectorAll(this.el,this.options.radioButtonSelector),n=0;n<t.length;n++)t[n].addEventListener("change",(function(t){return e._onRadioButtonChange(t)}));this.sepa.addEventListener("change",(function(t){return e._onFormChange(t)})),this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onRadioButtonChange",value:function(e){var t=e.target,n=h.a.querySelector(this.el,this.options.elementWrapperSelector),i=document.getElementById(this.options.birthDateFieldId);n.hidden=t.id!==this.options.radioButtonNewAccountId,t&&t.id!==this.options.radioButtonNewAccountId?(this.heidelpayPlugin.setSubmitButtonActive(!0),i.required=!1):(this.heidelpayPlugin.setSubmitButtonActive(this.sepa.validated),i.required=!0)}},{key:"_onFormChange",value:function(e){this.heidelpayPlugin.setSubmitButtonActive(e.success)}},{key:"_onCreateResource",value:function(){var e=this,t=document.getElementById(this.options.acceptMandateId),n=document.querySelector(this.options.selectedRadioButtonSelector);if(this.options.hasSepaDevices&&n&&n.id!==this.options.radioButtonNewAccountId)this.heidelpayPlugin.setSubmitButtonActive(!1),this._submitDevicePayment(n.value);else{if(!t.checked)return this._handleError({message:this.options.mandateNotAcceptedError}),void t.classList.add("is-invalid");this.heidelpayPlugin.setSubmitButtonActive(!1),this.sepa.createResource().then((function(t){return e._submitPayment(t)})).catch((function(t){return e._handleError(t)}))}}},{key:"_submitPayment",value:function(e){this.heidelpayPlugin.submitResource(e)}},{key:"_submitDevicePayment",value:function(e){this.heidelpayPlugin.submitTypeId(e)}},{key:"_handleError",value:function(e){this.heidelpayPlugin.showError(e)}}])&&se(n.prototype,i),r&&se(n,r),t}(i.a);de(pe,"options",{birthDateFieldId:"heidelpayBirthday",acceptMandateId:"acceptSepaMandate",mandateNotAcceptedError:"Please accept the SEPA direct debit mandate in order to continue.",elementWrapperSelector:".heidelpay-sepa-wrapper-elements",radioButtonSelector:'*[name="savedDirectDebitDevice"]',radioButtonNewAccountId:"device-new",selectedRadioButtonSelector:'*[name="savedDirectDebitDevice"]:checked'}),de(pe,"sepa",void 0),de(pe,"heidelpayPlugin",null);var ye=n("u0Tz");function fe(e){return(fe="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 be(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function me(e,t){return!t||"object"!==fe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),me(this,ve(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ge(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this.heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this.hirePurchase=this.heidelpayPlugin.heidelpayInstance.HirePurchase(),this.heidelpayPlugin.setSubmitButtonActive(!1),this._createForm(),this._registerEvents()}},{key:"_createForm",value:function(){var e=this,t=document.getElementById(this.options.formLoadingIndicatorElementId);ye.a.create(t),this.hirePurchase.create({containerId:"heidelpay-hire-purchase-container",amount:this.options.hirePurchaseAmount.toFixed(4),currency:this.options.hirePurchaseCurrency,effectiveInterest:this.options.hirePurchaseEffectiveInterest,orderDate:this.options.hirePurchaseOrderDate}).then((function(){t.hidden=!0})).catch((function(n){e.heidelpayPlugin.renderErrorToElement(n,t),e.heidelpayPlugin.setSubmitButtonActive(!1)})).finally((function(){ye.a.remove(t)}))}},{key:"_registerEvents",value:function(){var e=this;this.heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this}),this.hirePurchase.addEventListener("hirePurchaseEvent",(function(t){return e._onChangeHirePurchaseForm(t)}))}},{key:"_onCreateResource",value:function(){var e=this;this.heidelpayPlugin.setSubmitButtonActive(!1),this.hirePurchase.createResource().then((function(t){return e.heidelpayPlugin.submitResource(t)})).catch((function(t){return e.heidelpayPlugin.showError(t)}))}},{key:"_onChangeHirePurchaseForm",value:function(e){if("validate"===e.action&&(e.success?this.heidelpayPlugin.setSubmitButtonActive(!0):this.heidelpayPlugin.setSubmitButtonActive(!1)),"plan-detail"===e.currentStep){var t=document.getElementById(this.options.installmentsTotalValueElementId),n=document.getElementById(this.options.installmentsInterestValueElementId);t.innerText=this._formatCurrency(this.hirePurchase.selectedInstallmentPlan.totalAmount)+this.options.starSymbol,n.innerText=this._formatCurrency(this.hirePurchase.selectedInstallmentPlan.totalInterestAmount)+this.options.starSymbol}}},{key:"_formatCurrency",value:function(e){return e.toLocaleString(this.options.currencyFormatLocale,{style:"currency",currency:this.options.currencyIso})}}])&&be(n.prototype,i),r&&be(n,r),t}(i.a);function Se(e){return(Se="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 Be(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function we(e,t){return!t||"object"!==Se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_e(Pe,"options",{hirePurchaseAmount:0,hirePurchaseCurrency:"",hirePurchaseEffectiveInterest:0,hirePurchaseOrderDate:"",installmentsTotalValueElementId:"heidelpay-installments-total",installmentsInterestValueElementId:"heidelpay-installments-interest",formLoadingIndicatorElementId:"element-loader",currencyIso:"EUR",currencyFormatLocale:"en-GB",starSymbol:"*"}),_e(Pe,"hirePurchase",void 0),_e(Pe,"heidelpayPlugin",null);var Oe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),we(this,Ee(t).apply(this,arguments))}var n,i,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ie(e,t)}(t,e),n=t,(i=[{key:"init",value:function(){this._heidelpayPlugin=window.PluginManager.getPluginInstances("HeidelpayBase")[0],this._registerEvents()}},{key:"_registerEvents",value:function(){var e=this;this._heidelpayPlugin.$emitter.subscribe("heidelpayBase_createResource",(function(){return e._onCreateResource()}),{scope:this})}},{key:"_onCreateResource",value:function(){var e=null;this._heidelpayPlugin.setSubmitButtonActive(!1),this.options.hasSavedAccounts&&(e=document.querySelectorAll(this.options.selectedRadioButtonSelector)[0]),null===e||"new"===e.value?document.getElementById(this._heidelpayPlugin.options.confirmFormId).submit():this._heidelpayPlugin.submitTypeId(e.value)}}])&&Be(n.prototype,i),r&&Be(n,r),t}(i.a);Ce(Oe,"options",{radioButtonSelector:'input[name="savedPayPalAccount"]',selectedRadioButtonSelector:'input[name="savedPayPalAccount"]:checked',radioButtonNewSelector:"#new",hasSavedAccounts:!1}),Ce(Oe,"submitting",!1),Ce(Oe,"_heidelpayPlugin",null);var ke=window.PluginManager;ke.register("HeidelpayBase",l,"[data-heidelpay-base]"),ke.register("HeidelpayCreditCard",v,"[data-heidelpay-credit-card]"),ke.register("HeidelpayInvoice",E,"[data-heidelpay-invoice]"),ke.register("HeidelpayInvoiceGuaranteed",A,"[data-heidelpay-invoice-guaranteed]"),ke.register("HeidelpayInvoiceFactoring",q,"[data-heidelpay-invoice-factoring]"),ke.register("HeidelpayEps",z,"[data-heidelpay-eps]"),ke.register("HeidelpayIdeal",Z,"[data-heidelpay-ideal]"),ke.register("HeidelpaySepaDirectDebit",ae,"[data-heidelpay-sepa-direct-debit]"),ke.register("HeidelpaySepaDirectDebitGuaranteed",pe,"[data-heidelpay-sepa-direct-debit-guaranteed]"),ke.register("HeidelpayHirePurchase",Pe,"[data-heidelpay-hire-purchase]"),ke.register("HeidelpayPaypal",Oe,"[data-heidelpay-paypal]")}},[["XtTf","runtime","vendor-node","vendor-shared"]]]); \ No newline at end of file diff --git a/src/Resources/public/administration/js/heidel-payment6.js b/src/Resources/public/administration/js/heidel-payment6.js index f42a6dd..ae093e5 100644 --- a/src/Resources/public/administration/js/heidel-payment6.js +++ b/src/Resources/public/administration/js/heidel-payment6.js @@ -1 +1 @@ -(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment6"],{"+kxS":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)})},"1iz7":function(e,t,n){},"4aeB":function(e,t){e.exports='{% block heidel_payment_settings %}\n<sw-page class="heidel-payment-settings">\n {% block heidel_payment_settings_header %}\n <template slot="smart-bar-header">\n <h2>\n {{ $tc(\'sw-settings.index.title\') }}\n <sw-icon name="small-arrow-medium-right" small></sw-icon>\n {{ $tc(\'heidel-payment-settings.module.title\') }}\n </h2>\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n <template slot="smart-bar-actions">\n {% block heidel_payment_settings_actions_save %}\n <sw-button-process\n class="sw-settings-login-registration__save-action"\n :isLoading="isLoading"\n :processSuccess="isSaveSuccessful"\n :disabled="isLoading || isTesting"\n variant="primary"\n @click="onSave">\n {{ $tc(\'global.default.save\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_test %}\n <sw-button-process\n :isLoading="isTesting"\n :processSuccess="isTestSuccessful"\n @process-finish="onTestFinished()"\n :disabled="isLoading"\n @click="onValidateCredentials">\n {{ $tc(\'heidel-payment-settings.form.testButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_register_webhooks %}\n <heidel-payment-register-webhook></heidel-payment-register-webhook>\n {% endblock %}\n\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n <template slot="content">\n <sw-card-view>\n <sw-system-config\n ref="systemConfig"\n salesChannelSwitchable\n inherit\n @config-changed="onConfigChange"\n domain="HeidelPayment6.settings">\n\n <template #card-element="{ element, config }">\n <div>\n <sw-form-field-renderer\n :config="{\n componentName: \'sw-entity-single-select\',\n label: getInlineSnippet(element.config.label),\n helpText: getInlineSnippet(element.config.helpText),\n entity: \'state_machine_state\',\n criteria: getDeliveryStatusCriteria(),\n }"\n v-model="config[element.name]"\n v-if="element.name.endsWith(\'statusForAutomaticShippingNotification\')">\n </sw-form-field-renderer>\n\n <sw-form-field-renderer\n v-bind="getBind(element, config)"\n v-model="config[element.name]"\n v-else>\n </sw-form-field-renderer>\n </div>\n </template>\n </sw-system-config>\n </sw-card-view>\n </template>\n {% endblock %}\n</sw-page>\n{% endblock %}\n'},"5j/b":function(e,t){e.exports="{% block heidel_payment_detail %}\n <sw-card class=\"heidel-payment-detail\" :title=\"$tc('heidel-payment.paymentDetails.detail.cardTitle')\">\n {% block heidel_payment_detail_container %}\n <sw-container columns=\"1fr 1fr 1fr\" gap=\"0 20px\">\n {% block heidel_payment_detail_container_left %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.currency') }}</dt>\n <dd>{{ paymentResource.currency }}</dd>\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}</dd>\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}</dt>\n <dd>{{ paymentResource.shortId }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.id') }}</dt>\n <dd>{{ paymentResource.id }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.state') }}</dt>\n <dd>{{ paymentResource.state.name }}</dd>\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n <sw-container v-if=\"paymentResource.isGuaranteed\" columns=\"1fr\" justify=\"left\">\n <sw-button-process :isLoading=\"isLoading\" :processSuccess=\"isSuccessful\" @click=\"ship\">\n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n </sw-button-process>\n </sw-container>\n {% endblock %}\n </sw-card>\n{% endblock %}\n"},"6E3l":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n <template v-if=\"item.composerName === 'heidelpay/shopware-6'\">\n <sw-context-menu-item :routerLink=\"{ name: 'heidel.payment.configuration.settings' }\">\n {{ $tc('sw-plugin.list.config') }}\n </sw-context-menu-item>\n </template>\n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n <template v-if=\"item.composerName !== 'heidel/payment6'\">\n {% parent %}\n </template>\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 <sw-card class="heidel-payment-basket" :title="$tc(\'heidel-payment.paymentDetails.basket.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_basket_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\n{% endblock %}\n'},KEl0:function(e,t){e.exports='{% block heidel_payment_actions %}\n <sw-container columns="1fr 1fr" gap="0 10px" v-on:click.native.stop>\n {% block heidel_payment_actions_amount_field %}\n <div class="heidel-payment-actions--input">\n <sw-number-field\n :min="0.01"\n :max="maxTransactionAmount"\n v-model="transactionAmount">\n </sw-number-field>\n </div>\n {% endblock %}\n\n <div class="heidel-payment-actions--button">\n {% block heidel_payment_actions_charge_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isChargePossible" @click="charge">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isRefundPossible" @click="refund">\n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n <sw-button :disabled="true" v-if="!isChargePossible && !isRefundPossible">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button>\n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n </div>\n </sw-container>\n{% endblock %}\n'},KmwY:function(e,t){e.exports='{% block sw_order_create_details_footer_payment_method %}\n <sw-entity-single-select\n size="small"\n entity="payment_method"\n v-model="context.paymentMethodId"\n class="sw-order-create-details-footer__item"\n :disabled="!isCustomerActive"\n :criteria="paymentMethodCriteria"\n :label="$tc(\'sw-order.createBase.detailsFooter.labelPaymentMethod\')"\n :placeholder="$tc(\'sw-order.createBase.detailsFooter.placeholderPaymentMethod\')">\n </sw-entity-single-select>\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 <sw-tabs-item v-if=\"isHeidelpayPayment\"\n :route=\"{ name: 'heidel-payment.payment.detail', params: { id: $route.params.id } }\"\n :title=\"$tc('heidel-payment.tabTitle')\">\n {{ $tc('heidel-payment.tabTitle') }}\n </sw-tabs-item>\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<div class="register-webhook--container">\n <sw-button-process\n :isLoading="isRegistering"\n :processSuccess="isRegistrationSuccessful"\n @process-finish="onRegistrationFinished()"\n :disabled="isLoading"\n @click="openModal">\n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n </sw-button-process>\n <sw-modal v-if="showWebhookModal" @modal-close="closeModal"\n :title="$tc(`heidel-payment-settings.modal.webhook.title`)" class="heidel-payment-detail--webhook-modal">\n <sw-data-grid\n v-on:select-item="onSelectItem"\n :dataSource="salesChannelDomains"\n :columns="salesChannelDomainColumns"\n :showActions="false"\n :showSelection="true">\n </sw-data-grid>\n\n <template slot="modal-footer">\n <sw-button :disabled="isLoading" @click="closeModal">\n {{ $tc(\'heidel-payment-settings.modal.close\') }}\n </sw-button>\n\n <sw-button-process\n @click="clearWebhooks"\n @process-finish="onClearingFinished()"\n :isLoading="isLoading" :processSuccess="isClearingSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.clear\') }}\n </sw-button-process>\n\n <sw-button-process\n @click="registerWebhooks"\n @process-finish="onRegistrationFinished()"\n :isLoading="isLoading" :processSuccess="isRegistrationSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.register\') }}\n </sw-button-process>\n </template>\n </sw-modal>\n</div>\n{% endblock %}\n'},fpPm:function(e,t){e.exports='{% block heidel_payment_history %}\n <sw-card :title="$tc(\'heidel-payment.paymentDetails.history.cardTitle\')">\n {% block heidel_payment_history_container %}\n <sw-container slot="grid" type="row">\n {% block heidel_payment_history_data_grid %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false">\n\n {% block heidel_payment_history_actions %}\n <template slot="actions" slot-scope="{ item }">\n {% block heidel_payment_history_data_grid_item_actions %}\n <heidel-payment-actions\n :transactionResource="item.resource"\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-actions>\n {% endblock %}\n </template>\n {% endblock %}\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n {% endblock %}\n </sw-card>\n{% endblock %}\n'},nmHs:function(e,t){e.exports='{% block heidel_payment_metadata %}\n <sw-card class="heidel-payment-metadata" :title="$tc(\'heidel-payment.paymentDetails.metadata.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_metadata_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\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 <div class="heidel-payment-detail">\n <div v-if="!isLoading">\n {% block heidel_payment_payment_details_content %}\n <template v-for="paymentResource in paymentResources">\n {% block heidel_payment_payment_details_content_payment_detail %}\n <heidel-payment-detail\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-detail>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_history %}\n <heidel-payment-history\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-history>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_basket %}\n <heidel-payment-basket\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-basket>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_metadata %}\n <heidel-payment-metadata\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-metadata>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_inner %}{% endblock %}\n </template>\n {% endblock %}\n </div>\n\n <sw-loader v-if="isLoading"></sw-loader>\n </div>\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 <sw-container columns="1fr 1fr" gap="0 10px" v-on:click.native.stop>\n {% block heidel_payment_actions_amount_field %}\n <div class="heidel-payment-actions--input">\n <sw-number-field\n :min="0.01"\n :max="maxTransactionAmount"\n v-model="transactionAmount">\n </sw-number-field>\n </div>\n {% endblock %}\n\n <div class="heidel-payment-actions--button">\n {% block heidel_payment_actions_charge_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isChargePossible" @click="charge">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n <sw-button-process :isLoading="isLoading" :processSuccess="isSuccessful" v-if="isRefundPossible" @click="refund">\n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n <sw-button :disabled="true" v-if="!isChargePossible && !isRefundPossible">\n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n </sw-button>\n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n </div>\n </sw-container>\n{% endblock %}\n'},"5Wb7":function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_update %}\n <template v-if=\"item.composerName === 'heidelpay/shopware-6'\">\n <sw-context-menu-item :routerLink=\"{ name: 'heidel.payment.configuration.settings' }\">\n {{ $tc('sw-plugin.list.config') }}\n </sw-context-menu-item>\n </template>\n\n {% parent %}\n{% endblock %}\n\n{% block sw_plugin_list_grid_columns_actions_settings %}\n <template v-if=\"item.composerName !== 'heidelpay/showpare-6'\">\n {% parent %}\n </template>\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 <sw-entity-single-select\n size="small"\n entity="payment_method"\n v-model="context.paymentMethodId"\n class="sw-order-create-details-footer__item"\n :disabled="!isCustomerActive"\n :criteria="paymentMethodCriteria"\n :label="$tc(\'sw-order.createBase.detailsFooter.labelPaymentMethod\')"\n :placeholder="$tc(\'sw-order.createBase.detailsFooter.placeholderPaymentMethod\')">\n </sw-entity-single-select>\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<sw-page class="heidel-payment-settings">\n {% block heidel_payment_settings_header %}\n <template slot="smart-bar-header">\n <h2>\n {{ $tc(\'sw-settings.index.title\') }}\n <sw-icon name="small-arrow-medium-right" small></sw-icon>\n {{ $tc(\'heidel-payment-settings.module.title\') }}\n </h2>\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_actions %}\n <template slot="smart-bar-actions">\n {% block heidel_payment_settings_actions_save %}\n <sw-button-process\n class="sw-settings-login-registration__save-action"\n :isLoading="isLoading"\n :processSuccess="isSaveSuccessful"\n :disabled="isLoading || isTesting"\n variant="primary"\n @click="onSave">\n {{ $tc(\'global.default.save\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_test %}\n <sw-button-process\n :isLoading="isTesting"\n :processSuccess="isTestSuccessful"\n @process-finish="onTestFinished()"\n :disabled="isLoading"\n @click="onValidateCredentials">\n {{ $tc(\'heidel-payment-settings.form.testButton\') }}\n </sw-button-process>\n {% endblock %}\n\n {% block heidel_payment_settings_actions_register_webhooks %}\n <heidel-payment-register-webhook></heidel-payment-register-webhook>\n {% endblock %}\n\n </template>\n {% endblock %}\n\n {% block heidel_payment_settings_content %}\n <template slot="content">\n <sw-card-view>\n <sw-system-config\n ref="systemConfig"\n salesChannelSwitchable\n inherit\n @config-changed="onConfigChange"\n domain="HeidelPayment6.settings">\n\n <template #card-element="{ element, config }">\n <div>\n <sw-form-field-renderer\n :config="{\n componentName: \'sw-entity-single-select\',\n label: getInlineSnippet(element.config.label),\n helpText: getInlineSnippet(element.config.helpText),\n entity: \'state_machine_state\',\n criteria: getDeliveryStatusCriteria(),\n }"\n v-model="config[element.name]"\n v-if="element.name.endsWith(\'statusForAutomaticShippingNotification\')">\n </sw-form-field-renderer>\n\n <sw-form-field-renderer\n v-bind="getBind(element, config)"\n v-model="config[element.name]"\n v-else>\n </sw-form-field-renderer>\n </div>\n </template>\n </sw-system-config>\n </sw-card-view>\n </template>\n {% endblock %}\n</sw-page>\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 <sw-tabs-item v-if=\"isHeidelpayPayment\"\n :route=\"{ name: 'heidel-payment.payment.detail', params: { id: $route.params.id } }\"\n :title=\"$tc('heidel-payment.tabTitle')\">\n {{ $tc('heidel-payment.tabTitle') }}\n </sw-tabs-item>\n {% endblock %}\n{% endblock %}"},bmxS:function(e,t){e.exports='{% block heidel_payment_payment_register_webhook %}\n<div class="register-webhook--container">\n <sw-button-process\n :isLoading="isRegistering"\n :processSuccess="isRegistrationSuccessful"\n @process-finish="onRegistrationFinished()"\n :disabled="isLoading"\n @click="openModal">\n {{ $tc(\'heidel-payment-settings.form.webhookButton\') }}\n </sw-button-process>\n <sw-modal v-if="showWebhookModal" @modal-close="closeModal"\n :title="$tc(`heidel-payment-settings.modal.webhook.title`)" class="heidel-payment-detail--webhook-modal">\n <sw-data-grid\n v-on:select-item="onSelectItem"\n :dataSource="salesChannelDomains"\n :columns="salesChannelDomainColumns"\n :showActions="false"\n :showSelection="true">\n </sw-data-grid>\n\n <template slot="modal-footer">\n <sw-button :disabled="isLoading" @click="closeModal">\n {{ $tc(\'heidel-payment-settings.modal.close\') }}\n </sw-button>\n\n <sw-button-process\n @click="clearWebhooks"\n @process-finish="onClearingFinished()"\n :isLoading="isLoading" :processSuccess="isClearingSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.clear\') }}\n </sw-button-process>\n\n <sw-button-process\n @click="registerWebhooks"\n @process-finish="onRegistrationFinished()"\n :isLoading="isLoading" :processSuccess="isRegistrationSuccessful" :disabled="isLoading"\n variant="primary">\n {{ $tc(\'heidel-payment-settings.modal.webhook.submit.register\') }}\n </sw-button-process>\n </template>\n </sw-modal>\n</div>\n{% endblock %}\n'},btqN:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n <div class="heidel-payment-detail">\n <div v-if="!isLoading">\n {% block heidel_payment_payment_details_content %}\n <template v-for="paymentResource in paymentResources">\n {% block heidel_payment_payment_details_content_payment_detail %}\n <heidel-payment-detail\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-detail>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_history %}\n <heidel-payment-history\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-history>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_basket %}\n <heidel-payment-basket\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-basket>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_payment_metadata %}\n <heidel-payment-metadata\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-metadata>\n {% endblock %}\n\n {% block heidel_payment_payment_details_content_inner %}{% endblock %}\n </template>\n {% endblock %}\n </div>\n\n <sw-loader v-if="isLoading"></sw-loader>\n </div>\n{% endblock %}\n'},gQ1j:function(e,t){e.exports="{% block heidel_payment_detail %}\n <sw-card class=\"heidel-payment-detail\" :title=\"$tc('heidel-payment.paymentDetails.detail.cardTitle')\">\n {% block heidel_payment_detail_container %}\n <sw-container columns=\"1fr 1fr 1fr\" gap=\"0 20px\">\n {% block heidel_payment_detail_container_left %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotal') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountTotalVat') }}</dt>\n <dd>{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.currency') }}</dt>\n <dd>{{ paymentResource.currency }}</dd>\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_center %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountRemaining') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.remaining | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCancelled') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.cancelled | currency(paymentResource.currency) }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.amountCharged') }}</dt>\n <dd>{{ paymentResource.calculatedAmounts.charged | currency(paymentResource.currency) }}</dd>\n\n {% block heidel_payment_detail_container_center_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n <sw-container>\n <sw-description-list>\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}</dt>\n <dd>{{ paymentResource.shortId }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.id') }}</dt>\n <dd>{{ paymentResource.id }}</dd>\n\n <dt>{{ $tc('heidel-payment.paymentDetails.detail.state') }}</dt>\n <dd>{{ paymentResource.state.name }}</dd>\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n </sw-description-list>\n </sw-container>\n {% endblock %}\n </sw-container>\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n <sw-container v-if=\"paymentResource.isGuaranteed\" columns=\"1fr\" justify=\"left\">\n <sw-button-process :isLoading=\"isLoading\" :processSuccess=\"isSuccessful\" @click=\"ship\">\n {{ $tc('heidel-payment.paymentDetails.actions.shipButton') }}\n </sw-button-process>\n </sw-container>\n {% endblock %}\n </sw-card>\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 <sw-card :title="$tc(\'heidel-payment.paymentDetails.history.cardTitle\')">\n {% block heidel_payment_history_container %}\n <sw-container slot="grid" type="row">\n {% block heidel_payment_history_data_grid %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false">\n\n {% block heidel_payment_history_actions %}\n <template slot="actions" slot-scope="{ item }">\n {% block heidel_payment_history_data_grid_item_actions %}\n <heidel-payment-actions\n :transactionResource="item.resource"\n :paymentResource="paymentResource"\n @reload="reloadPaymentDetails">\n </heidel-payment-actions>\n {% endblock %}\n </template>\n {% endblock %}\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n {% endblock %}\n </sw-card>\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 <sw-card class="heidel-payment-metadata" :title="$tc(\'heidel-payment.paymentDetails.metadata.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_metadata_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\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 <sw-card class="heidel-payment-basket" :title="$tc(\'heidel-payment.paymentDetails.basket.cardTitle\')">\n <sw-container slot="grid" type="row">\n {% block heidel_payment_basket_container %}\n <sw-data-grid\n :dataSource="data"\n :columns="columns"\n :showSelection="false"\n :showActions="false">\n </sw-data-grid>\n {% endblock %}\n </sw-container>\n </sw-card>\n{% endblock %}\n'}},[["D4rn","runtime","vendors-node"]]]); \ No newline at end of file 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 %} <div class="card-title"> @@ -9,7 +10,7 @@ <div class="heidelpay-paypal-account-wrapper" data-heidelpay-paypal="true" data-heidelpay-paypal-options='{ - "hasSavedAccounts": {% if page.extensions.heidelpayPayPal.payPalAccounts|length > 0 %}true{% else %}false{% endif %} + "hasSavedAccounts": true }'> <div class="heidelpay-saved-accounts-wrapper"> <div class="heidelpay-saved-accounts--message"> @@ -42,5 +43,13 @@ {% endblock %} </div> </div> + {% else %} + {# PayPal without stored accounts #} + <div class="heidelpay-paypal-account-wrapper" + data-heidelpay-paypal="true" + data-heidelpay-paypal-options='{ + "hasSavedAccounts": false + }'> + </div> {% endif %} {% endblock %} From ab3ec3b080b262137b515a73004a13d671d25a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= <n.goedde@kellerkinder.de> Date: Thu, 23 Jul 2020 16:21:25 +0200 Subject: [PATCH 5/6] Increase version to 0.0.1.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6fb6381..9f46986 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", From 92a55aab6afbc2ac14fc63a142c4070b5ca80161 Mon Sep 17 00:00:00 2001 From: heidelpay-sp <sascha.pflueger@heidelpay.de> Date: Thu, 6 Aug 2020 08:14:43 +0200 Subject: [PATCH 6/6] SHOPWARE-865_UpdatePhpSdk * changed version of php-sdk --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9f46986..bc1c32b 100644 --- a/composer.json +++ b/composer.json @@ -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",