I want to add a new functionality to magento when a particular order is succeeded. I am wondering is there any common function where all the payment gateways reaches before destroying the order session information so I can pick the new order information like customer, credit card etc for the new functionality and then redirect to the success page.
2 Answers
I don't think there is such a point since every method behaves differently and can/should have different callback URLs. Maybe you can get the information you need on the success page using the event controller_action_predispatch_checkout_onepage_success
and use
$orderId = Mage::getSingleton('checkout/session')->>getLastSuccessQuoteId();
to get the last order id, then load the order
Mage::getModel('sales/order')->load($orderId);
and get the info you need from there.
-
Done by creating a helper class of the newly created module for the extra functionality from the Mage_Checkout_OnepageController success action. Thanks Commented Jul 12, 2013 at 6:14
You can create an observer for event "checkout_onepage_controller_success_action". This is in successAction in Mage_Checkout_OnepageController.