diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea1625..66446e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.1.4 +- Improved plugin's settings form +- Support for Shopware 6.6.2.0 + # 6.1.3 - Solvency check support for Powerpay and MF Group Invoice payment methods - Improved handling of abandoned transactions diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index 5282172..d7d8ea0 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,7 @@ +# 6.1.4 +- Das Einstellungsformular des Plugins wurde verbessert +- Unterstützung von Shopware 6.6.2.0 + # 6.1.3 - Unterstützung der Bonitätsprüfung für die Zahlungsmethoden Powerpay und MF Group Invoice - Verbesserte Handhabung abgebrochener Transaktionen diff --git a/README.md b/README.md index 888a1ab..c0c7e0f 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Uncompress the zip file you download, and include the autoloader in your project ```bash # unzip to ShopwareInstallDir/custom/plugins/PostFinanceCheckoutPayment -composer require postfinancecheckout/sdk 4.0.2 +composer require postfinancecheckout/sdk 4.2.0 php bin/console plugin:refresh php bin/console plugin:install --activate --clearCache PostFinanceCheckoutPayment ``` @@ -71,7 +71,7 @@ tail -f var/log/postfinancecheckout_payment*.log ## Documentation -[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/6.1.3/docs/en/documentation.html) +[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/6.1.4/docs/en/documentation.html) ## License diff --git a/composer.json b/composer.json index bc3165b..34b97c5 100644 --- a/composer.json +++ b/composer.json @@ -59,8 +59,8 @@ "php": ">=8.2", "shopware/core": "6.6.*", "shopware/storefront": "6.6.*", - "postfinancecheckout/sdk": "4.0.2" + "postfinancecheckout/sdk": "4.2.0" }, "type": "shopware-platform-plugin", - "version": "6.1.3" + "version": "6.1.4" } \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index d32af42..e682864 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -23,7 +23,7 @@

Documentation

  • - + Source
  • diff --git a/src/Core/Settings/Command/SettingsCommand.php b/src/Core/Settings/Command/SettingsCommand.php index f810554..c62c97a 100644 --- a/src/Core/Settings/Command/SettingsCommand.php +++ b/src/Core/Settings/Command/SettingsCommand.php @@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int SettingsService::CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED => $input->getOption(SettingsService::CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED), SettingsService::CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED => $input->getOption(SettingsService::CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED), ]); - return 0; + return Command::SUCCESS; } /** @@ -103,7 +103,7 @@ protected function configure() SettingsService::CONFIG_IS_SHOWCASE, InputOption::VALUE_OPTIONAL, SettingsService::CONFIG_IS_SHOWCASE, - true + false ) ->addOption( SettingsService::CONFIG_LINE_ITEM_CONSISTENCY_ENABLED, diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig index 57bc04b..f34ba6b 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/component/sw-postfinancecheckout-credentials/index.html.twig @@ -1,8 +1,8 @@ {% block postfinancecheckout_settings_content_card_channel_config_credentials %} {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %} diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig index 1b74f07..24b06f1 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.html.twig @@ -50,7 +50,6 @@ labelProperty="translated.name" valueProperty="id" :options="salesChannel" - :disabled="isShowcase" @change="onInput"> {% endblock %} diff --git a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.js b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.js index 1ccfd42..f15c7d1 100644 --- a/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.js +++ b/src/Resources/app/administration/src/module/postfinancecheckout-settings/page/postfinancecheckout-settings/index.js @@ -81,7 +81,6 @@ Component.register('postfinancecheckout-settings', { handler() { const defaultConfig = this.$refs.configComponent.allConfigs.null; const salesChannelId = this.$refs.configComponent.selectedSalesChannelId; - this.isShowcase = this.config[this.CONFIG_IS_SHOWCASE]; if (salesChannelId === null) { this.applicationKeyFilled = !!this.config[this.CONFIG_APPLICATION_KEY]; @@ -112,6 +111,10 @@ Component.register('postfinancecheckout-settings', { this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED] = this.configStorefrontPaymentsUpdateEnabledDefaultValue; } + if (!(this.CONFIG_IS_SHOWCASE in this.config)) { + this.config[this.CONFIG_IS_SHOWCASE] = this.isShowcase; + } + } else { this.applicationKeyFilled = !!this.config[this.CONFIG_APPLICATION_KEY] || !!defaultConfig[this.CONFIG_APPLICATION_KEY]; @@ -142,6 +145,10 @@ Component.register('postfinancecheckout-settings', { if (!(this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config) || !(this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in defaultConfig)) { this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED] = this.configStorefrontPaymentsUpdateEnabledDefaultValue; } + + if (!(this.CONFIG_IS_SHOWCASE in this.config) || !(this.CONFIG_IS_SHOWCASE in defaultConfig)) { + this.config[this.CONFIG_IS_SHOWCASE] = this.isShowcase; + } } }, deep: true 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 230828f..a5febb9 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(){var e={544:function(){},166:function(){},360:function(){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"]}}})},62:function(e,t,n){var a=n(544);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("40f59bd0",a,!0,{})},880:function(e,t,n){var a=n(166);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("6b556694",a,!0,{})},346:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{for(var s=[],i=0;i\n {{ $tc(\'postfinancecheckout-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n',data(){return{isPostFinanceCheckoutPayment:!1}},computed:{isEditable(){return!this.isPostFinanceCheckoutPayment||"postfinancecheckout.order.detail"!==this.$route.name},showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.setIsPostFinanceCheckoutPayment(null);return}let e=this.repositoryFactory.create("order"),n=new a(1,1);n.addAssociation("transactions"),e.get(this.orderId,t.api,n).then(e=>{if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId){this.setIsPostFinanceCheckoutPayment(null);return}let t=e.transactions[0].paymentMethodId;null!=t&&this.setIsPostFinanceCheckoutPayment(t)})},immediate:!0}},methods:{setIsPostFinanceCheckoutPayment(e){e&&this.repositoryFactory.create("payment_method").get(e,t.api).then(e=>{this.isPostFinanceCheckoutPayment="handler_postfinancecheckoutpayment_postfinancecheckoutpaymenthandler"===e.formattedHandlerIdentifier})}}});let{Component:i,Mixin:o,Filter:s,Utils:c}=Shopware;i.register("postfinancecheckout-order-action-completion",{template:'{% block postfinancecheckout_order_action_completion %}\n\n\n {% block postfinancecheckout_order_action_completion_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_completion_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionCompletionService"],mixins:[o.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter(){return s.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},completion(){this.isCompletion&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.captureAction.successTitle"),message:this.$tc("postfinancecheckout-order.captureAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${c.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${c.createId()}`)})}}))}}});let{Component:r,Mixin:l,Filter:d,Utils:u}=Shopware;r.register("postfinancecheckout-order-action-refund",{template:'{% block postfinancecheckout_order_action_refund %}\n\n\n {% block postfinancecheckout_order_action_refund_amount %}\n\n \n \n\n
    \n {{ $tc(\'postfinancecheckout-order.refundAction.maxAvailableItemsToRefund\') }}:\n {{ this.$parent.refundableQuantity }}\n
    \n {% endblock %}\n\n {% block postfinancecheckout_order_action_refund_confirm_button %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["PostFinanceCheckoutRefundService"],mixins:[l.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{refundQuantity:1,transactionData:{},isLoading:!0,currentLineItem:""}},computed:{dateFilter(){return d.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},refund(){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.currentLineItem).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${u.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${u.createId()}`)})}})}}});let{Component:h,Mixin:p,Filter:m,Utils:f}=Shopware;h.register("postfinancecheckout-order-action-refund-by-amount",{template:'{% block postfinancecheckout_order_action_refund_by_amount %}\n\n\n {% block postfinancecheckout_order_action_refund_amount_by_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_refund_confirm_button_by_amount %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutRefundService"],mixins:[p.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter(){return m.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){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(){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${f.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${f.createId()}`)})}})}}});let{Component:g,Mixin:_,Filter:k,Utils:I}=Shopware;g.register("postfinancecheckout-order-action-void",{template:'{% block postfinancecheckout_order_action_void %}\n\n\n {% block postfinancecheckout_order_action_void_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_void_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionVoidService"],mixins:[_.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter(){return k.getByName("date")},lineItemColumns(){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(){this.createdComponent()},methods:{createdComponent(){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(){this.isVoid&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.voidAction.successTitle"),message:this.$tc("postfinancecheckout-order.voidAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${I.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${I.createId()}`)})}}))}}}),n(880);let{Component:C,Mixin:b,Filter:y,Context:w,Utils:E}=Shopware,N=Shopware.Data.Criteria;C.register("postfinancecheckout-order-detail",{template:'{% block postfinancecheckout_order_detail %}\n
    \n
    \n \n \n \n {% block postfinancecheckout_order_transaction_history_card %}\n \n \n\n \n {% endblock %}\n {% block postfinancecheckout_order_transaction_line_items_card %}\n \n \n \n {% endblock %}\n {% block postfinancecheckout_order_transaction_refunds_card %}\n \n \n\n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_refund %}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_refund_by_amount %}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_completion%}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_void %}\n \n \n {% endblock %}\n
    \n \n
    \n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionService","PostFinanceCheckoutRefundService","repositoryFactory"],mixins:[b.getByName("notification")],data(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,currentLineItem:"",refundLineItem:[]}},metaInfo(){return{title:this.$tc("postfinancecheckout-order.header")}},computed:{dateFilter(){return y.getByName("date")},relatedResourceColumns(){return[{property:"paymentMethodName",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(){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(){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(){this.resetDataAttributes(),this.createdComponent()}},created(){this.createdComponent()},methods:{createdComponent(){this.orderId=this.$route.params.id;let e=this.repositoryFactory.create("order"),t=new N(1,1);t.addAssociation("transactions"),t.getAssociation("transactions").addSorting(N.sort("createdAt","DESC")),e.get(this.orderId,w.api,t).then(e=>{this.order=e,this.isLoading=!1;var t=0,n=0;let a=e.transactions[0].customFields.postfinancecheckout_transaction_id;this.PostFinanceCheckoutTransactionService.getTransactionData(e.salesChannelId,a).then(e=>{this.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=E.format.currency(e.transactions[0].authorizationAmount,this.currency),e.refunds.forEach(e=>{n=parseFloat(parseFloat(n)+parseFloat(e.amount)),e.amount=E.format.currency(e.amount,this.currency),e.reductions.forEach(e=>{void 0===this.refundLineItem[e.lineItemUniqueId]?this.refundLineItem[e.lineItemUniqueId]=e.quantityReduction:this.refundLineItem[e.lineItemUniqueId]+=e.quantityReduction})}),e.transactions[0].lineItems.forEach(e=>{e.amountIncludingTax=E.format.currency(e.amountIncludingTax,this.currency),e.taxAmount=E.format.currency(e.taxAmount,this.currency),t=parseFloat(parseFloat(t)+parseFloat(e.unitPriceIncludingTax*e.quantity)),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(this.refundLineItem[e.uniqueId]||0))}),this.lineItems=e.transactions[0].lineItems,this.transactionData=e,this.transaction=this.transactionData.transactions[0],this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=parseFloat(parseFloat(t)-parseFloat(n))}).catch(e=>{try{this.createNotificationError({title:this.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(t){this.createNotificationError({title:this.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{this.isLoading=!1}})})},downloadPackingSlip(){window.open(this.PostFinanceCheckoutTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice(){window.open(this.PostFinanceCheckoutTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItem=[],this.isLoading=!0},spawnModal(e,t,n){this.modalType=e,this.currentLineItem=t,this.refundableQuantity=n},closeModal(){this.modalType=""},lineItemRefund(e){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${E.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${E.createId()}`)})}})}}});var v=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue R\xfcckerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"R\xfcckerstattung nach Menge"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endg\xfcltige 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\xfchren"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre R\xfcckerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verf\xfcgbare Artikel zum Erstatten"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"W\xe4hrung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Kreditkarteninhaber","paymentMethod":"Zahlungsart","paymentMethodBrand":"Marke der Zahlungsmethode","PseudoCreditCardNumber":"Pseudo-Kreditkartennummer","CardExpire":"Karte verf\xe4llt"},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}'),S=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"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Credit Card Holder","paymentMethod":"Payment Method","paymentMethodBrand":"Payment Method Brand","PseudoCreditCardNumber":"Pseudo Credit Card Number","CardExpire":"Card Expire"},"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"}}}'),F=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Termin\xe9e","download-invoice":"T\xe9l\xe9charger la facture","download-packing-slip":"T\xe9l\xe9charger le bordereau d\'exp\xe9dition","refund":"Cr\xe9er un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne enti\xe8re","refund-line-item-by-quantity":"Remboursement par quantit\xe9"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a \xe9t\xe9 r\xe9ussie.","successTitle":"Succ\xe8s"},"general":{"title":"Commandes"},"header":"PostFinanceCheckout Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantit\xe9","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\xe9cup\xe9ration des d\xe9tails du paiement \xe0 partir de PostFinanceCheckout"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantit\xe9 \xe0 rembourser"},"types":{"amount":"Montant","createdOn":"Cr\xe9\xe9 le","id":"ID","state":"\xc9tat"}},"refundAction":{"confirmButton":{"text":"Ex\xe9cutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a \xe9t\xe9 effectu\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement"},"transactionHistory":{"cardTitle":"D\xe9tails","types":{"authorized_amount":"Montant autoris\xe9","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"\xc9tat","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Titulaire de la carte de cr\xe9dit","paymentMethod":"Mode de paiement","paymentMethodBrand":"Marque du mode de paiement","PseudoCreditCardNumber":"Pseudo num\xe9ro de carte de cr\xe9dit","CardExpire":"La carte expire"},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a \xe9t\xe9 annul\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s"}}}'),T=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\xe0"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa \xe8 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\xe0","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\xe0 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 \xe8 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"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Proprietario della carta di credito","paymentMethod":"Metodo di pagamento","paymentMethodBrand":"Metodo di pagamento Marca","PseudoCreditCardNumber":"Numero di carta di credito pseudo","CardExpire":"La carta scade"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento \xe8 stato annullato con successo.","successTitle":"Successo"}}}');let{Module:D}=Shopware;D.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":v,"en-GB":S,"fr-FR":F,"it-IT":T},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"postfinancecheckout-order-detail",name:"postfinancecheckout.order.detail",isChildren:!0,path:"/sw/order/postfinancecheckout/detail/:id"}),e(t)}}),n(360);let A="PostFinanceCheckoutPayment.config";var O={CONFIG_DOMAIN:A,CONFIG_APPLICATION_KEY:A+".applicationKey",CONFIG_EMAIL_ENABLED:A+".emailEnabled",CONFIG_INTEGRATION:A+".integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:A+".lineItemConsistencyEnabled",CONFIG_SPACE_ID:A+".spaceId",CONFIG_SPACE_VIEW_ID:A+".spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:A+".storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:A+".userId",CONFIG_IS_SHOWCASE:A+".isShowcase",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:A+".storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:A+".storefrontPaymentsUpdateEnabled"};let{Component:$,Mixin:P}=Shopware;$.register("postfinancecheckout-settings",{template:'{% block postfinancecheckout_settings %}\n\n\n {% block postfinancecheckout_settings_header %}\n \n {% endblock %}\n\n {% block postfinancecheckout_settings_actions %}\n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content %}\n \n {% endblock %}\n\n{% endblock %}',inject:["PostFinanceCheckoutConfigurationService"],mixins:[P.getByName("notification")],data(){return{config:{},isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isShowcase:!1,applicationKeyFilled:!1,applicationKeyErrorState:!1,spaceIdFilled:!1,spaceIdErrorState:!1,userIdFilled:!1,userIdErrorState:!1,isSetDefaultPaymentSuccessful:!1,isSettingDefaultPaymentMethods:!1,configIntegrationDefaultValue:"iframe",configEmailEnabledDefaultValue:!0,configLineItemConsistencyEnabledDefaultValue:!0,configStorefrontInvoiceDownloadEnabledEnabledDefaultValue:!0,configStorefrontWebhooksUpdateEnabledDefaultValue:!0,configStorefrontPaymentsUpdateEnabledDefaultValue:!0,...O}},props:{isLoading:{type:Boolean,required:!0}},metaInfo(){return{title:this.$createTitle()}},created(){this.$on("check-api-connection-event",this.onCheckApiConnection)},beforeDestroy(){this.$off("check-api-connection-event",this.onCheckApiConnection)},watch:{config:{handler(){let e=this.$refs.configComponent.allConfigs.null,t=this.$refs.configComponent.selectedSalesChannelId;this.isShowcase=this.config[this.CONFIG_IS_SHOWCASE],null===t?(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue)):(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY]||!!e[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID]||!!e[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID]||!!e[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config&&this.CONFIG_INTEGRATION in e||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config&&this.CONFIG_EMAIL_ENABLED in e||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config&&this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in e||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config&&this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue))},deep:!0}},methods:{onSave(){if(!(this.spaceIdFilled&&this.userIdFilled&&this.applicationKeyFilled)){this.setErrorStates();return}this.save()},save(){this.isLoading=!0,this.$refs.configComponent.save().then(e=>{e&&(this.config=e),this.registerWebHooks(),this.synchronizePaymentMethodConfiguration(),this.installOrderDeliveryStates()}).catch(()=>{this.isLoading=!1})},registerWebHooks(){if(!1===this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED])return!1;this.PostFinanceCheckoutConfigurationService.registerWebHooks(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messageWebHookUpdated")})}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messageWebHookError")}),this.isLoading=!1})},synchronizePaymentMethodConfiguration(){if(!1===this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED])return!1;this.PostFinanceCheckoutConfigurationService.synchronizePaymentMethodConfiguration(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messagePaymentMethodConfigurationUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messagePaymentMethodConfigurationError")}),this.isLoading=!1})},installOrderDeliveryStates(){this.PostFinanceCheckoutConfigurationService.installOrderDeliveryStates().then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messageOrderDeliveryStateUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messageOrderDeliveryStateError")}),this.isLoading=!1})},onSetPaymentMethodDefault(){this.isSettingDefaultPaymentMethods=!0,this.PostFinanceCheckoutConfigurationService.setPostFinanceCheckoutAsSalesChannelPaymentDefault(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.isSettingDefaultPaymentMethods=!1,this.isSetDefaultPaymentSuccessful=!0})},setErrorStates(){let e={code:1,detail:this.$tc("postfinancecheckout-settings.messageNotBlank")};this.spaceIdFilled||(this.spaceIdErrorState=e),this.userIdFilled||(this.userIdErrorState=e),this.applicationKeyFilled||(this.applicationKeyErrorState=e)},onCheckApiConnection(e){let{spaceId:t,userId:n,applicationKey:a}=e;this.isTesting=!0,this.PostFinanceCheckoutConfigurationService.checkApiConnection(t,n,a).then(e=>{200===e.result?this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.successMessage")}):this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1})}}});let{Component:x,Mixin:L}=Shopware;x.register("sw-postfinancecheckout-credentials",{template:'{% block postfinancecheckout_settings_content_card_channel_config_credentials %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n\n \n \n {{ $tc(\'postfinancecheckout-settings.settingForm.credentials.button.label\') }}\n \n \n\n
    \n {% endblock %}\n
    \n\n{% endblock %}\n',name:"PostFinanceCheckoutCredentials",mixins:[L.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},spaceIdFilled:{type:Boolean,required:!0},spaceIdErrorState:{required:!0},userIdFilled:{type:Boolean,required:!0},userIdErrorState:{required:!0},applicationKeyFilled:{type:Boolean,required:!0},applicationKeyErrorState:{required:!0},isLoading:{type:Boolean,required:!0},isTesting:{type:Boolean,required:!1},isShowcase:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},emitCheckApiConnectionEvent(){let e={spaceId:this.actualConfigData[O.CONFIG_SPACE_ID],userId:this.actualConfigData[O.CONFIG_USER_ID],applicationKey:this.actualConfigData[O.CONFIG_APPLICATION_KEY]};this.$emit("check-api-connection-event",e)}}});let{Component:B,Mixin:M}=Shopware;B.register("sw-postfinancecheckout-options",{template:'{% block postfinancecheckout_settings_content_card_channel_config_options %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n
    \n {% endblock %}\n
    \n\n{% endblock %}\n',name:"PostFinanceCheckoutOptions",mixins:[M.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{integrationOptions(){return[{id:"iframe",name:this.$tc("postfinancecheckout-settings.settingForm.options.integration.options.iframe")},{id:"payment_page",name:this.$tc("postfinancecheckout-settings.settingForm.options.integration.options.payment_page")}]}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:R}=Shopware;R.register("sw-postfinancecheckout-settings-icon",{template:'{% block postfinancecheckout_settings_icon %}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n{% endblock %}\n'});let{Component:G,Mixin:V}=Shopware;G.register("sw-postfinancecheckout-storefront-options",{template:'\n \n
    \n \n \n \n
    \n
    \n
    \n\n',name:"PostFinanceCheckoutStorefrontOptions",mixins:[V.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:q,Mixin:U}=Shopware;q.register("sw-postfinancecheckout-advanced-options",{template:'\n \n
    \n \n \n \n\n \n \n \n
    \n
    \n
    \n\n',name:"PostFinanceCheckoutAdvancedOptions",mixins:[U.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Module:H}=Shopware;H.register("postfinancecheckout-settings",{type:"plugin",name:"PostFinanceCheckout",title:"postfinancecheckout-settings.general.descriptionTextModule",description:"postfinancecheckout-settings.general.descriptionTextModule",color:"#28d8ff",icon:"default-action-settings",version:"1.0.0",targetVersion:"1.0.0",routes:{index:{component:"postfinancecheckout-settings",path:"index",meta:{parentPath:"sw.settings.index",privilege:"postfinancecheckout.viewer"}}},settingsItem:{group:"plugins",to:"postfinancecheckout.settings.index",iconComponent:"sw-postfinancecheckout-settings-icon",backgroundEnabled:!0,privilege:"postfinancecheckout.viewer"}});let z=Shopware.Classes.ApiService;var K=class extends z{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}registerWebHooks(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/register-web-hooks`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}checkApiConnection(e=null,t=null,n=null){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/check-api-connection`;return this.httpClient.post(i,{spaceId:e,userId:t,applicationId:n},{headers:a}).then(e=>z.handleResponse(e))}setPostFinanceCheckoutAsSalesChannelPaymentDefault(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/set-postfinancecheckout-as-sales-channel-payment-default`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}synchronizePaymentMethodConfiguration(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}installOrderDeliveryStates(){let e=this.getBasicHeaders(),t=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;return this.httpClient.post(t,{},{headers:e}).then(e=>z.handleResponse(e))}};let W=Shopware.Classes.ApiService;var Y=class extends W{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createRefund(e,t,n,a){let i=this.getBasicHeaders(),o=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund/`;return this.httpClient.post(o,{salesChannelId:e,transactionId:t,quantity:n,lineItemId:a},{headers:i}).then(e=>W.handleResponse(e))}createRefundByAmount(e,t,n){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund-by-amount/`;return this.httpClient.post(i,{salesChannelId:e,transactionId:t,refundableAmount:n},{headers:a}).then(e=>W.handleResponse(e))}};let Q=Shopware.Classes.ApiService;var j=class extends Q{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}getTransactionData(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-transaction-data/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>Q.handleResponse(e))}getInvoiceDocument(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-invoice-document/${e}/${t}`}getPackingSlip(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-packing-slip/${e}/${t}`}};let Z=Shopware.Classes.ApiService;var J=class extends Z{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createTransactionCompletion(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>Z.handleResponse(e))}};let X=Shopware.Classes.ApiService;var ee=class extends X{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createTransactionVoid(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>X.handleResponse(e))}};let{Application:et}=Shopware;et.addServiceProvider("PostFinanceCheckoutConfigurationService",e=>new K(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutRefundService",e=>new Y(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionService",e=>new j(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionCompletionService",e=>new J(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionVoidService",e=>new ee(et.getContainer("init").httpClient,e.loginService))}()})(); \ No newline at end of file +(function(){var e={544:function(){},166:function(){},360:function(){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"]}}})},62:function(e,t,n){var a=n(544);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("40f59bd0",a,!0,{})},880:function(e,t,n){var a=n(166);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("6b556694",a,!0,{})},346:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{for(var s=[],i=0;i\n {{ $tc(\'postfinancecheckout-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n',data(){return{isPostFinanceCheckoutPayment:!1}},computed:{isEditable(){return!this.isPostFinanceCheckoutPayment||"postfinancecheckout.order.detail"!==this.$route.name},showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.setIsPostFinanceCheckoutPayment(null);return}let e=this.repositoryFactory.create("order"),n=new a(1,1);n.addAssociation("transactions"),e.get(this.orderId,t.api,n).then(e=>{if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId){this.setIsPostFinanceCheckoutPayment(null);return}let t=e.transactions[0].paymentMethodId;null!=t&&this.setIsPostFinanceCheckoutPayment(t)})},immediate:!0}},methods:{setIsPostFinanceCheckoutPayment(e){e&&this.repositoryFactory.create("payment_method").get(e,t.api).then(e=>{this.isPostFinanceCheckoutPayment="handler_postfinancecheckoutpayment_postfinancecheckoutpaymenthandler"===e.formattedHandlerIdentifier})}}});let{Component:i,Mixin:o,Filter:s,Utils:c}=Shopware;i.register("postfinancecheckout-order-action-completion",{template:'{% block postfinancecheckout_order_action_completion %}\n\n\n {% block postfinancecheckout_order_action_completion_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_completion_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionCompletionService"],mixins:[o.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter(){return s.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},completion(){this.isCompletion&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.captureAction.successTitle"),message:this.$tc("postfinancecheckout-order.captureAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${c.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${c.createId()}`)})}}))}}});let{Component:r,Mixin:l,Filter:d,Utils:u}=Shopware;r.register("postfinancecheckout-order-action-refund",{template:'{% block postfinancecheckout_order_action_refund %}\n\n\n {% block postfinancecheckout_order_action_refund_amount %}\n\n \n \n\n
    \n {{ $tc(\'postfinancecheckout-order.refundAction.maxAvailableItemsToRefund\') }}:\n {{ this.$parent.refundableQuantity }}\n
    \n {% endblock %}\n\n {% block postfinancecheckout_order_action_refund_confirm_button %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["PostFinanceCheckoutRefundService"],mixins:[l.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{refundQuantity:1,transactionData:{},isLoading:!0,currentLineItem:""}},computed:{dateFilter(){return d.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},refund(){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.currentLineItem).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${u.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${u.createId()}`)})}})}}});let{Component:h,Mixin:p,Filter:m,Utils:f}=Shopware;h.register("postfinancecheckout-order-action-refund-by-amount",{template:'{% block postfinancecheckout_order_action_refund_by_amount %}\n\n\n {% block postfinancecheckout_order_action_refund_amount_by_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_refund_confirm_button_by_amount %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutRefundService"],mixins:[p.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter(){return m.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){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(){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${f.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${f.createId()}`)})}})}}});let{Component:g,Mixin:_,Filter:k,Utils:I}=Shopware;g.register("postfinancecheckout-order-action-void",{template:'{% block postfinancecheckout_order_action_void %}\n\n\n {% block postfinancecheckout_order_action_void_amount %}\n \n \n {% endblock %}\n\n {% block postfinancecheckout_order_action_void_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionVoidService"],mixins:[_.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter(){return k.getByName("date")},lineItemColumns(){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(){this.createdComponent()},methods:{createdComponent(){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(){this.isVoid&&(this.isLoading=!0,this.PostFinanceCheckoutTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.voidAction.successTitle"),message:this.$tc("postfinancecheckout-order.voidAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${I.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${I.createId()}`)})}}))}}}),n(880);let{Component:C,Mixin:b,Filter:y,Context:w,Utils:E}=Shopware,N=Shopware.Data.Criteria;C.register("postfinancecheckout-order-detail",{template:'{% block postfinancecheckout_order_detail %}\n
    \n
    \n \n \n \n {% block postfinancecheckout_order_transaction_history_card %}\n \n \n\n \n {% endblock %}\n {% block postfinancecheckout_order_transaction_line_items_card %}\n \n \n \n {% endblock %}\n {% block postfinancecheckout_order_transaction_refunds_card %}\n \n \n\n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_refund %}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_refund_by_amount %}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_completion%}\n \n \n {% endblock %}\n {% block postfinancecheckout_order_actions_modal_void %}\n \n \n {% endblock %}\n
    \n \n
    \n{% endblock %}\n',inject:["PostFinanceCheckoutTransactionService","PostFinanceCheckoutRefundService","repositoryFactory"],mixins:[b.getByName("notification")],data(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,currentLineItem:"",refundLineItem:[]}},metaInfo(){return{title:this.$tc("postfinancecheckout-order.header")}},computed:{dateFilter(){return y.getByName("date")},relatedResourceColumns(){return[{property:"paymentMethodName",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(){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(){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(){this.resetDataAttributes(),this.createdComponent()}},created(){this.createdComponent()},methods:{createdComponent(){this.orderId=this.$route.params.id;let e=this.repositoryFactory.create("order"),t=new N(1,1);t.addAssociation("transactions"),t.getAssociation("transactions").addSorting(N.sort("createdAt","DESC")),e.get(this.orderId,w.api,t).then(e=>{this.order=e,this.isLoading=!1;var t=0,n=0;let a=e.transactions[0].customFields.postfinancecheckout_transaction_id;this.PostFinanceCheckoutTransactionService.getTransactionData(e.salesChannelId,a).then(e=>{this.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=E.format.currency(e.transactions[0].authorizationAmount,this.currency),e.refunds.forEach(e=>{n=parseFloat(parseFloat(n)+parseFloat(e.amount)),e.amount=E.format.currency(e.amount,this.currency),e.reductions.forEach(e=>{void 0===this.refundLineItem[e.lineItemUniqueId]?this.refundLineItem[e.lineItemUniqueId]=e.quantityReduction:this.refundLineItem[e.lineItemUniqueId]+=e.quantityReduction})}),e.transactions[0].lineItems.forEach(e=>{e.amountIncludingTax=E.format.currency(e.amountIncludingTax,this.currency),e.taxAmount=E.format.currency(e.taxAmount,this.currency),t=parseFloat(parseFloat(t)+parseFloat(e.unitPriceIncludingTax*e.quantity)),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(this.refundLineItem[e.uniqueId]||0))}),this.lineItems=e.transactions[0].lineItems,this.transactionData=e,this.transaction=this.transactionData.transactions[0],this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=parseFloat(parseFloat(t)-parseFloat(n))}).catch(e=>{try{this.createNotificationError({title:this.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(t){this.createNotificationError({title:this.$tc("postfinancecheckout-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{this.isLoading=!1}})})},downloadPackingSlip(){window.open(this.PostFinanceCheckoutTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice(){window.open(this.PostFinanceCheckoutTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItem=[],this.isLoading=!0},spawnModal(e,t,n){this.modalType=e,this.currentLineItem=t,this.refundableQuantity=n},closeModal(){this.modalType=""},lineItemRefund(e){this.isLoading=!0,this.PostFinanceCheckoutRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-order.refundAction.successTitle"),message:this.$tc("postfinancecheckout-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${E.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${E.createId()}`)})}})}}});var S=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue R\xfcckerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"R\xfcckerstattung nach Menge"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endg\xfcltige 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\xfchren"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre R\xfcckerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verf\xfcgbare Artikel zum Erstatten"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"W\xe4hrung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Kreditkarteninhaber","paymentMethod":"Zahlungsart","paymentMethodBrand":"Marke der Zahlungsmethode","PseudoCreditCardNumber":"Pseudo-Kreditkartennummer","CardExpire":"Karte verf\xe4llt"},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}'),v=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"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Credit Card Holder","paymentMethod":"Payment Method","paymentMethodBrand":"Payment Method Brand","PseudoCreditCardNumber":"Pseudo Credit Card Number","CardExpire":"Card Expire"},"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"}}}'),F=JSON.parse('{"postfinancecheckout-order":{"buttons":{"label":{"completion":"Termin\xe9e","download-invoice":"T\xe9l\xe9charger la facture","download-packing-slip":"T\xe9l\xe9charger le bordereau d\'exp\xe9dition","refund":"Cr\xe9er un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne enti\xe8re","refund-line-item-by-quantity":"Remboursement par quantit\xe9"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a \xe9t\xe9 r\xe9ussie.","successTitle":"Succ\xe8s"},"general":{"title":"Commandes"},"header":"PostFinanceCheckout Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantit\xe9","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\xe9cup\xe9ration des d\xe9tails du paiement \xe0 partir de PostFinanceCheckout"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantit\xe9 \xe0 rembourser"},"types":{"amount":"Montant","createdOn":"Cr\xe9\xe9 le","id":"ID","state":"\xc9tat"}},"refundAction":{"confirmButton":{"text":"Ex\xe9cutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a \xe9t\xe9 effectu\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement"},"transactionHistory":{"cardTitle":"D\xe9tails","types":{"authorized_amount":"Montant autoris\xe9","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"\xc9tat","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Titulaire de la carte de cr\xe9dit","paymentMethod":"Mode de paiement","paymentMethodBrand":"Marque du mode de paiement","PseudoCreditCardNumber":"Pseudo num\xe9ro de carte de cr\xe9dit","CardExpire":"La carte expire"},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a \xe9t\xe9 annul\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s"}}}'),T=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\xe0"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa \xe8 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\xe0","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\xe0 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 \xe8 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"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Proprietario della carta di credito","paymentMethod":"Metodo di pagamento","paymentMethodBrand":"Metodo di pagamento Marca","PseudoCreditCardNumber":"Numero di carta di credito pseudo","CardExpire":"La carta scade"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento \xe8 stato annullato con successo.","successTitle":"Successo"}}}');let{Module:A}=Shopware;A.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":S,"en-GB":v,"fr-FR":F,"it-IT":T},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"postfinancecheckout-order-detail",name:"postfinancecheckout.order.detail",isChildren:!0,path:"/sw/order/postfinancecheckout/detail/:id"}),e(t)}}),n(360);let D="PostFinanceCheckoutPayment.config";var O={CONFIG_DOMAIN:D,CONFIG_APPLICATION_KEY:D+".applicationKey",CONFIG_EMAIL_ENABLED:D+".emailEnabled",CONFIG_INTEGRATION:D+".integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:D+".lineItemConsistencyEnabled",CONFIG_SPACE_ID:D+".spaceId",CONFIG_SPACE_VIEW_ID:D+".spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:D+".storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:D+".userId",CONFIG_IS_SHOWCASE:D+".isShowcase",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:D+".storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:D+".storefrontPaymentsUpdateEnabled"};let{Component:$,Mixin:P}=Shopware;$.register("postfinancecheckout-settings",{template:'{% block postfinancecheckout_settings %}\n\n\n {% block postfinancecheckout_settings_header %}\n \n {% endblock %}\n\n {% block postfinancecheckout_settings_actions %}\n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content %}\n \n {% endblock %}\n\n{% endblock %}',inject:["PostFinanceCheckoutConfigurationService"],mixins:[P.getByName("notification")],data(){return{config:{},isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isShowcase:!1,applicationKeyFilled:!1,applicationKeyErrorState:!1,spaceIdFilled:!1,spaceIdErrorState:!1,userIdFilled:!1,userIdErrorState:!1,isSetDefaultPaymentSuccessful:!1,isSettingDefaultPaymentMethods:!1,configIntegrationDefaultValue:"iframe",configEmailEnabledDefaultValue:!0,configLineItemConsistencyEnabledDefaultValue:!0,configStorefrontInvoiceDownloadEnabledEnabledDefaultValue:!0,configStorefrontWebhooksUpdateEnabledDefaultValue:!0,configStorefrontPaymentsUpdateEnabledDefaultValue:!0,...O}},props:{isLoading:{type:Boolean,required:!0}},metaInfo(){return{title:this.$createTitle()}},created(){this.$on("check-api-connection-event",this.onCheckApiConnection)},beforeDestroy(){this.$off("check-api-connection-event",this.onCheckApiConnection)},watch:{config:{handler(){let e=this.$refs.configComponent.allConfigs.null;null===this.$refs.configComponent.selectedSalesChannelId?(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue),this.CONFIG_IS_SHOWCASE in this.config||(this.config[this.CONFIG_IS_SHOWCASE]=this.isShowcase)):(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY]||!!e[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID]||!!e[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID]||!!e[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config&&this.CONFIG_INTEGRATION in e||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config&&this.CONFIG_EMAIL_ENABLED in e||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config&&this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in e||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config&&this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in e||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue),this.CONFIG_IS_SHOWCASE in this.config&&this.CONFIG_IS_SHOWCASE in e||(this.config[this.CONFIG_IS_SHOWCASE]=this.isShowcase))},deep:!0}},methods:{onSave(){if(!(this.spaceIdFilled&&this.userIdFilled&&this.applicationKeyFilled)){this.setErrorStates();return}this.save()},save(){this.isLoading=!0,this.$refs.configComponent.save().then(e=>{e&&(this.config=e),this.registerWebHooks(),this.synchronizePaymentMethodConfiguration(),this.installOrderDeliveryStates()}).catch(()=>{this.isLoading=!1})},registerWebHooks(){if(!1===this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED])return!1;this.PostFinanceCheckoutConfigurationService.registerWebHooks(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messageWebHookUpdated")})}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messageWebHookError")}),this.isLoading=!1})},synchronizePaymentMethodConfiguration(){if(!1===this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED])return!1;this.PostFinanceCheckoutConfigurationService.synchronizePaymentMethodConfiguration(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messagePaymentMethodConfigurationUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messagePaymentMethodConfigurationError")}),this.isLoading=!1})},installOrderDeliveryStates(){this.PostFinanceCheckoutConfigurationService.installOrderDeliveryStates().then(()=>{this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.titleSuccess"),message:this.$tc("postfinancecheckout-settings.settingForm.messageOrderDeliveryStateUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.titleError"),message:this.$tc("postfinancecheckout-settings.settingForm.messageOrderDeliveryStateError")}),this.isLoading=!1})},onSetPaymentMethodDefault(){this.isSettingDefaultPaymentMethods=!0,this.PostFinanceCheckoutConfigurationService.setPostFinanceCheckoutAsSalesChannelPaymentDefault(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.isSettingDefaultPaymentMethods=!1,this.isSetDefaultPaymentSuccessful=!0})},setErrorStates(){let e={code:1,detail:this.$tc("postfinancecheckout-settings.messageNotBlank")};this.spaceIdFilled||(this.spaceIdErrorState=e),this.userIdFilled||(this.userIdErrorState=e),this.applicationKeyFilled||(this.applicationKeyErrorState=e)},onCheckApiConnection(e){let{spaceId:t,userId:n,applicationKey:a}=e;this.isTesting=!0,this.PostFinanceCheckoutConfigurationService.checkApiConnection(t,n,a).then(e=>{200===e.result?this.createNotificationSuccess({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.successMessage")}):this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.title"),message:this.$tc("postfinancecheckout-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1})}}});let{Component:x,Mixin:L}=Shopware;x.register("sw-postfinancecheckout-credentials",{template:'{% block postfinancecheckout_settings_content_card_channel_config_credentials %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n\n \n \n {{ $tc(\'postfinancecheckout-settings.settingForm.credentials.button.label\') }}\n \n \n\n
    \n {% endblock %}\n \n\n{% endblock %}\n',name:"PostFinanceCheckoutCredentials",mixins:[L.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},spaceIdFilled:{type:Boolean,required:!0},spaceIdErrorState:{required:!0},userIdFilled:{type:Boolean,required:!0},userIdErrorState:{required:!0},applicationKeyFilled:{type:Boolean,required:!0},applicationKeyErrorState:{required:!0},isLoading:{type:Boolean,required:!0},isTesting:{type:Boolean,required:!1},isShowcase:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},emitCheckApiConnectionEvent(){let e={spaceId:this.actualConfigData[O.CONFIG_SPACE_ID],userId:this.actualConfigData[O.CONFIG_USER_ID],applicationKey:this.actualConfigData[O.CONFIG_APPLICATION_KEY]};this.$emit("check-api-connection-event",e)}}});let{Component:B,Mixin:M}=Shopware;B.register("sw-postfinancecheckout-options",{template:'{% block postfinancecheckout_settings_content_card_channel_config_options %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n \n \n \n {% endblock %}\n\n {% block postfinancecheckout_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n
    \n {% endblock %}\n
    \n\n{% endblock %}\n',name:"PostFinanceCheckoutOptions",mixins:[M.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{integrationOptions(){return[{id:"iframe",name:this.$tc("postfinancecheckout-settings.settingForm.options.integration.options.iframe")},{id:"payment_page",name:this.$tc("postfinancecheckout-settings.settingForm.options.integration.options.payment_page")}]}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:R}=Shopware;R.register("sw-postfinancecheckout-settings-icon",{template:'{% block postfinancecheckout_settings_icon %}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n{% endblock %}\n'});let{Component:G,Mixin:V}=Shopware;G.register("sw-postfinancecheckout-storefront-options",{template:'\n \n
    \n \n \n \n
    \n
    \n
    \n\n',name:"PostFinanceCheckoutStorefrontOptions",mixins:[V.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:q,Mixin:H}=Shopware;q.register("sw-postfinancecheckout-advanced-options",{template:'\n \n
    \n \n \n \n\n \n \n \n
    \n
    \n
    \n\n',name:"PostFinanceCheckoutAdvancedOptions",mixins:[H.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...O}},computed:{},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Module:U}=Shopware;U.register("postfinancecheckout-settings",{type:"plugin",name:"PostFinanceCheckout",title:"postfinancecheckout-settings.general.descriptionTextModule",description:"postfinancecheckout-settings.general.descriptionTextModule",color:"#28d8ff",icon:"default-action-settings",version:"1.0.0",targetVersion:"1.0.0",routes:{index:{component:"postfinancecheckout-settings",path:"index",meta:{parentPath:"sw.settings.index",privilege:"postfinancecheckout.viewer"}}},settingsItem:{group:"plugins",to:"postfinancecheckout.settings.index",iconComponent:"sw-postfinancecheckout-settings-icon",backgroundEnabled:!0,privilege:"postfinancecheckout.viewer"}});let z=Shopware.Classes.ApiService;var W=class extends z{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}registerWebHooks(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/register-web-hooks`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}checkApiConnection(e=null,t=null,n=null){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/check-api-connection`;return this.httpClient.post(i,{spaceId:e,userId:t,applicationId:n},{headers:a}).then(e=>z.handleResponse(e))}setPostFinanceCheckoutAsSalesChannelPaymentDefault(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/set-postfinancecheckout-as-sales-channel-payment-default`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}synchronizePaymentMethodConfiguration(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>z.handleResponse(e))}installOrderDeliveryStates(){let e=this.getBasicHeaders(),t=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;return this.httpClient.post(t,{},{headers:e}).then(e=>z.handleResponse(e))}};let K=Shopware.Classes.ApiService;var Y=class extends K{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createRefund(e,t,n,a){let i=this.getBasicHeaders(),o=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund/`;return this.httpClient.post(o,{salesChannelId:e,transactionId:t,quantity:n,lineItemId:a},{headers:i}).then(e=>K.handleResponse(e))}createRefundByAmount(e,t,n){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund-by-amount/`;return this.httpClient.post(i,{salesChannelId:e,transactionId:t,refundableAmount:n},{headers:a}).then(e=>K.handleResponse(e))}};let Q=Shopware.Classes.ApiService;var j=class extends Q{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}getTransactionData(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-transaction-data/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>Q.handleResponse(e))}getInvoiceDocument(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-invoice-document/${e}/${t}`}getPackingSlip(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-packing-slip/${e}/${t}`}};let Z=Shopware.Classes.ApiService;var J=class extends Z{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createTransactionCompletion(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>Z.handleResponse(e))}};let X=Shopware.Classes.ApiService;var ee=class extends X{constructor(e,t,n="postfinancecheckout"){super(e,t,n)}createTransactionVoid(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>X.handleResponse(e))}};let{Application:et}=Shopware;et.addServiceProvider("PostFinanceCheckoutConfigurationService",e=>new W(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutRefundService",e=>new Y(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionService",e=>new j(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionCompletionService",e=>new J(et.getContainer("init").httpClient,e.loginService)),et.addServiceProvider("PostFinanceCheckoutTransactionVoidService",e=>new ee(et.getContainer("init").httpClient,e.loginService))}()})(); \ No newline at end of file