/**
  * Check whether payment method is enabled
  *
  * @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);
 }
 /**
  * @return bool
  */
 public function isActive()
 {
     return $this->payment->isAvailable($this->checkoutSession->getQuote()) && $this->config->isDisplayShoppingCart();
 }