Im trying to call an Observer after the order has been created, and AFTER payment has been captured. So far I've tried; checkout_submit_all_after, sales_order_payment_place_end, sales_order_place_after, sales_order_payment_pay, sales_order_payment_capture, sales_order_payment_transaction_save_after
Just to name the main ones. I've also logged all Event Dispaches inside dispatchEvent() but found nothing that stands out and is only fired when i need it. the issue i'm having is that the status of the order is always ether 'Payment Pending' or something that predated this; meaning that i don't know whether the order will fail or succeed.
My aim, is to fire a function only on successful orders. thanks.
after much more testing i found the following Observer to do the trick;
checkout_onepage_controller_success_action
This returns just the order id, so;
$order_id = $observer->getData('order_ids');
$order = Mage::getModel('sales/order')->load($order_id);
and you see that the order status is 'processing' and the payment is aproved (or not).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With