-
-
-
-
+
+
+
0
@@ -139,32 +150,26 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ class="sw-button--small"
+ :is-loading="loading.addDebit"
+ :process-success="processSuccess"
+ @click="onClickButtonAddDebit">
{{ $t('ratepay.orderManagement.action.addDebit') }}
@@ -173,36 +178,30 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ class="sw-button--small"
+ :is-loading="loading.addCredit"
+ :process-success="processSuccess"
+ @click="onClickButtonAddCredit">
{{ $t('ratepay.orderManagement.action.addCredit') }}
-
+
diff --git a/src/Resources/app/administration/src/module/sw-order/component/ratepay-order-management/ratepay-order-management.scss b/src/Resources/app/administration/src/module/sw-order/component/ratepay-order-management/ratepay-order-management.scss
index 79dfb3c8..d2e99ed5 100644
--- a/src/Resources/app/administration/src/module/sw-order/component/ratepay-order-management/ratepay-order-management.scss
+++ b/src/Resources/app/administration/src/module/sw-order/component/ratepay-order-management/ratepay-order-management.scss
@@ -4,52 +4,63 @@
// file that was distributed with this source code.
.ratepay-article-panel {
- .sw-data-grid.is--compact {
- border-top: 1px solid #D1D9E0;
-
- .sw-data-grid__cell--quantity {
- .sw-data-grid__cell-content {
- padding: 0;
-
- &, div, select {
- height: 100%;
- }
- }
-
- .sw-block-field__block {
- border: 0;
- }
-
- select {
- text-align: left;
- padding-right: 30px;
- background: transparent;
- }
- }
- }
+ .sw-data-grid.is--compact {
+ border-top: 1px solid #D1D9E0;
+
+ .sw-data-grid__cell--quantity {
+ padding: 1rem;
- & > .sw-card__content {
+ .sw-data-grid__cell-content {
padding: 0;
- .button-group {
- margin-bottom: 15px;
- padding-left: 10px;
- padding-right: 10px;
+ &, div, select {
+ height: 100%;
+ }
+
+ .mt-field input, .mt-field select, .mt-field textarea {
+ padding: 0;
+ text-align: center;
}
+ }
+ .sw-block-field__block {
+ border: 0;
+ }
+
+ select {
+ text-align: left;
+ padding-right: 30px;
+ background: transparent;
+ }
}
- .sw-tabs__custom-content {
- padding-bottom: 0;
+ .sw-data-grid__cell {
+ .mt-number-field__controls {
+ display: flex;
+ }
}
+ }
+
+ & > .sw-card__content {
+ padding: 0;
+ .button-group {
+ margin-bottom: 15px;
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+ }
+
+ .sw-tabs__custom-content {
+ padding-bottom: 0;
+ }
}
.rp-price-field {
- &.hide-lock {
- .sw-price-field__lock {
- visibility: hidden;
- }
+ &.hide-lock {
+ .sw-price-field__lock {
+ visibility: hidden;
}
+ }
}
diff --git a/src/Resources/app/administration/src/module/sw-order/page/sw-order-detail/index.js b/src/Resources/app/administration/src/module/sw-order/page/sw-order-detail/index.js
index 08eb03ab..1e431054 100644
--- a/src/Resources/app/administration/src/module/sw-order/page/sw-order-detail/index.js
+++ b/src/Resources/app/administration/src/module/sw-order/page/sw-order-detail/index.js
@@ -2,7 +2,7 @@ import template from './sw-order-detail.html.twig';
import deDE from "./snippet/de-DE.json";
import enGB from "./snippet/en-GB.json";
-const {Component, State} = Shopware;
+const {Component} = Shopware;
Component.override('sw-order-detail', {
template,
@@ -11,36 +11,14 @@ Component.override('sw-order-detail', {
'en-GB': enGB
},
- methods: {
- /**
- * @deprecated will be removed in future releases which are only compatible with Shopware versions > 6.5
- */
- createdComponent() {
- this.$super('createdComponent');
- this._65to64LoadOrderBackwardCompatibility();
- },
+ computed: {
+ orderCriteria() {
+ const criteria = this.$super('orderCriteria');
- /**
- * @deprecated will be removed in future releases which are only compatible with Shopware versions > 6.5
- * this is a workaround for Shopware versions < 6.5.
- * in older SW Versions the order entity is not available in the global state/store, so we need to fetch the order
- * manually.
- *
- * if you also need to load the order for your own extension, please copy the method to your own module with
- * the same name. So we make sure that the order got loaded for your module and the Ratepay module, without loading it multiple times.
- * please do not forget to copy the method `createdComponent()`.
- */
- _65to64LoadOrderBackwardCompatibility() {
- if (this.versionContext || (this.order && this.order.id === this.orderId)) {
- // if the versionContext has been already set, it seems like FEATURE_NEXT_7530 has been enabled or
- // shopware is on version > 6.5.
- return;
- }
+ criteria.addAssociation('ratepayData');
+ criteria.addAssociation('lineItems.ratepayData');
- State.commit('swOrderDetail/setLoading', ['order', true]);
- this.orderRepository.get(this.orderId, Shopware.Context.api, this.orderCriteria).then((response) => {
- State.commit('swOrderDetail/setOrder', response);
- });
+ return criteria;
}
}
});
diff --git a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/index.js b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/index.js
index ad0c9679..e37d02a8 100644
--- a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/index.js
+++ b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/index.js
@@ -5,6 +5,8 @@ const {Component} = Shopware;
Component.override('sw-order-list', {
template,
+ inject: ['repositoryFactory'],
+
data() {
return {
ratepayCreateOrderModal: false,
@@ -12,6 +14,7 @@ Component.override('sw-order-list', {
};
},
+
methods: {
openRatepayCreateOrderModal() {
this.ratepayCreateOrderModal = true
diff --git a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig
index 62bb5721..9e25b4d3 100644
--- a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig
+++ b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig
@@ -4,6 +4,7 @@
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
#}
+
{% block sw_order_list_smart_bar_actions_add %}
{% parent %}
@@ -15,11 +16,14 @@
{% endblock %}
{% block sw_order_list_content_slot %}
- {% parent %}
+ {% parent %}
-
+ @modal-close="ratepayCreateOrderModal = false">
+
+
{% endblock %}
@@ -33,8 +37,8 @@
{% endblock %}
{% block sw_order_list_delete_modal_confirm %}
-
+
{{ $tc('sw-order.list.buttonDelete') }}
-
+
{% endblock %}
diff --git a/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/index.js b/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/index.js
index b0acf7f5..b5eb8b55 100644
--- a/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/index.js
+++ b/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/index.js
@@ -7,10 +7,9 @@
import template from './sw-order-detail-ratepay.html.twig';
-const {Component} = Shopware;
-const {mapState} = Component.getComponentHelper();
+const {Component, Store} = Shopware;
-Shopware.Component.register('sw-order-detail-ratepay', {
+Component.register('sw-order-detail-ratepay', {
template,
metaInfo() {
@@ -20,9 +19,7 @@ Shopware.Component.register('sw-order-detail-ratepay', {
},
computed: {
- ...mapState('swOrderDetail', [
- 'order',
- ]),
+ order: () => Store.get('swOrderDetail').order,
},
created() {
diff --git a/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/sw-order-detail-ratepay.html.twig b/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/sw-order-detail-ratepay.html.twig
index 016b89d7..dc454a78 100644
--- a/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/sw-order-detail-ratepay.html.twig
+++ b/src/Resources/app/administration/src/module/sw-order/view/sw-order-detail-ratepay/sw-order-detail-ratepay.html.twig
@@ -4,7 +4,7 @@
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
#}
-
+
diff --git a/src/Resources/app/storefront/dist/storefront/js/rpay-payments/rpay-payments.js b/src/Resources/app/storefront/dist/storefront/js/rpay-payments/rpay-payments.js
index 62251350..3d4e5321 100644
--- a/src/Resources/app/storefront/dist/storefront/js/rpay-payments/rpay-payments.js
+++ b/src/Resources/app/storefront/dist/storefront/js/rpay-payments/rpay-payments.js
@@ -1 +1,3 @@
-(()=>{"use strict";var t={857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function i(t,e,r){return t.concat(e).map(function(t){return n(t,r)})}function s(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function o(t,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=n;var c,u,h=Array.isArray(r);return h!==Array.isArray(t)?n(r,l):h?l.arrayMerge(t,r,l):(u={},(c=l).isMergeableObject(t)&&s(t).forEach(function(e){u[e]=n(t[e],c)}),s(r).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&c.isMergeableObject(r[e])?u[e]=(function(t,e){if(!e.customMerge)return o;var r=e.customMerge(t);return"function"==typeof r?r:o})(e,c)(t[e],r[e],c):u[e]=n(r[e],c))}),u)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return o(t,r,e)},{})},t.exports=o}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}(()=>{r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e}})(),(()=>{r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{var t=r(857),e=r.n(t);class n{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let r=n.toUpperCamelCase(t,e);return n.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class i{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!i.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===i.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=e.replace(/^data(|-)/,""),a=n.toLowerCamelCase(s,"-");if(!i.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let o=t.dataset[a];if(void 0===o){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return o}return n.parsePrimitive(o)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelector(e)||!1;if(r&&!1===n)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return n}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelectorAll(e);if(0===n.length&&(n=!1),r&&!1===n)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return n}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n select:not([tabindex^="-"]):not([disabled]),\n textarea:not([tabindex^="-"]):not([disabled]),\n button:not([tabindex^="-"]):not([disabled]),\n a[href]:not([tabindex^="-"]):not([disabled]),\n [tabindex]:not([tabindex^="-"]):not([disabled])\n ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}class s{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(n),n}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,i=t.split("."),s=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=s;s=function(r){n.unsubscribe(t),e(r)}}return this.el.addEventListener(i[0],s),this.listeners.push({splitEventName:i,opts:r,cb:s}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class a{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let r=n.toDashCase(this._pluginName),s=i.getDataAttribute(this.el,"data-".concat(r,"-config"),!1),a=i.getAttribute(this.el,"data-".concat(r,"-options"),!1),o=[this.constructor.options,this.options,t];s&&o.push(window.PluginConfigManager.get(this._pluginName,s));try{a&&o.push(JSON.parse(a))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(r,'-options" could not be parsed to json: ').concat(t.message))}return e().all(o.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},r=!1){if(!i.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}class o{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var r of t.entries())e(r[1],r[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(r=>{e(t[r],r)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}let l="loader",c={BEFORE:"before",INNER:"inner"};class u{create(){if(!this.exists()){if(this.position===c.INNER){this.parent.innerHTML=u.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),u.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(l));o.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(l)).length>0}_getPosition(){return this.position===c.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'
\n Loading...\n
')}static SELECTOR_CLASS(){return l}constructor(t,e=c.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}class h{get(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",n=this._createPreparedRequest("GET",t,r);return this._sendRequest(n,null,e)}post(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("POST",t,n);return this._sendRequest(i,e,r)}delete(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("DELETE",t,n);return this._sendRequest(i,e,r)}patch(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("PATCH",t,n);return this._sendRequest(i,e,r)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,r){return this._registerOnLoaded(t,r),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,r){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}let d=null;class p extends a{init(){this._runtimeSelect=this.el.querySelector("#rp-btn-runtime"),this._rateInput=this.el.querySelector("#rp-rate-value"),this._rateButton=this.el.querySelector("#rp-rate-button"),this._resultContainer=this.el.querySelector("#rp-result-container"),this._typeHolder=this.el.querySelector("#rp-calculation-type"),this._valueHolder=this.el.querySelector("#rp-calculation-value"),this._registerEvents()}_registerEvents(){this._runtimeSelect&&this._runtimeSelect.addEventListener("change",this._onSelectRuntime.bind(this)),this._rateInput&&this._rateInput.addEventListener("input",this._onInputRate.bind(this)),this._rateButton&&this._rateButton.addEventListener("click",this._onSubmitRate.bind(this)),this._registerInstallmentPlanEvents()}_registerInstallmentPlanEvents(){this._showInstallmentPlanDetailsButton=this._resultContainer.querySelector("#rp-show-installment-plan-details"),this._hideInstallmentPlanDetailsButton=this._resultContainer.querySelector("#rp-hide-installment-plan-details"),this._installmentPlanDetails=this._resultContainer.querySelectorAll(".rp-installment-plan-details"),this._showInstallmentPlanDetailsButton.addEventListener("click",this._onShowInstallmentPlanDetailsButtonClicked.bind(this)),this._hideInstallmentPlanDetailsButton.addEventListener("click",this._onHideInstallmentPlanDetailsButtonClicked.bind(this))}_onSelectRuntime(){this._fetchInstallmentPlan(this.options.calculationTypeTime,this._runtimeSelect.value)}_onInputRate(){""===this._rateInput.value?this._rateButton.setAttribute("disabled","disabled"):this._rateButton.removeAttribute("disabled")}_onSubmitRate(){this._fetchInstallmentPlan(this.options.calculationTypeRate,this._rateInput.value)}_onShowInstallmentPlanDetailsButtonClicked(){this._hide([this._showInstallmentPlanDetailsButton]),this._show([this._hideInstallmentPlanDetailsButton]),this._show(this._installmentPlanDetails,"table-row")}_onHideInstallmentPlanDetailsButtonClicked(){this._hide([this._hideInstallmentPlanDetailsButton]),this._show([this._showInstallmentPlanDetailsButton]),this._hide(this._installmentPlanDetails,"table-row")}_fetchInstallmentPlan(t,e){let r=new h(window.accessKey,window.contextToken),n="".concat(window.rpInstallmentCalculateUrl,"?type=").concat(t,"&value=").concat(e);this._activateLoader(),d&&d.abort(),d=r.get(n,this._executeCallback.bind(this,r=>{this._setContent(r),this._typeHolder.value=t,this._valueHolder.value=e,this._registerInstallmentPlanEvents(),window.PluginManager.initializePlugins()}))}_activateLoader(){this._setContent('
'.concat(u.getTemplate(),"
"))}_executeCallback(t,e){"function"==typeof t&&t(e)}_setContent(t){this._resultContainer.innerHTML=t}_hide(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.showCls,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.hiddenCls;t.forEach(t=>{t&&(t.classList.remove(e),t.classList.add(r))})}_show(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.showCls,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.hiddenCls;t.forEach(t=>{t&&(t.classList.add(e),t.classList.remove(r))})}}p.options={hiddenCls:"d-none",showCls:"d-block",calculationTypeTime:"time",calculationTypeRate:"rate"};class m extends a{init(){this._sepaForm=this.el.querySelector("#rp-sepa-form"),this.el.querySelectorAll(this.options.selectorTypeField).forEach(t=>{t.addEventListener("change",this._onChangeType.bind(this))}),this._onChangeType()}_onChangeType(){this.el.querySelector(this.options.selectorTypeField+":checked").value===this.options.paymentTypeDirectDebit?this._showSepaForm():this._hideSepaForm()}_hideSepaForm(){this._sepaForm&&(this._sepaForm.querySelector("#rp-iban-account-holder").removeAttribute("required"),this._sepaForm.querySelector("#rp-iban-account-number").removeAttribute("required"),this._sepaForm.querySelector("#rp-sepa-confirmation").removeAttribute("required"),this._sepaForm.querySelector("#rp-iban-account-holder").setAttribute("disabled","disabled"),this._sepaForm.querySelector("#rp-iban-account-number").setAttribute("disabled","disabled"),this._sepaForm.querySelector("#rp-sepa-confirmation").setAttribute("disabled","disabled"))}_showSepaForm(){this._sepaForm&&(this._sepaForm.querySelector("#rp-iban-account-holder").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-iban-account-number").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-sepa-confirmation").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-iban-account-holder").setAttribute("required","required"),this._sepaForm.querySelector("#rp-iban-account-number").setAttribute("required","required"),this._sepaForm.querySelector("#rp-sepa-confirmation").setAttribute("required","required"))}}m.options={paymentTypeBankTransfer:"BANK-TRANSFER",paymentTypeDirectDebit:"DIRECT-DEBIT",selectorTypeField:'input[name="ratepay[installment][paymentType]"]'};let b=window.PluginManager,_=b.getPluginList();"RatepayInstallment"in _||b.register("RatepayInstallment",p,'[data-ratepay-installment="true"]'),"RatepayInstallmentPaymentSwitch"in _||b.register("RatepayInstallmentPaymentSwitch",m,'[data-ratepay-installment-payment-switch="true"]')})()})();
\ No newline at end of file
+(()=>{"use strict";var t={156:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l(Array.isArray(t)?[]:{},t,e):t}function n(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function r(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function l(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||n,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=s;var u,h,c=Array.isArray(i);return c!==Array.isArray(t)?s(i,o):c?o.arrayMerge(t,i,o):(h={},(u=o).isMergeableObject(t)&&r(t).forEach(function(e){h[e]=s(t[e],u)}),r(i).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&u.isMergeableObject(i[e])?h[e]=(function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l})(e,u)(t[e],i[e],u):h[e]=s(i[e],u))}),h)}l.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return l(t,i,e)},{})},t.exports=l}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s=i(156),n=i.n(s);class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class a{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=t.split("."),r=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=r;r=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:i,cb:r}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class l{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),n().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}let o="loader",u={BEFORE:"before",INNER:"inner"};class h{constructor(t,e=u.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}create(){if(!this.exists()){if(this.position===u.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=h.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),h.getTemplate())}}remove(){if(this.position===u.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${o}`).forEach(t=>t.remove())}exists(){return this.parent.querySelectorAll(`.${o}`).length>0}_getPosition(){return this.position===u.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`
+ Loading...
+
`}static SELECTOR_CLASS(){return o}}class c{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,i);return this._sendRequest(s,null,e)}post(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let n=this._createPreparedRequest("POST",t,s);return this._sendRequest(n,e,i)}delete(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let n=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(n,e,i)}patch(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let n=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(n,e,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn(`the request to ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}let p=null;class d extends l{static #t=this.options={hiddenCls:"d-none",showCls:"d-block",calculationTypeTime:"time",calculationTypeRate:"rate"};init(){this._runtimeSelect=this.el.querySelector("#rp-btn-runtime"),this._rateInput=this.el.querySelector("#rp-rate-value"),this._rateButton=this.el.querySelector("#rp-rate-button"),this._resultContainer=this.el.querySelector("#rp-result-container"),this._typeHolder=this.el.querySelector("#rp-calculation-type"),this._valueHolder=this.el.querySelector("#rp-calculation-value"),this._registerEvents()}_registerEvents(){this._runtimeSelect&&this._runtimeSelect.addEventListener("change",this._onSelectRuntime.bind(this)),this._rateInput&&this._rateInput.addEventListener("input",this._onInputRate.bind(this)),this._rateButton&&this._rateButton.addEventListener("click",this._onSubmitRate.bind(this)),this._registerInstallmentPlanEvents()}_registerInstallmentPlanEvents(){this._showInstallmentPlanDetailsButton=this._resultContainer.querySelector("#rp-show-installment-plan-details"),this._hideInstallmentPlanDetailsButton=this._resultContainer.querySelector("#rp-hide-installment-plan-details"),this._installmentPlanDetails=this._resultContainer.querySelectorAll(".rp-installment-plan-details"),this._showInstallmentPlanDetailsButton.addEventListener("click",this._onShowInstallmentPlanDetailsButtonClicked.bind(this)),this._hideInstallmentPlanDetailsButton.addEventListener("click",this._onHideInstallmentPlanDetailsButtonClicked.bind(this))}_onSelectRuntime(){this._fetchInstallmentPlan(this.options.calculationTypeTime,this._runtimeSelect.value)}_onInputRate(){""===this._rateInput.value?this._rateButton.setAttribute("disabled","disabled"):this._rateButton.removeAttribute("disabled")}_onSubmitRate(){this._fetchInstallmentPlan(this.options.calculationTypeRate,this._rateInput.value)}_onShowInstallmentPlanDetailsButtonClicked(){this._hide([this._showInstallmentPlanDetailsButton]),this._show([this._hideInstallmentPlanDetailsButton]),this._show(this._installmentPlanDetails,"table-row")}_onHideInstallmentPlanDetailsButtonClicked(){this._hide([this._hideInstallmentPlanDetailsButton]),this._show([this._showInstallmentPlanDetailsButton]),this._hide(this._installmentPlanDetails,"table-row")}_fetchInstallmentPlan(t,e){let i=new c(window.accessKey,window.contextToken),s=`${window.rpInstallmentCalculateUrl}?type=${t}&value=${e}`;this._activateLoader(),p&&p.abort(),p=i.get(s,this._executeCallback.bind(this,i=>{this._setContent(i),this._typeHolder.value=t,this._valueHolder.value=e,this._registerInstallmentPlanEvents(),window.PluginManager.initializePlugins()}))}_activateLoader(){this._setContent(`
${h.getTemplate()}
`)}_executeCallback(t,e){"function"==typeof t&&t(e)}_setContent(t){this._resultContainer.innerHTML=t}_hide(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.showCls,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.hiddenCls;t.forEach(t=>{t&&(t.classList.remove(e),t.classList.add(i))})}_show(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.showCls,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.hiddenCls;t.forEach(t=>{t&&(t.classList.add(e),t.classList.remove(i))})}}class _ extends l{static #t=this.options={paymentTypeBankTransfer:"BANK-TRANSFER",paymentTypeDirectDebit:"DIRECT-DEBIT",selectorTypeField:'input[name="ratepay[installment][paymentType]"]'};init(){this._sepaForm=this.el.querySelector("#rp-sepa-form"),this.el.querySelectorAll(this.options.selectorTypeField).forEach(t=>{t.addEventListener("change",this._onChangeType.bind(this))}),this._onChangeType()}_onChangeType(){this.el.querySelector(this.options.selectorTypeField+":checked").value===this.options.paymentTypeDirectDebit?this._showSepaForm():this._hideSepaForm()}_hideSepaForm(){this._sepaForm&&(this._sepaForm.querySelector("#rp-iban-account-holder").removeAttribute("required"),this._sepaForm.querySelector("#rp-iban-account-number").removeAttribute("required"),this._sepaForm.querySelector("#rp-sepa-confirmation").removeAttribute("required"),this._sepaForm.querySelector("#rp-iban-account-holder").setAttribute("disabled","disabled"),this._sepaForm.querySelector("#rp-iban-account-number").setAttribute("disabled","disabled"),this._sepaForm.querySelector("#rp-sepa-confirmation").setAttribute("disabled","disabled"))}_showSepaForm(){this._sepaForm&&(this._sepaForm.querySelector("#rp-iban-account-holder").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-iban-account-number").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-sepa-confirmation").removeAttribute("disabled"),this._sepaForm.querySelector("#rp-iban-account-holder").setAttribute("required","required"),this._sepaForm.querySelector("#rp-iban-account-number").setAttribute("required","required"),this._sepaForm.querySelector("#rp-sepa-confirmation").setAttribute("required","required"))}}let m=window.PluginManager,g=m.getPluginList();"RatepayInstallment"in g||m.register("RatepayInstallment",d,'[data-ratepay-installment="true"]'),"RatepayInstallmentPaymentSwitch"in g||m.register("RatepayInstallmentPaymentSwitch",_,'[data-ratepay-installment-payment-switch="true"]')})();
\ No newline at end of file
diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml
index 25768cf6..ca6fb9d1 100644
--- a/src/Resources/config/services.xml
+++ b/src/Resources/config/services.xml
@@ -23,6 +23,10 @@
+
+
+
+
diff --git a/src/Resources/public/administration/assets/rpay-payments-Bh0AbCMf.js b/src/Resources/public/administration/assets/rpay-payments-Bh0AbCMf.js
new file mode 100644
index 00000000..f6cab5a4
--- /dev/null
+++ b/src/Resources/public/administration/assets/rpay-payments-Bh0AbCMf.js
@@ -0,0 +1,8 @@
+const Zt=`{# ~ Copyright (c) 2020 Ratepay GmbH ~ ~ For the full copyright and license information, please view the LICENSE ~ file that was distributed with this source code. #}