- protected function _initTransaction()
- {
- $txn = $this->_objectManager->create(
- 'Magento\Sales\Model\Order\Payment\Transaction'
- )->load(
- $this->getRequest()->getParam('txn_id')
- );
-
- if (!$txn->getId()) {
- $this->messageManager->addError(__('Please correct the transaction ID and try again.'));
- $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
- return false;
- }
- $orderId = $this->getRequest()->getParam('order_id');
- if ($orderId) {
- $txn->setOrderUrl($this->getUrl('sales/order/view', ['order_id' => $orderId]));
- }
-
- $this->_coreRegistry->register('current_transaction', $txn);
- return $txn;
- }