From e27865f807cd44ee51350a489e3253ade069df9f Mon Sep 17 00:00:00 2001 From: ivan_bojovic Date: Wed, 30 Dec 2020 16:54:33 +0100 Subject: [PATCH 1/6] Fix issues with mollie components when it is only payment method Adjust for GX4 ISSUE: CS-1591 --- .../Mollie/Shop/Javascripts/mollie-components.js | 9 +++++++++ .../Mollie/Shop/Javascripts/mollie-credit-card.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-components.js b/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-components.js index b5fcba31..279f467f 100644 --- a/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-components.js +++ b/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-components.js @@ -111,6 +111,9 @@ var MollieComponents = window.MollieComponents || {}; function getSelectedMethod() { let selectedMethod = document.querySelector('input[name=payment]:checked'); + if (!selectedMethod && isCreditCardOnlyPayment()) { + selectedMethod = document.querySelector('input[name=payment]'); + } return selectedMethod ? selectedMethod.value : null; } @@ -149,6 +152,12 @@ var MollieComponents = window.MollieComponents || {}; function isMounted() { return document.querySelectorAll('.mollie-component').length > 0; } + + function isCreditCardOnlyPayment() { + let paymentMethods = document.querySelectorAll('li.list-group-item'); + + return paymentMethods.length === 1 && paymentMethods[0].classList.contains('mollie_creditcard'); + } } MollieComponents.creditCard = new CreditCardService(); diff --git a/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-credit-card.js b/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-credit-card.js index f288b87a..04e55bb7 100644 --- a/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-credit-card.js +++ b/GXModules/Mollie/Mollie/Shop/Javascripts/mollie-credit-card.js @@ -27,14 +27,24 @@ return selectedMethod.value === 'mollie_creditcard'; } + selectedMethod = document.querySelector('input[name=payment]'); + if (selectedMethod.type === 'hidden') { + return selectedMethod.value === 'mollie_creditcard'; + } + return false; } function mountIfActive() { let creditCardWrapper = document.querySelector('.mollie_creditcard'); - if (creditCardWrapper && creditCardWrapper.classList.contains('active')) { + let isActive = creditCardWrapper.classList.contains('active') || isCreditCardOnlyPayment(); + if (creditCardWrapper && isActive) { MollieComponents.creditCard.mount(cardWrapper); } } + + function isCreditCardOnlyPayment() { + return paymentMethods.length === 1 && paymentMethods[0].classList.contains('mollie_creditcard'); + } }); })(); \ No newline at end of file From 6ee45ca95a5f4f5ec2ab030e47debb36130ca537 Mon Sep 17 00:00:00 2001 From: ivan_bojovic Date: Wed, 20 Jan 2021 14:42:44 +0100 Subject: [PATCH 2/6] Add assets files on checkout for Honeygrid (template) theme ISSUE: CS-1589 --- .../All/module/checkout_payment_block.html | 13 +++++++++++++ .../checkout_payment_modules.html | 0 2 files changed, 13 insertions(+) create mode 100644 GXModules/Mollie/Mollie/Shop/Templates/All/module/checkout_payment_block.html rename GXModules/Mollie/Mollie/Shop/Themes/{Honeygrid => All}/checkout_payment_modules.html (100%) diff --git a/GXModules/Mollie/Mollie/Shop/Templates/All/module/checkout_payment_block.html b/GXModules/Mollie/Mollie/Shop/Templates/All/module/checkout_payment_block.html new file mode 100644 index 00000000..8055e9e4 --- /dev/null +++ b/GXModules/Mollie/Mollie/Shop/Templates/All/module/checkout_payment_block.html @@ -0,0 +1,13 @@ +{block name="module_checkout_payment_block_list"} + + + + + + + + + + {$smarty.block.parent} + +{/block} \ No newline at end of file diff --git a/GXModules/Mollie/Mollie/Shop/Themes/Honeygrid/checkout_payment_modules.html b/GXModules/Mollie/Mollie/Shop/Themes/All/checkout_payment_modules.html similarity index 100% rename from GXModules/Mollie/Mollie/Shop/Themes/Honeygrid/checkout_payment_modules.html rename to GXModules/Mollie/Mollie/Shop/Themes/All/checkout_payment_modules.html From 7366fcb11155fc38b3c734a575169dbf83e042df Mon Sep 17 00:00:00 2001 From: ivan_bojovic Date: Wed, 20 Jan 2021 17:03:27 +0100 Subject: [PATCH 3/6] Add notification record on order cancel event Removed canceling order on mollie when cancel event detected ISSUE: CS-1654 --- .../Mollie_AdminApplicationTopExtender.inc.php | 9 +++++++-- .../Mollie_OrderActionExtender.inc.php | 14 ++++++++------ .../dutch/module_center_module.mollie.lang.inc.php | 3 +++ .../module_center_module.mollie.lang.inc.php | 3 +++ .../module_center_module.mollie.lang.inc.php | 3 +++ .../module_center_module.mollie.lang.inc.php | 3 +++ 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/GXModules/Mollie/Mollie/Admin/Overloads/AdminApplicationTopExtenderComponent/Mollie_AdminApplicationTopExtender.inc.php b/GXModules/Mollie/Mollie/Admin/Overloads/AdminApplicationTopExtenderComponent/Mollie_AdminApplicationTopExtender.inc.php index 66c04ef0..d7a25783 100644 --- a/GXModules/Mollie/Mollie/Admin/Overloads/AdminApplicationTopExtenderComponent/Mollie_AdminApplicationTopExtender.inc.php +++ b/GXModules/Mollie/Mollie/Admin/Overloads/AdminApplicationTopExtenderComponent/Mollie_AdminApplicationTopExtender.inc.php @@ -3,9 +3,10 @@ use Mollie\BusinessLogic\Http\DTO\Amount; use Mollie\BusinessLogic\Http\DTO\Orders\Order; use Mollie\BusinessLogic\Http\DTO\Orders\OrderLine; -use Mollie\BusinessLogic\Integration\Event\IntegrationOrderCanceledEvent; use Mollie\BusinessLogic\Integration\Event\IntegrationOrderLineChangedEvent; use Mollie\BusinessLogic\Integration\Event\IntegrationOrderTotalChangedEvent; +use Mollie\BusinessLogic\Notifications\NotificationHub; +use Mollie\BusinessLogic\Notifications\NotificationText; use Mollie\BusinessLogic\OrderReference\OrderReferenceService; use Mollie\BusinessLogic\PaymentMethod\Model\PaymentMethodConfig; use Mollie\Gambio\Utility\MollieModuleChecker; @@ -71,7 +72,11 @@ private function handleOrderCancel() { try { $orderId = $_POST['gm_multi_status'][0]; - $this->_getEventBus()->fire(new IntegrationOrderCanceledEvent($orderId)); + NotificationHub::pushInfo( + new NotificationText('mollie.payment.integration.event.notification.order_cancel.title'), + new NotificationText('mollie.payment.integration.event.notification.order_cancel.description'), + $orderId + ); } catch (Exception $exception) { $langKey = 'mollie.payment.integration.event.notification.order_cancel_error.description'; $this->pushMessage('error', $langKey, $exception); diff --git a/GXModules/Mollie/Mollie/Admin/Overloads/OrderActions/Mollie_OrderActionExtender.inc.php b/GXModules/Mollie/Mollie/Admin/Overloads/OrderActions/Mollie_OrderActionExtender.inc.php index ee2fc870..8a05dd5b 100644 --- a/GXModules/Mollie/Mollie/Admin/Overloads/OrderActions/Mollie_OrderActionExtender.inc.php +++ b/GXModules/Mollie/Mollie/Admin/Overloads/OrderActions/Mollie_OrderActionExtender.inc.php @@ -1,8 +1,7 @@ fire(new IntegrationOrderCanceledEvent($orderId)); + + NotificationHub::pushInfo( + new NotificationText('mollie.payment.integration.event.notification.order_cancel.title'), + new NotificationText('mollie.payment.integration.event.notification.order_cancel.description'), + $orderId + ); } parent::cancelOrder( diff --git a/GXModules/Mollie/Mollie/Admin/TextPhrases/dutch/module_center_module.mollie.lang.inc.php b/GXModules/Mollie/Mollie/Admin/TextPhrases/dutch/module_center_module.mollie.lang.inc.php index f67309c7..53216c50 100755 --- a/GXModules/Mollie/Mollie/Admin/TextPhrases/dutch/module_center_module.mollie.lang.inc.php +++ b/GXModules/Mollie/Mollie/Admin/TextPhrases/dutch/module_center_module.mollie.lang.inc.php @@ -106,6 +106,9 @@ 'mollie.payment.integration.event.notification.order_cancel_error.title' => 'Synchronisatie van winkelwijziging mislukt', 'mollie.payment.integration.event.notification.order_cancel_error.description' => 'De bestelling van Mollie kan niet worden geannuleerd. Reactie Mollie API: {api_message}', + 'mollie.payment.integration.event.notification.order_cancel.title' => 'Order cancel event detected', + 'mollie.payment.integration.event.notification.order_cancel.description' => 'Order cancel is not supported, so this change is not synchronized to the Mollie', + 'mollie.payment.integration.event.notification.billing_address_change_error.title' => 'Synchronisatie van winkelwijziging mislukt', 'mollie.payment.integration.event.notification.billing_address_change_error.description' => 'Het factuuradres van de Mollie-bestelling kan niet worden bijgewerkt. Reactie Mollie API: {api_message}', diff --git a/GXModules/Mollie/Mollie/Admin/TextPhrases/english/module_center_module.mollie.lang.inc.php b/GXModules/Mollie/Mollie/Admin/TextPhrases/english/module_center_module.mollie.lang.inc.php index 224151bf..356cdd74 100755 --- a/GXModules/Mollie/Mollie/Admin/TextPhrases/english/module_center_module.mollie.lang.inc.php +++ b/GXModules/Mollie/Mollie/Admin/TextPhrases/english/module_center_module.mollie.lang.inc.php @@ -108,6 +108,9 @@ 'mollie.payment.integration.event.notification.order_cancel_error.title' => 'Shop change synchronization failed', 'mollie.payment.integration.event.notification.order_cancel_error.description' => 'Failed to cancel Mollie order. Mollie api response {api_message}', + 'mollie.payment.integration.event.notification.order_cancel.title' => 'Order cancel event detected', + 'mollie.payment.integration.event.notification.order_cancel.description' => 'Order cancel is not supported, so this change is not synchronized to the Mollie', + 'mollie.payment.integration.event.notification.billing_address_change_error.title' => 'Shop change synchronization failed', 'mollie.payment.integration.event.notification.billing_address_change_error.description' => 'Failed to update billing address on Mollie order. Mollie api response {api_message}', diff --git a/GXModules/Mollie/Mollie/Admin/TextPhrases/french/module_center_module.mollie.lang.inc.php b/GXModules/Mollie/Mollie/Admin/TextPhrases/french/module_center_module.mollie.lang.inc.php index ed8fb8ee..2845376c 100755 --- a/GXModules/Mollie/Mollie/Admin/TextPhrases/french/module_center_module.mollie.lang.inc.php +++ b/GXModules/Mollie/Mollie/Admin/TextPhrases/french/module_center_module.mollie.lang.inc.php @@ -106,6 +106,9 @@ 'mollie.payment.integration.event.notification.order_cancel_error.title' => 'La synchronisation du changement de magasin a échoué', 'mollie.payment.integration.event.notification.order_cancel_error.description' => "Échec de l'annulation de la commande Mollie. Réponse de l'api Mollie {api_message}", + 'mollie.payment.integration.event.notification.order_cancel.title' => 'Order cancel event detected', + 'mollie.payment.integration.event.notification.order_cancel.description' => 'Order cancel is not supported, so this change is not synchronized to the Mollie', + 'mollie.payment.integration.event.notification.billing_address_change_error.title' => 'La synchronisation du changement de magasin a échoué', 'mollie.payment.integration.event.notification.billing_address_change_error.description' => "Échec de la mise à jour de l'adresse de facturation de la commande Mollie. Réponse de l'api Mollie {api_message}", diff --git a/GXModules/Mollie/Mollie/Admin/TextPhrases/german/module_center_module.mollie.lang.inc.php b/GXModules/Mollie/Mollie/Admin/TextPhrases/german/module_center_module.mollie.lang.inc.php index 00ea34b0..bae094c8 100755 --- a/GXModules/Mollie/Mollie/Admin/TextPhrases/german/module_center_module.mollie.lang.inc.php +++ b/GXModules/Mollie/Mollie/Admin/TextPhrases/german/module_center_module.mollie.lang.inc.php @@ -67,6 +67,9 @@ 'mollie.payment.integration.event.notification.order_cancel_error.title' => 'Synchronisieren von Shop-Änderungen fehlgeschlagen', 'mollie.payment.integration.event.notification.order_cancel_error.description' => 'Mollie-Bestellung konnte nicht storniert werden. Antwort Mollie-API {api_message}', + 'mollie.payment.integration.event.notification.order_cancel.title' => 'Order cancel event detected', + 'mollie.payment.integration.event.notification.order_cancel.description' => 'Order cancel is not supported, so this change is not synchronized to the Mollie', + 'mollie.payment.integration.event.notification.billing_address_change_error.title' => 'Synchronisieren von Shop-Änderungen fehlgeschlagen', 'mollie.payment.integration.event.notification.billing_address_change_error.description' => 'Aktualisieren der Rechnungsadresse für die Mollie-Bestellung fehlgeschlagen. Antwort Mollie-API {api_message}', From 33ee0e6e78a3eae225ba8240dafe470fd4bf1b35 Mon Sep 17 00:00:00 2001 From: "predrag.krstojevic" Date: Thu, 21 Jan 2021 15:34:15 +0100 Subject: [PATCH 4/6] Update version 2.0.5 --- .../Components/Services/Business/ConfigurationService.php | 2 +- README.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GXModules/Mollie/Mollie/Components/Services/Business/ConfigurationService.php b/GXModules/Mollie/Mollie/Components/Services/Business/ConfigurationService.php index 9b634c00..02de6145 100644 --- a/GXModules/Mollie/Mollie/Components/Services/Business/ConfigurationService.php +++ b/GXModules/Mollie/Mollie/Components/Services/Business/ConfigurationService.php @@ -12,7 +12,7 @@ */ class ConfigurationService extends Configuration { - const MOLLIE_GAMBIO_VERSION = '2.0.4'; + const MOLLIE_GAMBIO_VERSION = '2.0.5'; /** * @inheritDoc diff --git a/README.md b/README.md index 5c5c6acc..8699f853 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,11 @@ The payment methods are disabled by default in your account so you firstly need 6. **Check if there is any information in the logfile `Toolbox` » `Show logs`** # Release notes +*2.0.5* +- Bugfix: Fix issues with mollie components when it is only payment method. +- Bugfix: Restock product quantity, recalculate delivery status and reset article status when order is canceled during the checkout due to failed payment. +- Bugfix: Add assets files on the checkout for Honeygrid theme. + *2.0.4* - Bugfix: Use first available language for status name fallback instead of English. From 0099321d78b6c635acc82ebbb7b791a1439d4f38 Mon Sep 17 00:00:00 2001 From: "predrag.krstojevic" Date: Thu, 21 Jan 2021 15:57:40 +0100 Subject: [PATCH 5/6] Fix mollie components style issue on Honeygrid --- GXModules/Mollie/Mollie/Shop/Styles/mollie-credit-card.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GXModules/Mollie/Mollie/Shop/Styles/mollie-credit-card.css b/GXModules/Mollie/Mollie/Shop/Styles/mollie-credit-card.css index d55a57d9..155c0fe7 100644 --- a/GXModules/Mollie/Mollie/Shop/Styles/mollie-credit-card.css +++ b/GXModules/Mollie/Mollie/Shop/Styles/mollie-credit-card.css @@ -18,7 +18,7 @@ .mollie-component-wrapper .form-group--verificationCode { position: relative; min-height: 52px; - margin-bottom: 0; + margin: 0; } .mollie-component-wrapper label { From 2172ea4ea9555dbdc84cbd0b6f4a5e47e0fda883 Mon Sep 17 00:00:00 2001 From: "predrag.krstojevic" Date: Thu, 21 Jan 2021 16:49:30 +0100 Subject: [PATCH 6/6] Update readme file --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8699f853..2a7dca33 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,6 @@ The payment methods are disabled by default in your account so you firstly need # Release notes *2.0.5* - Bugfix: Fix issues with mollie components when it is only payment method. -- Bugfix: Restock product quantity, recalculate delivery status and reset article status when order is canceled during the checkout due to failed payment. - Bugfix: Add assets files on the checkout for Honeygrid theme. *2.0.4*