Subscriptions with Paypal IPN
Asked Answered
T

3

56

I am adding subscriptions to a site using Paypal IPN which works very well, I can successfully create a new subscription and verify it. The subscription has a two week free trial. The guide was unfortunately a little vague on subscription statuses.

At the moment, the users account gets subscribed status once subscr_signup or subscr_payment is received and gets removed when either subscr_cancel or subscr_failed is received. I believe this is correct but it's best to make sure.

Also what is subscr_eot? the IPN guide describes it as "subscription’s end-of-term." Does this get triggered after the trial period is over?

Tad answered 30/6, 2009 at 4:11 Comment(0)
C
81

subscr_eot is sent when a user's last paid interval has expired. subscr_cancel is sent as soon as the use cancels the subscription - for example:

User signs up on day 1 for a subscription which is billed once a month. subscr_signup is sent immediately, subscr_payment is sent as soon as payment goes through (usually immediately as well).

On day 13, the user cancels. subscr_cancel is immediately sent, although the user has technically paid through to day 30. Cancelling at this point is up to you.

On day 30, subscr_eot is sent - the user has cancelled, and this is the day which his last payment paid until.

Not much changes with trial subscriptions - if a user cancels before a trial subscription is up, subscr_cancel is sent immediately, and subscr_eot is sent at the end of the trial.

Cree answered 28/7, 2009 at 16:30 Comment(9)
I'm not sure this is necessarily true. I think it depends on the type of subscription they have, starting with I/S etcAntons
I hear that subscr_* is the old way. Is that true? Anyway, I'm trying to get these txn_type values figured out. #13855787Earnestineearnings
Just to add to this - afaik - if you weren't doing a free trial, then 'subscr_signup' is sent only if the first payment was successful as well. So you could listen to only subscr_signup and subscr_eot to activate / deactivate subscriptions.Chindwin
@Cree after subscr_eot ends, do we ask user to sign up for subscription again or modify existing subscription? so would it be subscr_modify or subscr_signup on after the end of the term. or for canclled users?Muddle
Thank you very much for describing subscr_eotFluctuation
@Chindwin You should only activate the subscription when you get the money, unless it's a free trial.Gauge
this is a very helpful answer, I wish the PayPal docs had stuff worded like thisChorea
answer below from ajbeaven is worth a look. I can confirm today I worked with some 'classic web software': subscr_eot happens before subscr_cancel. In our case we ignore subscr_eot and focus on subscr_cancel to terminate an account. In the DB I can see paypal changed this as members prior to 2010 have subscr_eot but members who left as recently as last month have subscr_cancel. In short: we have paying members who get subscr_eot for short times and later it changes to suscr_payment. paypal-community.com/t5/PayPal-Reporting/…Pomeroy
This belongs here: developer.paypal.com/api/nvp-soap/ipn/IPNandPDTVariablesPomeroy
A
38

Also, one interesting detail is how subscr_eot works with subscr_failed.

It looks like subscr_eot comes after the FINAL subscr_failed. So if in your account you set it to automatically retry failed payments 3 times, then it should go like this:

first failed payment => subscr_failed second failed payment => subscr_failed third failed payment => subscr_failed and subscr_eot

so basically in your code you can set subscr_failed to trigger an email like

hi user, please take moment to check your payment info, you may need to update the credit card expiration date, etc. You still have access, we'll try again in a few days.

And setup subscr_eot to actually turn their subscription off and trigger an email like

Sorry, we still havent' gotten payment and have taken your profile down. You can still reactivate it by logging in and updating your payment info

Basically this is the "nice" way of doing it so customers have a grace period, and their account isn't shut off unexpectedly just because of an expired credit card or something like that.

Aesculapius answered 29/10, 2009 at 2:45 Comment(4)
Do failed payments and the sending of subscr_eot notifications still work as they did in 2009?Antons
@ajbeaven: It would appear that since the post was updated in April, the information is still current.Provenience
@BrainArmstrong after subscr_eot ends, do we ask user to sign up for subscription again or modify existing subscription? so would it be subscr_modify or subscr_signup on after the end of the term. or for canclled users?Muddle
subscr_eot is not the final. (in the past this may have been true) but as recently as today I can confirm subscr_eot happens before subscr_cancel. to confirm: subscr_cancel is the end all beat all. subscr_eot seems to happen when a Subscription expired, HOWEVER, a user can renew and subscr_payment can be sent shortly after that. Reference the official docs as of 2023: developer.paypal.com/api/nvp-soap/ipn/IPNandPDTVariablesPomeroy
A
10

The thread posted by Chris has been updated recently.

Sometime in 2010, PayPal stopped using subscr_eot when a user cancelled their account. After a number of complaints, they reinstated this, but took 6 months to do so. All this means is that you can once again handle your subscription notifications as described by Peter in the accepted answer.

From a PayPal representative:

subscr_cancel means the profile is canceled and there will not be future payments. However, if the buyer has already paid for the current billing cycle as they are charged up-front, then you can use the subscr_eot to terminate the profile.

Still unsure what happens in the event of multiple failed payment attempts, however. PayPal documentation at the moment is terrible.

Antons answered 4/5, 2011 at 7:39 Comment(3)
Sure is. There's very little authoritative documentation about API/IPN-related stuff, and what there is is usually contradicted by other documentation, or that bastard called reality.Aeropause
yeah, like that day that the _payment ipn happened before the _signup ipn :DRunck
You are correct. Your answer is now the right one in this case. The previously selected answer was right 14 years ago, but I can confirm that today I worked with some lets say 'classic web software' and subscr_eot happens BEFORE the subscr_cancel.Pomeroy

© 2022 - 2024 — McMap. All rights reserved.