From ab90c2045451a7f6eb96fe058232e97c44c33fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= Date: Tue, 5 Nov 2019 18:04:34 +0100 Subject: [PATCH 001/105] [HEIDELPAY-123] Display Short-ID --- src/Components/ArrayHydrator/PaymentArrayHydrator.php | 4 ++++ .../heidel-payment-detail/heidel-payment-detail.html.twig | 4 ++-- .../src/module/heidel-payment/snippet/de-DE.json | 2 +- .../src/module/heidel-payment/snippet/en-GB.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Components/ArrayHydrator/PaymentArrayHydrator.php b/src/Components/ArrayHydrator/PaymentArrayHydrator.php index 5cfaf76..5b7fd18 100644 --- a/src/Components/ArrayHydrator/PaymentArrayHydrator.php +++ b/src/Components/ArrayHydrator/PaymentArrayHydrator.php @@ -57,6 +57,10 @@ public function hydrateArray(Payment $resource): array 'date' => $charge->getDate(), 'id' => $charge->getId(), ]; + + if (!array_key_exists('shortId', $data) && $charge->getShortId() !== null) { + $data['shortId'] = $charge->getShortId(); + } } /** @var Shipment $metaShipment */ diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig b/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig index cd97f7c..837eab7 100644 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig +++ b/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig @@ -22,8 +22,8 @@ {% block heidel_payment_detail_container_right %} -
{{ $tc('heidel-payment.paymentDetails.detail.orderId') }}
-
{{ paymentResource.orderId }}
+
{{ $tc('heidel-payment.paymentDetails.detail.shortId') }}
+
{{ paymentResource.shortId }}
{{ $tc('heidel-payment.paymentDetails.detail.id') }}
{{ paymentResource.id }}
diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json b/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json index 302d4f1..4d1bd98 100644 --- a/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json +++ b/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json @@ -27,7 +27,7 @@ "amountTotal": "Betrag (brutto)", "amountTotalVat": "Betrag (netto)", "currency": "Währung", - "orderId": "Auftrags-ID", + "shortId": "Short-ID", "id": "Zahlungs-ID", "state": "Status" }, diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json b/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json index 81bcf69..f46c93f 100644 --- a/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json +++ b/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json @@ -27,7 +27,7 @@ "amountTotal": "Amount (gross)", "amountTotalVat": "Amount (net)", "currency": "Currency", - "orderId": "Order-ID", + "shortId": "Short-ID", "id": "Payment-ID", "state": "State" }, From c7ad27e804bccc865753117e1722a65efa9e57ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= Date: Tue, 5 Nov 2019 18:07:39 +0100 Subject: [PATCH 002/105] [HEIDELPAY-123] Add compiled administration files --- src/Resources/public/administration/js/heidel-payment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/public/administration/js/heidel-payment.js b/src/Resources/public/administration/js/heidel-payment.js index 6e3ed24..726db3d 100644 --- a/src/Resources/public/administration/js/heidel-payment.js +++ b/src/Resources/public/administration/js/heidel-payment.js @@ -1 +1 @@ -(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment"],{"3L1I":function(e,t,n){var a=n("XFKd");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("6a91139e",a,!0,{})},"5XaW":function(e,t){e.exports='{% block heidel_payment_metadata %}\n \n{% endblock %}\n'},FcYZ:function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},Hp0e:function(e,t){e.exports='{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotal\') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotalVat\') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.currency\') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.orderId\') }}
\n
{{ paymentResource.orderId }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.id\') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.state\') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc(\'heidel-payment.paymentDetails.actions.shipButton\') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n'},Mzft:function(e,t,n){"use strict";n.r(t);var a=n("guYI"),i=n.n(a);n("mWga");const{Component:s,Mixin:o}=Shopware;s.register("heidel-payment-actions",{template:i.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:this.paymentResource.basket.amountTotalGross}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type}},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("Hp0e"),c=n.n(r);n("3L1I");const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var p=n("pry3"),m=n.n(p);const{Component:h}=Shopware;h.register("heidel-payment-history",{template:m.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.transactions.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),a=this.$options.filters.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("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("5XaW"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var f=n("pu9F"),b=n.n(f);const{Component:_}=Shopware;_.register("heidel-payment-basket",{template:b.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),a=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var k=n("FcYZ"),w=n.n(k);const{Component:D}=Shopware,{Criteria:S}=Shopware.Data;D.override("sw-order-detail",{template:w.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new S(1,1);t.addAssociation("transactions"),e.get(this.orderId,this.context,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var R=n("dM2R"),$=n.n(R);const{Component:T,State:v}=Shopware;T.register("heidel-payment-tab",{template:$.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>v.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(e)}).catch(()=>{this.isLoading=!1})})})})}}});var P=n("wwkQ"),E=n("UIvx");const{Module:B}=Shopware;B.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",snippets:{"de-DE":P,"en-GB":E},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});n("V472")},UIvx:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","orderId":"Order-ID","id":"Payment-ID","state":"State"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occoured!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully..","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice"}}}}')},V472:function(e,t){const{Application:n}=Shopware,a=Shopware.Classes.ApiService;class i extends a{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}chargeTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}refundTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new i(t.httpClient,e.loginService)})},XFKd:function(e,t,n){},dM2R:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'},guYI:function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},mWga:function(e,t,n){var a=n("s4xX");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("a93ec1d2",a,!0,{})},pry3:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},pu9F:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'},s4xX:function(e,t,n){},wwkQ:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","orderId":"Auftrags-ID","id":"Zahlungs-ID","state":"Status"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schlüssel","value":"Wert"}},"basket":{"cardTitle":"Warenkorb","column":{"quantity":"Anzahl","title":"Titel","amountGross":"Betrag (brutto)","amountNet":"Betrag (netto)"}},"notifications":{"genericErrorMessage":"Es ist ein Fehler aufgetreten!","refundSuccessTitle":"Rückerstatten","refundSuccessMessage":"Die Rückerstattung wurde erfolgreich durchgeführt.","refundErrorTitle":"Rückerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung"}}}}')}},[["Mzft","runtime","vendors-node"]]]); \ No newline at end of file +(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment"],{"3L1I":function(e,t,n){var a=n("XFKd");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("6a91139e",a,!0,{})},"5XaW":function(e,t){e.exports='{% block heidel_payment_metadata %}\n \n{% endblock %}\n'},FcYZ:function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},Hp0e:function(e,t){e.exports='{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotal\') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotalVat\') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.currency\') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.shortId\') }}
\n
{{ paymentResource.shortId }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.id\') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.state\') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc(\'heidel-payment.paymentDetails.actions.shipButton\') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n'},Mzft:function(e,t,n){"use strict";n.r(t);var a=n("guYI"),i=n.n(a);n("mWga");const{Component:s,Mixin:o}=Shopware;s.register("heidel-payment-actions",{template:i.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:this.paymentResource.basket.amountTotalGross}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type}},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("Hp0e"),c=n.n(r);n("3L1I");const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var p=n("pry3"),h=n.n(p);const{Component:m}=Shopware;m.register("heidel-payment-history",{template:h.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.transactions.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),a=this.$options.filters.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("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("5XaW"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var f=n("pu9F"),b=n.n(f);const{Component:_}=Shopware;_.register("heidel-payment-basket",{template:b.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),a=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var k=n("FcYZ"),w=n.n(k);const{Component:S}=Shopware,{Criteria:D}=Shopware.Data;S.override("sw-order-detail",{template:w.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new D(1,1);t.addAssociation("transactions"),e.get(this.orderId,this.context,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var R=n("dM2R"),$=n.n(R);const{Component:T,State:v}=Shopware;T.register("heidel-payment-tab",{template:$.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>v.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(e)}).catch(()=>{this.isLoading=!1})})})})}}});var P=n("wwkQ"),E=n("UIvx");const{Module:B}=Shopware;B.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",snippets:{"de-DE":P,"en-GB":E},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});n("V472")},UIvx:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","shortId":"Short-ID","id":"Payment-ID","state":"State"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occoured!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully..","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice"}}}}')},V472:function(e,t){const{Application:n}=Shopware,a=Shopware.Classes.ApiService;class i extends a{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}chargeTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}refundTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new i(t.httpClient,e.loginService)})},XFKd:function(e,t,n){},dM2R:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'},guYI:function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},mWga:function(e,t,n){var a=n("s4xX");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("a93ec1d2",a,!0,{})},pry3:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},pu9F:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'},s4xX:function(e,t,n){},wwkQ:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schlüssel","value":"Wert"}},"basket":{"cardTitle":"Warenkorb","column":{"quantity":"Anzahl","title":"Titel","amountGross":"Betrag (brutto)","amountNet":"Betrag (netto)"}},"notifications":{"genericErrorMessage":"Es ist ein Fehler aufgetreten!","refundSuccessTitle":"Rückerstatten","refundSuccessMessage":"Die Rückerstattung wurde erfolgreich durchgeführt.","refundErrorTitle":"Rückerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung"}}}}')}},[["Mzft","runtime","vendors-node"]]]); \ No newline at end of file From fef0be3c70b97ea746c61e405ae56f26bc071ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= Date: Tue, 5 Nov 2019 17:32:07 +0100 Subject: [PATCH 003/105] [HEIDELPAY-127] Fix shipping notice --- .../HeidelpayTransactionController.php | 29 +++++++++++++++++-- .../component/heidel-payment-detail/index.js | 2 ++ .../module/heidel-payment/snippet/de-DE.json | 3 +- .../module/heidel-payment/snippet/en-GB.json | 3 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/Controllers/Administration/HeidelpayTransactionController.php b/src/Controllers/Administration/HeidelpayTransactionController.php index 2e5e08d..2e7e006 100644 --- a/src/Controllers/Administration/HeidelpayTransactionController.php +++ b/src/Controllers/Administration/HeidelpayTransactionController.php @@ -7,6 +7,7 @@ use HeidelPayment\Components\ArrayHydrator\PaymentArrayHydratorInterface; use HeidelPayment\Components\ClientFactory\ClientFactoryInterface; use heidelpayPHP\Exceptions\HeidelpayApiException; +use Shopware\Core\Checkout\Document\DocumentEntity; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; @@ -161,10 +162,30 @@ public function shipTransaction(string $orderTransactionId, Context $context): J throw new NotFoundHttpException(); } + /** @var DocumentEntity[] $documents */ + $documents = $transaction->getOrder()->getDocuments()->getElements(); + $invoiceId = null; + + foreach ($documents as $document) { + if ($document->getDocumentType()->getTechnicalName() === 'invoice') { + $invoiceId = $document->getConfig()['documentNumber']; + } + } + + if (!$invoiceId) { + return new JsonResponse( + [ + 'status' => false, + 'message' => 'invoice-missing-error', + ], + Response::HTTP_BAD_REQUEST + ); + } + $client = $this->clientFactory->createClient($transaction->getOrder()->getSalesChannelId()); try { - $client->ship($orderTransactionId); + $client->ship($orderTransactionId, $invoiceId); } catch (HeidelpayApiException $exception) { return new JsonResponse( [ @@ -188,7 +209,11 @@ public function shipTransaction(string $orderTransactionId, Context $context): J private function getOrderTransaction(string $orderTransaction, Context $context): ?OrderTransactionEntity { $criteria = new Criteria([$orderTransaction]); - $criteria->addAssociation('order'); + $criteria->addAssociations([ + 'order', + 'order.documents', + 'order.documents.documentType', + ]); return $this->orderTransactionRepository->search($criteria, $context)->first(); } diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js b/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js index 2ad7d96..0b8a6b6 100644 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js +++ b/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js @@ -45,6 +45,8 @@ Component.register('heidel-payment-detail', { if (message === 'generic-error') { message = this.$tc('heidel-payment.paymentDetails.notifications.genericErrorMessage'); + } else if (message === 'invoice-missing-error') { + message = this.$tc('heidel-payment.paymentDetails.notifications.invoiceNotFoundMessage'); } this.createNotificationError({ diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json b/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json index 4d1bd98..83b0642 100644 --- a/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json +++ b/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json @@ -57,7 +57,8 @@ "chargeErrorTitle": "Einziehen", "shipSuccessTitle": "Versandmitteilung", "shipSuccessMessage": "Die Versandmitteilung wurde erfolgreich gesendet.", - "shipErrorTitle": "Versandmitteilung" + "shipErrorTitle": "Versandmitteilung", + "invoiceNotFoundMessage": "Zu dieser Bestellung wurde keine Rechnung gefunden" } } } diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json b/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json index f46c93f..9335f0d 100644 --- a/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json +++ b/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json @@ -57,7 +57,8 @@ "chargeErrorTitle": "Charge", "shipSuccessTitle": "Shipping notice", "shipSuccessMessage": "The shipping notification was successfully sent.", - "shipErrorTitle": "Shipping notice" + "shipErrorTitle": "Shipping notice", + "invoiceNotFoundMessage": "No invoice was found for this order." } } } From f38faa260d6a9ee778cd71f499ff25601e57e906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6dde?= Date: Thu, 28 Nov 2019 19:56:40 +0100 Subject: [PATCH 004/105] [FACKELMANN-4] Latest shopware master branch compatibility --- src/DependencyInjection/services.xml | 1 + src/DependencyInjection/translations.xml | 14 ++++++++ src/HeidelPayment.php | 12 ------- src/Installers/PaymentInstaller.php | 16 ++++----- src/Resources/administration/main.js | 2 -- .../heidel-payment-detail.scss | 20 ----------- .../{ => app}/administration/package.json | 0 .../src/api/heidel-payment.service.js | 0 src/Resources/app/administration/src/main.js | 3 ++ .../heidel-payment-actions.html.twig | 0 .../component/heidel-payment-actions/index.js | 1 - .../heidel-payment-basket.html.twig | 0 .../component/heidel-payment-basket/index.js | 0 .../heidel-payment-detail.html.twig | 0 .../component/heidel-payment-detail/index.js | 2 +- .../heidel-payment-history.html.twig | 0 .../component/heidel-payment-history/index.js | 0 .../heidel-payment-metadata.html.twig | 0 .../heidel-payment-metadata/index.js | 0 .../extension/sw-order/index.js | 4 +-- .../extension/sw-order/sw-order.html.twig | 0 .../src/module/heidel-payment/index.js | 4 +-- .../heidel-payment-tab.html.twig | 0 .../page/heidel-payment-tab/index.js | 4 +-- .../app/administration/src/scss/base.scss | 2 ++ .../component}/heidel-payment-actions.scss | 2 +- .../scss/component/heidel-payment-detail.scss | 20 +++++++++++ .../administration/src/snippets}/de-DE.json | 0 .../administration/src/snippets}/en-GB.json | 0 .../dist/storefront/js/heidel-payment.js | 2 +- .../src}/heidelpay/heidelpay-base.plugin.js | 2 +- .../heidelpay/heidelpay-credit-card.plugin.js | 4 +-- .../src}/heidelpay/heidelpay-eps.plugin.js | 2 +- .../src}/heidelpay/heidelpay-ideal.plugin.js | 2 +- .../heidelpay-invoice-factoring.plugin.js | 2 +- .../heidelpay-invoice-guaranteed.plugin.js | 2 +- .../heidelpay/heidelpay-invoice.plugin.js | 2 +- ...pay-sepa-direct-debit-guaranteed.plugin.js | 2 +- .../heidelpay-sepa-direct-debit.plugin.js | 2 +- .../storefront/src}/main.js | 18 +++++----- .../app/storefront/src/scss/base.scss | 3 ++ .../heidelpay/elements-account-payment.scss | 0 .../component/heidelpay/elements-confirm.scss | 0 .../component/heidelpay/elements-sepa.scss | 0 .../src/snippets/de_DE/SnippetFile_de_DE.php | 33 +++++++++++++++++++ .../src/snippets/de_DE/heidelpay.de-DE.json} | 0 .../src/snippets/en_GB/SnippetFile_en_GB.php | 32 ++++++++++++++++++ .../src/snippets/en_GB/heidelpay.en_GB.json} | 0 .../administration/js/heidel-payment.js | 2 +- src/Resources/storefront/style/main.scss | 3 -- .../heidelpay/frames/credit-card.html.twig | 19 ++++++----- .../frames/sepa_direct_debit.html.twig | 4 +-- .../sepa_direct_debit_guaranteed.html.twig | 4 +-- .../page/account/payment/index.html.twig | 6 ++-- .../page/checkout/confirm/index.html.twig | 6 ++-- .../page/checkout/finish/index.html.twig | 4 +-- 56 files changed, 167 insertions(+), 96 deletions(-) create mode 100644 src/DependencyInjection/translations.xml delete mode 100644 src/Resources/administration/main.js delete mode 100644 src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.scss rename src/Resources/{ => app}/administration/package.json (100%) rename src/Resources/{ => app}/administration/src/api/heidel-payment.service.js (100%) create mode 100644 src/Resources/app/administration/src/main.js rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js (98%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-basket/heidel-payment-basket.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-basket/index.js (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js (97%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-history/heidel-payment-history.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-history/index.js (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-metadata/heidel-payment-metadata.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/component/heidel-payment-metadata/index.js (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/extension/sw-order/index.js (90%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/extension/sw-order/sw-order.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/index.js (91%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/page/heidel-payment-tab/heidel-payment-tab.html.twig (100%) rename src/Resources/{ => app}/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js (94%) create mode 100644 src/Resources/app/administration/src/scss/base.scss rename src/Resources/{administration/src/module/heidel-payment/component/heidel-payment-actions => app/administration/src/scss/component}/heidel-payment-actions.scss (98%) create mode 100644 src/Resources/app/administration/src/scss/component/heidel-payment-detail.scss rename src/Resources/{administration/src/module/heidel-payment/snippet => app/administration/src/snippets}/de-DE.json (100%) rename src/Resources/{administration/src/module/heidel-payment/snippet => app/administration/src/snippets}/en-GB.json (100%) rename src/Resources/{ => app/storefront}/dist/storefront/js/heidel-payment.js (96%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-base.plugin.js (98%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-credit-card.plugin.js (98%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-eps.plugin.js (95%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-ideal.plugin.js (94%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-invoice-factoring.plugin.js (96%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-invoice-guaranteed.plugin.js (95%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-invoice.plugin.js (96%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-sepa-direct-debit-guaranteed.plugin.js (97%) rename src/Resources/{storefront/script/plugin => app/storefront/src}/heidelpay/heidelpay-sepa-direct-debit.plugin.js (96%) rename src/Resources/{storefront => app/storefront/src}/main.js (56%) create mode 100755 src/Resources/app/storefront/src/scss/base.scss rename src/Resources/{storefront/style => app/storefront/src/scss}/component/heidelpay/elements-account-payment.scss (100%) rename src/Resources/{storefront/style => app/storefront/src/scss}/component/heidelpay/elements-confirm.scss (100%) rename src/Resources/{storefront/style => app/storefront/src/scss}/component/heidelpay/elements-sepa.scss (100%) create mode 100644 src/Resources/app/storefront/src/snippets/de_DE/SnippetFile_de_DE.php rename src/Resources/{translations/de_DE/messages.de-DE.json => app/storefront/src/snippets/de_DE/heidelpay.de-DE.json} (100%) create mode 100644 src/Resources/app/storefront/src/snippets/en_GB/SnippetFile_en_GB.php rename src/Resources/{translations/en_GB/messages.en-GB.json => app/storefront/src/snippets/en_GB/heidelpay.en_GB.json} (100%) delete mode 100755 src/Resources/storefront/style/main.scss diff --git a/src/DependencyInjection/services.xml b/src/DependencyInjection/services.xml index 6739ebf..465274c 100755 --- a/src/DependencyInjection/services.xml +++ b/src/DependencyInjection/services.xml @@ -12,6 +12,7 @@ + diff --git a/src/DependencyInjection/translations.xml b/src/DependencyInjection/translations.xml new file mode 100644 index 0000000..a0f6f43 --- /dev/null +++ b/src/DependencyInjection/translations.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/src/HeidelPayment.php b/src/HeidelPayment.php index 35aba4a..3eeb3c9 100755 --- a/src/HeidelPayment.php +++ b/src/HeidelPayment.php @@ -105,16 +105,4 @@ public function uninstall(UninstallContext $uninstallContext): void (new PaymentInstaller($paymentRepository))->uninstall($uninstallContext); (new CustomFieldInstaller($customFieldRepository))->uninstall($uninstallContext); } - - public function getViewPaths(): array - { - return array_merge( - parent::getViewPaths(), - [ - 'Resources/views/storefront', - 'Resources/views/administration', - 'Resources/views/framework', - ] - ); - } } diff --git a/src/Installers/PaymentInstaller.php b/src/Installers/PaymentInstaller.php index a2befc8..25b77e4 100755 --- a/src/Installers/PaymentInstaller.php +++ b/src/Installers/PaymentInstaller.php @@ -59,7 +59,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/credit-card.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/credit-card.html.twig', ], ], [ @@ -77,7 +77,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/invoice.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/invoice.html.twig', ], ], [ @@ -110,7 +110,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/invoice-guaranteed.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/invoice-guaranteed.html.twig', ], ], [ @@ -128,7 +128,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/invoice-factoring.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/invoice-factoring.html.twig', ], ], [ @@ -146,7 +146,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/eps.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/eps.html.twig', ], ], [ @@ -194,7 +194,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/component/heidelpay/frames/ideal.html.twig', + CustomFieldInstaller::HEIDELPAY_FRAME => '@Storefront/storefront/component/heidelpay/frames/ideal.html.twig', ], ], [ @@ -212,7 +212,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - 'heidelpay_frame' => '@Storefront/component/heidelpay/frames/sepa_direct_debit.html.twig', + 'heidelpay_frame' => '@Storefront/storefront/component/heidelpay/frames/sepa_direct_debit.html.twig', ], ], [ @@ -230,7 +230,7 @@ class PaymentInstaller implements InstallerInterface ], ], 'customFields' => [ - 'heidelpay_frame' => '@Storefront/component/heidelpay/frames/sepa_direct_debit_guaranteed.html.twig', + 'heidelpay_frame' => '@Storefront/storefront/component/heidelpay/frames/sepa_direct_debit_guaranteed.html.twig', ], ], [ diff --git a/src/Resources/administration/main.js b/src/Resources/administration/main.js deleted file mode 100644 index 0daaa44..0000000 --- a/src/Resources/administration/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import './src/module/heidel-payment'; -import './src/api/heidel-payment.service'; diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.scss b/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.scss deleted file mode 100644 index 089965b..0000000 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.scss +++ /dev/null @@ -1,20 +0,0 @@ -.heidel-payment-detail { - line-height: 15px; - - dt, dd { - padding: 0; - border-bottom: none; - } - - dt { - font-weight: 600; - - &:not(:first-child), &:only-of-type{ - padding-top: 10px; - } - } - - .sw-button { - margin-top: 20px; - } -} \ No newline at end of file diff --git a/src/Resources/administration/package.json b/src/Resources/app/administration/package.json similarity index 100% rename from src/Resources/administration/package.json rename to src/Resources/app/administration/package.json diff --git a/src/Resources/administration/src/api/heidel-payment.service.js b/src/Resources/app/administration/src/api/heidel-payment.service.js similarity index 100% rename from src/Resources/administration/src/api/heidel-payment.service.js rename to src/Resources/app/administration/src/api/heidel-payment.service.js diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js new file mode 100644 index 0000000..8823fa2 --- /dev/null +++ b/src/Resources/app/administration/src/main.js @@ -0,0 +1,3 @@ +import './module/heidel-payment'; +import './api/heidel-payment.service'; +import './scss/base.scss'; diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.html.twig b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js similarity index 98% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js index 0396ef7..47f859b 100644 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-actions/index.js @@ -1,7 +1,6 @@ const { Component, Mixin } = Shopware; import template from './heidel-payment-actions.html.twig'; -import './heidel-payment-actions.scss'; Component.register('heidel-payment-actions', { template, diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-basket/heidel-payment-basket.html.twig b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-basket/heidel-payment-basket.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-basket/heidel-payment-basket.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-basket/heidel-payment-basket.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-basket/index.js b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-basket/index.js similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-basket/index.js rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-basket/index.js diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-detail/heidel-payment-detail.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js similarity index 97% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js index 0b8a6b6..325ccd1 100644 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-detail/index.js @@ -1,6 +1,6 @@ const { Component, Mixin } = Shopware; + import template from './heidel-payment-detail.html.twig'; -import './heidel-payment-detail.scss'; Component.register('heidel-payment-detail', { template, diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-history/heidel-payment-history.html.twig b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-history/heidel-payment-history.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-history/heidel-payment-history.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-history/heidel-payment-history.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-history/index.js b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-history/index.js similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-history/index.js rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-history/index.js diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-metadata/heidel-payment-metadata.html.twig b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-metadata/heidel-payment-metadata.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-metadata/heidel-payment-metadata.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-metadata/heidel-payment-metadata.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-metadata/index.js b/src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-metadata/index.js similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-metadata/index.js rename to src/Resources/app/administration/src/module/heidel-payment/component/heidel-payment-metadata/index.js diff --git a/src/Resources/administration/src/module/heidel-payment/extension/sw-order/index.js b/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order/index.js similarity index 90% rename from src/Resources/administration/src/module/heidel-payment/extension/sw-order/index.js rename to src/Resources/app/administration/src/module/heidel-payment/extension/sw-order/index.js index ca1f0cd..fc7f998 100644 --- a/src/Resources/administration/src/module/heidel-payment/extension/sw-order/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order/index.js @@ -1,4 +1,4 @@ -const { Component } = Shopware; +const { Component, Context } = Shopware; const { Criteria } = Shopware.Data; import template from './sw-order.html.twig'; @@ -36,7 +36,7 @@ Component.override('sw-order-detail', { const orderCriteria = new Criteria(1, 1); orderCriteria.addAssociation('transactions'); - orderRepository.get(this.orderId, this.context, orderCriteria).then((order) => { + orderRepository.get(this.orderId, Context.api, orderCriteria).then((order) => { order.transactions.forEach((orderTransaction) => { if (!orderTransaction.customFields) { return; diff --git a/src/Resources/administration/src/module/heidel-payment/extension/sw-order/sw-order.html.twig b/src/Resources/app/administration/src/module/heidel-payment/extension/sw-order/sw-order.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/extension/sw-order/sw-order.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/extension/sw-order/sw-order.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/index.js b/src/Resources/app/administration/src/module/heidel-payment/index.js similarity index 91% rename from src/Resources/administration/src/module/heidel-payment/index.js rename to src/Resources/app/administration/src/module/heidel-payment/index.js index 0857ec3..aa797e4 100644 --- a/src/Resources/administration/src/module/heidel-payment/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/index.js @@ -8,8 +8,8 @@ import './component/heidel-payment-basket'; import './extension/sw-order'; import './page/heidel-payment-tab'; -import deDE from './snippet/de-DE.json'; -import enGB from './snippet/en-GB.json'; +import deDE from '../../snippets/de-DE.json'; +import enGB from '../../snippets/en-GB.json'; Module.register('heidel-payment', { type: 'plugin', diff --git a/src/Resources/administration/src/module/heidel-payment/page/heidel-payment-tab/heidel-payment-tab.html.twig b/src/Resources/app/administration/src/module/heidel-payment/page/heidel-payment-tab/heidel-payment-tab.html.twig similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/page/heidel-payment-tab/heidel-payment-tab.html.twig rename to src/Resources/app/administration/src/module/heidel-payment/page/heidel-payment-tab/heidel-payment-tab.html.twig diff --git a/src/Resources/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js b/src/Resources/app/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js similarity index 94% rename from src/Resources/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js rename to src/Resources/app/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js index 0344a7c..238047d 100644 --- a/src/Resources/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js +++ b/src/Resources/app/administration/src/module/heidel-payment/page/heidel-payment-tab/index.js @@ -1,4 +1,4 @@ -const { Component, State } = Shopware; +const { Component, StateDeprecated } = Shopware; import template from './heidel-payment-tab.html.twig'; Component.register('heidel-payment-tab', { @@ -30,7 +30,7 @@ Component.register('heidel-payment-tab', { }, orderStore() { - return State.getStore('order'); + return StateDeprecated.getStore('order'); }, resetDataAttributes() { diff --git a/src/Resources/app/administration/src/scss/base.scss b/src/Resources/app/administration/src/scss/base.scss new file mode 100644 index 0000000..a900122 --- /dev/null +++ b/src/Resources/app/administration/src/scss/base.scss @@ -0,0 +1,2 @@ +@import "component/heidel-payment-actions"; +@import "component/heidel-payment-detail"; diff --git a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.scss b/src/Resources/app/administration/src/scss/component/heidel-payment-actions.scss similarity index 98% rename from src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.scss rename to src/Resources/app/administration/src/scss/component/heidel-payment-actions.scss index 3e503b8..9f20274 100644 --- a/src/Resources/administration/src/module/heidel-payment/component/heidel-payment-actions/heidel-payment-actions.scss +++ b/src/Resources/app/administration/src/scss/component/heidel-payment-actions.scss @@ -8,4 +8,4 @@ .sw-button { height: 100%; } -} \ No newline at end of file +} diff --git a/src/Resources/app/administration/src/scss/component/heidel-payment-detail.scss b/src/Resources/app/administration/src/scss/component/heidel-payment-detail.scss new file mode 100644 index 0000000..b046e10 --- /dev/null +++ b/src/Resources/app/administration/src/scss/component/heidel-payment-detail.scss @@ -0,0 +1,20 @@ +.heidel-payment-detail { + line-height: 15px; + + dt, dd { + padding: 0; + border-bottom: none; + } + + dt { + font-weight: 600; + + &:not(:first-child), &:only-of-type{ + padding-top: 10px; + } + } + + .sw-button { + margin-top: 20px; + } +} diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json b/src/Resources/app/administration/src/snippets/de-DE.json similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/snippet/de-DE.json rename to src/Resources/app/administration/src/snippets/de-DE.json diff --git a/src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json b/src/Resources/app/administration/src/snippets/en-GB.json similarity index 100% rename from src/Resources/administration/src/module/heidel-payment/snippet/en-GB.json rename to src/Resources/app/administration/src/snippets/en-GB.json diff --git a/src/Resources/dist/storefront/js/heidel-payment.js b/src/Resources/app/storefront/dist/storefront/js/heidel-payment.js similarity index 96% rename from src/Resources/dist/storefront/js/heidel-payment.js rename to src/Resources/app/storefront/dist/storefront/js/heidel-payment.js index bd576e1..9a9f10f 100644 --- a/src/Resources/dist/storefront/js/heidel-payment.js +++ b/src/Resources/app/storefront/dist/storefront/js/heidel-payment.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["heidel-payment"],{PVBn:function(e,t,n){"use strict";n.r(t);var r=n("FGIj");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),r=document.querySelectorAll(this.options.errorContentSelector)[0];t&&""!==r.innerText?r.innerText="".concat(r.innerText,"\n").concat(e.message):r.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0)}},{key:"_registerEvents",value:function(){this.submitButton.addEventListener("click",this._onSubmitButtonClick.bind(this))}},{key:"_onSubmitButtonClick",value:function(e){e.preventDefault(),this._validateForm()&&(this.setSubmitButtonActive(!1),this.$emitter.publish("heidelpayBase_createResource"))}},{key:"_validateForm",value:function(){var e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(var n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,r.labels[0].innerText)},!0),e=!1):r.classList.remove("is-invalid")}return e}},{key:"_clearErrorMessage",value:function(){var e=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText="",e.hidden=!0}}])&&o(n.prototype,i),s&&o(n,s),t}();s(l,"options",{publicKey:null,locale:null,submitButtonId:"confirmFormSubmit",disabledClass:"disabled",resourceIdElementId:"heidelpayResourceId",confirmFormId:"confirmOrderForm",errorWrapperClass:"heidelpay-error-wrapper",errorContentSelector:".heidelpay-error-wrapper .alert-content",errorShouldNotBeEmpty:"%field% should not be empty"}),s(l,"heidelpayInstance",null);var p=n("gHbT");function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=document.getElementsByClassName(this.options.errorWrapperClass).item(0),r=document.querySelectorAll(this.options.errorContentSelector)[0];t&&""!==r.innerText?r.innerText="".concat(r.innerText,"\n").concat(e.message):r.innerText=e.message,n.hidden=!1,n.scrollIntoView({block:"end",behavior:"smooth"}),this.setSubmitButtonActive(!0)}},{key:"_registerEvents",value:function(){this.submitButton.addEventListener("click",this._onSubmitButtonClick.bind(this))}},{key:"_onSubmitButtonClick",value:function(e){e.preventDefault(),this._validateForm()&&(this.setSubmitButtonActive(!1),this.$emitter.publish("heidelpayBase_createResource"))}},{key:"_validateForm",value:function(){var e=!0,t=document.forms[this.options.confirmFormId].elements;this._clearErrorMessage();for(var n=0;n0&&this.showError({message:this.options.errorShouldNotBeEmpty.replace(/%field%/,r.labels[0].innerText)},!0),e=!1):r.classList.remove("is-invalid")}return e}},{key:"_clearErrorMessage",value:function(){var e=document.getElementsByClassName(this.options.errorWrapperClass).item(0);document.querySelectorAll(this.options.errorContentSelector)[0].innerText="",e.hidden=!0}}])&&o(n.prototype,i),s&&o(n,s),t}();s(l,"options",{publicKey:null,locale:null,submitButtonId:"confirmFormSubmit",disabledClass:"disabled",resourceIdElementId:"heidelpayResourceId",confirmFormId:"confirmOrderForm",errorWrapperClass:"heidelpay-error-wrapper",errorContentSelector:".heidelpay-error-wrapper .alert-content",errorShouldNotBeEmpty:"%field% should not be empty"}),s(l,"heidelpayInstance",null);var p=n("gHbT");function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n\n \n {% block heidel_payment_metadata_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'},FcYZ:function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},Hp0e:function(e,t){e.exports='{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotal\') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotalVat\') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.currency\') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.shortId\') }}
\n
{{ paymentResource.shortId }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.id\') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.state\') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc(\'heidel-payment.paymentDetails.actions.shipButton\') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n'},Mzft:function(e,t,n){"use strict";n.r(t);var a=n("guYI"),i=n.n(a);n("mWga");const{Component:s,Mixin:o}=Shopware;s.register("heidel-payment-actions",{template:i.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:this.paymentResource.basket.amountTotalGross}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type}},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("Hp0e"),c=n.n(r);n("3L1I");const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var p=n("pry3"),h=n.n(p);const{Component:m}=Shopware;m.register("heidel-payment-history",{template:h.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.transactions.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),a=this.$options.filters.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("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("5XaW"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var f=n("pu9F"),b=n.n(f);const{Component:_}=Shopware;_.register("heidel-payment-basket",{template:b.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),a=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var k=n("FcYZ"),w=n.n(k);const{Component:S}=Shopware,{Criteria:D}=Shopware.Data;S.override("sw-order-detail",{template:w.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new D(1,1);t.addAssociation("transactions"),e.get(this.orderId,this.context,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var R=n("dM2R"),$=n.n(R);const{Component:T,State:v}=Shopware;T.register("heidel-payment-tab",{template:$.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>v.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(e)}).catch(()=>{this.isLoading=!1})})})})}}});var P=n("wwkQ"),E=n("UIvx");const{Module:B}=Shopware;B.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",snippets:{"de-DE":P,"en-GB":E},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});n("V472")},UIvx:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","shortId":"Short-ID","id":"Payment-ID","state":"State"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occoured!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully..","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice"}}}}')},V472:function(e,t){const{Application:n}=Shopware,a=Shopware.Classes.ApiService;class i extends a{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}chargeTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}refundTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new i(t.httpClient,e.loginService)})},XFKd:function(e,t,n){},dM2R:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'},guYI:function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},mWga:function(e,t,n){var a=n("s4xX");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("a93ec1d2",a,!0,{})},pry3:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},pu9F:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'},s4xX:function(e,t,n){},wwkQ:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schlüssel","value":"Wert"}},"basket":{"cardTitle":"Warenkorb","column":{"quantity":"Anzahl","title":"Titel","amountGross":"Betrag (brutto)","amountNet":"Betrag (netto)"}},"notifications":{"genericErrorMessage":"Es ist ein Fehler aufgetreten!","refundSuccessTitle":"Rückerstatten","refundSuccessMessage":"Die Rückerstattung wurde erfolgreich durchgeführt.","refundErrorTitle":"Rückerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung"}}}}')}},[["Mzft","runtime","vendors-node"]]]); \ No newline at end of file +(this.webpackJsonp=this.webpackJsonp||[]).push([["heidel-payment"],{"+k6L":function(e,t){e.exports='{% block heidel_payment_actions %}\n \n {% block heidel_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n\n
\n {% block heidel_payment_actions_charge_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_refund_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.refundButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_default_button %}\n \n {{ $tc(\'heidel-payment.paymentDetails.actions.chargeButton\') }}\n \n {% endblock %}\n\n {% block heidel_payment_actions_button_container_inner %}{% endblock %}\n
\n
\n{% endblock %}\n'},D4rn:function(e,t,n){"use strict";n.r(t);var a=n("+k6L"),i=n.n(a);const{Component:s,Mixin:o}=Shopware;s.register("heidel-payment-actions",{template:i.a,inject:["HeidelPaymentService"],mixins:[o.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:this.paymentResource.basket.amountTotalGross}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0}},computed:{isChargePossible:function(){return"authorization"===this.transactionResource.type},isRefundPossible:function(){return"charge"===this.transactionResource.type}},methods:{charge(){this.isLoading=!0,this.HeidelPaymentService.chargeTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.HeidelPaymentService.refundTransaction(this.paymentResource.orderId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})}}});var r=n("gQ1j"),c=n.n(r);const{Component:l,Mixin:d}=Shopware;l.register("heidel-payment-detail",{template:c.a,inject:["HeidelPaymentService"],mixins:[d.getByName("notification")],data:()=>({isLoading:!1,isSuccessful:!1}),props:{paymentResource:{type:Object,required:!0}},methods:{ship(){this.isLoading=!0,this.HeidelPaymentService.ship(this.paymentResource.orderId).then(()=>{this.createNotificationSuccess({title:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("heidel-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.message;"generic-error"===t?t=this.$tc("heidel-payment.paymentDetails.notifications.genericErrorMessage"):"invoice-missing-error"===t&&(t=this.$tc("heidel-payment.paymentDetails.notifications.invoiceNotFoundMessage")),this.createNotificationError({title:this.$tc("heidel-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})}}});var p=n("ofTY"),h=n.n(p);const{Component:m}=Shopware;m.register("heidel-payment-history",{template:h.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.transactions.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amount),this.paymentResource.currency),a=this.$options.filters.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("heidel-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("heidel-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("heidel-payment.paymentDetails.history.column.date"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("heidel-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("heidel-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("heidel-payment.paymentDetails.history.type.shipment");case"cancellation":return this.$tc("heidel-payment.paymentDetails.history.type.cancellation");default:return this.$tc("heidel-payment.paymentDetails.history.type.default")}},reloadPaymentDetails:function(){this.$emit("reload")}}});var u=n("thoX"),y=n.n(u);const{Component:g}=Shopware;g.register("heidel-payment-metadata",{template:y.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){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("heidel-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("heidel-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});var f=n("zXXx"),b=n.n(f);const{Component:_}=Shopware;_.register("heidel-payment-basket",{template:b.a,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){let e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.$options.filters.currency(parseFloat(t.amountGross),this.paymentResource.currency),a=this.$options.filters.currency(parseFloat(t.amountNet),this.paymentResource.currency);e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("heidel-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("heidel-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("heidel-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}}});var k=n("TXG+"),w=n.n(k);const{Component:D,Context:S}=Shopware,{Criteria:R}=Shopware.Data;D.override("sw-order-detail",{template:w.a,data:()=>({isHeidelpayPayment:!1}),computed:{showTabs:()=>!0,paymentMethodStore:()=>State.getStore("payment_method")},watch:{orderId:{deep:!0,handler(){if(!this.orderId)return void(this.isHeidelpayPayment=!1);const e=this.repositoryFactory.create("order"),t=new R(1,1);t.addAssociation("transactions"),e.get(this.orderId,S.api,t).then(e=>{e.transactions.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&(this.isHeidelpayPayment=!0)})})},immediate:!0}}});var $=n("btqN"),T=n.n($);const{Component:v,StateDeprecated:P}=Shopware;v.register("heidel-payment-tab",{template:T.a,inject:["HeidelPaymentService"],data:()=>({paymentResources:[],isLoading:!0}),created(){this.createdComponent()},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},orderStore:()=>P.getStore("order"),resetDataAttributes(){this.paymentResources=[],this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id;this.orderStore().getByIdAsync(e).then(e=>{this.order=e,this.order.getAssociation("transactions").getList({}).then(e=>{e.items.forEach(e=>{e.customFields&&e.customFields.heidelpay_is_transaction&&this.HeidelPaymentService.fetchPaymentDetails(e.id).then(e=>{this.isLoading=!1,this.paymentResources.push(e)}).catch(()=>{this.isLoading=!1})})})})}}});var B=n("yZy9"),E=n("Q9fF");const{Module:A}=Shopware;A.register("heidel-payment",{type:"plugin",name:"HeidelPayment",title:"heidel-payment.general.title",description:"heidel-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",snippets:{"de-DE":B,"en-GB":E},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"heidel-payment-tab",name:"heidel-payment.payment.detail",isChildren:!0,path:"/sw/order/heidelpayment/detail/:id"}),e(t)}});n("mAjF"),n("ycwP")},Q9fF:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Payment History","column":{"type":"Type","amount":"Amount","date":"Date"},"type":{"authorization":"Authorization","charge":"Charging","shipment":"Shipping notification","cancellation":"Refund","default":""}},"actions":{"chargeButton":"Charge","shipButton":"Shipping notice","refundButton":"Refund"},"detail":{"cardTitle":"Payment Details","amountTotal":"Amount (gross)","amountTotalVat":"Amount (net)","currency":"Currency","shortId":"Short-ID","id":"Payment-ID","state":"State"},"metadata":{"cardTitle":"Metadata","column":{"key":"Key","value":"Value"}},"basket":{"cardTitle":"Basket","column":{"quantity":"Quantity","title":"Title","amountGross":"Amount (gross)","amountNet":"Amount (net)"}},"notifications":{"genericErrorMessage":"An error has occoured!","refundSuccessTitle":"Refund","refundSuccessMessage":"The reimbursement was successfully completed.","refundErrorTitle":"Refund","chargeSuccessTitle":"Charge","chargeSuccessMessage":"The collection of the payment was carried out successfully..","chargeErrorTitle":"Charge","shipSuccessTitle":"Shipping notice","shipSuccessMessage":"The shipping notification was successfully sent.","shipErrorTitle":"Shipping notice","invoiceNotFoundMessage":"No invoice was found for this order."}}}}')},"TXG+":function(e,t){e.exports="{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n {% block heidel_payment_payment_tab %}\n \n {{ $tc('heidel-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}"},btqN:function(e,t){e.exports='{% block heidel_payment_payment_details %}\n
\n
\n {% block heidel_payment_payment_details_content %}\n \n {% endblock %}\n
\n\n \n
\n{% endblock %}\n'},gQ1j:function(e,t){e.exports='{% block heidel_payment_detail %}\n \n {% block heidel_payment_detail_container %}\n \n {% block heidel_payment_detail_container_left %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotal\') }}
\n
{{ paymentResource.basket.amountTotalGross | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.amountTotalVat\') }}
\n
{{ paymentResource.basket.amountTotalVat | currency(paymentResource.currency) }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.currency\') }}
\n
{{ paymentResource.currency }}
\n\n {% block heidel_payment_detail_container_left_inner %}{% endblock %}\n
\n
\n {% endblock %}\n\n {% block heidel_payment_detail_container_right %}\n \n \n
{{ $tc(\'heidel-payment.paymentDetails.detail.shortId\') }}
\n
{{ paymentResource.shortId }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.id\') }}
\n
{{ paymentResource.id }}
\n\n
{{ $tc(\'heidel-payment.paymentDetails.detail.state\') }}
\n
{{ paymentResource.state.name }}
\n\n {% block heidel_payment_detail_container_right_inner %}{% endblock %}\n
\n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block heidel_payment_detail_ship_button %}\n \n \n {{ $tc(\'heidel-payment.paymentDetails.actions.shipButton\') }}\n \n \n {% endblock %}\n
\n{% endblock %}\n'},mAjF:function(e,t){const{Application:n}=Shopware,a=Shopware.Classes.ApiService;class i extends a{constructor(e,t,n="heidelpay"){super(e,t,n)}fetchPaymentDetails(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/details`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}chargeTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/charge/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}refundTransaction(e,t,n){const i=`_action/${this.getApiBasePath()}/transaction/${e}/refund/${t}/${n}`;return this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}ship(e){const t=`_action/${this.getApiBasePath()}/transaction/${e}/ship`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(e=>a.handleResponse(e))}}n.addServiceProvider("HeidelPaymentService",e=>{const t=n.getContainer("init");return new i(t.httpClient,e.loginService)})},ofTY:function(e,t){e.exports='{% block heidel_payment_history %}\n \n {% block heidel_payment_history_container %}\n \n {% block heidel_payment_history_data_grid %}\n \n\n {% block heidel_payment_history_actions %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}\n'},thoX:function(e,t){e.exports='{% block heidel_payment_metadata %}\n \n{% endblock %}\n'},yZy9:function(e){e.exports=JSON.parse('{"heidel-payment":{"tabTitle":"Heidelpay","paymentDetails":{"history":{"cardTitle":"Zahlungsverlauf","column":{"type":"Typ","amount":"Betrag","date":"Datum"},"type":{"authorization":"Reservierung","charge":"Einzug","shipment":"Versandtmitteilung","cancellation":"Rückerstattung","default":""}},"actions":{"chargeButton":"Einziehen","shipButton":"Versandmitteilung","refundButton":"Rückerstatten"},"detail":{"cardTitle":"Zahlungsdetails","amountTotal":"Betrag (brutto)","amountTotalVat":"Betrag (netto)","currency":"Währung","shortId":"Short-ID","id":"Zahlungs-ID","state":"Status"},"metadata":{"cardTitle":"Metadaten","column":{"key":"Schlüssel","value":"Wert"}},"basket":{"cardTitle":"Warenkorb","column":{"quantity":"Anzahl","title":"Titel","amountGross":"Betrag (brutto)","amountNet":"Betrag (netto)"}},"notifications":{"genericErrorMessage":"Es ist ein Fehler aufgetreten!","refundSuccessTitle":"Rückerstatten","refundSuccessMessage":"Die Rückerstattung wurde erfolgreich durchgeführt.","refundErrorTitle":"Rückerstatten","chargeSuccessTitle":"Einziehen","chargeSuccessMessage":"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.","chargeErrorTitle":"Einziehen","shipSuccessTitle":"Versandmitteilung","shipSuccessMessage":"Die Versandmitteilung wurde erfolgreich gesendet.","shipErrorTitle":"Versandmitteilung","invoiceNotFoundMessage":"Zu dieser Bestellung wurde keine Rechnung gefunden"}}}}')},ycwP:function(e,t,n){var a=n("zRs7");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("767f10c8",a,!0,{})},zRs7:function(e,t,n){},zXXx:function(e,t){e.exports='{% block heidel_payment_basket %}\n \n \n {% block heidel_payment_basket_container %}\n \n \n {% endblock %}\n \n \n{% endblock %}\n'}},[["D4rn","runtime","vendors-node"]]]); \ No newline at end of file diff --git a/src/Resources/storefront/style/main.scss b/src/Resources/storefront/style/main.scss deleted file mode 100755 index b3c8049..0000000 --- a/src/Resources/storefront/style/main.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import './component/heidelpay/elements-confirm'; -@import './component/heidelpay/elements-account-payment'; -@import './component/heidelpay/elements-sepa'; diff --git a/src/Resources/views/storefront/component/heidelpay/frames/credit-card.html.twig b/src/Resources/views/storefront/component/heidelpay/frames/credit-card.html.twig index 82cf2e0..58a8a64 100755 --- a/src/Resources/views/storefront/component/heidelpay/frames/credit-card.html.twig +++ b/src/Resources/views/storefront/component/heidelpay/frames/credit-card.html.twig @@ -1,3 +1,4 @@ + {% block heidelpay_frame_credit_card %}
{% if shopware.config.HeidelPayment.config.testMode %} - {% sw_include '@Storefront/component/heidelpay/frames/testdata/credit-card.html.twig' %} + {% sw_include '@Storefront/storefront/component/heidelpay/frames/testdata/credit-card.html.twig' %} {% endif %} {% if page.extensions.heidelpay.displayCreditCardSelection and page.extensions.heidelpay.creditCards|length > 0 %} @@ -17,11 +18,11 @@
+
+ {{ creditCard.data['number'] }} +

{{ creditCard.data['holder'] }} ({{ creditCard.data['expiryDate'] }})

+
{% endfor %} {% endblock %} @@ -30,7 +31,7 @@
{% endblock %} @@ -40,7 +41,7 @@
{% block heidelpay_frame_credit_card_number %}
- +
@@ -54,7 +55,7 @@ {% block heidelpay_frame_credit_card_expiry %}
- +