As I have looked into this more I believe I may have found a bug.
In my testing I sent through another subscription. This one worked fine. That made me wonder what went wrong the first time. I was reminded of an issue I had on a previous project where I was doing a similar PayPal integration in my own custom code. One issue I had then is the real possibility the subscription IPN notifications may not come in the proper order for various reasons. This is probably only an issue when creating a new subscription as two notifications are sent. One to create the subscription and a second to apply the payment. I had to make sure I ignored the payment notification (sent back a 400) until the subscription notification had been processed and the new subscription created. That’s because the payment has to be connected to a subscription record and if it’s not created you can’t connect to it.
The Simple Commerce Module’s code for “subscription_payment” tries to find an existing subscription and if it doesn’t find one it returns FALSE out of the functions. But it then also seems to return a 200 response to PayPal tell them I have processed this notification.
So if the Simple Commerce Module receives the payment notification first it will be ignored and PayPal will not send it again. The subscription notification is received and the subscription is created, but since PayPal will not be sending the payment notification again the subscription will never be taken out of the pending state.
This scenario needs to be handled.
Also reading the notes in the code there also is an issue with multiple subscriptions of the same type/item. This will be a problem for me as I will need users to possibly purchase more than one subscription of a particular type/item.
Please verify these issues and let me know when they might be addressed.
Thanks