Pages

Magento 1 - Get Payment Methods (code) using Observer.

The following code return payment methods code,
<?php
    class Gta_FindPaymentGateway_Model_Observer
    {
        public function paymenter($Observer)
        {
           $allPaymentMethods = Mage::getModel('payment/config')->getAllMethods();

           foreach($allPaymentMethods as $paymentMethod)
           {
                Mage::log($paymentMethod->getCode(),null,'filter.log',true);
           }
        }
    }
?>

No comments:

Post a Comment