![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/magento/module-sales/Block/Adminhtml/Order/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Block\Adminhtml\Order; use Magento\Payment\Model\Info; /** * Adminhtml sales order payment information * * @api * @author Magento Core Team <[email protected]> * @since 100.0.2 */ class Payment extends \Magento\Backend\Block\Template { /** * Payment data * * @var \Magento\Payment\Helper\Data */ protected $_paymentData = null; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Payment\Helper\Data $paymentData, array $data = [] ) { $this->_paymentData = $paymentData; parent::__construct($context, $data); } /** * Retrieve required options from parent * * @return void * @throws \Magento\Framework\Exception\LocalizedException */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { throw new \Magento\Framework\Exception\LocalizedException(__('Invalid parent block for this block')); } $this->setPayment($this->getParentBlock()->getOrder()->getPayment()); parent::_beforeToHtml(); } /** * Set payment * * @param Info $payment * @return $this */ public function setPayment($payment) { $paymentInfoBlock = $this->_paymentData->getInfoBlock($payment, $this->getLayout()); $this->setChild('info', $paymentInfoBlock); $this->setData('payment', $payment); return $this; } /** * Prepare html output * * @return string */ protected function _toHtml() { return $this->getChildHtml('info'); } }