Available payment method for your order is calculated here :
src/src/app/code/core/Mage/Payment/Helper/Data.php::getStoreMethods()
And call
src/src/app/code/core/Mage/Payment/Model/Method/Abstract.php::isAvailable() && isApplicableToQuote()
Available payment method for your order is calculated here :
src/src/app/code/core/Mage/Payment/Helper/Data.php::getStoreMethods()
And call
src/src/app/code/core/Mage/Payment/Model/Method/Abstract.php::isAvailable() && isApplicableToQuote()
Is there a function to get all available payment methods in magento ? YES
app/code/core/Mage/Payment/Model/Config.php
public function getActiveMethods($store=null) { $methods = array(); $config = Mage::getStoreConfig('payment', $store); foreach ($config as $code => $methodConfig) { if (Mage::getStoreConfigFlag('payment/'.$code.'/active', $store)) { if (array_key_exists('model', $methodConfig)) { $methodModel = Mage::getModel($methodConfig['model']); if ($methodModel && $methodModel->getConfigData('active', $store)) { $methods[$code] = $this->_getMethod($code, $methodConfig); } } } } return $methods; }
To get payment method from an order, you can do this :
$order->getPayment()->getMethodInstance()->getCode();