![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/paypal/module-braintree-core/Controller/Paypal/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace PayPal\Braintree\Controller\Paypal; use InvalidArgumentException; use Magento\Checkout\Model\Session; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Quote\Api\Data\CartInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Redirect; use PayPal\Braintree\Gateway\Config\PayPal\Config; /** * Abstract class AbstractAction */ abstract class AbstractAction extends Action { /** * @var Config */ protected $config; /** * @var Session */ protected $checkoutSession; /** * Constructor * * @param Context $context * @param Config $config * @param Session $checkoutSession */ public function __construct( Context $context, Config $config, Session $checkoutSession ) { parent::__construct($context); $this->config = $config; $this->checkoutSession = $checkoutSession; } /** * @inheritdoc */ public function dispatch(RequestInterface $request) { if (!$this->config->isActive() || !$this->config->isDisplayShoppingCart()) { $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('noRoute'); return $resultRedirect; } return parent::dispatch($request); } /** * Validate quote * * @param CartInterface $quote * @return void * @throws InvalidArgumentException */ protected function validateQuote($quote) { if (!$quote || !$quote->getItemsCount()) { throw new InvalidArgumentException(__('We can\'t initialize checkout.')); } } }