Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-braintree
Controller
Paypal
AbstractAction.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Braintree\Controller\Paypal
;
8
9
use
Magento\Checkout\Model\Session
;
10
use
Magento\Framework\App\Action\Action
;
11
use
Magento\Framework\App\Action\Context
;
12
use
Magento\Quote\Api\Data\CartInterface
;
13
use
Magento\Framework\App\RequestInterface
;
14
use
Magento\Framework\Controller\Result\Redirect
;
15
use
Magento\Braintree\Gateway\Config\PayPal\Config
;
16
20
abstract
class
AbstractAction
extends
Action
21
{
25
protected
$config
;
26
30
protected
$checkoutSession
;
31
39
public
function
__construct
(
40
Context
$context,
41
Config
$config
,
42
Session
$checkoutSession
43
) {
44
parent::__construct($context);
45
$this->config =
$config
;
46
$this->checkoutSession =
$checkoutSession
;
47
}
48
54
public
function
dispatch
(
RequestInterface
$request
)
55
{
56
if
(!$this->config->isActive() || !$this->config->isDisplayShoppingCart()) {
57
$this->_actionFlag->set(
''
, self::FLAG_NO_DISPATCH,
true
);
58
60
$resultRedirect = $this->resultRedirectFactory->create();
61
$resultRedirect->setPath(
'noRoute'
);
62
63
return
$resultRedirect;
64
}
65
66
return
parent::dispatch(
$request
);
67
}
68
74
protected
function
validateQuote
(
$quote
)
75
{
76
if
(!
$quote
|| !
$quote
->getItemsCount()) {
77
throw
new \InvalidArgumentException(
__
(
'Checkout failed to initialize. Verify and try again.'
));
78
}
79
}
80
}
Magento\Quote\Api\Data\CartInterface
Definition:
CartInterface.php:13
Magento\Braintree\Gateway\Config\PayPal\Config
Definition:
Config.php:14
$quote
$quote
Definition:
paypal_quote.php:17
Magento\Checkout\Model\Session
Definition:
SuccessValidator.php:6
Magento\Braintree\Controller\Paypal\AbstractAction\$config
$config
Definition:
AbstractAction.php:25
__
__()
Definition:
__.php:13
Magento\Framework\Controller\Result\Redirect
Definition:
Redirect.php:22
Magento\Braintree\Controller\Paypal\AbstractAction\$checkoutSession
$checkoutSession
Definition:
AbstractAction.php:30
Magento\Braintree\Controller\Paypal
Definition:
AbstractAction.php:7
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Braintree\Controller\Paypal\AbstractAction\__construct
__construct(Context $context, Config $config, Session $checkoutSession)
Definition:
AbstractAction.php:39
Magento\Braintree\Controller\Paypal\AbstractAction\validateQuote
validateQuote($quote)
Definition:
AbstractAction.php:74
Magento\Framework\App\Action\Action\dispatch
dispatch(RequestInterface $request)
Definition:
Action.php:92
Magento\Checkout\Model\Session
Definition:
Session.php:17
Magento\Framework\App\Action\Context
Definition:
Context.php:24
Magento\Framework\App\ResourceConnection\Config
Definition:
Config.php:14
Magento\Braintree\Controller\Paypal\AbstractAction
Definition:
AbstractAction.php:20
Magento\Framework\App\Action\Action
Definition:
Action.php:25