public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { if ($quote && ($quote->getBaseGrandTotal() < $this->_minAmount || $this->_maxAmount && $quote->getBaseGrandTotal() > $this->_maxAmount)) { return false; } return parent::isAvailable($quote); }
/** * Determines method's availability based on config data and quote amount * * @param \Magento\Quote\Api\Data\CartInterface|null $quote * @return bool */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { return parent::isAvailable($quote) && $this->getConfigHelper()->isMethodAvailable() && $this->getModuleHelper()->isStoreSecure(); }
/** * Check whether payment method can be used * * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) { if (parent::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable()) { return true; } return false; }
/** * Check whether payment method can be used * * @param \Magento\Sales\Model\Quote|null $quote * @return bool */ public function isAvailable($quote = null) { $storeId = $this->_storeManager->getStore($this->getStore())->getId(); /** @var \Magento\Paypal\Model\Config $config */ $config = $this->_configFactory->create()->setStoreId($storeId); if (parent::isAvailable($quote) && $config->isMethodAvailable($this->getCode())) { return true; } return false; }
/** * Check whether payment method can be used * * @param \Magento\Quote\Api\Data\CartInterface|\Magento\Quote\Model\Quote|null $quote * @return bool */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { return parent::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable(); }
/** * Check whether payment method is applicable to quote * Purposed to allow use in controllers some logic that was implemented in blocks only before * * @param \Magento\Quote\Api\Data\CartInterface|null $quote * @return bool */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { if (parent::isAvailable($quote)) { if ($quote != null) { $availableCcTypes = $this->config->getApplicableCardTypes($quote->getBillingAddress()->getCountryId()); if (!$availableCcTypes) { return false; } } } else { return false; } return true; }
/** * is payment method available? * * @param \Magento\Quote\Api\Data\CartInterface|null $quote * * @return bool */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { $parent = parent::isAvailable($quote); if (!$this->_accessToken) { $this->_accessToken = $this->_scopeConfig->getValue(\MercadoPago\Core\Helper\Data::XML_PATH_ACCESS_TOKEN); } if (!$this->_publicKey) { $this->_publicKey = $this->_scopeConfig->getValue(\MercadoPago\Core\Helper\Data::XML_PATH_PUBLIC_KEY); } $custom = !empty($this->_publicKey) && !empty($this->_accessToken); if (!$parent || !$custom) { return false; } $debugMode = $this->_scopeConfig->getValue('payment/mercadopago/debug_mode'); $secure = $this->_request->isSecure(); if (!$secure && !$debugMode) { return false; } return $this->_helperData->isValidAccessToken($this->_accessToken); }
/** * Check whether payment method can be used * * @param Quote|null $quote * @return bool */ public function isAvailable($quote = null) { return parent::isAvailable($quote) && $this->getConfig()->isMethodAvailable($this->getCode()); }