Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Iframe.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Payment\Block\Transparent\Iframe as TransparentIframe;
9 
14 class Iframe extends TransparentIframe
15 {
19  protected $dataFactory;
20 
24  private $messageManager;
25 
35  public function __construct(
36  \Magento\Framework\View\Element\Template\Context $context,
37  \Magento\Framework\Registry $registry,
38  \Magento\Authorizenet\Helper\DataFactory $dataFactory,
39  \Magento\Framework\Message\ManagerInterface $messageManager,
40  array $data = []
41  ) {
42  $this->dataFactory = $dataFactory;
43  $this->messageManager = $messageManager;
44  parent::__construct($context, $registry, $data);
45  }
46 
53  public function getHelper($area)
54  {
55  return $this->dataFactory->create($area);
56  }
57 
61  protected function _beforeToHtml()
62  {
63  $this->addSuccessMessage();
64  return parent::_beforeToHtml();
65  }
66 
72  private function addSuccessMessage()
73  {
74  $params = $this->getParams();
75  if (isset($params['redirect_parent'])) {
76  $this->messageManager->addSuccess(__('You created the order.'));
77  }
78  }
79 }
__()
Definition: __.php:13
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Authorizenet\Helper\DataFactory $dataFactory, \Magento\Framework\Message\ManagerInterface $messageManager, array $data=[])
Definition: Iframe.php:35
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18