From e2dbddbcd93bbdf676ed92a38100e6610633a1e1 Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Tue, 31 Aug 2021 08:50:59 +0200 Subject: [PATCH 1/3] Make sure that when the Klarna exception is thrown no rollback is done --- app/code/community/Mollie/Mpm/Model/Mollie.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/community/Mollie/Mpm/Model/Mollie.php b/app/code/community/Mollie/Mpm/Model/Mollie.php index 23f06c6..da361dc 100644 --- a/app/code/community/Mollie/Mpm/Model/Mollie.php +++ b/app/code/community/Mollie/Mpm/Model/Mollie.php @@ -167,6 +167,9 @@ public function processTransaction($orderId, $type = 'webhook', $paymentToken = } else { return $this->paymentsApi->processTransaction($order, $type, $paymentToken); } + } catch (Mollie_Mpm_Exceptions_KlarnaException $exception) { + // No rollback, save is done in the finally. + throw $exception; } catch (\Exception $exception) { $connection->rollback(); throw $exception; From 3b0e21dc5b88cf053b0cae7a83367617c5761db9 Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Tue, 31 Aug 2021 09:05:11 +0200 Subject: [PATCH 2/3] Feature: Sort issuers by name --- app/code/community/Mollie/Mpm/Block/Payment/Form.php | 12 ++++++++++++ .../default/template/mollie/mpm/payment/form.phtml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/code/community/Mollie/Mpm/Block/Payment/Form.php b/app/code/community/Mollie/Mpm/Block/Payment/Form.php index 97f8eac..73edc8f 100644 --- a/app/code/community/Mollie/Mpm/Block/Payment/Form.php +++ b/app/code/community/Mollie/Mpm/Block/Payment/Form.php @@ -113,4 +113,16 @@ public function getIssuerTitle($code) return $this->__('Select Issuer'); } + /** + * @param \Mollie\Api\Resources\IssuerCollection $issuers + */ + public function sortIssuers($issuers) + { + $issuers->uasort(function($a, $b) { + return strcmp(strtolower($a->name), strtolower($b->name)); + }); + + return $issuers; + } + } diff --git a/app/design/frontend/base/default/template/mollie/mpm/payment/form.phtml b/app/design/frontend/base/default/template/mollie/mpm/payment/form.phtml index 4007482..a8a7faa 100644 --- a/app/design/frontend/base/default/template/mollie/mpm/payment/form.phtml +++ b/app/design/frontend/base/default/template/mollie/mpm/payment/form.phtml @@ -52,7 +52,7 @@ $method = $this->getMethodByCode($code);