Magento – problem in magento default order status changes

magento-1.7order-status

I have a problem with magento order status, when i place an order with cc-avenue payment method, order status first assign as "Processing" and then "Pending". i am using citruspay payment gateway module.i have assigned "pending" as default order status in citruspay configuration from backend. can anybody help me where to change to get it resolved???

Thanks

Best Answer

Magento has a default authorize which sets the state as processing.

You will have to edit/override the below file: code/core/Mage/Sales/Model/Order/Payment.php

protected function _authorize($isOnline, $amount)
{
    // update totals
    $amount = $this->_formatAmount($amount, true);
    $this->setBaseAmountAuthorized($amount);

    // do authorization
    $order  = $this->getOrder();
    $state  = Mage_Sales_Model_Order::STATE_PROCESSING;
    $status = true;

Change the state to new or whatever you want to set when authorizing any payment from payment gateway.