Ok, I found a "solution". As described above, I ditched the idea of doing it properly (integrating observer functionality into ipn_application_top.php) and just hardcoded it. I'm going to write my solution here in case it helps someone trying to do something similar, or perhaps helps someone tell me how I can do it better.
in my particular case, I was tapping into the notifier: NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS that occurs in checkout_process.php immediately after these lines
Code:
$order->create_add_products($insert_id);
$_SESSION['order_number_created'] = $insert_id;
The first line also occurs in ipn_main_handler.php so I simply added these lines immediately after
Code:
//begin: stockManger
$_SESSION['order_number_created'] = $insert_id;
require(DIR_WS_CLASSES . 'observers/class.stockManager.php');
$stockManager = new stockManager();
$stockManager->update($this, 'NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS');
//end: stockManager
which essentially does what the observer/auto loader functionality does... only simpler and with no flexibility (hardcoded). I put in the first line there because the stockManager observer class that I created relied on that session variable.
Obviously, it would just be better to have the notifier/observer functionality present in the IPN processing so that contribs don't have to worry about any of this... but until then, anyone trying to make an observer that occurs after an order is completed (and uses PayPal)... this may help you solve the PayPal problem.
- Steven