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}', 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/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 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 { 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 diff --git a/README.md b/README.md index 5c5c6acc..2a7dca33 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,10 @@ 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: Add assets files on the checkout for Honeygrid theme. + *2.0.4* - Bugfix: Use first available language for status name fallback instead of English.