On PayPal subscriptions, it appears that all I need to do is treat it like a regular IPN except look at the txn_type
field. When I see one of the following stat
If you've gone through the subscription button mechanism, and it's not one of the pre-approved recurring payment things then you'll only see the "subscr" prefixed ones, I think.
I personally don't respond to "subscr_cancel" in my app. The IPN for that is sent the moment the users cancels. I don't want to disable their access at that point so I wait for the "subscr_eot" one and do it then.
So if they sign up for a year, and cancel the next day, they still have access to the end of the year, which is when PayPal will send the "subscr_eot". They'll always send both.
I found that these are the ones to watch regarding "end of membership" type reactions in my code:
All others are just "noise" regarding "end of membership" status. For instance, to react to any payment "failure" type IPNs would be wrong because eventually PayPal may rectify that problem with the customer after a reattempt, and so cancellation and expiration events are really what you should look for.
I know i'm kind of late in this post, but here is a quick solution (php) for your question:
switch ($_POST['txn_type']) {
case 'cart':
//for products without subscription
break;
case 'subscr_payment':
//subscription payment recieved
break;
case 'subscr_signup':
//subscription bought payment pending
break;
case 'subscr_eot':
//subscription end of term
break;
case 'subscr_cancel':
//subscription canceled
break;
}