Requested Payment Method Not Available on Custom Module

magento-1.9onepage-checkoutpayment

I am shortening the one page checkout page as my store will not have payment option and shipping selection option. I am following below blog

http://excellencemagentoblog.com/blog/2011/10/17/magento-onestep-checkout-remove-payment-method-step/

Everything works fine till place order after the review section. Upon clicking on the place order button I am getting below error

The requested Payment Method is not available.

My controller section to set payment mode is as below

$quote = Mage::getSingleton('checkout/session')->getQuote();
                        $methodCode = 'free';


                        if ($quote->isVirtual()) {
                            $quote->getBillingAddress()->setPaymentMethod($methodCode);
                        } else {
                            $quote->getShippingAddress()->setPaymentMethod($methodCode);
                        }
                        $quote->save();

And the free shipping mode enabled also.

I referred below question posted before:

The requested Payment Method is not available

It is not solving my issue. No system.lo captured also.

Best Answer

Try free_free as method code. I seem to remember it should be something like that.

Also, try placing an order with all steps enabled and check what the code for payment and shipping is in the sales_flat_order table.

Related Topic