/** * Check whether payment method is applicable to quote * Purposed to allow use in controllers some logic that was implemented in blocks only before * * @param Mage_Sales_Model_Quote $quote * @param int|null $checksBitMask * @return bool */ public function isApplicableToQuote($quote, $checksBitMask) { if (!Mage::helper('braintree_payments')->areCredentialCorrect()) { return false; } if (parent::isApplicableToQuote($quote, $checksBitMask)) { $availableCcTypes = $this->getApplicableCardTypes($quote->getBillingAddress()->getCountryId()); if (!$availableCcTypes) { return false; } } else { return false; } return true; }
/** * Check whether payment method is applicable to quote * * @param Mage_Sales_Model_Quote $quote * @param int|null $checksBitMask * @return bool */ public function isApplicableToQuote($quote, $checksBitMask) { if (!parent::isApplicableToQuote($quote, $checksBitMask)) { return false; } if (!Mage::helper('braintree_payments')->areCredentialCorrect()) { return false; } return true; }