[I posted this yesterday as a reply to another topic in "How do I..." but it's fallen pretty far down the list, and this is probably a better place to ask my question anyhow.]
I've been trying to get paypal_subscriptions working on my local test site, and it seems to be working now, but only after several hours of debugging and fixing stuff... and I'm still left with one issue I don't understand at all.
A bit of background:
I originally started using the ecommerce module and had hacked the ps module to work with it. I only did limited testing, but it seemed to be working. Unfortunately, the ecomm module wasn't cutting it - it was too complicated for what I need (and not flexible enough), the user experience was painful, and I found I was just working around it too much.
So, I ditched ecomm and chose to use paypal_framework (plus a few functions from the ecomm paypal) with the ps module and some custom code to handle my needs. I have a couple of extra modules that use the paypal_transaction hook for some of my custom processing.
The problem:
The paypal_transaction hook is called in ps upon receiving an IPN, but no matching data is found. When the same query is run in MySQL, data shows up. After some investigation, I determined that there's some sort of timing/sequence issue. Running the query in one of my other modules (called after ps), returns data. Yet even if I put a usleep() in ps, even if I loop it 100 times, that query still fails. It only works if ps is the last module called with paypal_transaction.