diff --git a/app/code/community/Mollie/Mpm/Block/Payment/Info/Base.php b/app/code/community/Mollie/Mpm/Block/Payment/Info/Base.php index aad5b27..0051211 100644 --- a/app/code/community/Mollie/Mpm/Block/Payment/Info/Base.php +++ b/app/code/community/Mollie/Mpm/Block/Payment/Info/Base.php @@ -159,4 +159,63 @@ public function getcardLabel() return ''; } + + public function getIssuer() + { + try { + $issuerCodeToName = [ + 'ideal_ABNANL2A' => 'ABN AMRO', + 'ideal_INGBNL2A' => 'ING', + 'ideal_RABONL2U' => 'Rabobank', + 'ideal_ASNBNL21' => 'ASN Bank', + 'ideal_BUNQNL2A' => 'Bunq', + 'ideal_HANDNL2A' => 'Handelsbanken', + 'ideal_KNABNL2H' => 'Knab', + 'ideal_RBRBNL21' => 'Regiobank', + 'ideal_REVOLT21' => 'Revolut', + 'ideal_SNSBNL2A' => 'SNS Bank', + 'ideal_TRIONL2U' => 'Triodos', + 'ideal_FVLBNL22' => 'Van Lanschot', + ]; + + $issuer = $this->getInfo()->getAdditionalInformation('selected_issuer'); + if (array_key_exists($issuer, $issuerCodeToName)) { + return $issuerCodeToName[$issuer]; + } + + return $issuer; + } catch (\Exception $exception) { + return null; + } + } + + public function getConsumerName() + { + try { + $details = json_decode($this->getInfo()->getAdditionalInformation('details'), true); + return $details['consumerName']; + } catch (\Exception $exception) { + return null; + } + } + + public function getIban() + { + try { + $details = json_decode($this->getInfo()->getAdditionalInformation('details'), true); + return $details['consumerAccount']; + } catch (\Exception $exception) { + return null; + } + } + + public function getBic() + { + try { + $details = json_decode($this->getInfo()->getAdditionalInformation('details'), true); + return $details['consumerBic']; + } catch (\Exception $exception) { + return null; + } + } } diff --git a/app/code/community/Mollie/Mpm/Model/Client/Payments.php b/app/code/community/Mollie/Mpm/Model/Client/Payments.php index cd2a2ef..5471875 100644 --- a/app/code/community/Mollie/Mpm/Model/Client/Payments.php +++ b/app/code/community/Mollie/Mpm/Model/Client/Payments.php @@ -255,6 +255,8 @@ public function processTransaction(Mage_Sales_Model_Order $order, $type = 'webho $msg = array('success' => true, 'status' => 'paid', 'order_id' => $orderId, 'type' => $type); $this->mollieHelper->addTolog('success', $msg); $this->checkCheckoutSession($order, $paymentToken, $paymentData, $type); + $order->save(); + return $msg; } diff --git a/app/design/adminhtml/default/default/template/mollie/mpm/payment/info/base.phtml b/app/design/adminhtml/default/default/template/mollie/mpm/payment/info/base.phtml index 955f121..43bb1b9 100644 --- a/app/design/adminhtml/default/default/template/mollie/mpm/payment/info/base.phtml +++ b/app/design/adminhtml/default/default/template/mollie/mpm/payment/info/base.phtml @@ -78,6 +78,32 @@ $status = $this->getPaymentStatus(); + + getIssuer()): ?> +