What's the right magento observer event to capture order paid?

Ox3 picture Ox3 · Aug 1, 2014 · Viewed 12.4k times · Source

I'm trying to send orders to a third-party after and ONLY after an order has been paid and has now been set to 'Processing' as status. What's the best observer to use to set up this to work for all payments types?

After reading several sources it seems like:

sales_order_invoice_pay

Should work for all payment methods but it seems like it has been removed on Magento 1.9: http://rabee.me/codes/magento/cheatsheet/1.9/ (This list is incomplete, please check the updates below )

The other option was:

'sales_order_payment_pay'

But when I test it setting the payment method to "Check / Money order" it is NOT fired after I generate the invoice on backend using Order > Invoice > Submit Invoice

Is this method only called with the other payment methods? (paypal/authorize.net)

UPDATE:

After reading: this other question it seems like the only way to guarantee that I'm exporting the order AFTER a payment (online or offline) has been made is to capture when an invoice is created, and that for Magento 1.9 the right observer is:

sales_order_invoice_register

Are invoices automatically created and sent after payment on online methods paypal/authorize.net? Will this still be true when using them on sandbox/test mode?

UPDATE 2:

After much testing it seems that 'sales_order_invoice_pay' is the right method to use to achieve what I needed.

Answer

Rajeev K Tomy picture Rajeev K Tomy · Aug 1, 2014

What about checkout_onepage_controller_success_action. This can be used if your order payment is success. There is another event sales_order_payment_capture. It may also use in your case. I didn't use it before.

Check this LINK

EDIT

As per discussion, it seems that sales_order_invoice_pay is the perfect observer for capturing order paid and that event is still available in Magento 1.9. (not deprecated)

For more reference, check out this Link