1

I am writing a payment module for our payment gateway,I am a java programmer and new to php,so please forgive for my poor php skill. I have setted the new order status with pending and payment action with Authorise and Capture in my module.Then I want to change the order status to processing after payment approved in capture method with the code below

        $payment->setStatus(self::STATUS_SUCCESS);
        $order->addStatusToHistory(
            Mage_Sales_Model_Order::STATE_PROCESSING,'payment success',false
        );

But I found that the order status always is changed to pending after the payment like this enter image description here

How do I fix this bug?please help me,Thank you!

BTW,if I change the new order status with processing,even if the payment failed,the order still will be changed to processing,that's not what I want.

1

you can get help from here. >>> http://www.atwix.com/magento/auto-invoice-and-custom-order-status-upon-checkout/ Or http://inchoo.net/magento/magento-orders/automatically-invoice-ship-complete-order-in-magento/

2
  • I will read it right now,thank for your help.
    – kyo
    Sep 10 '15 at 10:56
  • thank you very much,it worked.the obsever is executed after the magento change the order to pending.
    – kyo
    Sep 10 '15 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.