Magento: How to get all active payment modules

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;

You made it all the way down here so you must have enjoyed this post! You may also like:

Drazen Karacic-Soljic
, | 8

Heartbleed and Magento – how to fix!

Ivan Galambos
Ivan Galambos, | 0

Run methods that are specified in module’s xml file using XPath and Varien_Object

Tomas Novoselic
, | 50

Magento PayPal Standard – How to pay with currency other than base one and do it in your language


  1. Magento1 specific shipping display specific payment option

    I want to show specific payment method when specific shipping is selected

  2. @oreales, @Contempo:

    This function returns all the payment methods configured in the Magento store, not the ACTIVE payment methods.

  3. @Contempo thx for the update, apart for that change, it seems still being the same function and more / less the same behavior isn´t it?

  4. @oreales… in v1.7CE the sale helper doesn’t have that helper method… it’s in the payment helper

    Mage::helper(‘payment’)->getPaymentMethodList(true, true, true)

  5. 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

    $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
    /*And followed by your code*/
  6. 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);
  7. 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.


  8. 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

  9. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.