Abstract Express Checkout Controller @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 15 of file AbstractExpress.php.
◆ __construct()
- Parameters
-
\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 | |
Definition at line 105 of file AbstractExpress.php.
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);
◆ _getCheckoutSession()
Return checkout session object
- Returns
- \Magento\Checkout\Model\Session
Definition at line 205 of file AbstractExpress.php.
◆ _getQuote()
Return checkout quote object
- Returns
- \Magento\Quote\Model\Quote
Definition at line 215 of file AbstractExpress.php.
217 if (!$this->_quote) {
◆ _getSession()
PayPal session instance getter
- Returns
- \Magento\Framework\Session\Generic
Definition at line 195 of file AbstractExpress.php.
◆ _initCheckout()
Instantiate quote and checkout
- Returns
- void
- Exceptions
-
Definition at line 133 of file AbstractExpress.php.
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);
◆ _initToken()
_initToken |
( |
|
$setToken = null | ) |
|
|
protected |
Search for proper checkout token in request or session or (un)set specified one Combined getter/setter
- Parameters
-
- Returns
- $this|string
- Exceptions
-
Definition at line 161 of file AbstractExpress.php.
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();
◆ getActionFlagList()
◆ getCustomerBeforeAuthUrl()
getCustomerBeforeAuthUrl |
( |
| ) |
|
◆ getLoginUrl()
◆ getRedirectActionName()
getRedirectActionName |
( |
| ) |
|
◆ redirectLogin()
Redirect to login page
- Returns
- void
Definition at line 264 of file AbstractExpress.php.
266 $this->_actionFlag->set(
'',
'no-dispatch',
true);
267 $this->_customerSession->setBeforeAuthUrl($this->
_redirect->getRefererUrl());
269 $this->_urlHelper->addRequestParam($this->_customerUrl->getLoginUrl(), [
'context' =>
'checkout'])
_redirect($path, $arguments=[])
◆ $_checkout
◆ $_checkoutFactory
◆ $_checkoutSession
◆ $_checkoutType
◆ $_checkoutTypes
◆ $_config
◆ $_configMethod
◆ $_configType
◆ $_customerSession
◆ $_customerUrl
◆ $_orderFactory
◆ $_paypalSession
◆ $_quote
◆ $_urlHelper
The documentation for this class was generated from the following file: