Magento: How to get all active payment modules

Featured Image

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;

About Domagoj Potkoc

Backend Developer

Domagoj is Magento Certified Developer who enjoys playing tennis after long hours in front of computer screen.

Read more posts by Domagoj / Visit Domagoj's profile


  1. @oreales, @Contempo:

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

  2. @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?

  3. @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)

  4. 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*/
  5. 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);
  6. 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.


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

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