Skip to content

Commit

Permalink
Revert "change from iDeal 1.0 to iDeal 2.0"
Browse files Browse the repository at this point in the history
This reverts commit f8fbd2a.
  • Loading branch information
SergejSavic committed Sep 26, 2024
1 parent 8a602a0 commit 4105112
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,13 @@ private function displayIssuers()
private function renderIssuerList()
{
$template = PathProvider::getShopTemplatePath('mollie_issuer_list.html');
$issuers = $this->_formatIssuers();

if ($this->paymentMethod->getId() === 'ideal') {
$issuers = array();
}

return mollie_render_template(
$template,
[
'isLegacy' => $this->versionCompatibilityProvider->isLegacyVersion(),
'payment_method' => $this->code,
'issuers' => $issuers,
'issuers' => $this->_formatIssuers(),
'list_type' => $this->issuerListType,
]
);
Expand Down
39 changes: 2 additions & 37 deletions GXModules/Mollie/Mollie/Shop/Javascripts/mollie-issuers.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
(function () {
(function() {
document.addEventListener("DOMContentLoaded", function () {
let issuerListWrappers = document.querySelectorAll('.mollie-issuer-list-wrapper');
const paymentMethods = document.querySelectorAll('input[type="radio"]');

//switch to iDeal 2.0 without issuers
paymentMethods.forEach(function (method) {
if (method.value.includes('mollie_')) {
if (method.value === 'mollie_ideal') {
if (method.checked) {
hideIdealCheckoutPaymentForm();
}
method.addEventListener('click', function () {
hideIdealCheckoutPaymentForm();
});
}
}
});

//in case if ideal is the only available payment method, it won't be shown as radio button but as li element
const issuerMethod = document.querySelector('li.mollie_ideal');
if (issuerMethod) {
hideIdealCheckoutPaymentForm();
}

for (let i = 0; i < issuerListWrappers.length; i++) {
addIssuerListListeners(issuerListWrappers[i]);
}

let checkoutForm = document.querySelector('#checkout_payment');
checkoutForm.addEventListener('submit', async event => {
//skip checking issuer selection for iDeal 2.0 payment method
let activeMethod = getActiveMethod();
if (activeMethod.classList.contains('mollie_ideal')) {
return;
}

if (!isIssuersSelected()) {
showIssuerErrorMessage();
event.preventDefault();
Expand Down Expand Up @@ -124,12 +96,5 @@
return document.querySelector('.list-group-item.active');
}

function hideIdealCheckoutPaymentForm() {
let checkoutPaymentForm = document.querySelector('.checkout-payment-form');
if (checkoutPaymentForm) {
checkoutPaymentForm.style.display = 'none';
}
}

});
})();
})();

0 comments on commit 4105112

Please sign in to comment.