Paypal subscriptions IPN - problem with users subscribing multiple times

Posted by Brian Armstrong on Stack Overflow See other posts from Stack Overflow or by Brian Armstrong
Published on 2010-03-27T00:45:54Z Indexed on 2010/03/27 0:53 UTC
Read the original article Hit count: 567

I'm using paypal subscriptions and the instant payment notification (IPN) to handle subscribers on my site.

For the most part it works well but there is one occasional problem I've encountered.

Usually if a user cancels their subscription, I wait for the "end of term" (subscr_eot) notification before disabling access to my site.

So if they prepay for the whole month, and then cancel right away, they still have access for the rest of the month (as it should be).

But some users are having this problem where they:

  1. Cancel their subscription
  2. Before the "end of term" is reached they decide to re-subscribe
  3. When the "end of term" is reached for their first subscription, my app receives the notification and fires off an email to the user with something like "your account has been disabled, if you ever want to sign up again, you can re-subscribe by clicking here".
  4. This confuses them because they are thinking...that's weird, I thought I subscribed like a week ago (and they did). So they go subscribe AGAIN. Now they have two concurrent running subscriptions to my site and I get a support email in a month or two ("wtf you billed me twice this month jerk!!")

So I haven't found a good way to fix this. I guess the best solution would be to do an additional API call when the "end of term" notification is received which asks paypal "hey did this person already re-subscribe?". If so then no need to fire off that email. But I haven't seen any way to do this API call yet.

Another solution is to disable their account immediately when they cancel (the "subscr_cancel" notification) but then I get different angry support emails "hey I prepaid for the whole month why was my account disabled already!!".

Anyone else solved this?

© Stack Overflow or respective owner

Related posts about paypal

Related posts about ipn