List all payment methods in Magento

How to get a list with all available payment methods in Magento.

If for any reason you need to a get a list with all payment methods in Magento, you can do it easily by using the payment config class (app/code/core/Mage/Payment/Model/Config.php).

To get a list with all payments active and inactive:

$allAvailablePaymentMethods = Mage::getModel('payment/config')->getAllMethods();

To get a list with all active payment methods:

$allActivePaymentMethods = Mage::getModel('payment/config')->getActiveMethods();

To get a list with all credit cards that Magento supports:

$allCcTypes = Mage::getModel('payment/config')->getCcTypes();

I hope this helps you in your projects.

Leave a Reply

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