\n {% block unzer_payment_actions_amount_field %}\n \n \n \n
\n {% endblock %}\n\n \n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.cancelButton\') }}\n \n {% endblock %}\n \n\n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n \n\n {% block unzer_payment_actions_default_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.defaultButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n{% endblock %}\n',inject:["UnzerPaymentService"],mixins:[t.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type},maxTransactionAmount(){let e=0;return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:"CANCEL"},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:"CREDIT"},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:"RETURN"}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),"paylater-invoice-document-required"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});let{Component:a,Mixin:i,Module:s}=Shopware;a.register("unzer-payment-detail",{template:'{% block unzer_payment_detail %}\n \n \n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.amountRemaining\') }}\n {{ formatCurrency(remainingAmount) }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.amountCancelled\') }}\n {{ formatCurrency(cancelledAmount) }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.amountCharged\') }}\n {{ formatCurrency(chargedAmount) }}\n\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.shortId\') }}\n {{ paymentResource.shortId }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.id\') }}\n {{ paymentResource.id }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.state\') }}\n {{ paymentResource.state.name }}\n\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.descriptor\') }}\n {{ paymentResource.descriptor }}\n \n\n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.shipButton\') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["UnzerPaymentService"],mixins:[i.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){let e=s.getModuleRegistry().get("unzer-payment");return e&&e.manifest?e.manifest.maxDigits:4},remainingAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision):0},cancelledAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision):0},chargedAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision):0}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):"invoice-missing-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):"documentdate-missing-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):"payment-missing-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});let{Component:r,Module:o,Mixin:c}=Shopware;r.register("unzer-payment-history",{template:'{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% block unzer_payment_history_data_grid %}\n \n\n {% block unzer_payment_history_actions %}\n \n {% block unzer_payment_history_data_grid_item_actions %}\n { openCancelModal(item, cancelAmount) }">\n \n {% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_history_actions_modals %}\n \n \n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.text\') }}
\n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.amountLabel\') }} {{ formatCurrency(cancelAmount) }}\n
\n\n \n\n {% block sw_confirm_modal_footer_cancel %}\n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.noButton\') }}\n \n {% endblock %}\n\n {% block sw_confirm_modal_footer_confirm %}\n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.yesButton\') }}\n \n {% endblock %}\n\n \n \n \n {% endblock %}\n\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["repositoryFactory","UnzerPaymentService"],mixins:[c.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){let e=o.getModuleRegistry().get("unzer-payment");return e&&e.manifest?e.manifest.maxDigits:4},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return this.paymentResource&&this.paymentResource.amount&&this.paymentResource.amount.decimalPrecision?Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision):this.unzerMaxDigits},data:function(){let e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{let n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});let{Component:l}=Shopware;l.register("unzer-payment-metadata",{template:'{% block unzer_payment_metadata %}\n \n \n {% block unzer_payment_metadata_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n',props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});let{Component:d}=Shopware;d.register("unzer-payment-basket",{template:'{% block unzer_payment_basket %}\n \n \n {% block unzer_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n',props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(-1*parseFloat(t.amountDiscount.toFixed(2))),a=this.formatCurrency(-1*parseFloat((t.amountDiscount-t.amountVat).toFixed(2)))),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});let{Criteria:p}=Shopware.Data,u=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","95aa098aac8f11e9a2a32a2ae2dbcce4","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:'{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}\n',computed:{paymentMethodCriteria(){let e=new p;return this.salesChannelId&&e.addFilter(p.equals("salesChannels.id",this.salesChannelId)),e.addFilter(p.not("AND",[p.equalsAny("id",u)])),e}}});let{Component:h,Context:m}=Shopware,{Criteria:y}=Shopware.Data;h.override("sw-order-detail",{template:"{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}\n",data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}let e=this.repositoryFactory.create("order"),t=new y(1,1);t.addAssociation("transactions"),e.get(this.orderId,m.api,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&(e.customFields.unzer_payment_is_transaction||e.customFields.heidelpay_is_transaction)&&(this.isUnzerPayment=!0)})})},immediate:!0}}}),Shopware.Component.override("sw-order-list",{template:'{% block sw_order_list_grid_columns %}\n {% parent %}\n\n {% block unzer_payment_column_transaction %}\n \n \n {{ item.transactions.last().id }}\n \n \n {% endblock %}\n{% endblock %}\n',methods:{getOrderColumns(){let e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});let{Component:g,Context:f,Mixin:b}=Shopware,{Criteria:w}=Shopware.Data;g.register("unzer-payment-tab",{template:'{% block unzer_payment_payment_details %}\n \n
\n {% block unzer_payment_payment_details_content %}\n \n \n {% block unzer_payment_payment_details_content_payment_detail %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_history %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_basket %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_metadata %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_inner %}{% endblock %}\n \n \n {% endblock %}\n
\n\n
\n
\n{% endblock %}\n',inject:["UnzerPaymentService","repositoryFactory"],mixins:[b.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){let e=this.$route.params.id,t=new w;t.getAssociation("transactions").addSorting(w.sort("createdAt","DESC")),this.orderRepository.get(e,f.api,t).then(e=>{this.order=e,e.transactions&&e.transactions.forEach((e,t)=>{if(!e.customFields||!e.customFields.unzer_payment_is_transaction&&!e.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(e.id).then(e=>{this.paymentResources[t]=e,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){let t=e.$parent;return void 0===t?null:"sw-order-detail"!==t.$options.name?this.findOrderDetailComponentAndReInit(t):t.isOrderEditing?null:void t.createdComponent()}}});var k=JSON.parse('{"unzer-payment":{"tabTitle":"Unzer Payment","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandmitteilung","refund":"R\xfcckerstattung","cancellation":"Stornierung","default":""}},"actions":{"reason":{"placeholder":"Grund","cancel":"Abgebrochen","credit":"Gutschrift","return":"R\xfcckgabe"},"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"R\xfcckerstatten","defaultButton":"Erledigt","cancelButton":"Stornieren","confirmCancelModal":{"text":"M\xf6chten Sie wirklich die Reservierung \xfcber den angegebenen Betrag stornieren?","amountLabel":"Betrag:","yesButton":"Ja","noButton":"Nein"}},"detail":{"cardTitle":"Zahlungsdetails","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status","amountRemaining":"Betrag (Rest)","amountCancelled":"Betrag (R\xfcckerstattet)","amountCharged":"Betrag (Eingezogen)","descriptor":"Verwendungszweck"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schl\xfcssel","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\xfcckerstatten","refundSuccessMessage":"Die R\xfcckerstattung wurde erfolgreich durchgef\xfchrt.","refundErrorTitle":"R\xfcckerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgef\xfchrt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung","invoiceNotFoundMessage":"Zu dieser Bestellung wurde keine Rechnung gefunden","couldNotRetrieveMessage":"Die Zahlungsdetails konnten nicht abgerufen werden, bitte pr\xfcfen Sie die Logdateien f\xfcr weitere Informationen.","documentDateMissingError":"Das Datum der Rechnung ist leer.","paymentMissingError":"Die Zahlung konnte nicht gefunden werden","paylaterInvoiceDocumentRequiredErrorMessage":"Bitte erstellen oder hinterlegen Sie zun\xe4chst eine Rechnung f\xfcr die Bestellung.","cancelSuccessTitle":"Stornierung","cancelErrorTitle":"Stornierung","cancelSuccessMessage":"Die Stornierung wurde erfolgreich durchgef\xfchrt.","cancelErrorMessage":"Die Stornierung konnte nicht durchgef\xfchrt werden."}},"order-list":{"transactionId":"Unzer Transaktions ID"},"methods":{"paylaterInvoice":{"b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},"paylaterInstallment":{"b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},"paylaterDirectDebitSecured":{"b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{"module":{"title":"Unzer Payment","description":"Unzer Payment"},"apple-pay":{"certificates":{"title":"Apple Pay Zertifikate (Veraltet)","textExisting":"Wir haben unsere Integration mit Apple Pay aktualisiert, aber da Sie sie bereits eingerichtet haben, brauchen Sie im Moment nichts zu tun.
Wenn Ihre Apple-Pay-Zertifikate jedoch bald ablaufen, k\xf6nnen Sie auf die neue Integration umsteigen.
Sie k\xf6nnen nat\xfcrlich auch jetzt schon auf die neue Integration umsteigen, wenn Sie m\xf6chten, und m\xfcssen sich dann in Zukunft keine Gedanken mehr \xfcber ablaufende Zertifikate, einen Wechsel der Integration usw. machen.","textAll":"Bevor Sie Apple Pay aktivieren, stellen Sie bitte sicher, dass Sie unsere Checkliste gelesen haben.","check":{"paymentProcessingValid":{"true":"Das Payment Processing-Zertifikat ist vorhanden und g\xfcltig","false":"Das Payment Processing-Zertifikat fehlt"},"paymentProcessingActive":{"true":"Das Payment Processing-Zertifikat ist aktiv","false":"Das Payment Processing-Zertifikat ist nicht aktiv"},"merchantIdentificationValid":{"true":"Das Merchant Identification-Zertifikat ist vorhanden","false":"Das Merchant Identification-Zertifikat fehlt"},"merchantIdentificationValidUntil":{"true":"Das Merchant Identification-Zertifikat ist g\xfcltig","false":"Das Merchant Identification-Zertifikat ist abgelaufen und muss erneuert werden"}},"update":{"success":{"title":"Erfolg","message":"Die Zertifikate wurden erfolgreich aktualisiert"},"error":{"title":"Fehler","message":"Bei der Aktualisierung der Zertifikate trat ein Fehler auf","messageInvalidCertificate":"Die \xfcbergebenen Zertifikatsdaten f\xfcr {type} sind ung\xfcltig","messageMissingCertificateFiles":"Die \xfcbergebenen Zertifikatsdaten f\xfcr {type} sind unvollst\xe4ndig"}}},"paymentProcessingCertificate":{"label":"Payment Processing Zertifikat (apple_pay.pem)","helpText":"Zertifikat und Schl\xfcssel m\xfcssen nach den Schritten der Unzer-Dokumentation vorbereitet werden."},"paymentProcessingKey":{"label":"Payment Processing Zertifikatsschl\xfcssel (privatekey.key)"},"publicKey":{"changeNotice":"Bitte beachten: Nach dem \xc4ndern der Unzer Keys muss das Apple Pay Payment Processing Certificate neu hochgeladen werden."},"merchantIdentificationCertificate":{"label":"Merchant Identification Zertifikat (merchant_id.pem)","helpText":"Zertifikat und Schl\xfcssel m\xfcssen nach den Schritten der Unzer-Dokumentation vorbereitet werden."},"merchantIdentificationKey":{"label":"Merchant Identification Zertifikatsschl\xfcssel (merchant_id.key)"}},"google-pay":{"gatewayMerchantId":"Gateway H\xe4ndler ID"},"form":{"message":{"success":{"title":"Test erfolgreich","message":"Die angegebenen API-Zugangsdaten sind korrekt!"},"error":{"title":"Test fehlgeschlagen","message":"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},"testButton":"API Zugangsdaten testen","webhookButton":"Webhooks registrieren","privateKey":"Private Key","publicKey":"Public Key"},"modal":{"close":"Schlie\xdfen","webhook":{"title":"Webhooks","httpsInfo":"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.","registered":"Webhook ist bereits registriert","placeholder":"Bitte w\xe4hlen Sie eine Domain aus","submit":{"register":"Webhooks registrieren","clear":"Webhooks ausw\xe4hlen | Ausgew\xe4hlten Webhook entfernen | Entferne {count} Webhooks"}}},"webhook":{"messagePrefix":"Domain: ","register":{"done":"Webhook registriert | Webhooks registriert","error":"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},"clear":{"done":"Webhook entfernt | Webhooks entfernt","error":"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},"missing":{"fields":"Nicht alle ben\xf6tigten 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\xfcr mehr Informationen"},"empty":"F\xfcr diesen Private Key sind keine Webhooks registriert. Bitte pr\xfcfen Sie ob dieser valide ist und ob Konfigurationen f\xfcr dedizierte Verkaufskan\xe4le vorgenommen wurden.","show":"Webhooks anzeigen"}},"sw-payment-card":{"deprecated":"Veraltet"}}'),C=JSON.parse('{"unzer-payment":{"tabTitle":"Unzer Payment","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","refund":"Refund","cancellation":"Cancel","default":""}},"actions":{"reason":{"placeholder":"Reason","cancel":"Cancel","credit":"Credit","return":"Return"},"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund","defaultButton":"Done","cancelButton":"Cancel","confirmCancelModal":{"text":"Do you really want to cancel the authorization of the selected amount?","amountLabel":"Amount:","yesButton":"Yes","noButton":"No"}},"detail":{"cardTitle":"Payment Details","shortId":"Short-ID","id":"Payment-ID","state":"State","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)","descriptor":"Descriptor"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occurred!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully.","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice","invoiceNotFoundMessage":"No invoice was found for this order.","couldNotRetrieveMessage":"The payment details could not be retrieved, please check the log files for more information.","documentDateMissingError":"Document date for invoice is empty.","paymentMissingError":"Payment could not be found","paylaterInvoiceDocumentRequiredErrorMessage":"Please create or upload an invoice for the order first.","cancelSuccessTitle":"Cancel","cancelErrorTitle":"Cancel","cancelSuccessMessage":"The reversal was successfully completed.","cancelErrorMessage":"The reversal could not be performed."}},"order-list":{"transactionId":"Unzer transaction ID"},"methods":{"paylaterInvoice":{"b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},"paylaterInstallment":{"b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},"paylaterDirectDebitSecured":{"b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{"module":{"title":"Unzer Payment","description":"Unzer Payment"},"apple-pay":{"certificates":{"title":"Apple Pay Certificates (Deprecated)","textExisting":"We have updated our integration with Apple Pay, but since you already have it set up, you don\'t need to do anything just now.
However, when your Apple Pay certificates are about to expire, you can change to the new integration.
You can of course change to the new integration now, if you want, and then you don\'t have to worry about expiring certificates, changing integration, etc. in the future.","textAll":"Before you activate Apple Pay, please make sure you have read our checklist.","check":{"paymentProcessingValid":{"true":"The Payment Processing certificate is present and valid","false":"The Payment Processing certificate is missing"},"paymentProcessingActive":{"true":"The Payment Processing certificate is active","false":"The Payment Processing certificate is inactive"},"merchantIdentificationValid":{"true":"The Merchant Identification certificate is present","false":"The Merchant Identification certificate is missing"},"merchantIdentificationValidUntil":{"true":"The Merchant Identification certificate is valid","false":"The Merchant Identification certificate is expired and must be renewed"}},"update":{"success":{"title":"Success","message":"Certificates were updated successfully"},"error":{"title":"Error","message":"An error occurred during certificate update","messageInvalidCertificate":"The given certificate data for {type} is invalid","messageMissingCertificateFiles":"The given certificate data for {type} is incomplete"}}},"paymentProcessingCertificate":{"label":"Payment Processing Certificate","helpText":"Certificate and Key have to be prepared as specified in the Unzer documentation."},"paymentProcessingKey":{"label":"Payment Processing Certificate Key (Private Key)"},"publicKey":{"changeNotice":"Please note: After changing the Unzer keys, you have to re-upload your Apple Pay Payment Processing Certificate."},"merchantIdentificationCertificate":{"label":"Merchant Identification Certificate","helpText":"Certificate and Key have to be prepared as specified in the Unzer documentation."},"merchantIdentificationKey":{"label":"Merchant Identification Certificate Key (Private Key)"}},"google-pay":{"gatewayMerchantId":"Gateway Merchant ID"},"form":{"message":{"success":{"title":"Test succeeded","message":"The provided credentials are valid!"},"error":{"title":"Test failed","message":"API Credentials are invalid, please correct them and try again!"}},"testButton":"Test API credentials","webhookButton":"Register webhooks","privateKey":"Private Key","publicKey":"Public Key"},"modal":{"close":"Close","webhook":{"title":"Webhooks","httpsInfo":"Only one HTTPS domain per sales channel can be registered.","registered":"Webhook is already registered","placeholder":"Please select a domain","submit":{"register":"Register webhooks","clear":"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},"webhook":{"messagePrefix":"Domain: ","register":{"done":"Webhook registered | Webhooks registered","error":"Webhook could not be registered | Webhooks could not be registered"},"clear":{"done":"Webhook cleared | Webhooks cleared","error":"Webhook could not be cleared | Webhooks could not be cleared"},"missing":{"fields":"Some mandatory fields are missing","context":"The context could not be refreshed","selection":"No domain was selected"},"notFound":{"salesChannelDomain":"The selected domain could not be found"},"globalError":{"title":"An error has occurred!","message":"Please contact us for more information"},"empty":"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.","show":"Show webhooks"}},"sw-payment-card":{"deprecated":"Deprecated"}}');let{Module:v}=Shopware;v.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,snippets:{"de-DE":k,"en-GB":C},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}}),n(119);let P=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:'{% block unzer_payment_payment_register_webhook %}\n \n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc(\'unzer-payment-settings.form.webhookButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n\n \n \n {{ $tc(\'unzer-payment-settings.modal.webhook.httpsInfo\') }}\n \n\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.registered\') }}\n \n \n\n \n \n\n \n\n \n\n \n {{ $tc(\'unzer-payment-settings.modal.close\') }}\n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.submit.register\') }}\n \n \n \n {% endblock %}\n
\n{% endblock %}\n',mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;n.isDataLoading=!0;let a=new P(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(e=>{n.salesChannels=e,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){let e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,void 0!==t&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){console.log(e,t),t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){let t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1,n=this.getSalesChannelById(e);return!!this.webhooks.length&&(n.domains.forEach(e=>{this.webhooks.forEach(n=>{if(n.url.indexOf(e.url)>-1)return t=!0,!0})}),t)},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new P;return t.addFilter(P.prefix("url","https://")),t.addFilter(P.equals("salesChannelId",e)),t}}});let{Component:z,Mixin:S,Context:_}=Shopware;z.register("unzer-webhooks-modal",{template:'\n \n {{ $tc(\'unzer-payment-settings.webhook.empty\') }}\n \n\n \n \n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.submit.clear\', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n\n',mixins:[S.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){let t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),void 0!==n&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){let t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}}),n(858),Shopware.Component.register("unzer-payment-apple-pay-certificates",{template:'{% block unzer_payment_apple_pay_certificates %}\n \n \n {% block unzer_payment_apple_pay_certificates_form %}\n \n \n \n \n \n \n \n
\n \n \n \n \n \n
\n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n\n \n \n \n \n\n \n \n \n \n \n \n {% endblock %}\n \n \n{% endblock %}\n',mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentApplePayService"],props:{isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},parentRefs:{required:!0}},data(){return{isUpdating:!1,isUpdateSuccessful:!1,isDataLoading:!1,paymentProcessingCertificate:!1,paymentProcessingKey:!1,merchantIdentificationCertificate:!1,merchantIdentificationKey:!1,merchantIdentificationValid:!1,merchantIdentificationValidUntil:null,paymentProcessingValid:!1,paymentProcessingActive:!1}},computed:{isNotDefaultSalesChannel(){return null!==this.selectedSalesChannelId},now(){return Date.now()},parentConfigData(){return this.parentRefs&&this.parentRefs.systemConfig&&this.parentRefs.systemConfig.actualConfigData&&this.parentRefs.systemConfig.actualConfigData[this.selectedSalesChannelId]||{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(){this.checkCertificates()},checkCertificates(){let e=this;e.isDataLoading=!0,this.UnzerPaymentApplePayService.checkCertificates(this.selectedSalesChannelId).then(e=>{void 0!==e&&(this.merchantIdentificationValid=e.merchantIdentificationValid,this.merchantIdentificationValidUntil=e.merchantIdentificationValidUntil?new Date(e.merchantIdentificationValidUntil):null,this.paymentProcessingValid=e.paymentProcessingValid,this.paymentProcessingActive=e.paymentProcessingActive)}).finally(()=>{e.isDataLoading=!1})},onSave(){return this.updateCertificates()},resetFileFieldsMerchantIdentification(){this.$refs.merchantIdentificationCertificateInput.onRemoveIconClick(),this.$refs.merchantIdentificationKeyInput.onRemoveIconClick()},resetFileFieldsPaymentProcessing(){this.$refs.paymentProcessingCertificateInput.onRemoveIconClick(),this.$refs.paymentProcessingKeyInput.onRemoveIconClick()},updateCertificates(){let e=this;return(this.isUpdateSuccessful=!1,this.isUpdating=!0,this.paymentProcessingCertificate||this.paymentProcessingKey||this.merchantIdentificationCertificate||this.merchantIdentificationKey||this.$refs.inheritWrapperMerchantIdentificationCertificate.isInherited||this.$refs.inheritWrapperPaymentProcessingCertificate.isInherited)?this.UnzerPaymentApplePayService.updateCertificates(this.selectedSalesChannelId,{paymentProcessingCertificate:this.paymentProcessingCertificate,paymentProcessingKey:this.paymentProcessingKey,merchantIdentificationCertificate:this.merchantIdentificationCertificate,merchantIdentificationKey:this.merchantIdentificationKey},this.$refs.inheritWrapperMerchantIdentificationCertificate.isInherited,this.$refs.inheritWrapperPaymentProcessingCertificate.isInherited).then(t=>{e.isUpdateSuccessful=!0,e.createNotificationSuccess({title:e.$tc("unzer-payment-settings.apple-pay.certificates.update.success.title"),message:e.$tc("unzer-payment-settings.apple-pay.certificates.update.success.message")}),e.$emit("certificate-updated",t),e.parentRefs.systemConfig.loadCurrentSalesChannelConfig?e.parentRefs.systemConfig.loadCurrentSalesChannelConfig():(delete e.parentRefs.systemConfig.actualConfigData[this.selectedSalesChannelId],e.parentRefs.systemConfig.readAll()),e.checkCertificates(),e.resetFileFieldsPaymentProcessing(),e.resetFileFieldsMerchantIdentification()}).catch(t=>{let n="unzer-payment-settings.apple-pay.certificates.update.error.message";t&&t.response&&t.response.data&&t.response.data.message&&(n=t.response.data.message);let a={};t&&t.response&&t.response.data&&t.response.data.translationData&&(a=t.response.data.translationData),e.createNotificationError({title:e.$tc("unzer-payment-settings.apple-pay.certificates.update.error.title"),message:e.$t(n,a)})}).finally(()=>{e.isUpdating=!1}):(this.isUpdateSuccessful=!0,this.isUpdating=!1,Promise.resolve())},onInputChangePaymentProcessing(e){e&&this.$refs.inheritWrapperPaymentProcessingCertificate.removeInheritance()},onInputChangeMerchantIdentification(e){e&&this.$refs.inheritWrapperMerchantIdentificationCertificate.removeInheritance()},getInheritedValue(e){let t=this.parentRefs.systemConfig;return t?t.getInheritedValue&&t.actualConfigData.null?t.getInheritedValue({name:"UnzerPayment6.settings."+e,type:"text"}):t.actualConfigData.null&&t.actualConfigData.null["UnzerPayment6.settings."+e]||null:null}}});let{Component:D}=Shopware;D.register("unzer-payment-plugin-icon",{template:'{% block unzer_plugin_icon %}\n
\n{% endblock %}\n',computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});let{Component:I}=Shopware;I.override("sw-system-config",{template:'{% block sw_system_config_content_card_field %}\n \n {% parent() %}\n\n \n \n \n \n \n
\n \n\n \n \n \n \n \n{% endblock %}\n',inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:{}}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId(),this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}},computed:{unzerGooglePayGatewayMerchantId(){return this.readOnlyUnzerGooglePayGatewayMerchantId||""}},methods:{async createdComponent(){await this.$super("createdComponent"),this.getUnzerGooglePayGatewayMerchantId()},getUnzerGooglePayGatewayMerchantId(){"UnzerPayment6.settings"===this.domain&&this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}}),n(569);let{Component:$,Mixin:R,Context:M}=Shopware;$.register("unzer-payment-settings",{template:'{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n \n {{ $tc(\'sw-settings.index.title\') }}\n \n {{ $tc(\'unzer-payment-settings.module.title\') }}\n
\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% block unzer_payment_settings_actions_save %}\n \n {{ $tc(\'global.default.save\') }}\n \n {% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n \n {{ $tc(\'unzer-payment-settings.webhook.show\') }}\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.form.testButton\') }}\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n {{ $tc(\'unzer-payment-settings.webhook.show\') }}\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.form.testButton\') }}\n \n \n \n \n \n \n \n {% endblock %}\n \n{% endblock %}\n',mixins:[R.getByName("notification"),R.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return M.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";let t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;let t=this.getArrayKeyOfKeyPairSetting(e),n=e;-1!==t&&(n=this.keyPairSettings[t]);let a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},setPublicKey(e,t){this.keyPairSettings[this.getArrayKeyOfKeyPairSetting(e)].publicKey=t},setPrivateKey(e,t){this.keyPairSettings[this.getArrayKeyOfKeyPairSetting(e)].privateKey=t},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(t&&t.privateKey&&t.publicKey&&e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");"sw-plugin-config.messageSaveSuccess"===e&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),this.$refs.applePayCertificates.onSave().then(()=>{this.isLoading=!1})}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig(),this.$refs.applePayCertificates.loadData()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(t=>{t.elements.forEach(t=>{if(t.name===e.name){n=t;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){let e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(t=>{e.keyPairSettings.forEach((e,n,a)=>{e.group===t.group&&e.key===t.key&&(a[n]=t)})})})}}});let{Module:A}=Shopware;A.register("unzer-payment-configuration",{type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":k,"en-GB":C},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}}),n(962),n(443),n(547),Shopware.Component.override("sw-payment-card",{template:'{% block sw_payment_card_description %}\n \n
\n \n {{ $tc(\'sw-payment-card.deprecated\') }}\n \n
\n
\n
\n{% endblock %}',snippets:{"de-DE":k,"en-GB":C}}),n(467)}()})();
\ No newline at end of file
+!function(){var e={39:function(){},943:function(){},956:function(){},436:function(){},47:function(){let{Application:e}=Shopware,t=Shopware.Classes.ApiService;class n extends t{constructor(e,t,n="unzer-payment"){super(e,t,n)}checkCertificates(e){let n=`_action/${this.getApiBasePath()}/apple-pay/certificates`;return e&&(n+=`/${e}`),this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}async updateCertificates(e,n,a,i){let s=`_action/${this.getApiBasePath()}/apple-pay/certificates`;e&&(s+=`/${e}`);let r={};for(let e in n)if(n[e]){let t=n[e];r[e]=await t.text()}return(a&&(r.inheritMerchantIdentification=!0),i&&(r.inheritPaymentProcessing=!0),0===r.length)?new Promise:this.httpClient.post(s,r,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}}e.addServiceProvider("UnzerPaymentApplePayService",t=>new n(e.getContainer("init").httpClient,t.loginService))},650:function(){let{Application:e}=Shopware,t=Shopware.Classes.ApiService;class n extends t{constructor(e,t,n="unzer-payment"){super(e,t,n)}validateCredentials(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,e,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}registerWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}clearWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,e,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}getWebhooks(e){return this.httpClient.post(`_action/${this.getApiBasePath()}/get-webhooks`,{privateKey:e},{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}getGooglePayGatewayMerchantId(e){return this.httpClient.get(`_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${e||""}`,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}}e.addServiceProvider("UnzerPaymentConfigurationService",t=>new n(e.getContainer("init").httpClient,t.loginService))},213:function(){let{Application:e}=Shopware,t=Shopware.Classes.ApiService;class n extends t{constructor(e,t,n="unzer-payment"){super(e,t,n)}fetchPaymentDetails(e){let n=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}chargeTransaction(e,n,a){let i=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${a}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}refundTransaction(e,n,a,i=null){let s=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${n}/${a}`;return null!==i&&(s=`${s}/${i}`),this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}cancelTransaction(e,n,a){let i=`_action/${this.getApiBasePath()}/transaction/${e}/cancel/${n}/${a}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}ship(e){let n=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(e=>t.handleResponse(e))}}e.addServiceProvider("UnzerPaymentService",t=>new n(e.getContainer("init").httpClient,t.loginService))},410:function(){let{Component:e}=Shopware,{Criteria:t,EntityCollection:n}=Shopware.Data;e.extend("unzer-entity-multi-select-delivery-status","sw-entity-multi-id-select",{inject:["repositoryFactory"],props:{repository:{type:Object,required:!0,default(){return this.repositoryFactory.create("state_machine_state")}},criteria:{type:Object,required:!1,default(){let e=new t(1,100);return e.addFilter(t.equals("stateMachine.technicalName","order_delivery.state")),e}},entityCollection(){}}})},421:function(){let{Component:e}=Shopware,{Criteria:t}=Shopware.Data;e.extend("unzer-entity-single-select-delivery-status","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){let e=new t(1,100);return e.addFilter(t.equals("stateMachine.technicalName","order_delivery.state")),e}}}})},434:function(e,t,n){var a=n(39);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("2d68c4fa",a,!0,{})},806:function(e,t,n){var a=n(943);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("abbee774",a,!0,{})},683:function(e,t,n){var a=n(956);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("53fb75b7",a,!0,{})},73:function(e,t,n){var a=n(436);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("2543d738",a,!0,{})},534:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{for(var s=[],i=0;i\n {% block unzer_payment_actions_amount_field %}\n \n \n \n
\n {% endblock %}\n\n \n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.cancelButton\') }}\n \n {% endblock %}\n \n\n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n \n\n {% block unzer_payment_actions_default_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.defaultButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n{% endblock %}\n',inject:["UnzerPaymentService"],mixins:[t.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type},maxTransactionAmount(){let e=0;return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:"CANCEL"},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:"CREDIT"},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:"RETURN"}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),"paylater-invoice-document-required"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});let{Component:a,Mixin:i,Module:s}=Shopware;a.register("unzer-payment-detail",{template:'{% block unzer_payment_detail %}\n \n \n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.amountRemaining\') }}\n {{ formatCurrency(remainingAmount) }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.amountCancelled\') }}\n {{ formatCurrency(cancelledAmount) }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.amountCharged\') }}\n {{ formatCurrency(chargedAmount) }}\n\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.shortId\') }}\n {{ paymentResource.shortId }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.id\') }}\n {{ paymentResource.id }}\n\n {{ $tc(\'unzer-payment.paymentDetails.detail.state\') }}\n {{ paymentResource.state.name }}\n\n \n {{ $tc(\'unzer-payment.paymentDetails.detail.descriptor\') }}\n {{ paymentResource.descriptor }}\n \n\n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc(\'unzer-payment.paymentDetails.actions.shipButton\') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["UnzerPaymentService"],mixins:[i.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){let e=s.getModuleRegistry().get("unzer-payment");return e&&e.manifest?e.manifest.maxDigits:4},remainingAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision):0},cancelledAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision):0},chargedAmount(){return this.paymentResource&&this.paymentResource.amount?this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision):0}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):"invoice-missing-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):"documentdate-missing-error"===t?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):"payment-missing-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});let{Component:r,Module:o,Mixin:c}=Shopware;r.register("unzer-payment-history",{template:'{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% block unzer_payment_history_data_grid %}\n \n\n {% block unzer_payment_history_actions %}\n \n {% block unzer_payment_history_data_grid_item_actions %}\n { openCancelModal(item, cancelAmount) }">\n \n {% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_history_actions_modals %}\n \n \n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.text\') }}
\n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.amountLabel\') }} {{ formatCurrency(cancelAmount) }}\n
\n\n \n\n {% block sw_confirm_modal_footer_cancel %}\n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.noButton\') }}\n \n {% endblock %}\n\n {% block sw_confirm_modal_footer_confirm %}\n \n {{ $t(\'unzer-payment.paymentDetails.actions.confirmCancelModal.yesButton\') }}\n \n {% endblock %}\n\n \n \n \n {% endblock %}\n\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["repositoryFactory","UnzerPaymentService"],mixins:[c.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){let e=o.getModuleRegistry().get("unzer-payment");return e&&e.manifest?e.manifest.maxDigits:4},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return this.paymentResource&&this.paymentResource.amount&&this.paymentResource.amount.decimalPrecision?Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision):this.unzerMaxDigits},data:function(){let e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{let n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];"generic-error"===t&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});let{Component:l}=Shopware;l.register("unzer-payment-metadata",{template:'{% block unzer_payment_metadata %}\n \n \n {% block unzer_payment_metadata_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n',props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});let{Component:d}=Shopware;d.register("unzer-payment-basket",{template:'{% block unzer_payment_basket %}\n \n \n {% block unzer_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n',props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(-1*parseFloat(t.amountDiscount.toFixed(2))),a=this.formatCurrency(-1*parseFloat((t.amountDiscount-t.amountVat).toFixed(2)))),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});let{Criteria:p}=Shopware.Data,u=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","95aa098aac8f11e9a2a32a2ae2dbcce4","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:'{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}\n',computed:{paymentMethodCriteria(){let e=new p;return this.salesChannelId&&e.addFilter(p.equals("salesChannels.id",this.salesChannelId)),e.addFilter(p.not("AND",[p.equalsAny("id",u)])),e}}});let{Component:h,Context:m}=Shopware,{Criteria:y}=Shopware.Data;h.override("sw-order-detail",{template:"{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}\n",data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}let e=this.repositoryFactory.create("order"),t=new y(1,1);t.addAssociation("transactions"),e.get(this.orderId,m.api,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&(e.customFields.unzer_payment_is_transaction||e.customFields.heidelpay_is_transaction)&&(this.isUnzerPayment=!0)})})},immediate:!0}}}),Shopware.Component.override("sw-order-list",{template:'{% block sw_order_list_grid_columns %}\n {% parent %}\n\n {% block unzer_payment_column_transaction %}\n \n \n {{ item.transactions.last().id }}\n \n \n {% endblock %}\n{% endblock %}\n',methods:{getOrderColumns(){let e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});let{Component:g,Context:f,Mixin:b}=Shopware,{Criteria:w}=Shopware.Data;g.register("unzer-payment-tab",{template:'{% block unzer_payment_payment_details %}\n \n
\n {% block unzer_payment_payment_details_content %}\n \n \n {% block unzer_payment_payment_details_content_payment_detail %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_history %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_basket %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_payment_metadata %}\n \n \n {% endblock %}\n\n {% block unzer_payment_payment_details_content_inner %}{% endblock %}\n \n \n {% endblock %}\n
\n\n
\n
\n{% endblock %}\n',inject:["UnzerPaymentService","repositoryFactory"],mixins:[b.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){let e=this.$route.params.id,t=new w;t.getAssociation("transactions").addSorting(w.sort("createdAt","DESC")),this.orderRepository.get(e,f.api,t).then(e=>{this.order=e,e.transactions&&e.transactions.forEach((e,t)=>{if(!e.customFields||!e.customFields.unzer_payment_is_transaction&&!e.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(e.id).then(e=>{this.paymentResources[t]=e,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){let t=e.$parent;return void 0===t?null:"sw-order-detail"!==t.$options.name?this.findOrderDetailComponentAndReInit(t):t.isOrderEditing?null:void t.createdComponent()}}});var k=JSON.parse('{"unzer-payment":{"tabTitle":"Unzer Payment","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandmitteilung","refund":"R\xfcckerstattung","cancellation":"Stornierung","default":""}},"actions":{"reason":{"placeholder":"Grund","cancel":"Abgebrochen","credit":"Gutschrift","return":"R\xfcckgabe"},"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"R\xfcckerstatten","defaultButton":"Erledigt","cancelButton":"Stornieren","confirmCancelModal":{"text":"M\xf6chten Sie wirklich die Reservierung \xfcber den angegebenen Betrag stornieren?","amountLabel":"Betrag:","yesButton":"Ja","noButton":"Nein"}},"detail":{"cardTitle":"Zahlungsdetails","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status","amountRemaining":"Betrag (Rest)","amountCancelled":"Betrag (R\xfcckerstattet)","amountCharged":"Betrag (Eingezogen)","descriptor":"Verwendungszweck"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schl\xfcssel","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\xfcckerstatten","refundSuccessMessage":"Die R\xfcckerstattung wurde erfolgreich durchgef\xfchrt.","refundErrorTitle":"R\xfcckerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgef\xfchrt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung","invoiceNotFoundMessage":"Zu dieser Bestellung wurde keine Rechnung gefunden","couldNotRetrieveMessage":"Die Zahlungsdetails konnten nicht abgerufen werden, bitte pr\xfcfen Sie die Logdateien f\xfcr weitere Informationen.","documentDateMissingError":"Das Datum der Rechnung ist leer.","paymentMissingError":"Die Zahlung konnte nicht gefunden werden","paylaterInvoiceDocumentRequiredErrorMessage":"Bitte erstellen oder hinterlegen Sie zun\xe4chst eine Rechnung f\xfcr die Bestellung.","cancelSuccessTitle":"Stornierung","cancelErrorTitle":"Stornierung","cancelSuccessMessage":"Die Stornierung wurde erfolgreich durchgef\xfchrt.","cancelErrorMessage":"Die Stornierung konnte nicht durchgef\xfchrt werden."}},"order-list":{"transactionId":"Unzer Transaktions ID"},"methods":{"paylaterInvoice":{"b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},"paylaterInstallment":{"b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},"paylaterDirectDebitSecured":{"b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{"module":{"title":"Unzer Payment","description":"Unzer Payment"},"apple-pay":{"certificates":{"title":"Apple Pay Zertifikate (Veraltet)","textExisting":"Wir haben unsere Integration mit Apple Pay aktualisiert, aber da Sie sie bereits eingerichtet haben, brauchen Sie im Moment nichts zu tun.
Wenn Ihre Apple-Pay-Zertifikate jedoch bald ablaufen, k\xf6nnen Sie auf die neue Integration umsteigen.
Sie k\xf6nnen nat\xfcrlich auch jetzt schon auf die neue Integration umsteigen, wenn Sie m\xf6chten, und m\xfcssen sich dann in Zukunft keine Gedanken mehr \xfcber ablaufende Zertifikate, einen Wechsel der Integration usw. machen.","textAll":"Bevor Sie Apple Pay aktivieren, stellen Sie bitte sicher, dass Sie unsere Checkliste gelesen haben.","check":{"paymentProcessingValid":{"true":"Das Payment Processing-Zertifikat ist vorhanden und g\xfcltig","false":"Das Payment Processing-Zertifikat fehlt"},"paymentProcessingActive":{"true":"Das Payment Processing-Zertifikat ist aktiv","false":"Das Payment Processing-Zertifikat ist nicht aktiv"},"merchantIdentificationValid":{"true":"Das Merchant Identification-Zertifikat ist vorhanden","false":"Das Merchant Identification-Zertifikat fehlt"},"merchantIdentificationValidUntil":{"true":"Das Merchant Identification-Zertifikat ist g\xfcltig","false":"Das Merchant Identification-Zertifikat ist abgelaufen und muss erneuert werden"}},"update":{"success":{"title":"Erfolg","message":"Die Zertifikate wurden erfolgreich aktualisiert"},"error":{"title":"Fehler","message":"Bei der Aktualisierung der Zertifikate trat ein Fehler auf","messageInvalidCertificate":"Die \xfcbergebenen Zertifikatsdaten f\xfcr {type} sind ung\xfcltig","messageMissingCertificateFiles":"Die \xfcbergebenen Zertifikatsdaten f\xfcr {type} sind unvollst\xe4ndig"}}},"paymentProcessingCertificate":{"label":"Payment Processing Zertifikat (apple_pay.pem)","helpText":"Zertifikat und Schl\xfcssel m\xfcssen nach den Schritten der Unzer-Dokumentation vorbereitet werden."},"paymentProcessingKey":{"label":"Payment Processing Zertifikatsschl\xfcssel (privatekey.key)"},"publicKey":{"changeNotice":"Bitte beachten: Nach dem \xc4ndern der Unzer Keys muss das Apple Pay Payment Processing Certificate neu hochgeladen werden."},"merchantIdentificationCertificate":{"label":"Merchant Identification Zertifikat (merchant_id.pem)","helpText":"Zertifikat und Schl\xfcssel m\xfcssen nach den Schritten der Unzer-Dokumentation vorbereitet werden."},"merchantIdentificationKey":{"label":"Merchant Identification Zertifikatsschl\xfcssel (merchant_id.key)"}},"google-pay":{"gatewayMerchantId":"Gateway H\xe4ndler ID"},"form":{"message":{"success":{"title":"Test erfolgreich","message":"Die angegebenen API-Zugangsdaten sind korrekt!"},"error":{"title":"Test fehlgeschlagen","message":"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},"testButton":"API Zugangsdaten testen","webhookButton":"Webhooks registrieren","privateKey":"Private Key","publicKey":"Public Key"},"modal":{"close":"Schlie\xdfen","webhook":{"title":"Webhooks","httpsInfo":"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.","registered":"Webhook ist bereits registriert","placeholder":"Bitte w\xe4hlen Sie eine Domain aus","submit":{"register":"Webhooks registrieren","clear":"Webhooks ausw\xe4hlen | Ausgew\xe4hlten Webhook entfernen | Entferne {count} Webhooks"}}},"webhook":{"messagePrefix":"Domain: ","register":{"done":"Webhook registriert | Webhooks registriert","error":"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},"clear":{"done":"Webhook entfernt | Webhooks entfernt","error":"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},"missing":{"fields":"Nicht alle ben\xf6tigten 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\xfcr mehr Informationen"},"empty":"F\xfcr diesen Private Key sind keine Webhooks registriert. Bitte pr\xfcfen Sie ob dieser valide ist und ob Konfigurationen f\xfcr dedizierte Verkaufskan\xe4le vorgenommen wurden.","show":"Webhooks anzeigen"}},"sw-payment-card":{"deprecated":"Veraltet"}}'),C=JSON.parse('{"unzer-payment":{"tabTitle":"Unzer Payment","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","refund":"Refund","cancellation":"Cancel","default":""}},"actions":{"reason":{"placeholder":"Reason","cancel":"Cancel","credit":"Credit","return":"Return"},"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund","defaultButton":"Done","cancelButton":"Cancel","confirmCancelModal":{"text":"Do you really want to cancel the authorization of the selected amount?","amountLabel":"Amount:","yesButton":"Yes","noButton":"No"}},"detail":{"cardTitle":"Payment Details","shortId":"Short-ID","id":"Payment-ID","state":"State","amountRemaining":"Amount (Remaining)","amountCancelled":"Amount (Cancelled)","amountCharged":"Amount (Charged)","descriptor":"Descriptor"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occurred!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully.","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice","invoiceNotFoundMessage":"No invoice was found for this order.","couldNotRetrieveMessage":"The payment details could not be retrieved, please check the log files for more information.","documentDateMissingError":"Document date for invoice is empty.","paymentMissingError":"Payment could not be found","paylaterInvoiceDocumentRequiredErrorMessage":"Please create or upload an invoice for the order first.","cancelSuccessTitle":"Cancel","cancelErrorTitle":"Cancel","cancelSuccessMessage":"The reversal was successfully completed.","cancelErrorMessage":"The reversal could not be performed."}},"order-list":{"transactionId":"Unzer transaction ID"},"methods":{"paylaterInvoice":{"b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},"paylaterInstallment":{"b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},"paylaterDirectDebitSecured":{"b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{"module":{"title":"Unzer Payment","description":"Unzer Payment"},"apple-pay":{"certificates":{"title":"Apple Pay Certificates (Deprecated)","textExisting":"We have updated our integration with Apple Pay, but since you already have it set up, you don\'t need to do anything just now.
However, when your Apple Pay certificates are about to expire, you can change to the new integration.
You can of course change to the new integration now, if you want, and then you don\'t have to worry about expiring certificates, changing integration, etc. in the future.","textAll":"Before you activate Apple Pay, please make sure you have read our checklist.","check":{"paymentProcessingValid":{"true":"The Payment Processing certificate is present and valid","false":"The Payment Processing certificate is missing"},"paymentProcessingActive":{"true":"The Payment Processing certificate is active","false":"The Payment Processing certificate is inactive"},"merchantIdentificationValid":{"true":"The Merchant Identification certificate is present","false":"The Merchant Identification certificate is missing"},"merchantIdentificationValidUntil":{"true":"The Merchant Identification certificate is valid","false":"The Merchant Identification certificate is expired and must be renewed"}},"update":{"success":{"title":"Success","message":"Certificates were updated successfully"},"error":{"title":"Error","message":"An error occurred during certificate update","messageInvalidCertificate":"The given certificate data for {type} is invalid","messageMissingCertificateFiles":"The given certificate data for {type} is incomplete"}}},"paymentProcessingCertificate":{"label":"Payment Processing Certificate","helpText":"Certificate and Key have to be prepared as specified in the Unzer documentation."},"paymentProcessingKey":{"label":"Payment Processing Certificate Key (Private Key)"},"publicKey":{"changeNotice":"Please note: After changing the Unzer keys, you have to re-upload your Apple Pay Payment Processing Certificate."},"merchantIdentificationCertificate":{"label":"Merchant Identification Certificate","helpText":"Certificate and Key have to be prepared as specified in the Unzer documentation."},"merchantIdentificationKey":{"label":"Merchant Identification Certificate Key (Private Key)"}},"google-pay":{"gatewayMerchantId":"Gateway Merchant ID"},"form":{"message":{"success":{"title":"Test succeeded","message":"The provided credentials are valid!"},"error":{"title":"Test failed","message":"API Credentials are invalid, please correct them and try again!"}},"testButton":"Test API credentials","webhookButton":"Register webhooks","privateKey":"Private Key","publicKey":"Public Key"},"modal":{"close":"Close","webhook":{"title":"Webhooks","httpsInfo":"Only one HTTPS domain per sales channel can be registered.","registered":"Webhook is already registered","placeholder":"Please select a domain","submit":{"register":"Register webhooks","clear":"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},"webhook":{"messagePrefix":"Domain: ","register":{"done":"Webhook registered | Webhooks registered","error":"Webhook could not be registered | Webhooks could not be registered"},"clear":{"done":"Webhook cleared | Webhooks cleared","error":"Webhook could not be cleared | Webhooks could not be cleared"},"missing":{"fields":"Some mandatory fields are missing","context":"The context could not be refreshed","selection":"No domain was selected"},"notFound":{"salesChannelDomain":"The selected domain could not be found"},"globalError":{"title":"An error has occurred!","message":"Please contact us for more information"},"empty":"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.","show":"Show webhooks"}},"sw-payment-card":{"deprecated":"Deprecated"}}');let{Module:v}=Shopware;v.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,snippets:{"de-DE":k,"en-GB":C},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}}),n(434);let P=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:'{% block unzer_payment_payment_register_webhook %}\n \n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc(\'unzer-payment-settings.form.webhookButton\') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n\n \n \n {{ $tc(\'unzer-payment-settings.modal.webhook.httpsInfo\') }}\n \n\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.registered\') }}\n \n \n\n \n \n\n \n\n \n\n \n {{ $tc(\'unzer-payment-settings.modal.close\') }}\n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.submit.register\') }}\n \n \n \n {% endblock %}\n
\n{% endblock %}\n',mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;n.isDataLoading=!0;let a=new P(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(e=>{n.salesChannels=e,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){let e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,void 0!==t&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){console.log(e,t),t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){let t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1,n=this.getSalesChannelById(e);return!!this.webhooks.length&&(n.domains.forEach(e=>{this.webhooks.forEach(n=>{if(n.url.indexOf(e.url)>-1)return t=!0,!0})}),t)},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new P;return t.addFilter(P.prefix("url","https://")),t.addFilter(P.equals("salesChannelId",e)),t}}});let{Component:z,Mixin:S,Context:_}=Shopware;z.register("unzer-webhooks-modal",{template:'\n \n {{ $tc(\'unzer-payment-settings.webhook.empty\') }}\n \n\n \n \n \n\n \n {{ $tc(\'unzer-payment-settings.modal.webhook.submit.clear\', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n\n',mixins:[S.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){let t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),void 0!==n&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){let t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}}),n(421),n(410),Shopware.Component.register("unzer-payment-apple-pay-certificates",{template:'{% block unzer_payment_apple_pay_certificates %}\n \n \n {% block unzer_payment_apple_pay_certificates_form %}\n \n \n \n \n \n \n \n
\n \n \n \n \n \n
\n \n\n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n\n \n \n \n \n\n \n \n \n \n \n \n {% endblock %}\n \n \n{% endblock %}\n',mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentApplePayService"],props:{isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},parentRefs:{required:!0}},data(){return{isUpdating:!1,isUpdateSuccessful:!1,isDataLoading:!1,paymentProcessingCertificate:!1,paymentProcessingKey:!1,merchantIdentificationCertificate:!1,merchantIdentificationKey:!1,merchantIdentificationValid:!1,merchantIdentificationValidUntil:null,paymentProcessingValid:!1,paymentProcessingActive:!1}},computed:{isNotDefaultSalesChannel(){return null!==this.selectedSalesChannelId},now(){return Date.now()},parentConfigData(){return this.parentRefs&&this.parentRefs.systemConfig&&this.parentRefs.systemConfig.actualConfigData&&this.parentRefs.systemConfig.actualConfigData[this.selectedSalesChannelId]||{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(){this.checkCertificates()},checkCertificates(){let e=this;e.isDataLoading=!0,this.UnzerPaymentApplePayService.checkCertificates(this.selectedSalesChannelId).then(e=>{void 0!==e&&(this.merchantIdentificationValid=e.merchantIdentificationValid,this.merchantIdentificationValidUntil=e.merchantIdentificationValidUntil?new Date(e.merchantIdentificationValidUntil):null,this.paymentProcessingValid=e.paymentProcessingValid,this.paymentProcessingActive=e.paymentProcessingActive)}).finally(()=>{e.isDataLoading=!1})},onSave(){return this.updateCertificates()},resetFileFieldsMerchantIdentification(){this.$refs.merchantIdentificationCertificateInput.onRemoveIconClick(),this.$refs.merchantIdentificationKeyInput.onRemoveIconClick()},resetFileFieldsPaymentProcessing(){this.$refs.paymentProcessingCertificateInput.onRemoveIconClick(),this.$refs.paymentProcessingKeyInput.onRemoveIconClick()},updateCertificates(){let e=this;return(this.isUpdateSuccessful=!1,this.isUpdating=!0,this.paymentProcessingCertificate||this.paymentProcessingKey||this.merchantIdentificationCertificate||this.merchantIdentificationKey||this.$refs.inheritWrapperMerchantIdentificationCertificate.isInherited||this.$refs.inheritWrapperPaymentProcessingCertificate.isInherited)?this.UnzerPaymentApplePayService.updateCertificates(this.selectedSalesChannelId,{paymentProcessingCertificate:this.paymentProcessingCertificate,paymentProcessingKey:this.paymentProcessingKey,merchantIdentificationCertificate:this.merchantIdentificationCertificate,merchantIdentificationKey:this.merchantIdentificationKey},this.$refs.inheritWrapperMerchantIdentificationCertificate.isInherited,this.$refs.inheritWrapperPaymentProcessingCertificate.isInherited).then(t=>{e.isUpdateSuccessful=!0,e.createNotificationSuccess({title:e.$tc("unzer-payment-settings.apple-pay.certificates.update.success.title"),message:e.$tc("unzer-payment-settings.apple-pay.certificates.update.success.message")}),e.$emit("certificate-updated",t),e.parentRefs.systemConfig.loadCurrentSalesChannelConfig?e.parentRefs.systemConfig.loadCurrentSalesChannelConfig():(delete e.parentRefs.systemConfig.actualConfigData[this.selectedSalesChannelId],e.parentRefs.systemConfig.readAll()),e.checkCertificates(),e.resetFileFieldsPaymentProcessing(),e.resetFileFieldsMerchantIdentification()}).catch(t=>{let n="unzer-payment-settings.apple-pay.certificates.update.error.message";t&&t.response&&t.response.data&&t.response.data.message&&(n=t.response.data.message);let a={};t&&t.response&&t.response.data&&t.response.data.translationData&&(a=t.response.data.translationData),e.createNotificationError({title:e.$tc("unzer-payment-settings.apple-pay.certificates.update.error.title"),message:e.$t(n,a)})}).finally(()=>{e.isUpdating=!1}):(this.isUpdateSuccessful=!0,this.isUpdating=!1,Promise.resolve())},onInputChangePaymentProcessing(e){e&&this.$refs.inheritWrapperPaymentProcessingCertificate.removeInheritance()},onInputChangeMerchantIdentification(e){e&&this.$refs.inheritWrapperMerchantIdentificationCertificate.removeInheritance()},getInheritedValue(e){let t=this.parentRefs.systemConfig;return t?t.getInheritedValue&&t.actualConfigData.null?t.getInheritedValue({name:"UnzerPayment6.settings."+e,type:"text"}):t.actualConfigData.null&&t.actualConfigData.null["UnzerPayment6.settings."+e]||null:null}}});let{Component:D}=Shopware;D.register("unzer-payment-plugin-icon",{template:'{% block unzer_plugin_icon %}\n
\n{% endblock %}\n',computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});let{Component:I}=Shopware;I.override("sw-system-config",{template:'{% block sw_system_config_content_card_field %}\n \n {% parent() %}\n\n \n \n \n \n \n
\n \n\n \n \n \n \n \n{% endblock %}\n',inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:{}}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId(),this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}},computed:{unzerGooglePayGatewayMerchantId(){return this.readOnlyUnzerGooglePayGatewayMerchantId||""}},methods:{async createdComponent(){await this.$super("createdComponent"),this.getUnzerGooglePayGatewayMerchantId()},getUnzerGooglePayGatewayMerchantId(){"UnzerPayment6.settings"===this.domain&&this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}}),n(806);let{Component:$,Mixin:R,Context:M}=Shopware;$.register("unzer-payment-settings",{template:'{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n \n {{ $tc(\'sw-settings.index.title\') }}\n \n {{ $tc(\'unzer-payment-settings.module.title\') }}\n
\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% block unzer_payment_settings_actions_save %}\n \n {{ $tc(\'global.default.save\') }}\n \n {% endblock %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n \n {{ $tc(\'unzer-payment-settings.webhook.show\') }}\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.form.testButton\') }}\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n {{ $tc(\'unzer-payment-settings.webhook.show\') }}\n \n\n \n \n\n \n {{ $tc(\'unzer-payment-settings.form.testButton\') }}\n \n \n \n \n \n \n \n {% endblock %}\n \n{% endblock %}\n',mixins:[R.getByName("notification"),R.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return M.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";let t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;let t=this.getArrayKeyOfKeyPairSetting(e),n=e;-1!==t&&(n=this.keyPairSettings[t]);let a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},setPublicKey(e,t){this.keyPairSettings[this.getArrayKeyOfKeyPairSetting(e)].publicKey=t},setPrivateKey(e,t){this.keyPairSettings[this.getArrayKeyOfKeyPairSetting(e)].privateKey=t},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(t&&t.privateKey&&t.publicKey&&e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");"sw-plugin-config.messageSaveSuccess"===e&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),this.$refs.applePayCertificates.onSave().then(()=>{this.isLoading=!1})}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig(),this.$refs.applePayCertificates.loadData()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(t=>{t.elements.forEach(t=>{if(t.name===e.name){n=t;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){let e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(t=>{e.keyPairSettings.forEach((e,n,a)=>{e.group===t.group&&e.key===t.key&&(a[n]=t)})})})}}});let{Module:A}=Shopware;A.register("unzer-payment-configuration",{type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":k,"en-GB":C},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}}),n(213),n(47),n(650),Shopware.Component.override("sw-payment-card",{template:'{% block sw_payment_card_description %}\n \n
\n \n {{ $tc(\'sw-payment-card.deprecated\') }}\n \n
\n
\n
\n{% endblock %}',snippets:{"de-DE":k,"en-GB":C}}),n(73)}()}();
\ No newline at end of file