_initCheckout(); $this->_checkout->prepareOrderReview($this->_initToken()); $this->_view->loadLayout(); $reviewBlock = $this->_view->getLayout()->getBlock('paypal.express.review'); $reviewBlock->setQuote($this->_getQuote()); $reviewBlock->getChildBlock('details')->setQuote($this->_getQuote()); if ($reviewBlock->getChildBlock('shipping_method')) { $reviewBlock->getChildBlock('shipping_method')->setQuote($this->_getQuote()); } $this->_view->renderLayout(); return; } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->messageManager->addExceptionMessage( $e, $e->getMessage() ); } catch (\Exception $e) { $this->messageManager->addExceptionMessage( $e, __('We can\'t initialize Express Checkout review.') ); } /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); return $resultRedirect->setPath('checkout/cart'); } }