This code bellow will get you all active Magento payment modules. This example below return an array which you can use to create drop down menu or something else in Magento’s front-end or admin sections.
class Inchoo_Vendor_Model_Activpayment
{
public function getActivPaymentMethods()
{
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$methods = array(array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('--Please Select--')));
foreach ($payments as $paymentCode=>$paymentModel) {
$paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
$methods[$paymentCode] = array(
'label' => $paymentTitle,
'value' => $paymentCode,
);
}
return $methods;
}
}



And getActiveMethods() method has a bug , dependent on store based settings in multi store/website environment “googlecheckout/payment” will always return as active method even if it’s disabled
i m newbie in magento, how to use this module i want the paypal payment module to be shown to my customers while they shop
can u suggest me some thing to do this paypal enable
thanks
This is relay helpful ,,
I searched much , but i didn’t find…..
anyway ,, thanks
Hi,
Very useful article. One of my college used this.
Can you explain what is what in this code.
I want to get all active shipping methods.
Regards,
Saurabh
There is another “standard” and “cleaner” way of do it:
Mage_Payment_Helper_Data has a method: getPaymentMethodList that returns an array. Returned array format depends on parameters passed to this method. This is used in different grids in Admin to show an HTML select of payment methods, and can be used in frontend also.
To get an array of Payment Methods, with label and value to show a select in the front, you can use this code:
Mage::helper("sales")->getPaymentMethodList(true, true, true);Thanks a lot for this code. And if anyone wants to have only the active payment methods which are enabled on the back end then they can check a condition given below
if($paymentModel->canUseCheckout()==1): $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title'); /*And followed by your code*/ endif;