I have read many posts about the problems of Paypal and checkout complete in Commerce, but I can't seem to get this simple thing to work.
When an order is completed I want to run a custom function. I have tried both hook_commerce_payment_order_paid_in_full and hook_commerce_checkout_complete - but neither seem to fire when paid through Paypal WPS. I am receiving IPN callback from Paypal fine, and it is updating the order status after adding in some custom rules as seen here: Is this normal to have Drupal Commerce stuck in PENDING status after a completed paypal payment?
I have also tried adding a custom action to be used in rules - but unsure how to get the corresponding order id in this case?
The only way I have got it to work is to use hook_preprocess_html which checks for the checkout/complete page, gets the order id from arg(1), and runs it all there, which is obviously very dirty.
Any help on this would be greatly appreciated.