From dffe46673bf67d67f3588111d881f168c5943b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89bano=20Penha=20Andrello=20Lopes?= Date: Mon, 29 Jan 2018 17:51:48 -0200 Subject: [PATCH] Version 2.2.0 - MAG1-119 - MAG1-117 - MAG1-101 - Put back implementation of MAG1-101, previously reverted --- Block/Adminhtml/CaseInfo.php | 89 ++++++++++++++++++++++ view/adminhtml/layout/sales_order_view.xml | 4 + view/adminhtml/templates/case_info.phtml | 38 +++++++++ 3 files changed, 131 insertions(+) create mode 100644 Block/Adminhtml/CaseInfo.php create mode 100644 view/adminhtml/templates/case_info.phtml diff --git a/Block/Adminhtml/CaseInfo.php b/Block/Adminhtml/CaseInfo.php new file mode 100644 index 00000000..159b80d4 --- /dev/null +++ b/Block/Adminhtml/CaseInfo.php @@ -0,0 +1,89 @@ +caseEntity = $caseEntity; + $this->coreRegistry = $registry; + + parent::__construct($context, $data); + } + + /** + * Gets case entity associated with order id. + * + * @return Casedata|null + */ + public function getCaseEntity() + { + if ($this->caseEntity->isEmpty()) { + $order = $this->getOrder(); + if (!$order->isEmpty()) { + $this->caseEntity = $this->caseEntity->load($order->getIncrementId()); + } + } + + return $this->caseEntity; + } + + /** + * Retrieve order model object + * + * @return \Magento\Sales\Model\Order + */ + public function getOrder() + { + return $this->coreRegistry->registry('sales_order'); + } + + /** + * Gets case guarantee disposition status + */ + public function getCaseGuaranteeDisposition() + { + return $this->getCaseEntity()->getData('guarantee'); + } + + /** + * Gets case score + */ + public function getCaseScore() + { + return floor($this->getCaseEntity()->getData('score')); + } +} \ No newline at end of file diff --git a/view/adminhtml/layout/sales_order_view.xml b/view/adminhtml/layout/sales_order_view.xml index 3547a309..962ffec0 100644 --- a/view/adminhtml/layout/sales_order_view.xml +++ b/view/adminhtml/layout/sales_order_view.xml @@ -11,5 +11,9 @@ + + + + diff --git a/view/adminhtml/templates/case_info.phtml b/view/adminhtml/templates/case_info.phtml new file mode 100644 index 00000000..015064e2 --- /dev/null +++ b/view/adminhtml/templates/case_info.phtml @@ -0,0 +1,38 @@ + + +getCaseEntity()->isEmpty()) { + return ''; +} +?> +
+
+ escapeHtml(__('Fraud Protection Information')) ?> +
+
+
+
+ + + + + + + + + + + +
escapeHtml(__('Signifyd Guarantee Decision')) ?>escapeHtml($block->getCaseGuaranteeDisposition()) ?>
escapeHtml(__('Signifyd Score')) ?>escapeHtml($block->getCaseScore()) ?>
+
+
+
+
\ No newline at end of file