diff --git a/Block/Payment/Checkout/Info.php b/Block/Payment/Checkout/Info.php index f3e8c40..159d92a 100644 --- a/Block/Payment/Checkout/Info.php +++ b/Block/Payment/Checkout/Info.php @@ -36,4 +36,13 @@ public function getSveaCheckoutId() return ""; } } + + public function getSveaCustomerReference() + { + try { + return $this->getInfo()->getAdditionalInformation('svea_customer_reference'); + } catch (\Exception $e) { + return ""; + } + } } diff --git a/Model/Checkout.php b/Model/Checkout.php index 8448024..37534dc 100644 --- a/Model/Checkout.php +++ b/Model/Checkout.php @@ -597,6 +597,10 @@ public function placeOrder(GetOrderResponse $sveaOrder, Quote $quote) //set payment $payment = $quote->getPayment(); + $customerReference = $sveaOrder->getCustomerReference(); + if ($customerReference) { + $payment->setAdditionalInformation('svea_customer_reference', $customerReference); + } //force payment method if (!$payment->getMethod() || $payment->getMethod() != $this->_paymentMethod) { diff --git a/view/adminhtml/templates/payment/checkout/info.phtml b/view/adminhtml/templates/payment/checkout/info.phtml index e4f07aa..85e9f3b 100644 --- a/view/adminhtml/templates/payment/checkout/info.phtml +++ b/view/adminhtml/templates/payment/checkout/info.phtml @@ -1,16 +1,27 @@ -
escapeHtml($block->getMethod()->getTitle()); ?>
+
escapeHtml($block->getMethod()->getTitle()); ?>
- - + + - - + + + getSveaCustomerReference()): ?> + + + +
escapeHtml(__('Svea Checkout Order ID')); ?>:escapeHtml($block->getSveaCheckoutId()); ?>escapeHtml(__('Svea Checkout Order ID')); ?>:escapeHtml($block->getSveaCheckoutId()); ?>
escapeHtml(__('Svea Payment Method')); ?>:escapeHtml($block->getSveaPaymentMethod()); ?>escapeHtml(__('Svea Payment Method')); ?>:escapeHtml($block->getSveaPaymentMethod()); ?>
escapeHtml(__('Svea Customer Payment Reference')) ?>:escapeHtml($block->getSveaCustomerReference()) ?> +
\ No newline at end of file