/** * Retrieve availale payment methods * * @param Mage_Sales_Model_Quote $quote * @return array */ public function getPaymentMethods(Mage_Sales_Model_Quote $quote) { if (is_null($this->_paymentMethodsBlock)) { $this->_paymentMethodsBlock = Mage::getBlockSingleton('checkout/Onepage_Payment_Methods'); } $methods = $this->_methods; if (empty($methods)) { $methodInstances = $this->_paymentMethodsBlock->setQuote($quote)->getMethods(); foreach ($methodInstances as $methodItem) { $methods[] = $methodItem->getCode(); } $this->_methods = $methods; } return $this->_methods; }