109 \
Magento\Sales\Model\OrderFactory $orderFactory,
115 $this->_customerSession = $customerSession;
116 $this->_checkoutSession = $checkoutSession;
117 $this->_orderFactory = $orderFactory;
118 $this->_checkoutFactory = $checkoutFactory;
119 $this->_paypalSession = $paypalSession;
120 $this->_urlHelper = $urlHelper;
122 parent::__construct($context);
124 $this->_config = $this->_objectManager->create($this->_configType, $parameters);
137 $this->
getResponse()->setStatusHeader(403,
'1.1',
'Forbidden');
138 throw new \Magento\Framework\Exception\LocalizedException(
__(
'We can\'t initialize Express Checkout.'));
140 if (!isset($this->_checkoutTypes[$this->_checkoutType])) {
148 ->create($this->_checkoutType, $parameters);
163 if (
null !== $setToken) {
164 if (
false === $setToken) {
166 if (!$this->
_getSession()->getExpressCheckoutToken()) {
167 throw new \Magento\Framework\Exception\LocalizedException(
168 __(
'PayPal Express Checkout Token does not exist.')
173 $this->
_getSession()->setExpressCheckoutToken($setToken);
177 $setToken = $this->
getRequest()->getParam(
'token');
179 if ($setToken !== $this->
_getSession()->getExpressCheckoutToken()) {
180 throw new \Magento\Framework\Exception\LocalizedException(
181 __(
'A wrong PayPal Express Checkout Token is specified.')
185 $setToken = $this->
_getSession()->getExpressCheckoutToken();
217 if (!$this->_quote) {
247 return $this->_customerUrl->getLoginUrl();
266 $this->_actionFlag->set(
'',
'no-dispatch',
true);
267 $this->_customerSession->setBeforeAuthUrl($this->
_redirect->getRefererUrl());
269 $this->_urlHelper->addRequestParam($this->_customerUrl->getLoginUrl(), [
'context' =>
'checkout'])
_initToken($setToken=null)
_redirect($path, $arguments=[])
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory, \Magento\Framework\Session\Generic $paypalSession, \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Customer\Model\Url $customerUrl)
getCustomerBeforeAuthUrl()