Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Transactions Class Reference
Inheritance diagram for Transactions:
Action AbstractAction Action AbstractAction ActionInterface Fetch Grid Index View

Public Member Functions

 __construct (\Magento\Backend\App\Action\Context $context, Registry $coreRegistry, PageFactory $resultPageFactory, LayoutFactory $resultLayoutFactory, OrderPaymentRepositoryInterface $orderPaymentRepository)
 
- Public Member Functions inherited from AbstractAction
 __construct (Action\Context $context)
 
 dispatch (\Magento\Framework\App\RequestInterface $request)
 
 _processUrlKeys ()
 
 getUrl ($route='', $params=[])
 
- Public Member Functions inherited from Action
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getActionFlag ()
 
- Public Member Functions inherited from AbstractAction
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getRequest ()
 
 getResponse ()
 
- Public Member Functions inherited from ActionInterface
 execute ()
 

Data Fields

const ADMIN_RESOURCE = 'Magento_Sales::transactions'
 
- Data Fields inherited from AbstractAction
const FLAG_IS_URLS_CHECKED = 'check_url_settings'
 
const SESSION_NAMESPACE = 'adminhtml'
 
const ADMIN_RESOURCE = 'Magento_Backend::admin'
 
- Data Fields inherited from ActionInterface
const FLAG_NO_DISPATCH = 'no-dispatch'
 
const FLAG_NO_POST_DISPATCH = 'no-postDispatch'
 
const FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'
 
const PARAM_NAME_BASE64_URL = 'r64'
 
const PARAM_NAME_URL_ENCODED = 'uenc'
 

Protected Member Functions

 _initTransaction ()
 
- Protected Member Functions inherited from AbstractAction
 _isAllowed ()
 
 _getSession ()
 
 getMessageManager ()
 
 _addBreadcrumb ($label, $title, $link=null)
 
 _addContent (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addLeft (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addJs (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _isUrlChecked ()
 
 _processLocaleSettings ()
 
 _redirect ($path, $arguments=[])
 
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _validateSecretKey ()
 
- Protected Member Functions inherited from Action
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _redirect ($path, $arguments=[])
 

Protected Attributes

 $_coreRegistry = null
 
 $resultPageFactory
 
 $resultLayoutFactory
 
 $orderPaymentRepository
 
- Protected Attributes inherited from AbstractAction
 $_publicActions = []
 
 $_sessionNamespace = self::SESSION_NAMESPACE
 
 $_helper
 
 $_session
 
 $_authorization
 
 $_auth
 
 $_backendUrl
 
 $_localeResolver
 
 $_canUseBaseUrl
 
 $_formKeyValidator
 
- Protected Attributes inherited from Action
 $_objectManager
 
 $_sessionNamespace
 
 $_eventManager
 
 $_actionFlag
 
 $_redirect
 
 $_view
 
 $_url
 
 $messageManager
 
- Protected Attributes inherited from AbstractAction
 $_request
 
 $_response
 
 $resultRedirectFactory
 
 $resultFactory
 

Detailed Description

Adminhtml sales transactions controller

Author
Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m

Definition at line 19 of file Transactions.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Backend\App\Action\Context  $context,
Registry  $coreRegistry,
PageFactory  $resultPageFactory,
LayoutFactory  $resultLayoutFactory,
OrderPaymentRepositoryInterface  $orderPaymentRepository 
)
Parameters
\Magento\Backend\App\Action\Context$context
Registry$coreRegistry
PageFactory$resultPageFactory
LayoutFactory$resultLayoutFactory
OrderPaymentRepositoryInterface$orderPaymentRepository

Definition at line 57 of file Transactions.php.

63  {
64  $this->_coreRegistry = $coreRegistry;
65  $this->resultPageFactory = $resultPageFactory;
66  $this->resultLayoutFactory = $resultLayoutFactory;
67  $this->orderPaymentRepository = $orderPaymentRepository;
68  parent::__construct($context);
69  }

Member Function Documentation

◆ _initTransaction()

_initTransaction ( )
protected

Initialize payment transaction model

Returns
\Magento\Sales\Model\Order\Payment\Transaction|bool

Definition at line 76 of file Transactions.php.

77  {
78  $txn = $this->_objectManager->create(
79  \Magento\Sales\Model\Order\Payment\Transaction::class
80  )->load(
81  $this->getRequest()->getParam('txn_id')
82  );
83 
84  if (!$txn->getId()) {
85  $this->messageManager->addErrorMessage(__('Please correct the transaction ID and try again.'));
86  $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
87  return false;
88  }
89  $orderId = $this->getRequest()->getParam('order_id');
90  if ($orderId) {
91  $txn->setOrderUrl($this->getUrl('sales/order/view', ['order_id' => $orderId]));
92  }
93 
94  $this->_coreRegistry->register('current_transaction', $txn);
95  return $txn;
96  }
__()
Definition: __.php:13

Field Documentation

◆ $_coreRegistry

$_coreRegistry = null
protected

Definition at line 33 of file Transactions.php.

◆ $orderPaymentRepository

$orderPaymentRepository
protected

Definition at line 48 of file Transactions.php.

◆ $resultLayoutFactory

$resultLayoutFactory
protected

Definition at line 43 of file Transactions.php.

◆ $resultPageFactory

$resultPageFactory
protected

Definition at line 38 of file Transactions.php.

◆ ADMIN_RESOURCE

const ADMIN_RESOURCE = 'Magento_Sales::transactions'

Authorization level of a basic admin session

See also
_isAllowed()

Definition at line 26 of file Transactions.php.


The documentation for this class was generated from the following file: