From 3457f6cb8a3667e7d1e2ec11ff43da0ed048fa5c Mon Sep 17 00:00:00 2001 From: Drew Rowan Date: Fri, 5 Aug 2022 15:40:45 +0200 Subject: [PATCH] Release 4.0.37 --- README.md | 2 +- composer.json | 2 +- docs/en/documentation.html | 2 +- .../page/postfinancecheckout-order-detail/index.html.twig | 4 ++-- .../public/administration/js/post-finance-checkout-payment.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index df8869d..1f4bb6f 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ tail -f var/log/postfinancecheckout_payment*.log ## Documentation -[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/4.0.36/docs/en/documentation.html) +[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/4.0.37/docs/en/documentation.html) ## License diff --git a/composer.json b/composer.json index e3bf5c9..ff505d9 100644 --- a/composer.json +++ b/composer.json @@ -62,5 +62,5 @@ "postfinancecheckout/sdk": "3.0.1" }, "type": "shopware-platform-plugin", - "version": "4.0.36" + "version": "4.0.37" } \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index c1d491e..eef3956 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -22,7 +22,7 @@

Documentation

  • - + Source
  • diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-order/page/postfinancecheckout-order-detail/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-order/page/postfinancecheckout-order-detail/index.html.twig index 749810f..8939778 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-order/page/postfinancecheckout-order-detail/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-order/page/postfinancecheckout-order-detail/index.html.twig @@ -36,7 +36,7 @@ {{ $tc('postfinancecheckout-order.buttons.label.download-invoice') }} @@ -45,7 +45,7 @@ {{ $tc('postfinancecheckout-order.buttons.label.download-packing-slip') }} diff --git a/src/Resources/public/administration/js/post-finance-checkout-payment.js b/src/Resources/public/administration/js/post-finance-checkout-payment.js index b029b9a..1e0477e 100644 --- a/src/Resources/public/administration/js/post-finance-checkout-payment.js +++ b/src/Resources/public/administration/js/post-finance-checkout-payment.js @@ -1 +1 @@ -!function(t){var e={};function n(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(o,a,function(e){return t[e]}.bind(null,a));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/bundles/postfinancecheckoutpayment/",n(n.s="ypuE")}({"/iC3":function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue Rückerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"Rückerstattung nach Menge"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endgültige Verbuchung","maxAmount":"Maximaler Betrag","successMessage":"Ihre Verbuchung war erfolgreich","successTitle":"Erfolg"},"general":{"title":"Bestellungen"},"header":"PostFinanceCheckout Payment","lineItem":{"cardTitle":"Einzelposten","types":{"amountIncludingTax":"Betrag","name":"Name","quantity":"Anzahl","taxAmount":"Steuern","type":"Typ","uniqueId":"Eindeutige ID"}},"modal":{"title":{"capture":"Erfassen","refund":"Neue Gutschrift","void":"Autorisierung aufheben"}},"paymentDetails":{"cardTitle":"Zahlung","error":{"title":"Fehler beim Abrufen von Zahlungsdetails von PostFinanceCheckout"}},"refund":{"cardTitle":"Gutschriften","refundAmount":{"label":"Gutschriftsbetrag"},"refundQuantity":{"label":"Refund Menge"},"types":{"amount":"Betrag","createdOn":"Erstellt am","id":"ID","state":"Staat"}},"refundAction":{"confirmButton":{"text":"Ausführen"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre Rückerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verfügbare Artikel zum Erstatten"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"Währung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"}},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}')},"2zY8":function(t,e,n){var o=n("6Ef7");o.__esModule&&(o=o.default),"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("52fac0e8",o,!0,{})},"6Ef7":function(t,e,n){},ADsd:function(t,e,n){},FCMq:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Complete","download-invoice":"Download Invoice","download-packing-slip":"Download Packing Slip","refund":"Create a new refund","void":"Cancel authorization","refund-whole-line-item":"Refund whole line item","refund-line-item-by-quantity":"Refund by quantity"}},"captureAction":{"button":{"text":"Capture payment"},"currentAmount":"Amount","isFinal":"This is final capture","maxAmount":"Maximum amount","successMessage":"Your capture was successful.","successTitle":"Success"},"general":{"title":"Orders"},"header":"PostFinanceCheckout Payment","lineItem":{"cardTitle":"Line Items","types":{"amountIncludingTax":"Amount","name":"Name","quantity":"Quantity","taxAmount":"Taxes","type":"Type","uniqueId":"Unique ID"}},"modal":{"title":{"capture":"Capture","refund":"New refund","void":"Cancel authorization"}},"paymentDetails":{"cardTitle":"Payment","error":{"title":"Error fetching payment details from PostFinanceCheckout"}},"refund":{"cardTitle":"Refunds","refundAmount":{"label":"Refund Amount"},"refundQuantity":{"label":"Refund Quantity"},"types":{"amount":"Amount","createdOn":"Created On","id":"ID","state":"State"}},"refundAction":{"confirmButton":{"text":"Execute"},"refundAmount":{"label":"Amount","placeholder":"Enter a amount"},"successMessage":"Your refund was successful.","successTitle":"Success","maxAvailableItemsToRefund":"Maximum available items to refund"},"transactionHistory":{"cardTitle":"Details","types":{"authorized_amount":"Authorized Amount","currency":"Currency","customer":"Customer","payment_method":"Payment Method","state":"State","transaction":"Transaction"}},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Cancel authorization"},"message":"Do you really want to cancel this payment?"},"successMessage":"The payment was successfully voided.","successTitle":"Success"}}}')},FJBk:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Completato","download-invoice":"Scarica fattura","download-packing-slip":"Scarica distinta di imballaggio","refund":"Crea un nuovo rimborso","void":"Annulla autorizzazione","refund-whole-line-item":"Rimborso intera riga","refund-line-item-by-quantity":"Rimborso per quantità"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa è la cattura finale","maxAmount":"Importo massimo","successMessage":"La tua cattura ha avuto successo.","successTitle":"Successo"},"general":{"title":"Ordini"},"header":"Pagamento PostFinanceCheckout","lineItem":{"cardTitle":"Articoli di linea","types":{"amountIncludingTax":"Importo","name":"Nome","quantity":"Quantità","taxAmount":"Tasse","type":"Tipo","uniqueId":"ID unico"}},"modal":{"title":{"capture":"Cattura","refund":"Nuovo rimborso","void":"Annulla autorizzazione"}},"paymentDetails":{"cardTitle":"Pagamento","error":{"title":"Errore nel recupero dei dettagli del pagamento da PostFinanceCheckout"}},"refund":{"cardTitle":"Rimborsi","refundAmount":{"label":"Importo del rimborso"},"refundQuantity":{"label":"Quantità di rimborso"},"types":{"amount":"Importo","createdOn":"Creato il","id":"ID","state":"Stato"}},"refundAction":{"confirmButton":{"text":"Esegui"},"refundAmount":{"label":"Importo","placeholder":"Inserisci un importo"},"successMessage":"Il tuo rimborso è andato a buon fine.","successTitle":"Successo","maxAvailableItemsToRefund":"Numero massimo di articoli disponibili da rimborsare"},"transactionHistory":{"cardTitle":"Dettagli","types":{"authorized_amount":"Importo autorizzato","currency":"Valuta","customer":"Cliente","payment_method":"Metodo di pagamento","state":"Stato","transaction":"Transazione"}},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento è stato annullato con successo.","successTitle":"Successo"}}}')},FLPB:function(t,e){t.exports='{% block postfinancecheckout_order_action_completion %}\n\n\n\t{% block postfinancecheckout_order_action_completion_amount %}\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_completion_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},H4Kp:function(t,e){t.exports='{% block postfinancecheckout_order_action_refund %}\n\n\n\t{% block postfinancecheckout_order_action_refund_amount %}\n\n\t\t\n\t\t\n\n\t\t
    \n\t\t\t{{ $tc(\'postfinancecheckout-order.refundAction.maxAvailableItemsToRefund\') }}:\n\t\t\t{{ this.$parent.refundableQuantity }}\n\t\t
    \n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_refund_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n
    \n{% endblock %}\n'},Hmsx:function(t,e){t.exports='{% block postfinancecheckout_settings %}\n\n\n\t{% block postfinancecheckout_settings_header %}\n\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_settings_actions %}\n\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_settings_content %}\n\t\n\t{% endblock %}\n\n{% endblock %}'},PwZK:function(t,e,n){var o=n("ADsd");o.__esModule&&(o=o.default),"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("4addc608",o,!0,{})},SZ7m:function(t,e,n){"use strict";function o(t,e){for(var n=[],o={},a=0;an.parts.length&&(o.parts.length=n.parts.length)}else{var r=[];for(a=0;a\n\n\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n\t\t\t\n\n\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n\t\t\t\t\t
    \n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\t\t\t\t\t
    \n\t\t\t\t{% endblock %}\n\t\t\t
    \n\t\t{% endblock %}\n\t\n\n{% endblock %}\n'},Uo3W:function(t,e){t.exports='\n\t\n\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n
    \n\n'},VP8G:function(t,e){t.exports='{% block postfinancecheckout_order_detail %}\n
    \n\t
    \n\t\t\n\t\t\t\n\t\t\n\t\t{% block postfinancecheckout_order_transaction_history_card %}\n\t\t\n\t\t\t\n\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_transaction_line_items_card %}\n\t\t\n\t\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_transaction_refunds_card %}\n\t\t\n\t\t\t\n\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_refund %}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_refund_by_amount %}\n\t\t\t\n\t\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_completion%}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_void %}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t
    \n\t\n
    \n{% endblock %}\n'},aubh:function(t,e){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:"postfinancecheckout",key:"postfinancecheckout",roles:{viewer:{privileges:["sales_channel:read","sales_channel_payment_method:read","system_config:read"],dependencies:[]},editor:{privileges:["sales_channel:update","sales_channel_payment_method:create","sales_channel_payment_method:update","system_config:update","system_config:create","system_config:delete"],dependencies:["postfinancecheckout.viewer"]}}}),Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"sales_channel",roles:{viewer:{privileges:["sales_channel_payment_method:read"]},editor:{privileges:["payment_method:update"]},creator:{privileges:["payment_method:create","shipping_method:create","delivery_time:create"]},deleter:{privileges:["payment_method:delete"]}}})},gF78:function(t,e){t.exports='{% block postfinancecheckout_order_action_refund_by_amount %}\n\n\n\t{% block postfinancecheckout_order_action_refund_amount_by_amount %}\n\t\t\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_refund_confirm_button_by_amount %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},heDV:function(t,e){t.exports='{% block postfinancecheckout_settings_content_card_channel_config_credentials %}\n\t\n\n\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n\t\t\t\n\n\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n\t\t\t\t\t
    \n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\t\t\t\t\t
    \n\t\t\t\t{% endblock %}\n\t\t\t
    \n\t\t{% endblock %}\n\t\n\n{% endblock %}\n'},juBS:function(t,e){t.exports='\n\t\n\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n
    \n\n'},tYm5:function(t,e){t.exports='{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n\n\t{{ $tc(\'postfinancecheckout-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n'},wwge:function(t,e){t.exports='{% block postfinancecheckout_settings_icon %}\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n{% endblock %}\n'},x5wL:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Terminée","download-invoice":"Télécharger la facture","download-packing-slip":"Télécharger le bordereau d\'expédition","refund":"Créer un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne entière","refund-line-item-by-quantity":"Remboursement par quantité"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a été réussie.","successTitle":"Succès"},"general":{"title":"Commandes"},"header":"PostFinanceCheckout Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantité","taxAmount":"Taxes","type":"Type","uniqueId":"ID unique"}},"modal":{"title":{"capture":"Capture","refund":"Nouveau remboursement","void":"Annulez l\'autorisation"}},"paymentDetails":{"cardTitle":"Paiement","error":{"title":"Erreur dans la récupération des détails du paiement à partir de PostFinanceCheckout"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantité à rembourser"},"types":{"amount":"Montant","createdOn":"Créé le","id":"ID","state":"État"}},"refundAction":{"confirmButton":{"text":"Exécutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a été effectué avec succès.","successTitle":"Succès","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement"},"transactionHistory":{"cardTitle":"Détails","types":{"authorized_amount":"Montant autorisé","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"État","transaction":"Transaction"}},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a été annulé avec succès.","successTitle":"Succès"}}}')},ygOZ:function(t,e){t.exports='{% block postfinancecheckout_order_action_void %}\n\n\n\t{% block postfinancecheckout_order_action_void_amount %}\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_void_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},ypuE:function(t,e,n){"use strict";n.r(e);var o=n("tYm5"),a=n.n(o),i=(n("PwZK"),Shopware),r=i.Component,c=i.Context,s=Shopware.Data.Criteria;r.override("sw-order-detail",{template:a.a,data:function(){return{isPostFinanceCheckoutPayment:!1}},computed:{isEditable:function(){return!this.isPostFinanceCheckoutPayment||"postfinancecheckout.order.detail"!==this.$route.name},showTabs:function(){return!0}},watch:{orderId:{deep:!0,handler:function(){var t=this;if(this.orderId){var e=this.repositoryFactory.create("order"),n=new s(1,1);n.addAssociation("transactions"),e.get(this.orderId,c.api,n).then((function(e){if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId)t.setIsPostFinanceCheckoutPayment(null);else{var n=e.transactions[0].paymentMethodId;null!=n&&t.setIsPostFinanceCheckoutPayment(n)}}))}else this.setIsPostFinanceCheckoutPayment(null)},immediate:!0}},methods:{setIsPostFinanceCheckoutPayment:function(t){var e=this;t&&this.repositoryFactory.create("payment_method").get(t,c.api).then((function(t){e.isPostFinanceCheckoutPayment="handler_postfinancecheckoutpayment_postfinancecheckoutpaymenthandler"===t.formattedHandlerIdentifier}))}}});var l=n("FLPB"),u=n.n(l),d=Shopware,p=d.Component,f=d.Mixin,h=d.Filter,m=d.Utils;p.register("postfinancecheckout-order-action-completion",{template:u.a,inject:["PostFinanceCheckoutTransactionCompletionService"],mixins:[f.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data:function(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter:function(){return h.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1},completion:function(){var t=this;this.isCompletion&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.captureAction.successTitle"),message:t.$tc("postfinancecheckout-order.captureAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(m.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(m.createId()))}))}})))}}});var g=n("H4Kp"),b=n.n(g),_=Shopware,y=_.Component,k=_.Mixin,I=_.Filter,w=_.Utils;y.register("postfinancecheckout-order-action-refund",{template:b.a,inject:["PostFinanceCheckoutRefundService"],mixins:[k.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data:function(){return{refundQuantity:1,transactionData:{},isLoading:!0,currentLineItem:""}},computed:{dateFilter:function(){return I.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1},refund:function(){var t=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.currentLineItem).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.refundAction.successTitle"),message:t.$tc("postfinancecheckout-order.refundAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(w.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(w.createId()))}))}}))}}});var C=n("gF78"),v=n.n(C),O=Shopware,E=O.Component,S=O.Mixin,N=O.Filter,F=O.Utils;E.register("postfinancecheckout-order-action-refund-by-amount",{template:v.a,inject:["PostFinanceCheckoutRefundService"],mixins:[S.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data:function(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter:function(){return N.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=Number(this.transactionData.transactions[0].amountIncludingTax)},refundByAmount:function(){var t=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.refundAction.successTitle"),message:t.$tc("postfinancecheckout-order.refundAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(F.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(F.createId()))}))}}))}}});var D=n("ygOZ"),P=n.n(D),T=Shopware,A=T.Component,x=T.Mixin,L=T.Filter,R=T.Utils;A.register("postfinancecheckout-order-action-void",{template:P.a,inject:["PostFinanceCheckoutTransactionVoidService"],mixins:[x.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data:function(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter:function(){return L.getByName("date")},lineItemColumns:function(){return[{property:"uniqueId",label:this.$tc("postfinancecheckout-order.refund.types.uniqueId"),rawData:!1,allowResize:!0,primary:!0,width:"auto"},{property:"name",label:this.$tc("postfinancecheckout-order.refund.types.name"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"quantity",label:this.$tc("postfinancecheckout-order.refund.types.quantity"),rawData:!0,allowResize:!0,width:"auto"},{property:"amountIncludingTax",label:this.$tc("postfinancecheckout-order.refund.types.amountIncludingTax"),rawData:!0,allowResize:!0,inlineEdit:"string",width:"auto"},{property:"type",label:this.$tc("postfinancecheckout-order.refund.types.type"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"taxAmount",label:this.$tc("postfinancecheckout-order.refund.types.taxAmount"),rawData:!0,allowResize:!0,width:"auto"}]}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundableAmount=this.transactionData.transactions[0].amountIncludingTax,this.refundAmount=this.transactionData.transactions[0].amountIncludingTax},voidPayment:function(){var t=this;this.isVoid&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.voidAction.successTitle"),message:t.$tc("postfinancecheckout-order.voidAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(R.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(R.createId()))}))}})))}}});var $=n("VP8G"),B=n.n($),j=(n("2zY8"),Shopware),M=j.Component,G=j.Mixin,V=j.Filter,q=j.Context,U=j.Utils,z=Shopware.Data.Criteria;M.register("postfinancecheckout-order-detail",{template:B.a,inject:["PostFinanceCheckoutTransactionService","PostFinanceCheckoutRefundService","repositoryFactory"],mixins:[G.getByName("notification")],data:function(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,currentLineItem:"",refundLineItem:[]}},metaInfo:function(){return{title:this.$tc("postfinancecheckout-order.header")}},computed:{dateFilter:function(){return V.getByName("date")},relatedResourceColumns:function(){return[{property:"paymentConnectorConfiguration.name",label:this.$tc("postfinancecheckout-order.transactionHistory.types.payment_method"),rawData:!0},{property:"state",label:this.$tc("postfinancecheckout-order.transactionHistory.types.state"),rawData:!0},{property:"currency",label:this.$tc("postfinancecheckout-order.transactionHistory.types.currency"),rawData:!0},{property:"authorized_amount",label:this.$tc("postfinancecheckout-order.transactionHistory.types.authorized_amount"),rawData:!0},{property:"id",label:this.$tc("postfinancecheckout-order.transactionHistory.types.transaction"),rawData:!0},{property:"customerId",label:this.$tc("postfinancecheckout-order.transactionHistory.types.customer"),rawData:!0}]},lineItemColumns:function(){return[{property:"uniqueId",label:this.$tc("postfinancecheckout-order.lineItem.types.uniqueId"),rawData:!0,visible:!1,primary:!0},{property:"name",label:this.$tc("postfinancecheckout-order.lineItem.types.name"),rawData:!0},{property:"quantity",label:this.$tc("postfinancecheckout-order.lineItem.types.quantity"),rawData:!0},{property:"amountIncludingTax",label:this.$tc("postfinancecheckout-order.lineItem.types.amountIncludingTax"),rawData:!0},{property:"type",label:this.$tc("postfinancecheckout-order.lineItem.types.type"),rawData:!0},{property:"taxAmount",label:this.$tc("postfinancecheckout-order.lineItem.types.taxAmount"),rawData:!0},{property:"refundableQuantity",rawData:!0,visible:!1}]},refundColumns:function(){return[{property:"id",label:this.$tc("postfinancecheckout-order.refund.types.id"),rawData:!0,visible:!0,primary:!0},{property:"amount",label:this.$tc("postfinancecheckout-order.refund.types.amount"),rawData:!0},{property:"state",label:this.$tc("postfinancecheckout-order.refund.types.state"),rawData:!0},{property:"createdOn",label:this.$tc("postfinancecheckout-order.refund.types.createdOn"),rawData:!0}]}},watch:{$route:function(){this.resetDataAttributes(),this.createdComponent()}},created:function(){this.createdComponent()},methods:{createdComponent:function(){var t=this;this.orderId=this.$route.params.id;var e=this.repositoryFactory.create("order"),n=new z(1,1);n.addAssociation("transactions"),n.getAssociation("transactions").addSorting(z.sort("createdAt","DESC")),e.get(this.orderId,q.api,n).then((function(e){t.order=e,t.isLoading=!1;var n=0,o=0,a=e.transactions[0].customFields.postfinancecheckout_transaction_id;t.PostFinanceCheckoutTransactionService.getTransactionData(e.salesChannelId,a).then((function(e){t.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=U.format.currency(e.transactions[0].authorizationAmount,t.currency),e.refunds.forEach((function(e){o=parseFloat(parseFloat(o)+parseFloat(e.amount)),e.amount=U.format.currency(e.amount,t.currency),e.reductions.forEach((function(e){void 0===t.refundLineItem[e.lineItemUniqueId]?t.refundLineItem[e.lineItemUniqueId]=e.quantityReduction:t.refundLineItem[e.lineItemUniqueId]+=e.quantityReduction}))})),e.transactions[0].lineItems.forEach((function(e){e.amountIncludingTax=U.format.currency(e.amountIncludingTax,t.currency),e.taxAmount=U.format.currency(e.taxAmount,t.currency),n=parseFloat(e.unitPriceIncludingTax*e.quantity),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(t.refundLineItem[e.uniqueId]||0))})),t.lineItems=e.transactions[0].lineItems,t.transactionData=e,t.transaction=t.transactionData.transactions[0],t.refundAmount=Number(t.transactionData.transactions[0].amountIncludingTax),t.refundableAmount=parseFloat(parseFloat(n)-parseFloat(o))})).catch((function(e){try{t.createNotificationError({title:t.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(n){t.createNotificationError({title:t.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{t.isLoading=!1}}))}))},downloadPackingSlip:function(){window.open(this.PostFinanceCheckoutTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice:function(){window.open(this.PostFinanceCheckoutTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes:function(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItem=[],this.isLoading=!0},spawnModal:function(t,e,n){this.modalType=t,this.currentLineItem=e,this.refundableQuantity=n},closeModal:function(){this.modalType=""},lineItemRefund:function(t){var e=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,t).then((function(){e.createNotificationSuccess({title:e.$tc("postfinancecheckout-order.refundAction.successTitle"),message:e.$tc("postfinancecheckout-order.refundAction.successMessage")}),e.isLoading=!1,e.$emit("modal-close"),e.$nextTick((function(){e.$router.replace("".concat(e.$route.path,"?hash=").concat(U.createId()))}))})).catch((function(t){try{e.createNotificationError({title:t.response.data.errors[0].title,message:t.response.data.errors[0].detail,autoClose:!1})}catch(n){e.createNotificationError({title:t.title,message:t.message,autoClose:!1})}finally{e.isLoading=!1,e.$emit("modal-close"),e.$nextTick((function(){e.$router.replace("".concat(e.$route.path,"?hash=").concat(U.createId()))}))}}))}}});var H=n("/iC3"),W=n("FCMq"),K=n("x5wL"),Y=n("FJBk");Shopware.Module.register("postfinancecheckout-order",{type:"plugin",name:"PostFinanceCheckout",title:"postfinancecheckout-order.general.title",description:"postfinancecheckout-order.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",color:"#2b52ff",snippets:{"de-DE":H,"en-GB":W,"fr-FR":K,"it-IT":Y},routeMiddleware:function(t,e){"sw.order.detail"===e.name&&e.children.push({component:"postfinancecheckout-order-detail",name:"postfinancecheckout.order.detail",isChildren:!0,path:"/sw/order/postfinancecheckout/detail/:id"}),t(e)}});n("aubh");var Q=n("Hmsx"),Z=n.n(Q),J="PostFinanceCheckoutPayment.config",X={CONFIG_DOMAIN:J,CONFIG_APPLICATION_KEY:"PostFinanceCheckoutPayment.config.applicationKey",CONFIG_EMAIL_ENABLED:"PostFinanceCheckoutPayment.config.emailEnabled",CONFIG_INTEGRATION:"PostFinanceCheckoutPayment.config.integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:"PostFinanceCheckoutPayment.config.lineItemConsistencyEnabled",CONFIG_SPACE_ID:"PostFinanceCheckoutPayment.config.spaceId",CONFIG_SPACE_VIEW_ID:"PostFinanceCheckoutPayment.config.spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:"PostFinanceCheckoutPayment.config.storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:"PostFinanceCheckoutPayment.config.userId",CONFIG_IS_SHOWCASE:"PostFinanceCheckoutPayment.config.isShowcase",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:"PostFinanceCheckoutPayment.config.storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:"PostFinanceCheckoutPayment.config.storefrontPaymentsUpdateEnabled"};function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function et(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nt=Shopware,ot=nt.Component,at=nt.Mixin;ot.register("postfinancecheckout-settings",{template:Z.a,inject:["PostFinanceCheckoutConfigurationService"],mixins:[at.getByName("notification")],data:function(){return function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return Rt(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"registerWebHooks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/register-web-hooks");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"setPostFinanceCheckoutAsSalesChannelPaymentDefault",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/set-postfinancecheckout-as-sales-channel-payment-default");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"synchronizePaymentMethodConfiguration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/synchronize-payment-method-configuration");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"installOrderDeliveryStates",value:function(){var t=this.getBasicHeaders(),e="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/install-order-delivery-states");return this.httpClient.post(e,{},{headers:t}).then((function(t){return Vt.handleResponse(t)}))}}])&&$t(e.prototype,n),o&&$t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(Vt);function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ht(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return zt(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createRefund",value:function(t,e,n,o){var a=this.getBasicHeaders(),i="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/refund/create-refund/");return this.httpClient.post(i,{salesChannelId:t,transactionId:e,quantity:n,lineItemId:o},{headers:a}).then((function(t){return Zt.handleResponse(t)}))}},{key:"createRefundByAmount",value:function(t,e,n){var o=this.getBasicHeaders(),a="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/refund/create-refund-by-amount/");return this.httpClient.post(a,{salesChannelId:t,transactionId:e,refundableAmount:n},{headers:o}).then((function(t){return Zt.handleResponse(t)}))}}])&&Ht(e.prototype,n),o&&Ht(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(Zt);function Xt(t){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ee(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return te(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"getTransactionData",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-transaction-data/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return re.handleResponse(t)}))}},{key:"getInvoiceDocument",value:function(t,e){return"".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-invoice-document/").concat(t,"/").concat(e)}},{key:"getPackingSlip",value:function(t,e){return"".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-packing-slip/").concat(t,"/").concat(e)}}])&&ee(e.prototype,n),o&&ee(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(re);function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return le(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createTransactionCompletion",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction-completion/create-transaction-completion/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return me.handleResponse(t)}))}}])&&ue(e.prototype,n),o&&ue(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(me);function be(t){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return _e(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createTransactionVoid",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction-void/create-transaction-void/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return ve.handleResponse(t)}))}}])&&ye(e.prototype,n),o&&ye(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(ve),Ee=Shopware.Application;Ee.addServiceProvider("PostFinanceCheckoutConfigurationService",(function(t){var e=Ee.getContainer("init");return new qt(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutRefundService",(function(t){var e=Ee.getContainer("init");return new Jt(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionService",(function(t){var e=Ee.getContainer("init");return new ce(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionCompletionService",(function(t){var e=Ee.getContainer("init");return new ge(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionVoidService",(function(t){var e=Ee.getContainer("init");return new Oe(e.httpClient,t.loginService)}))}}); \ No newline at end of file +!function(t){var e={};function n(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(o,a,function(e){return t[e]}.bind(null,a));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/bundles/postfinancecheckoutpayment/",n(n.s="ypuE")}({"/iC3":function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue Rückerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"Rückerstattung nach Menge"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endgültige Verbuchung","maxAmount":"Maximaler Betrag","successMessage":"Ihre Verbuchung war erfolgreich","successTitle":"Erfolg"},"general":{"title":"Bestellungen"},"header":"PostFinanceCheckout Payment","lineItem":{"cardTitle":"Einzelposten","types":{"amountIncludingTax":"Betrag","name":"Name","quantity":"Anzahl","taxAmount":"Steuern","type":"Typ","uniqueId":"Eindeutige ID"}},"modal":{"title":{"capture":"Erfassen","refund":"Neue Gutschrift","void":"Autorisierung aufheben"}},"paymentDetails":{"cardTitle":"Zahlung","error":{"title":"Fehler beim Abrufen von Zahlungsdetails von PostFinanceCheckout"}},"refund":{"cardTitle":"Gutschriften","refundAmount":{"label":"Gutschriftsbetrag"},"refundQuantity":{"label":"Refund Menge"},"types":{"amount":"Betrag","createdOn":"Erstellt am","id":"ID","state":"Staat"}},"refundAction":{"confirmButton":{"text":"Ausführen"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre Rückerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verfügbare Artikel zum Erstatten"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"Währung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"}},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}')},"2zY8":function(t,e,n){var o=n("6Ef7");o.__esModule&&(o=o.default),"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("52fac0e8",o,!0,{})},"6Ef7":function(t,e,n){},ADsd:function(t,e,n){},FCMq:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Complete","download-invoice":"Download Invoice","download-packing-slip":"Download Packing Slip","refund":"Create a new refund","void":"Cancel authorization","refund-whole-line-item":"Refund whole line item","refund-line-item-by-quantity":"Refund by quantity"}},"captureAction":{"button":{"text":"Capture payment"},"currentAmount":"Amount","isFinal":"This is final capture","maxAmount":"Maximum amount","successMessage":"Your capture was successful.","successTitle":"Success"},"general":{"title":"Orders"},"header":"PostFinanceCheckout Payment","lineItem":{"cardTitle":"Line Items","types":{"amountIncludingTax":"Amount","name":"Name","quantity":"Quantity","taxAmount":"Taxes","type":"Type","uniqueId":"Unique ID"}},"modal":{"title":{"capture":"Capture","refund":"New refund","void":"Cancel authorization"}},"paymentDetails":{"cardTitle":"Payment","error":{"title":"Error fetching payment details from PostFinanceCheckout"}},"refund":{"cardTitle":"Refunds","refundAmount":{"label":"Refund Amount"},"refundQuantity":{"label":"Refund Quantity"},"types":{"amount":"Amount","createdOn":"Created On","id":"ID","state":"State"}},"refundAction":{"confirmButton":{"text":"Execute"},"refundAmount":{"label":"Amount","placeholder":"Enter a amount"},"successMessage":"Your refund was successful.","successTitle":"Success","maxAvailableItemsToRefund":"Maximum available items to refund"},"transactionHistory":{"cardTitle":"Details","types":{"authorized_amount":"Authorized Amount","currency":"Currency","customer":"Customer","payment_method":"Payment Method","state":"State","transaction":"Transaction"}},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Cancel authorization"},"message":"Do you really want to cancel this payment?"},"successMessage":"The payment was successfully voided.","successTitle":"Success"}}}')},FJBk:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Completato","download-invoice":"Scarica fattura","download-packing-slip":"Scarica distinta di imballaggio","refund":"Crea un nuovo rimborso","void":"Annulla autorizzazione","refund-whole-line-item":"Rimborso intera riga","refund-line-item-by-quantity":"Rimborso per quantità"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa è la cattura finale","maxAmount":"Importo massimo","successMessage":"La tua cattura ha avuto successo.","successTitle":"Successo"},"general":{"title":"Ordini"},"header":"Pagamento PostFinanceCheckout","lineItem":{"cardTitle":"Articoli di linea","types":{"amountIncludingTax":"Importo","name":"Nome","quantity":"Quantità","taxAmount":"Tasse","type":"Tipo","uniqueId":"ID unico"}},"modal":{"title":{"capture":"Cattura","refund":"Nuovo rimborso","void":"Annulla autorizzazione"}},"paymentDetails":{"cardTitle":"Pagamento","error":{"title":"Errore nel recupero dei dettagli del pagamento da PostFinanceCheckout"}},"refund":{"cardTitle":"Rimborsi","refundAmount":{"label":"Importo del rimborso"},"refundQuantity":{"label":"Quantità di rimborso"},"types":{"amount":"Importo","createdOn":"Creato il","id":"ID","state":"Stato"}},"refundAction":{"confirmButton":{"text":"Esegui"},"refundAmount":{"label":"Importo","placeholder":"Inserisci un importo"},"successMessage":"Il tuo rimborso è andato a buon fine.","successTitle":"Successo","maxAvailableItemsToRefund":"Numero massimo di articoli disponibili da rimborsare"},"transactionHistory":{"cardTitle":"Dettagli","types":{"authorized_amount":"Importo autorizzato","currency":"Valuta","customer":"Cliente","payment_method":"Metodo di pagamento","state":"Stato","transaction":"Transazione"}},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento è stato annullato con successo.","successTitle":"Successo"}}}')},FLPB:function(t,e){t.exports='{% block postfinancecheckout_order_action_completion %}\n\n\n\t{% block postfinancecheckout_order_action_completion_amount %}\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_completion_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},H4Kp:function(t,e){t.exports='{% block postfinancecheckout_order_action_refund %}\n\n\n\t{% block postfinancecheckout_order_action_refund_amount %}\n\n\t\t\n\t\t\n\n\t\t
    \n\t\t\t{{ $tc(\'postfinancecheckout-order.refundAction.maxAvailableItemsToRefund\') }}:\n\t\t\t{{ this.$parent.refundableQuantity }}\n\t\t
    \n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_refund_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n
    \n{% endblock %}\n'},Hmsx:function(t,e){t.exports='{% block postfinancecheckout_settings %}\n\n\n\t{% block postfinancecheckout_settings_header %}\n\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_settings_actions %}\n\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_settings_content %}\n\t\n\t{% endblock %}\n\n{% endblock %}'},PwZK:function(t,e,n){var o=n("ADsd");o.__esModule&&(o=o.default),"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("4addc608",o,!0,{})},SZ7m:function(t,e,n){"use strict";function o(t,e){for(var n=[],o={},a=0;an.parts.length&&(o.parts.length=n.parts.length)}else{var r=[];for(a=0;a\n\n\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n\t\t\t\n\n\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n\t\t\t\t\t
    \n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\t\t\t\t\t
    \n\t\t\t\t{% endblock %}\n\t\t\t
    \n\t\t{% endblock %}\n\t\n\n{% endblock %}\n'},Uo3W:function(t,e){t.exports='\n\t\n\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n
    \n\n'},VP8G:function(t,e){t.exports='{% block postfinancecheckout_order_detail %}\n
    \n\t
    \n\t\t\n\t\t\t\n\t\t\n\t\t{% block postfinancecheckout_order_transaction_history_card %}\n\t\t\n\t\t\t\n\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_transaction_line_items_card %}\n\t\t\n\t\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_transaction_refunds_card %}\n\t\t\n\t\t\t\n\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_refund %}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_refund_by_amount %}\n\t\t\t\n\t\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_completion%}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t\t{% block postfinancecheckout_order_actions_modal_void %}\n\t\t\n\t\t\n\t\t{% endblock %}\n\t
    \n\t\n
    \n{% endblock %}\n'},aubh:function(t,e){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:"postfinancecheckout",key:"postfinancecheckout",roles:{viewer:{privileges:["sales_channel:read","sales_channel_payment_method:read","system_config:read"],dependencies:[]},editor:{privileges:["sales_channel:update","sales_channel_payment_method:create","sales_channel_payment_method:update","system_config:update","system_config:create","system_config:delete"],dependencies:["postfinancecheckout.viewer"]}}}),Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"sales_channel",roles:{viewer:{privileges:["sales_channel_payment_method:read"]},editor:{privileges:["payment_method:update"]},creator:{privileges:["payment_method:create","shipping_method:create","delivery_time:create"]},deleter:{privileges:["payment_method:delete"]}}})},gF78:function(t,e){t.exports='{% block postfinancecheckout_order_action_refund_by_amount %}\n\n\n\t{% block postfinancecheckout_order_action_refund_amount_by_amount %}\n\t\t\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_refund_confirm_button_by_amount %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},heDV:function(t,e){t.exports='{% block postfinancecheckout_settings_content_card_channel_config_credentials %}\n\t\n\n\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n\t\t\t\n\n\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n\t\t\t\t\t
    \n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\n\t\t\t\t\t\t{% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{% endblock %}\n\t\t\t\t\t
    \n\t\t\t\t{% endblock %}\n\t\t\t
    \n\t\t{% endblock %}\n\t\n\n{% endblock %}\n'},juBS:function(t,e){t.exports='\n\t\n\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n
    \n\n'},tYm5:function(t,e){t.exports='{% block sw_order_detail_content_tabs_general %}\n {% parent %}\n\n\n\t{{ $tc(\'postfinancecheckout-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n'},wwge:function(t,e){t.exports='{% block postfinancecheckout_settings_icon %}\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n{% endblock %}\n'},x5wL:function(t){t.exports=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Terminée","download-invoice":"Télécharger la facture","download-packing-slip":"Télécharger le bordereau d\'expédition","refund":"Créer un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne entière","refund-line-item-by-quantity":"Remboursement par quantité"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a été réussie.","successTitle":"Succès"},"general":{"title":"Commandes"},"header":"PostFinanceCheckout Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantité","taxAmount":"Taxes","type":"Type","uniqueId":"ID unique"}},"modal":{"title":{"capture":"Capture","refund":"Nouveau remboursement","void":"Annulez l\'autorisation"}},"paymentDetails":{"cardTitle":"Paiement","error":{"title":"Erreur dans la récupération des détails du paiement à partir de PostFinanceCheckout"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantité à rembourser"},"types":{"amount":"Montant","createdOn":"Créé le","id":"ID","state":"État"}},"refundAction":{"confirmButton":{"text":"Exécutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a été effectué avec succès.","successTitle":"Succès","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement"},"transactionHistory":{"cardTitle":"Détails","types":{"authorized_amount":"Montant autorisé","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"État","transaction":"Transaction"}},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a été annulé avec succès.","successTitle":"Succès"}}}')},ygOZ:function(t,e){t.exports='{% block postfinancecheckout_order_action_void %}\n\n\n\t{% block postfinancecheckout_order_action_void_amount %}\n\t\t\n\t{% endblock %}\n\n\t{% block postfinancecheckout_order_action_void_confirm_button %}\n\t\n\t{% endblock %}\n\n\t\n\n{% endblock %}\n'},ypuE:function(t,e,n){"use strict";n.r(e);var o=n("tYm5"),a=n.n(o),i=(n("PwZK"),Shopware),r=i.Component,c=i.Context,s=Shopware.Data.Criteria;r.override("sw-order-detail",{template:a.a,data:function(){return{isPostFinanceCheckoutPayment:!1}},computed:{isEditable:function(){return!this.isPostFinanceCheckoutPayment||"postfinancecheckout.order.detail"!==this.$route.name},showTabs:function(){return!0}},watch:{orderId:{deep:!0,handler:function(){var t=this;if(this.orderId){var e=this.repositoryFactory.create("order"),n=new s(1,1);n.addAssociation("transactions"),e.get(this.orderId,c.api,n).then((function(e){if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId)t.setIsPostFinanceCheckoutPayment(null);else{var n=e.transactions[0].paymentMethodId;null!=n&&t.setIsPostFinanceCheckoutPayment(n)}}))}else this.setIsPostFinanceCheckoutPayment(null)},immediate:!0}},methods:{setIsPostFinanceCheckoutPayment:function(t){var e=this;t&&this.repositoryFactory.create("payment_method").get(t,c.api).then((function(t){e.isPostFinanceCheckoutPayment="handler_postfinancecheckoutpayment_postfinancecheckoutpaymenthandler"===t.formattedHandlerIdentifier}))}}});var l=n("FLPB"),u=n.n(l),d=Shopware,p=d.Component,f=d.Mixin,h=d.Filter,m=d.Utils;p.register("postfinancecheckout-order-action-completion",{template:u.a,inject:["PostFinanceCheckoutTransactionCompletionService"],mixins:[f.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data:function(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter:function(){return h.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1},completion:function(){var t=this;this.isCompletion&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.captureAction.successTitle"),message:t.$tc("postfinancecheckout-order.captureAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(m.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(m.createId()))}))}})))}}});var g=n("H4Kp"),b=n.n(g),_=Shopware,y=_.Component,k=_.Mixin,I=_.Filter,w=_.Utils;y.register("postfinancecheckout-order-action-refund",{template:b.a,inject:["PostFinanceCheckoutRefundService"],mixins:[k.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data:function(){return{refundQuantity:1,transactionData:{},isLoading:!0,currentLineItem:""}},computed:{dateFilter:function(){return I.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1},refund:function(){var t=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.currentLineItem).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.refundAction.successTitle"),message:t.$tc("postfinancecheckout-order.refundAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(w.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(w.createId()))}))}}))}}});var C=n("gF78"),v=n.n(C),O=Shopware,E=O.Component,S=O.Mixin,N=O.Filter,F=O.Utils;E.register("postfinancecheckout-order-action-refund-by-amount",{template:v.a,inject:["PostFinanceCheckoutRefundService"],mixins:[S.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data:function(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter:function(){return N.getByName("date")}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=Number(this.transactionData.transactions[0].amountIncludingTax)},refundByAmount:function(){var t=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.refundAction.successTitle"),message:t.$tc("postfinancecheckout-order.refundAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(F.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(F.createId()))}))}}))}}});var D=n("ygOZ"),P=n.n(D),T=Shopware,A=T.Component,x=T.Mixin,L=T.Filter,R=T.Utils;A.register("postfinancecheckout-order-action-void",{template:P.a,inject:["PostFinanceCheckoutTransactionVoidService"],mixins:[x.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data:function(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter:function(){return L.getByName("date")},lineItemColumns:function(){return[{property:"uniqueId",label:this.$tc("postfinancecheckout-order.refund.types.uniqueId"),rawData:!1,allowResize:!0,primary:!0,width:"auto"},{property:"name",label:this.$tc("postfinancecheckout-order.refund.types.name"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"quantity",label:this.$tc("postfinancecheckout-order.refund.types.quantity"),rawData:!0,allowResize:!0,width:"auto"},{property:"amountIncludingTax",label:this.$tc("postfinancecheckout-order.refund.types.amountIncludingTax"),rawData:!0,allowResize:!0,inlineEdit:"string",width:"auto"},{property:"type",label:this.$tc("postfinancecheckout-order.refund.types.type"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"taxAmount",label:this.$tc("postfinancecheckout-order.refund.types.taxAmount"),rawData:!0,allowResize:!0,width:"auto"}]}},created:function(){this.createdComponent()},methods:{createdComponent:function(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundableAmount=this.transactionData.transactions[0].amountIncludingTax,this.refundAmount=this.transactionData.transactions[0].amountIncludingTax},voidPayment:function(){var t=this;this.isVoid&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then((function(){t.createNotificationSuccess({title:t.$tc("postfinancecheckout-order.voidAction.successTitle"),message:t.$tc("postfinancecheckout-order.voidAction.successMessage")}),t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(R.createId()))}))})).catch((function(e){try{t.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(n){t.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{t.isLoading=!1,t.$emit("modal-close"),t.$nextTick((function(){t.$router.replace("".concat(t.$route.path,"?hash=").concat(R.createId()))}))}})))}}});var $=n("VP8G"),B=n.n($),j=(n("2zY8"),Shopware),M=j.Component,G=j.Mixin,V=j.Filter,q=j.Context,U=j.Utils,z=Shopware.Data.Criteria;M.register("postfinancecheckout-order-detail",{template:B.a,inject:["PostFinanceCheckoutTransactionService","PostFinanceCheckoutRefundService","repositoryFactory"],mixins:[G.getByName("notification")],data:function(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,currentLineItem:"",refundLineItem:[]}},metaInfo:function(){return{title:this.$tc("postfinancecheckout-order.header")}},computed:{dateFilter:function(){return V.getByName("date")},relatedResourceColumns:function(){return[{property:"paymentConnectorConfiguration.name",label:this.$tc("postfinancecheckout-order.transactionHistory.types.payment_method"),rawData:!0},{property:"state",label:this.$tc("postfinancecheckout-order.transactionHistory.types.state"),rawData:!0},{property:"currency",label:this.$tc("postfinancecheckout-order.transactionHistory.types.currency"),rawData:!0},{property:"authorized_amount",label:this.$tc("postfinancecheckout-order.transactionHistory.types.authorized_amount"),rawData:!0},{property:"id",label:this.$tc("postfinancecheckout-order.transactionHistory.types.transaction"),rawData:!0},{property:"customerId",label:this.$tc("postfinancecheckout-order.transactionHistory.types.customer"),rawData:!0}]},lineItemColumns:function(){return[{property:"uniqueId",label:this.$tc("postfinancecheckout-order.lineItem.types.uniqueId"),rawData:!0,visible:!1,primary:!0},{property:"name",label:this.$tc("postfinancecheckout-order.lineItem.types.name"),rawData:!0},{property:"quantity",label:this.$tc("postfinancecheckout-order.lineItem.types.quantity"),rawData:!0},{property:"amountIncludingTax",label:this.$tc("postfinancecheckout-order.lineItem.types.amountIncludingTax"),rawData:!0},{property:"type",label:this.$tc("postfinancecheckout-order.lineItem.types.type"),rawData:!0},{property:"taxAmount",label:this.$tc("postfinancecheckout-order.lineItem.types.taxAmount"),rawData:!0},{property:"refundableQuantity",rawData:!0,visible:!1}]},refundColumns:function(){return[{property:"id",label:this.$tc("postfinancecheckout-order.refund.types.id"),rawData:!0,visible:!0,primary:!0},{property:"amount",label:this.$tc("postfinancecheckout-order.refund.types.amount"),rawData:!0},{property:"state",label:this.$tc("postfinancecheckout-order.refund.types.state"),rawData:!0},{property:"createdOn",label:this.$tc("postfinancecheckout-order.refund.types.createdOn"),rawData:!0}]}},watch:{$route:function(){this.resetDataAttributes(),this.createdComponent()}},created:function(){this.createdComponent()},methods:{createdComponent:function(){var t=this;this.orderId=this.$route.params.id;var e=this.repositoryFactory.create("order"),n=new z(1,1);n.addAssociation("transactions"),n.getAssociation("transactions").addSorting(z.sort("createdAt","DESC")),e.get(this.orderId,q.api,n).then((function(e){t.order=e,t.isLoading=!1;var n=0,o=0,a=e.transactions[0].customFields.postfinancecheckout_transaction_id;t.PostFinanceCheckoutTransactionService.getTransactionData(e.salesChannelId,a).then((function(e){t.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=U.format.currency(e.transactions[0].authorizationAmount,t.currency),e.refunds.forEach((function(e){o=parseFloat(parseFloat(o)+parseFloat(e.amount)),e.amount=U.format.currency(e.amount,t.currency),e.reductions.forEach((function(e){void 0===t.refundLineItem[e.lineItemUniqueId]?t.refundLineItem[e.lineItemUniqueId]=e.quantityReduction:t.refundLineItem[e.lineItemUniqueId]+=e.quantityReduction}))})),e.transactions[0].lineItems.forEach((function(e){e.amountIncludingTax=U.format.currency(e.amountIncludingTax,t.currency),e.taxAmount=U.format.currency(e.taxAmount,t.currency),n=parseFloat(e.unitPriceIncludingTax*e.quantity),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(t.refundLineItem[e.uniqueId]||0))})),t.lineItems=e.transactions[0].lineItems,t.transactionData=e,t.transaction=t.transactionData.transactions[0],t.refundAmount=Number(t.transactionData.transactions[0].amountIncludingTax),t.refundableAmount=parseFloat(parseFloat(n)-parseFloat(o))})).catch((function(e){try{t.createNotificationError({title:t.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(n){t.createNotificationError({title:t.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{t.isLoading=!1}}))}))},downloadPackingSlip:function(){window.open(this.PostFinanceCheckoutTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice:function(){window.open(this.PostFinanceCheckoutTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes:function(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItem=[],this.isLoading=!0},spawnModal:function(t,e,n){this.modalType=t,this.currentLineItem=e,this.refundableQuantity=n},closeModal:function(){this.modalType=""},lineItemRefund:function(t){var e=this;this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,t).then((function(){e.createNotificationSuccess({title:e.$tc("postfinancecheckout-order.refundAction.successTitle"),message:e.$tc("postfinancecheckout-order.refundAction.successMessage")}),e.isLoading=!1,e.$emit("modal-close"),e.$nextTick((function(){e.$router.replace("".concat(e.$route.path,"?hash=").concat(U.createId()))}))})).catch((function(t){try{e.createNotificationError({title:t.response.data.errors[0].title,message:t.response.data.errors[0].detail,autoClose:!1})}catch(n){e.createNotificationError({title:t.title,message:t.message,autoClose:!1})}finally{e.isLoading=!1,e.$emit("modal-close"),e.$nextTick((function(){e.$router.replace("".concat(e.$route.path,"?hash=").concat(U.createId()))}))}}))}}});var H=n("/iC3"),W=n("FCMq"),K=n("x5wL"),Y=n("FJBk");Shopware.Module.register("postfinancecheckout-order",{type:"plugin",name:"PostFinanceCheckout",title:"postfinancecheckout-order.general.title",description:"postfinancecheckout-order.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",color:"#2b52ff",snippets:{"de-DE":H,"en-GB":W,"fr-FR":K,"it-IT":Y},routeMiddleware:function(t,e){"sw.order.detail"===e.name&&e.children.push({component:"postfinancecheckout-order-detail",name:"postfinancecheckout.order.detail",isChildren:!0,path:"/sw/order/postfinancecheckout/detail/:id"}),t(e)}});n("aubh");var Q=n("Hmsx"),Z=n.n(Q),J="PostFinanceCheckoutPayment.config",X={CONFIG_DOMAIN:J,CONFIG_APPLICATION_KEY:"PostFinanceCheckoutPayment.config.applicationKey",CONFIG_EMAIL_ENABLED:"PostFinanceCheckoutPayment.config.emailEnabled",CONFIG_INTEGRATION:"PostFinanceCheckoutPayment.config.integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:"PostFinanceCheckoutPayment.config.lineItemConsistencyEnabled",CONFIG_SPACE_ID:"PostFinanceCheckoutPayment.config.spaceId",CONFIG_SPACE_VIEW_ID:"PostFinanceCheckoutPayment.config.spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:"PostFinanceCheckoutPayment.config.storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:"PostFinanceCheckoutPayment.config.userId",CONFIG_IS_SHOWCASE:"PostFinanceCheckoutPayment.config.isShowcase",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:"PostFinanceCheckoutPayment.config.storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:"PostFinanceCheckoutPayment.config.storefrontPaymentsUpdateEnabled"};function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function et(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nt=Shopware,ot=nt.Component,at=nt.Mixin;ot.register("postfinancecheckout-settings",{template:Z.a,inject:["PostFinanceCheckoutConfigurationService"],mixins:[at.getByName("notification")],data:function(){return function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return Rt(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"registerWebHooks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/register-web-hooks");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"setPostFinanceCheckoutAsSalesChannelPaymentDefault",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/set-postfinancecheckout-as-sales-channel-payment-default");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"synchronizePaymentMethodConfiguration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getBasicHeaders(),n="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/synchronize-payment-method-configuration");return this.httpClient.post(n,{salesChannelId:t},{headers:e}).then((function(t){return Vt.handleResponse(t)}))}},{key:"installOrderDeliveryStates",value:function(){var t=this.getBasicHeaders(),e="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/configuration/install-order-delivery-states");return this.httpClient.post(e,{},{headers:t}).then((function(t){return Vt.handleResponse(t)}))}}])&&$t(e.prototype,n),o&&$t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(Vt);function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ht(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return zt(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createRefund",value:function(t,e,n,o){var a=this.getBasicHeaders(),i="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/refund/create-refund/");return this.httpClient.post(i,{salesChannelId:t,transactionId:e,quantity:n,lineItemId:o},{headers:a}).then((function(t){return Zt.handleResponse(t)}))}},{key:"createRefundByAmount",value:function(t,e,n){var o=this.getBasicHeaders(),a="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/refund/create-refund-by-amount/");return this.httpClient.post(a,{salesChannelId:t,transactionId:e,refundableAmount:n},{headers:o}).then((function(t){return Zt.handleResponse(t)}))}}])&&Ht(e.prototype,n),o&&Ht(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(Zt);function Xt(t){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ee(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return te(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"getTransactionData",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-transaction-data/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return re.handleResponse(t)}))}},{key:"getInvoiceDocument",value:function(t,e){return"".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-invoice-document/").concat(t,"/").concat(e)}},{key:"getPackingSlip",value:function(t,e){return"".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction/get-packing-slip/").concat(t,"/").concat(e)}}])&&ee(e.prototype,n),o&&ee(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(re);function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return le(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createTransactionCompletion",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction-completion/create-transaction-completion/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return me.handleResponse(t)}))}}])&&ue(e.prototype,n),o&&ue(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(me);function be(t){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"postfinancecheckout";return _e(this,i),a.call(this,t,e,n)}return e=i,(n=[{key:"createTransactionVoid",value:function(t,e){var n=this.getBasicHeaders(),o="".concat(Shopware.Context.api.apiPath,"/_action/").concat(this.getApiBasePath(),"/transaction-void/create-transaction-void/");return this.httpClient.post(o,{salesChannelId:t,transactionId:e},{headers:n}).then((function(t){return ve.handleResponse(t)}))}}])&&ye(e.prototype,n),o&&ye(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(ve),Ee=Shopware.Application;Ee.addServiceProvider("PostFinanceCheckoutConfigurationService",(function(t){var e=Ee.getContainer("init");return new qt(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutRefundService",(function(t){var e=Ee.getContainer("init");return new Jt(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionService",(function(t){var e=Ee.getContainer("init");return new ce(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionCompletionService",(function(t){var e=Ee.getContainer("init");return new ge(e.httpClient,t.loginService)})),Ee.addServiceProvider("PostFinanceCheckoutTransactionVoidService",(function(t){var e=Ee.getContainer("init");return new Oe(e.httpClient,t.loginService)}))}}); \ No newline at end of file