예제 #1
0
 /**
  * Add control buttons
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_txn = $this->_coreRegistry->registry('current_transaction');
     if (!$this->_txn) {
         return;
     }
     $backUrl = $this->_txn->getOrderUrl() ? $this->_txn->getOrderUrl() : $this->getUrl('sales/*/');
     $this->buttonList->add('back', ['label' => __('Back'), 'onclick' => "setLocation('{$backUrl}')", 'class' => 'back']);
     if ($this->_authorization->isAllowed('Magento_Sales::transactions_fetch') && $this->_txn->getOrderPaymentObject()->getMethodInstance()->canFetchTransactionInfo()) {
         $fetchUrl = $this->getUrl('sales/*/fetch', ['_current' => true]);
         $this->buttonList->add('fetch', ['label' => __('Fetch'), 'onclick' => "setLocation('{$fetchUrl}')", 'class' => 'button']);
     }
 }