diff --git a/src/Resources/app/administration/src/module/payone-payment/page/payone-settings/index.js b/src/Resources/app/administration/src/module/payone-payment/page/payone-settings/index.js index d1bcaf807..83a1424a0 100644 --- a/src/Resources/app/administration/src/module/payone-payment/page/payone-settings/index.js +++ b/src/Resources/app/administration/src/module/payone-payment/page/payone-settings/index.js @@ -51,6 +51,7 @@ Component.register('payone-settings', { 'paypalExpress', 'payolutionInvoicing', 'payolutionInstallment', + 'payolutionDebit', 'sofort' ]; }, diff --git a/src/Resources/app/administration/src/module/payone-payment/snippet/de_DE.json b/src/Resources/app/administration/src/module/payone-payment/snippet/de_DE.json index a21695fe7..4b67b3cf2 100644 --- a/src/Resources/app/administration/src/module/payone-payment/snippet/de_DE.json +++ b/src/Resources/app/administration/src/module/payone-payment/snippet/de_DE.json @@ -29,8 +29,9 @@ "debit": "Die API-Zugangsdaten für Lastschrift sind nicht korrekt.", "paypalExpress": "Die API-Zugangsdaten für PayPal Express sind nicht korrekt.", "paypal": "Die API-Zugangsdaten für PayPal sind nicht korrekt.", - "payolutionInstallment": "Die API-Zugangsdaten für Payolution Installment sind nicht korrekt.", - "payolutionInvoicing": "Die API-Zugangsdaten für Payolution Invoicing sind nicht korrekt.", + "payolutionInstallment": "Die API-Zugangsdaten für Paysafe Pay Later Ratenzahlung sind nicht korrekt.", + "payolutionInvoicing": "Die API-Zugangsdaten für Paysafe Pay Later Rechnungskauf sind nicht korrekt.", + "payolutionDebit": "Die API-Zugangsdaten für Paysafe Pay Later Lastschrift sind nicht korrekt.", "sofort": "Die API-Zugangsdaten für SOFORT sind nicht korrekt." } }, diff --git a/src/Resources/app/administration/src/module/payone-payment/snippet/en_GB.json b/src/Resources/app/administration/src/module/payone-payment/snippet/en_GB.json index 27783a9f9..fc6ae7fb1 100644 --- a/src/Resources/app/administration/src/module/payone-payment/snippet/en_GB.json +++ b/src/Resources/app/administration/src/module/payone-payment/snippet/en_GB.json @@ -29,8 +29,9 @@ "debit": "The API credentials for Debit are not valid.", "paypalExpress": "The API credentials for PayPal Express are not valid.", "paypal": "The API credentials for PayPal are not valid.", - "payolutionInstallment": "The API credentials for Payolution Installment are not valid.", - "payolutionInvoicing": "The API credentials for Payolution Invoicing are not valid.", + "payolutionInstallment": "The API credentials for Paysafe Pay Later Installment are not valid.", + "payolutionInvoicing": "The API credentials for Paysafe Pay Later Invoicing are not valid.", + "payolutionDebit": "The API credentials for Paysafe Pay Later Debit are not valid.", "sofort": "The API credentials for SOFORT are not valid." } }, diff --git a/src/Resources/app/storefront/dist/storefront/js/payone-payment.js b/src/Resources/app/storefront/dist/storefront/js/payone-payment.js index c0f6bd57e..0fd71fe28 100644 --- a/src/Resources/app/storefront/dist/storefront/js/payone-payment.js +++ b/src/Resources/app/storefront/dist/storefront/js/payone-payment.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["payone-payment"],{i1fa:function(e,t,n){"use strict";n.r(t);var o=n("FGIj");function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0)return!0;if(!this.iframe.isComplete()||this.orderFormDisabled){var n=this;return window.creditCardCheckCallback=function(e){n._payoneCheckCallback(e)},this.iframe.creditCardCheck("creditCardCheckCallback"),e.preventDefault(),!1}}},{key:"_handleChangeSavedCard",value:function(){var e=document.getElementById("savedpseudocardpan");e.options[e.selectedIndex].value?i(document.getElementsByClassName("credit-card-input")).forEach((function(e){e.classList.add("hide")})):i(document.getElementsByClassName("credit-card-input")).forEach((function(e){e.classList.remove("hide")}))}},{key:"_payoneCheckCallback",value:function(e){if("VALID"===e.status)document.getElementById("pseudocardpan").value=e.pseudocardpan,document.getElementById("truncatedcardpan").value=e.truncatedcardpan,document.getElementById("cardexpiredate").value=e.cardexpiredate,this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit();else{var t=document.getElementById("confirmFormSubmit"),n=document.getElementById("errorOutput");t.removeAttribute("disabled"),n.innerHTML=e.errormessage,n.style.display="block"}}}])&&a(n.prototype,o),r&&a(n,r),t}(o.a);y={supportedCardtypes:["#","V","A","M","D","J","O","U","P"]},(s="options")in(d=m)?Object.defineProperty(d,s,{value:y,enumerable:!0,configurable:!0,writable:!0}):d[s]=y;var f=n("k8s9"),p=n("2Jwc"),v=n("3xtq");function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n0)return!0;if(!this.iframe.isComplete()){var o=document.getElementById("iframeErrorOutput");return this.iframeFieldCheckerStarted||setInterval((function(){t.iframe.isComplete()?o.style.display="none":o.style.display="block"}),250),this.iframeFieldCheckerStarted=!0,e.preventDefault(),!1}return this.orderFormDisabled?(window.payoneCreditCardCheckCallback=this._payoneCheckCallback.bind(this),this.iframe.creditCardCheck("payoneCreditCardCheckCallback"),e.preventDefault(),!1):void 0}},{key:"_handleChangeSavedCard",value:function(){var e=document.getElementById("savedpseudocardpan");e.options[e.selectedIndex].value?i(document.getElementsByClassName("credit-card-input")).forEach((function(e){e.classList.add("hide")})):i(document.getElementsByClassName("credit-card-input")).forEach((function(e){e.classList.remove("hide")}))}},{key:"_payoneCheckCallback",value:function(e){if("VALID"===e.status)document.getElementById("pseudocardpan").value=e.pseudocardpan,document.getElementById("truncatedcardpan").value=e.truncatedcardpan,document.getElementById("cardexpiredate").value=e.cardexpiredate,this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit();else{var t=document.getElementById("confirmFormSubmit"),n=document.getElementById("errorOutput");t.removeAttribute("disabled"),n.innerHTML=e.errormessage,n.style.display="block"}}}])&&a(n.prototype,o),r&&a(n,r),t}(o.a);y={supportedCardtypes:["#","V","A","M","D","J","O","U","P"]},(s="options")in(d=f)?Object.defineProperty(d,s,{value:y,enumerable:!0,configurable:!0,writable:!0}):d[s]=y;var m=n("k8s9"),p=n("2Jwc"),h=n("3xtq");function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n { + if (this.iframe.isComplete()) { + iframeError.style.display = 'none'; + } else { + iframeError.style.display = 'block'; + } + }, 250); + } - window.creditCardCheckCallback = function(response) { - me._payoneCheckCallback(response); - }; + // Flag that the check interval has started and prevent + // submitting the form. + this.iframeFieldCheckerStarted = true; + event.preventDefault(); + return false; + } - this.iframe.creditCardCheck('creditCardCheckCallback'); + // Perform the credit card check if no check was performed + // before or the prior check was not successful. + if (this.orderFormDisabled) { + window.payoneCreditCardCheckCallback = this._payoneCheckCallback.bind(this); + this.iframe.creditCardCheck('payoneCreditCardCheckCallback'); + // Prevent form submit, credit card check handler takes + // care about submitting the form. event.preventDefault(); - return false; } } diff --git a/src/Resources/app/storefront/src/scss/base.scss b/src/Resources/app/storefront/src/scss/base.scss index 1bd5c242b..979dc491e 100644 --- a/src/Resources/app/storefront/src/scss/base.scss +++ b/src/Resources/app/storefront/src/scss/base.scss @@ -19,7 +19,8 @@ $payone-logo-gutter: 1rem; .form-control.iframe { padding: 0; - border: 0; + border: .0625rem solid #d1d9e0; + border-radius: 3px; height: calc(5em - #{$payone-input-gutter}); } @@ -82,4 +83,4 @@ $payone-logo-gutter: 1rem; .installment { font-size: 0.8rem; } -} \ No newline at end of file +} diff --git a/src/Resources/public/administration/js/payone-payment.js b/src/Resources/public/administration/js/payone-payment.js index 97ee9d099..7c3d21c48 100644 --- a/src/Resources/public/administration/js/payone-payment.js +++ b/src/Resources/public/administration/js/payone-payment.js @@ -1 +1 @@ -(this.webpackJsonp=this.webpackJsonp||[]).push([["payone-payment"],{CXah:function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_settings %}\r\n \r\n\r\n \r\n{% endblock %}\r\n"},DMdC:function(e,t,n){},IoYR:function(e,t){const{Application:n}=Shopware,s=Shopware.Classes.ApiService;class a extends s{constructor(e,t,n="payone_payment"){super(e,t,n)}validateApiCredentials(e){const t=this.getBasicHeaders();return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-api-credentials`,{credentials:e},{headers:t}).then(e=>s.handleResponse(e))}}n.addServiceProvider("PayonePaymentApiCredentialsService",e=>{const t=n.getContainer("init");return new a(t.httpClient,e.loginService)})},KBQv:function(e,t){const{Application:n}=Shopware,s=Shopware.Classes.ApiService;class a extends s{constructor(e,t,n="payone"){super(e,t,n)}capturePayment(e){const t=`_action/${this.getApiBasePath()}/capture-payment`;return this.httpClient.post(t,{transaction:e},{headers:this.getBasicHeaders()}).then(e=>s.handleResponse(e))}refundPayment(e){const t=`_action/${this.getApiBasePath()}/refund-payment`;return this.httpClient.post(t,{transaction:e},{headers:this.getBasicHeaders()}).then(e=>s.handleResponse(e))}}n.addServiceProvider("PayonePaymentService",e=>{const t=n.getContainer("init");return new a(t.httpClient,e.loginService)})},Lvox:function(e,t,n){var s=n("DMdC");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("3806acf0",s,!0,{})},McCE:function(e,t,n){var s=n("McMq");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("f06f327e",s,!0,{})},McMq:function(e,t,n){},NXBA:function(e,t,n){},OPxs:function(e,t,n){"use strict";n.r(t);var s=n("mLM4"),a=n.n(s);n("McCE");const{Component:r,Mixin:i}=Shopware,{Criteria:o}=Shopware.Data;r.register("payone-settings",{template:a.a,mixins:[i.getByName("notification"),i.getByName("sw-inline-snippet")],inject:["PayonePaymentApiCredentialsService"],data:()=>({isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isTestSuccessful:!1,config:{},merchantIdFilled:!1,accountIdFilled:!1,portalIdFilled:!1,portalKeyFilled:!1,showValidationErrors:!1,isSupportModalOpen:!1}),computed:{credentialsMissing:function(){return!(this.merchantIdFilled&&this.accountIdFilled&&this.portalIdFilled&&this.portalKeyFilled)}},metaInfo(){return{title:this.$createTitle()}},methods:{paymentMethodPrefixes:()=>["creditCard","debit","paypal","paypalExpress","payolutionInvoicing","payolutionInstallment","sofort"],saveFinish(){this.isSaveSuccessful=!1},testFinish(){this.isTestSuccessful=!1},onConfigChange(e){this.config=e,this.checkCredentialsFilled(),this.showValidationErrors=!1},checkCredentialsFilled(){this.merchantIdFilled=!!this.getConfigValue("merchantId"),this.accountIdFilled=!!this.getConfigValue("accountId"),this.portalIdFilled=!!this.getConfigValue("portalId"),this.portalKeyFilled=!!this.getConfigValue("portalKey")},getConfigValue(e){const t=this.$refs.systemConfig.actualConfigData.null;return null===this.$refs.systemConfig.currentSalesChannelId?this.config[`PayonePayment.settings.${e}`]:this.config[`PayonePayment.settings.${e}`]||t[`PayonePayment.settings.${e}`]},getPaymentConfigValue(e,t){let n=e.charAt(0).toUpperCase()+e.slice(1);return this.getConfigValue(t+n)||this.getConfigValue(e)},onSave(){this.credentialsMissing?this.showValidationErrors=!0:(this.isSaveSuccessful=!1,this.isLoading=!0,this.$refs.systemConfig.saveAll().then(()=>{this.isLoading=!1,this.isSaveSuccessful=!0}).catch(()=>{this.isLoading=!1}))},onTest(){this.isTesting=!0,this.isTestSuccessful=!1;let e={};this.paymentMethodPrefixes().forEach(t=>{e[t]={merchantId:this.getPaymentConfigValue("merchantId",t),accountId:this.getPaymentConfigValue("accountId",t),portalId:this.getPaymentConfigValue("portalId",t),portalKey:this.getPaymentConfigValue("portalKey",t)}}),this.PayonePaymentApiCredentialsService.validateApiCredentials(e).then(e=>{const t=e.credentialsValid,n=e.errors;if(t)this.createNotificationSuccess({title:this.$tc("payone-payment.settingsForm.titleSuccess"),message:this.$tc("payone-payment.settingsForm.messageTestSuccess")}),this.isTestSuccessful=!0;else for(let e in n)n.hasOwnProperty(e)&&this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageTestError."+e)});this.isTesting=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageTestError.general")}),this.isTesting=!1})},getBind(e,t){return t!==this.config&&this.onConfigChange(t),this.showValidationErrors&&("PayonePayment.settings.merchantId"!==e.name||this.merchantIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.accountId"!==e.name||this.accountIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalId"!==e.name||this.portalIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalKey"!==e.name||this.portalKeyFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")})),e},getPaymentStatusCriteria(){const e=new o(1,100);return e.addFilter(o.equals("stateMachine.technicalName","order_transaction.state")),e}}});var c=n("jAFz"),l=n.n(c);n("Lvox");const{Component:p,Mixin:d}=Shopware;p.override("sw-order-detail-base",{template:l.a,inject:["PayonePaymentService"],mixins:[d.getByName("notification")],data:()=>({disableButtons:!1}),methods:{isPayonePayment:e=>!!e.customFields&&e.customFields.payone_transaction_id,isCapturePossible(e){return!!e.customFields&&(!this.disableButtons&&e.customFields.payone_allow_capture)},isRefundPossible(e){return!!e.customFields&&(!this.disableButtons&&e.customFields.payone_allow_refund)},hasPayonePayment(e){let t=this,n=!1;return!!e.transactions&&(e.transactions.map((function(e){t.isPayonePayment(e)&&(n=!0)})),n)},captureOrder(e){let t=this;this.isPayonePayment(e)&&(t.disableButtons=!0,this.PayonePaymentService.capturePayment(e.id).then(()=>{this.createNotificationSuccess({title:this.$tc("payone-payment.capture.successTitle"),message:this.$tc("payone-payment.capture.successMessage")}),t.reloadEntityData(),t.disableButtons=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.capture.errorTitle"),message:e.response.data.message}),t.disableButtons=!1}))},refundOrder(e){let t=this;this.isPayonePayment(e)&&(t.disableButtons=!0,this.PayonePaymentService.refundPayment(e.id).then(()=>{this.createNotificationSuccess({title:this.$tc("payone-payment.refund.successTitle"),message:this.$tc("payone-payment.refund.successMessage")}),t.reloadEntityData(),t.disableButtons=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.refund.errorTitle"),message:e.response.data.message}),t.disableButtons=!1}))}}});var u=n("Yjca"),m=n.n(u);n("d11z");const{Component:y}=Shopware;y.override("sw-settings-index",{template:m.a});var g=n("CXah"),h=n.n(g);const{Component:f}=Shopware;f.override("sw-plugin-list",{template:h.a});var b=n("m1C4"),P=n("eQpg");const{Module:w}=Shopware;w.register("payone-payment",{type:"plugin",name:"PayonePayment",title:"payone-payment.general.mainMenuItemGeneral",description:"payone-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",icon:"default-action-settings",snippets:{"de-DE":b,"en-GB":P},routeMiddleware(e,t){e(t)},routes:{index:{component:"payone-settings",path:"index",meta:{parentPath:"sw.settings.index"}}}});n("KBQv"),n("IoYR")},Yjca:function(e,t){e.exports='{% block sw_settings_content_card_slot_plugins %}\r\n {% parent %}\r\n\r\n \r\n \r\n \r\n{% endblock %}\r\n'},d11z:function(e,t,n){var s=n("NXBA");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("e7715378",s,!0,{})},eQpg:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Settings for PAYONE"},"capture":{"buttonTitle":"Capture","successTitle":"PAYONE","successMessage":"Capture processed successfully.","errorTitle":"PAYONE"},"refund":{"buttonTitle":"Refund","successTitle":"PAYONE","successMessage":"Refund processed successfully.","errorTitle":"PAYONE"},"settingsForm":{"save":"Save","test":"Test API Credentials","titleSuccess":"Success","titleError":"Error","messageTestSuccess":"The API credentials were verified successfully.","messageTestError":{"general":"The API credentials could not be verified successfully.","creditCard":"The API credentials for Credit Card are not valid.","debit":"The API credentials for Debit are not valid.","paypalExpress":"The API credentials for PayPal Express are not valid.","paypal":"The API credentials for PayPal are not valid.","payolutionInstallment":"The API credentials for Payolution Installment are not valid.","payolutionInvoicing":"The API credentials for Payolution Invoicing are not valid.","sofort":"The API credentials for SOFORT are not valid."}},"supportModal":{"menuButton":"Support","title":"How Can We Help You?","documentation":{"description":"Read our online manual","button":"Online Manual"},"support":{"description":"Contact our technical support","button":"Tech Support"},"repository":{"description":"Report errors on GitHub","button":"GitHub"}},"messageNotBlank":"This field must not be empty.","txid":"TXID","sequenceNumber":{"label":"Sequence Number","empty":"none"},"transactionState":"State"}}')},jAFz:function(e,t){e.exports='{% block sw_order_detail_delivery_metadata %}\r\n {% parent %}\r\n\r\n \r\n{% endblock %}\r\n'},m1C4:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Einstellungen für PAYONE"},"capture":{"buttonTitle":"Capture","successTitle":"PAYONE","successMessage":"Capture erfolgreich durchgeführt.","errorTitle":"PAYONE"},"refund":{"buttonTitle":"Refund","successTitle":"PAYONE","successMessage":"Refund erfolgreich durchgeführt.","errorTitle":"PAYONE"},"settingsForm":{"save":"Speichern","test":"API-Zugangsdaten testen","titleSuccess":"Erfolg","titleError":"Fehler","messageTestSuccess":"Die API-Zugangsdaten wurden erfolgreich validiert.","messageTestError":{"general":"Die API-Zugangsdaten konnten nicht validiert werden.","creditCard":"Die API-Zugangsdaten für Kreditkarte sind nicht korrekt.","debit":"Die API-Zugangsdaten für Lastschrift sind nicht korrekt.","paypalExpress":"Die API-Zugangsdaten für PayPal Express sind nicht korrekt.","paypal":"Die API-Zugangsdaten für PayPal sind nicht korrekt.","payolutionInstallment":"Die API-Zugangsdaten für Payolution Installment sind nicht korrekt.","payolutionInvoicing":"Die API-Zugangsdaten für Payolution Invoicing sind nicht korrekt.","sofort":"Die API-Zugangsdaten für SOFORT sind nicht korrekt."}},"supportModal":{"menuButton":"Support","title":"Wie können wir Ihnen helfen?","documentation":{"description":"Lesen Sie unsere Online-Dokumentation","button":"Dokumentation"},"support":{"description":"Kontaktieren Sie unseren technischen Support","button":"Technischer Support"},"repository":{"description":"Melden Sie Fehler und Verbesserungen auf GitHub","button":"GitHub"}},"messageNotBlank":"Dieser Wert darf nicht leer sein.","txid":"TXID","sequenceNumber":{"label":"Sequenznummer","empty":"keine"},"transactionState":"Status"}}')},mLM4:function(e,t){e.exports='{% block payone_payment %}\r\n \r\n {% block payone_payment_header %}\r\n \r\n {% endblock %}\r\n\r\n {% block payone_payment_actions %}\r\n \r\n {% endblock %}\r\n\r\n {% block payone_payment_settings_content %}\r\n \r\n {% endblock %}\r\n \r\n{% endblock %}\r\n'}},[["OPxs","runtime","vendors-node"]]]); \ No newline at end of file +(this.webpackJsonp=this.webpackJsonp||[]).push([["payone-payment"],{CXah:function(e,t){e.exports="{% block sw_plugin_list_grid_columns_actions_settings %}\r\n \r\n\r\n \r\n{% endblock %}\r\n"},DMdC:function(e,t,n){},IoYR:function(e,t){const{Application:n}=Shopware,s=Shopware.Classes.ApiService;class a extends s{constructor(e,t,n="payone_payment"){super(e,t,n)}validateApiCredentials(e){const t=this.getBasicHeaders();return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-api-credentials`,{credentials:e},{headers:t}).then(e=>s.handleResponse(e))}}n.addServiceProvider("PayonePaymentApiCredentialsService",e=>{const t=n.getContainer("init");return new a(t.httpClient,e.loginService)})},KBQv:function(e,t){const{Application:n}=Shopware,s=Shopware.Classes.ApiService;class a extends s{constructor(e,t,n="payone"){super(e,t,n)}capturePayment(e){const t=`_action/${this.getApiBasePath()}/capture-payment`;return this.httpClient.post(t,{transaction:e},{headers:this.getBasicHeaders()}).then(e=>s.handleResponse(e))}refundPayment(e){const t=`_action/${this.getApiBasePath()}/refund-payment`;return this.httpClient.post(t,{transaction:e},{headers:this.getBasicHeaders()}).then(e=>s.handleResponse(e))}}n.addServiceProvider("PayonePaymentService",e=>{const t=n.getContainer("init");return new a(t.httpClient,e.loginService)})},Lvox:function(e,t,n){var s=n("DMdC");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("3806acf0",s,!0,{})},McCE:function(e,t,n){var s=n("McMq");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("f06f327e",s,!0,{})},McMq:function(e,t,n){},NXBA:function(e,t,n){},OPxs:function(e,t,n){"use strict";n.r(t);var s=n("mLM4"),a=n.n(s);n("McCE");const{Component:r,Mixin:i}=Shopware,{Criteria:o}=Shopware.Data;r.register("payone-settings",{template:a.a,mixins:[i.getByName("notification"),i.getByName("sw-inline-snippet")],inject:["PayonePaymentApiCredentialsService"],data:()=>({isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isTestSuccessful:!1,config:{},merchantIdFilled:!1,accountIdFilled:!1,portalIdFilled:!1,portalKeyFilled:!1,showValidationErrors:!1,isSupportModalOpen:!1}),computed:{credentialsMissing:function(){return!(this.merchantIdFilled&&this.accountIdFilled&&this.portalIdFilled&&this.portalKeyFilled)}},metaInfo(){return{title:this.$createTitle()}},methods:{paymentMethodPrefixes:()=>["creditCard","debit","paypal","paypalExpress","payolutionInvoicing","payolutionInstallment","payolutionDebit","sofort"],saveFinish(){this.isSaveSuccessful=!1},testFinish(){this.isTestSuccessful=!1},onConfigChange(e){this.config=e,this.checkCredentialsFilled(),this.showValidationErrors=!1},checkCredentialsFilled(){this.merchantIdFilled=!!this.getConfigValue("merchantId"),this.accountIdFilled=!!this.getConfigValue("accountId"),this.portalIdFilled=!!this.getConfigValue("portalId"),this.portalKeyFilled=!!this.getConfigValue("portalKey")},getConfigValue(e){const t=this.$refs.systemConfig.actualConfigData.null;return null===this.$refs.systemConfig.currentSalesChannelId?this.config[`PayonePayment.settings.${e}`]:this.config[`PayonePayment.settings.${e}`]||t[`PayonePayment.settings.${e}`]},getPaymentConfigValue(e,t){let n=e.charAt(0).toUpperCase()+e.slice(1);return this.getConfigValue(t+n)||this.getConfigValue(e)},onSave(){this.credentialsMissing?this.showValidationErrors=!0:(this.isSaveSuccessful=!1,this.isLoading=!0,this.$refs.systemConfig.saveAll().then(()=>{this.isLoading=!1,this.isSaveSuccessful=!0}).catch(()=>{this.isLoading=!1}))},onTest(){this.isTesting=!0,this.isTestSuccessful=!1;let e={};this.paymentMethodPrefixes().forEach(t=>{e[t]={merchantId:this.getPaymentConfigValue("merchantId",t),accountId:this.getPaymentConfigValue("accountId",t),portalId:this.getPaymentConfigValue("portalId",t),portalKey:this.getPaymentConfigValue("portalKey",t)}}),this.PayonePaymentApiCredentialsService.validateApiCredentials(e).then(e=>{const t=e.credentialsValid,n=e.errors;if(t)this.createNotificationSuccess({title:this.$tc("payone-payment.settingsForm.titleSuccess"),message:this.$tc("payone-payment.settingsForm.messageTestSuccess")}),this.isTestSuccessful=!0;else for(let e in n)n.hasOwnProperty(e)&&this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageTestError."+e)});this.isTesting=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageTestError.general")}),this.isTesting=!1})},getBind(e,t){return t!==this.config&&this.onConfigChange(t),this.showValidationErrors&&("PayonePayment.settings.merchantId"!==e.name||this.merchantIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.accountId"!==e.name||this.accountIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalId"!==e.name||this.portalIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalKey"!==e.name||this.portalKeyFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")})),e},getPaymentStatusCriteria(){const e=new o(1,100);return e.addFilter(o.equals("stateMachine.technicalName","order_transaction.state")),e}}});var c=n("jAFz"),l=n.n(c);n("Lvox");const{Component:p,Mixin:d}=Shopware;p.override("sw-order-detail-base",{template:l.a,inject:["PayonePaymentService"],mixins:[d.getByName("notification")],data:()=>({disableButtons:!1}),methods:{isPayonePayment:e=>!!e.customFields&&e.customFields.payone_transaction_id,isCapturePossible(e){return!!e.customFields&&(!this.disableButtons&&e.customFields.payone_allow_capture)},isRefundPossible(e){return!!e.customFields&&(!this.disableButtons&&e.customFields.payone_allow_refund)},hasPayonePayment(e){let t=this,n=!1;return!!e.transactions&&(e.transactions.map((function(e){t.isPayonePayment(e)&&(n=!0)})),n)},captureOrder(e){let t=this;this.isPayonePayment(e)&&(t.disableButtons=!0,this.PayonePaymentService.capturePayment(e.id).then(()=>{this.createNotificationSuccess({title:this.$tc("payone-payment.capture.successTitle"),message:this.$tc("payone-payment.capture.successMessage")}),t.reloadEntityData(),t.disableButtons=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.capture.errorTitle"),message:e.response.data.message}),t.disableButtons=!1}))},refundOrder(e){let t=this;this.isPayonePayment(e)&&(t.disableButtons=!0,this.PayonePaymentService.refundPayment(e.id).then(()=>{this.createNotificationSuccess({title:this.$tc("payone-payment.refund.successTitle"),message:this.$tc("payone-payment.refund.successMessage")}),t.reloadEntityData(),t.disableButtons=!1}).catch(e=>{this.createNotificationError({title:this.$tc("payone-payment.refund.errorTitle"),message:e.response.data.message}),t.disableButtons=!1}))}}});var u=n("Yjca"),m=n.n(u);n("d11z");const{Component:y}=Shopware;y.override("sw-settings-index",{template:m.a});var g=n("CXah"),h=n.n(g);const{Component:f}=Shopware;f.override("sw-plugin-list",{template:h.a});var b=n("m1C4"),P=n("eQpg");const{Module:w}=Shopware;w.register("payone-payment",{type:"plugin",name:"PayonePayment",title:"payone-payment.general.mainMenuItemGeneral",description:"payone-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",icon:"default-action-settings",snippets:{"de-DE":b,"en-GB":P},routeMiddleware(e,t){e(t)},routes:{index:{component:"payone-settings",path:"index",meta:{parentPath:"sw.settings.index"}}}});n("KBQv"),n("IoYR")},Yjca:function(e,t){e.exports='{% block sw_settings_content_card_slot_plugins %}\r\n {% parent %}\r\n\r\n \r\n \r\n \r\n{% endblock %}\r\n'},d11z:function(e,t,n){var s=n("NXBA");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n("SZ7m").default)("e7715378",s,!0,{})},eQpg:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Settings for PAYONE"},"capture":{"buttonTitle":"Capture","successTitle":"PAYONE","successMessage":"Capture processed successfully.","errorTitle":"PAYONE"},"refund":{"buttonTitle":"Refund","successTitle":"PAYONE","successMessage":"Refund processed successfully.","errorTitle":"PAYONE"},"settingsForm":{"save":"Save","test":"Test API Credentials","titleSuccess":"Success","titleError":"Error","messageTestSuccess":"The API credentials were verified successfully.","messageTestError":{"general":"The API credentials could not be verified successfully.","creditCard":"The API credentials for Credit Card are not valid.","debit":"The API credentials for Debit are not valid.","paypalExpress":"The API credentials for PayPal Express are not valid.","paypal":"The API credentials for PayPal are not valid.","payolutionInstallment":"The API credentials for Paysafe Pay Later Installment are not valid.","payolutionInvoicing":"The API credentials for Paysafe Pay Later Invoicing are not valid.","payolutionDebit":"The API credentials for Paysafe Pay Later Debit are not valid.","sofort":"The API credentials for SOFORT are not valid."}},"supportModal":{"menuButton":"Support","title":"How Can We Help You?","documentation":{"description":"Read our online manual","button":"Online Manual"},"support":{"description":"Contact our technical support","button":"Tech Support"},"repository":{"description":"Report errors on GitHub","button":"GitHub"}},"messageNotBlank":"This field must not be empty.","txid":"TXID","sequenceNumber":{"label":"Sequence Number","empty":"none"},"transactionState":"State"}}')},jAFz:function(e,t){e.exports='{% block sw_order_detail_delivery_metadata %}\r\n {% parent %}\r\n\r\n \r\n{% endblock %}\r\n'},m1C4:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Einstellungen für PAYONE"},"capture":{"buttonTitle":"Capture","successTitle":"PAYONE","successMessage":"Capture erfolgreich durchgeführt.","errorTitle":"PAYONE"},"refund":{"buttonTitle":"Refund","successTitle":"PAYONE","successMessage":"Refund erfolgreich durchgeführt.","errorTitle":"PAYONE"},"settingsForm":{"save":"Speichern","test":"API-Zugangsdaten testen","titleSuccess":"Erfolg","titleError":"Fehler","messageTestSuccess":"Die API-Zugangsdaten wurden erfolgreich validiert.","messageTestError":{"general":"Die API-Zugangsdaten konnten nicht validiert werden.","creditCard":"Die API-Zugangsdaten für Kreditkarte sind nicht korrekt.","debit":"Die API-Zugangsdaten für Lastschrift sind nicht korrekt.","paypalExpress":"Die API-Zugangsdaten für PayPal Express sind nicht korrekt.","paypal":"Die API-Zugangsdaten für PayPal sind nicht korrekt.","payolutionInstallment":"Die API-Zugangsdaten für Paysafe Pay Later Ratenzahlung sind nicht korrekt.","payolutionInvoicing":"Die API-Zugangsdaten für Paysafe Pay Later Rechnungskauf sind nicht korrekt.","payolutionDebit":"Die API-Zugangsdaten für Paysafe Pay Later Lastschrift sind nicht korrekt.","sofort":"Die API-Zugangsdaten für SOFORT sind nicht korrekt."}},"supportModal":{"menuButton":"Support","title":"Wie können wir Ihnen helfen?","documentation":{"description":"Lesen Sie unsere Online-Dokumentation","button":"Dokumentation"},"support":{"description":"Kontaktieren Sie unseren technischen Support","button":"Technischer Support"},"repository":{"description":"Melden Sie Fehler und Verbesserungen auf GitHub","button":"GitHub"}},"messageNotBlank":"Dieser Wert darf nicht leer sein.","txid":"TXID","sequenceNumber":{"label":"Sequenznummer","empty":"keine"},"transactionState":"Status"}}')},mLM4:function(e,t){e.exports='{% block payone_payment %}\r\n \r\n {% block payone_payment_header %}\r\n \r\n {% endblock %}\r\n\r\n {% block payone_payment_actions %}\r\n \r\n {% endblock %}\r\n\r\n {% block payone_payment_settings_content %}\r\n \r\n {% endblock %}\r\n \r\n{% endblock %}\r\n'}},[["OPxs","runtime","vendors-node"]]]); \ No newline at end of file diff --git a/src/Resources/translations/de_DE/messages.de-DE.json b/src/Resources/translations/de_DE/messages.de-DE.json index 5d5a99839..63e347014 100644 --- a/src/Resources/translations/de_DE/messages.de-DE.json +++ b/src/Resources/translations/de_DE/messages.de-DE.json @@ -8,7 +8,8 @@ "cardNumber": "Kartennummer", "securityCode": "CVV", "expiryDate": "Gültig bis", - "savedCards": "Gespeicherte Karte" + "savedCards": "Gespeicherte Karte", + "iframeError": "Bitte prüfen Sie, ob alle Felder korrekt und vollständig ausgefüllt sind." }, "debit": { "accountOwner": "Kontoinhaber", @@ -88,6 +89,7 @@ }, "document": { "clearingReference": "Referenz: %reference%", + "invoicingDescription": "Bitte überweisen Sie den ausstehenden Betrag auf das folgende Konto:", "iban": "IBAN: %iban%", "bic": "BIC: %bic%" }, diff --git a/src/Resources/translations/en_GB/messages.en-GB.json b/src/Resources/translations/en_GB/messages.en-GB.json index b3282bf5b..07fa12c6f 100644 --- a/src/Resources/translations/en_GB/messages.en-GB.json +++ b/src/Resources/translations/en_GB/messages.en-GB.json @@ -8,7 +8,8 @@ "cardNumber": "Card number", "securityCode": "Security code", "expiryDate": "Expiry date", - "savedCards": "Saved card" + "savedCards": "Saved card", + "iframeError": "Please verify the fields and make sure no field is empty." }, "debit": { "accountOwner": "Account owner", @@ -88,6 +89,7 @@ }, "document": { "clearingReference": "Reference: %reference%", + "invoicingDescription": "Please transfer the outstanding amount to the following bank account:", "iban": "IBAN: %iban%", "bic": "BIC: %bic%" }, diff --git a/src/Resources/views/framework/documents/invoice.html.twig b/src/Resources/views/documents/invoice.html.twig similarity index 83% rename from src/Resources/views/framework/documents/invoice.html.twig rename to src/Resources/views/documents/invoice.html.twig index 939d566f8..594413379 100644 --- a/src/Resources/views/framework/documents/invoice.html.twig +++ b/src/Resources/views/documents/invoice.html.twig @@ -21,6 +21,8 @@ {% endblock %} {% if order.extensions.payone_document %} +
+ {{ 'PayonePayment.payolution.document.invoicingDescription' | trans }} {% block document_payment_payone_invoicing_iban %} {{ 'PayonePayment.payolution.document.iban' | trans({'%iban%': order.extensions.payone_document.iban}) }}
{% endblock %} @@ -30,6 +32,15 @@ {% endblock %} {% endif %} {% endif %} + + {% if constant('PayonePayment\\PaymentMethod\\PayonePayolutionDebit::UUID') == order.transactions.first.paymentMethod.id %} + {% block document_payment_payone_debit_clearing_reference %} + {% if order.transactions.first.customFields.payone_clearing_reference %} +
+ {{ 'PayonePayment.payolution.document.clearingReference' | trans({'%reference%': order.transactions.first.customFields.payone_clearing_reference}) }}
+ {% endif %} + {% endblock %} + {% endif %} {% endblock %} {% block document_footer_bank_name %} @@ -70,4 +81,4 @@ {% else %} {{ parent() }} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/Resources/views/storefront/payone/account/card.html.twig b/src/Resources/views/storefront/payone/account/card.html.twig index 9b85488b0..45c39d22a 100644 --- a/src/Resources/views/storefront/payone/account/card.html.twig +++ b/src/Resources/views/storefront/payone/account/card.html.twig @@ -39,7 +39,7 @@ {% if card.expiresAt <= date() %} ({{ "PayonePayment.cardPage.expired" | trans }}) {% else %} - ({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt|format_date('medium', 'none', locale, 'UTC')}) }}) + ({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt | format_date('medium')}) }}) {% endif %} diff --git a/src/Resources/views/storefront/payone/credit-card/credit-card-form.html.twig b/src/Resources/views/storefront/payone/credit-card/credit-card-form.html.twig index 0d4a06c96..88f81e3a1 100644 --- a/src/Resources/views/storefront/payone/credit-card/credit-card-form.html.twig +++ b/src/Resources/views/storefront/payone/credit-card/credit-card-form.html.twig @@ -23,7 +23,7 @@ {% if card.expiresAt > date() %} {% endif %} {% endfor %} @@ -63,6 +63,9 @@
+
diff --git a/src/Storefront/Controller/Account/AccountCardController.php b/src/Storefront/Controller/Account/AccountCardController.php index adeeec726..f25c6106c 100644 --- a/src/Storefront/Controller/Account/AccountCardController.php +++ b/src/Storefront/Controller/Account/AccountCardController.php @@ -39,7 +39,7 @@ public function cardOverview(Request $request, SalesChannelContext $context): Re $page = $this->accountCardPageLoader->load($request, $context); - return $this->renderStorefront('@Storefront/payone/account/card.html.twig', ['page' => $page]); + return $this->renderStorefront('@Storefront/storefront/payone/account/card.html.twig', ['page' => $page]); } /** diff --git a/src/Storefront/Controller/Account/AccountMandateController.php b/src/Storefront/Controller/Account/AccountMandateController.php index 70b664a1c..b72d9f701 100644 --- a/src/Storefront/Controller/Account/AccountMandateController.php +++ b/src/Storefront/Controller/Account/AccountMandateController.php @@ -39,7 +39,7 @@ public function mandateOverview(Request $request, SalesChannelContext $context): $page = $this->accountMandatePageLoader->load($request, $context); - return $this->renderStorefront('@Storefront/payone/account/mandate.html.twig', ['page' => $page]); + return $this->renderStorefront('@Storefront/storefront/payone/account/mandate.html.twig', ['page' => $page]); } /**