Do this using event observer.....create an event on payment_method_is_active
and depends on grandtoatal group disable and enable payment method:
See there.Implementing payment method per currency
And you need change on observer.
<?php
class Bh_ZeroSubtotalpaymentmethod_Model_Observer {
public function filterpaymentmethod(Varien_Event_Observer $observer) {
/* call get payment method */
$method = $observer->getEvent()->getMethodInstance();
$quote = $observer->getEvent()->getQuote();
/* this condition will disable rest of payment method if grandtotal <= 0 */
if($method->getCode()!='free' && (Mage::app()->getStore()->roundPrice($quote->getGrandTotal())<=0))
{
$result = $observer->getEvent()->getResult();
$result->isAvailable = false;
return;
}
/* this condtion prevent zero payment to display when grandtotal greater then 0 */
if($method->getCode()=='free'){
$quote = $observer->getEvent()->getQuote();
if(Mage::app()->getStore()->roundPrice($quote->getGrandTotal())>0){
$result = $observer->getEvent()->getResult();
$result->isAvailable = false;
return;
}
}
return;
}
}