0

I need to run a very simple function when an order is set to complete and/or if the payment was successful.

If it's relevant we're using Global Transport for payment. I mention it mostly because where I expect to see an order status go from "pending" to "complete" (as per documentation) it seems to stay as "pending"... this is possibly a red herring.

I'm almost losing track of the things I've tried:

  • sales_order_invoice_save_after
  • sales_order_payment_pay
  • sales_order_place_after
  • sales_order_payment_place_end

To be clear: I only need to run this function when payment is received for an order. These seem to run, but when I try to capture the order/payment object it's always "pending".

1 Answer 1

3

You have this observer:

checkout_onepage_controller_success_action 

The observer return order_ids :

<?php class Namespace_Modulename_Model_Observer { public function customFunction(Varien_Event_Observer $observer) { $order = $observer->getData('order_ids'); //here you can add your custom code } } 
1
  • this is great. I was hung up on trying to look too closely and track payment itself, but of course this works. Commented May 7, 2015 at 14:10

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.