/** * Render payment information block * * @param Info $info * @param int $storeId * @return string * @throws \Exception */ public function getInfoBlockHtml(Info $info, $storeId) { $initialEnvironmentInfo = $this->_appEmulation->startEnvironmentEmulation($storeId); try { // Retrieve specified view block from appropriate design package (depends on emulated store) $paymentBlock = $info->getBlockMock() ?: $this->getInfoBlock($info); $paymentBlock->setArea(\Magento\Framework\App\Area::AREA_FRONTEND)->setIsSecureMode(true); $paymentBlock->getMethod()->setStore($storeId); $paymentBlockHtml = $paymentBlock->toHtml(); } catch (\Exception $exception) { $this->_appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); throw $exception; } $this->_appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); return $paymentBlockHtml; }