From 39e40019360028a6ecb2c52b816490f7e29ccf5c Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 7 Dec 2020 13:17:27 +0100 Subject: [PATCH 1/7] Bugfix: Add SVG image to QR option --- Model/Mollie.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Model/Mollie.php b/Model/Mollie.php index 3091ad51d12..5f7bc8527d6 100644 --- a/Model/Mollie.php +++ b/Model/Mollie.php @@ -616,7 +616,10 @@ public function getIssuers($mollieApi, $method, $issuerListType) 'resource' => 'issuer', 'id' => '', 'name' => __('QR Code'), - 'image' => ['size2x' => $this->assetRepository->getUrl("Mollie_Payment::images/qr-select.svg")] + 'image' => [ + 'size2x' => $this->assetRepository->getUrl('Mollie_Payment::images/qr-select.svg'), + 'svg' => $this->assetRepository->getUrl('Mollie_Payment::images/qr-select.svg'), + ] ]; } From 661b734211a753992beac34ad81758a016d6b85b Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 7 Dec 2020 13:25:16 +0100 Subject: [PATCH 2/7] Bugfix: Too few arguments to function Mollie\Payment\Plugin\Config\LoadCorrectGroup::beforeGetConfigByPath --- Plugin/Config/LoadCorrectGroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/Config/LoadCorrectGroup.php b/Plugin/Config/LoadCorrectGroup.php index 760bfcfc4ef..2e17437350f 100644 --- a/Plugin/Config/LoadCorrectGroup.php +++ b/Plugin/Config/LoadCorrectGroup.php @@ -10,7 +10,7 @@ class LoadCorrectGroup { - public function beforeGetConfigByPath(Loader $subject, $path, $scope, $scopeId, $full) + public function beforeGetConfigByPath(Loader $subject, $path, $scope, $scopeId, $full = true) { $groups = ['mollie_second_chance_email', 'mollie_advanced', 'mollie_payment_methods', 'mollie_general']; if (in_array($path, $groups)) { From a67100869c8ec86b049cf29cd78f0c15099bea86 Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 7 Dec 2020 14:03:42 +0100 Subject: [PATCH 3/7] Added configuration for 'Use webhooks' --- etc/adminhtml/system.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 57f47707b17..d2b7bfd9889 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -223,6 +223,23 @@ payment/mollie_general/loading_screen + + + Mollie\Payment\Model\Adminhtml\Source\WebhookUrlOptions + payment/mollie_general/use_webhooks + Note: This setting has only effect when the store deploy mode is in development. When the store deploy mode is in production, this setting is ignored and the webhooks are always enabled. + ]]> + + + + payment/mollie_general/custom_webhook_url + + custom_url + + Date: Mon, 7 Dec 2020 12:50:25 +0100 Subject: [PATCH 4/7] Feature: Dispatch an event when processing the transaction --- Model/Client/Orders.php | 26 ++++++++++++++++++++++---- Model/Client/Payments.php | 22 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/Model/Client/Orders.php b/Model/Client/Orders.php index 14a0c4fc4a2..f414aa0ef14 100644 --- a/Model/Client/Orders.php +++ b/Model/Client/Orders.php @@ -7,6 +7,7 @@ namespace Mollie\Payment\Model\Client; use Magento\Catalog\Model\Product\Type as ProductType; +use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Message\ManagerInterface; @@ -24,6 +25,7 @@ use Magento\Checkout\Model\Session as CheckoutSession; use Mollie\Api\Exceptions\ApiException; use Mollie\Api\MollieApiClient; +use Mollie\Api\Resources\Order as MollieOrder; use Mollie\Api\Types\OrderStatus; use Mollie\Payment\Config; use Mollie\Payment\Helper\General as MollieHelper; @@ -139,6 +141,11 @@ class Orders extends AbstractModel */ private $transactionProcessor; + /** + * @var EventManager + */ + private $eventManager; + /** * Orders constructor. * @@ -164,6 +171,7 @@ class Orders extends AbstractModel * @param Config $config * @param DashboardUrl $dashboardUrl * @param TransactionProcessor $transactionProcessor + * @param EventManager $eventManager */ public function __construct( OrderLines $orderLines, @@ -187,7 +195,8 @@ public function __construct( BuildTransaction $buildTransaction, Config $config, DashboardUrl $dashboardUrl, - TransactionProcessor $transactionProcessor + TransactionProcessor $transactionProcessor, + EventManager $eventManager ) { $this->orderLines = $orderLines; $this->orderSender = $orderSender; @@ -211,6 +220,7 @@ public function __construct( $this->config = $config; $this->dashboardUrl = $dashboardUrl; $this->transactionProcessor = $transactionProcessor; + $this->eventManager = $eventManager; } /** @@ -300,12 +310,20 @@ public function getAddressLine($address) /** * @param Order $order - * @param $mollieOrder + * @param MollieOrder $mollieOrder * * @throws LocalizedException */ public function processResponse(Order $order, $mollieOrder) { + $eventData = [ + 'order' => $order, + 'mollie_order' => $mollieOrder, + ]; + + $this->eventManager->dispatch('mollie_process_response', $eventData); + $this->eventManager->dispatch('mollie_process_response_orders_api', $eventData); + $this->mollieHelper->addTolog('response', $mollieOrder); $order->getPayment()->setAdditionalInformation('checkout_url', $mollieOrder->getCheckoutUrl()); $order->getPayment()->setAdditionalInformation('checkout_type', self::CHECKOUT_TYPE); @@ -923,11 +941,11 @@ public function createOrderRefund(Order\Creditmemo $creditmemo, Order $order) * an exception and the user is unable to create an order. This code checks if the selected lines are already * marked as shipped. If that's the case a warning will be shown, but the order is still created. * - * @param \Mollie\Api\Resources\Order $mollieOrder + * @param MollieOrder $mollieOrder * @param $orderLines * @return bool */ - private function itemsAreShippable(\Mollie\Api\Resources\Order $mollieOrder, $orderLines) + private function itemsAreShippable(MollieOrder $mollieOrder, $orderLines) { $lines = []; foreach ($orderLines['lines'] as $line) { diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php index 28b0c1a20b9..46385828bef 100644 --- a/Model/Client/Payments.php +++ b/Model/Client/Payments.php @@ -6,6 +6,7 @@ namespace Mollie\Payment\Model\Client; +use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Exception\LocalizedException; use Magento\Sales\Api\Data\OrderInterface; @@ -15,6 +16,7 @@ use Magento\Sales\Model\OrderRepository; use Magento\Checkout\Model\Session as CheckoutSession; use Mollie\Api\MollieApiClient; +use Mollie\Api\Resources\Payment as MolliePayment; use Mollie\Api\Types\PaymentStatus; use Mollie\Payment\Config; use Mollie\Payment\Helper\General as MollieHelper; @@ -79,6 +81,11 @@ class Payments extends AbstractModel */ private $transactionProcessor; + /** + * @var EventManager + */ + private $eventManager; + /** * Payments constructor. * @@ -93,6 +100,7 @@ class Payments extends AbstractModel * @param DashboardUrl $dashboardUrl * @param Transaction $transaction * @param TransactionProcessor $transactionProcessor + * @param EventManager $eventManager */ public function __construct( OrderSender $orderSender, @@ -105,7 +113,8 @@ public function __construct( Config $config, DashboardUrl $dashboardUrl, Transaction $transaction, - TransactionProcessor $transactionProcessor + TransactionProcessor $transactionProcessor, + EventManager $eventManager ) { $this->orderSender = $orderSender; $this->invoiceSender = $invoiceSender; @@ -118,6 +127,7 @@ public function __construct( $this->dashboardUrl = $dashboardUrl; $this->transaction = $transaction; $this->transactionProcessor = $transactionProcessor; + $this->eventManager = $eventManager; } /** @@ -197,10 +207,18 @@ public function getAddressLine($address) /** * @param Order $order - * @param $payment + * @param MolliePayment $payment */ public function processResponse(Order $order, $payment) { + $eventData = [ + 'order' => $order, + 'mollie_payment' => $payment, + ]; + + $this->eventManager->dispatch('mollie_process_response', $eventData); + $this->eventManager->dispatch('mollie_process_response_payments_api', $eventData); + $this->mollieHelper->addTolog('response', $payment); $order->getPayment()->setAdditionalInformation('checkout_url', $payment->getCheckoutUrl()); $order->getPayment()->setAdditionalInformation('checkout_type', self::CHECKOUT_TYPE); From 11ccffc7eaf923d16c9930a0bbf39978bc1f9c69 Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 7 Dec 2020 14:37:06 +0100 Subject: [PATCH 5/7] Feature: Allow to sent a payment reminder for canceled orders --- .../Sales/Block/Adminhtml/Order/Buttons/SecondChanceButton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/Sales/Block/Adminhtml/Order/Buttons/SecondChanceButton.php b/Plugin/Sales/Block/Adminhtml/Order/Buttons/SecondChanceButton.php index 6eb27f24b7b..d350c0e9de2 100644 --- a/Plugin/Sales/Block/Adminhtml/Order/Buttons/SecondChanceButton.php +++ b/Plugin/Sales/Block/Adminhtml/Order/Buttons/SecondChanceButton.php @@ -41,7 +41,7 @@ public function add(View $view) } $state = $view->getOrder()->getState(); - if (!in_array($state, [Order::STATE_NEW, Order::STATE_PENDING_PAYMENT])) { + if (!in_array($state, [Order::STATE_NEW, Order::STATE_PENDING_PAYMENT, Order::STATE_CANCELED])) { return; } From c359e882986be161db419984e32ba0895accb6d7 Mon Sep 17 00:00:00 2001 From: Frank Tiggelman Date: Mon, 14 Dec 2020 11:10:28 +0100 Subject: [PATCH 6/7] Translated Mollie Components Labels --- i18n/de_DE.csv | 6 +++++- i18n/en_US.csv | 6 +++++- i18n/fr_FR.csv | 6 +++++- i18n/nl_NL.csv | 6 +++++- .../template/payment/creditcard-with-components.html | 12 ++++++------ 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index 1a0175df4f6..3287f9b675b 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -281,4 +281,8 @@ "Increment ID","Inkrementierungs-ID" "Firstname","Vorname" "Lastname","Nachname" -"E-mail","E-Mail-Adresse" \ No newline at end of file +"E-mail","E-Mail-Adresse" +"Card Holder","Kartenhalter" +"Card Number","Kartennummer" +"Expiry Date","Verfallsdatum" +"Verification Code", "Verifizierungs-Schlüssel" \ No newline at end of file diff --git a/i18n/en_US.csv b/i18n/en_US.csv index e07b8cc7d24..610436c4531 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -281,4 +281,8 @@ "Increment ID","Increment ID" "Firstname","Firstname" "Lastname","Lastname" -"E-mail","E-mail" \ No newline at end of file +"E-mail","E-mail" +"Card Holder","Card Holder" +"Card Number","Card Number" +"Expiry Date","Expiry Date" +"Verification Code", "Verification Code" \ No newline at end of file diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 4df94b29a16..b4959f6a163 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -281,4 +281,8 @@ "Increment ID","Numéro d'incrément" "Firstname","Prénom" "Lastname","Nom" -"E-mail","E-mail" \ No newline at end of file +"E-mail","E-mail" +"Card Holder","Titulaire de la carte" +"Card Number","Numéro de carte" +"Expiry Date","Date d'expiration" +"Verification Code", "Code de vérification" \ No newline at end of file diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index c3b51076fae..31a7c02a28c 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -281,4 +281,8 @@ "Increment ID","ID Verhogen" "Firstname","Voornaam" "Lastname","Achternaam" -"E-mail","E-mail" \ No newline at end of file +"E-mail","E-mail" +"Card Holder","Kaarthouder" +"Card Number","Kaartnummer" +"Expiry Date","Vervaldatum" +"Verification Code", "Verificatie code" \ No newline at end of file diff --git a/view/frontend/web/template/payment/creditcard-with-components.html b/view/frontend/web/template/payment/creditcard-with-components.html index a800ce385aa..de1b9a77fbe 100644 --- a/view/frontend/web/template/payment/creditcard-with-components.html +++ b/view/frontend/web/template/payment/creditcard-with-components.html @@ -6,9 +6,9 @@ data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/> @@ -18,19 +18,19 @@
- +
- +
- +
- +
From 95ad413ae657e54783c422b272719bed136a808d Mon Sep 17 00:00:00 2001 From: Marvin-Magmodules Date: Mon, 14 Dec 2020 15:17:00 +0100 Subject: [PATCH 7/7] version bump --- composer.json | 2 +- etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d0eb2c469ab..e16b303dcb2 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "mollie/magento2", "description": "Mollie Payment Module for Magento 2", - "version": "1.19.0", + "version": "1.20.0", "keywords": [ "mollie", "payment", diff --git a/etc/config.xml b/etc/config.xml index 1cb15d5bd91..02d1972bebc 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -3,7 +3,7 @@ - v1.19.0 + v1.20.0 0 0 test