Subscription Renewal, Expiration and Cancellation

15 replies [Last post]
jaybee
Offline
Joined: 08/14/2009
Status: 
Answered

 Hi Leighton,

I wonder if you would mind explaining how the module/PayPal handles renewal, expiration and cancellation of subscriptions for both auto-renewing and non-renewing products?

For a non-renewing subscription, where is the expiry date stored and how is a notification of expiry or cancellation triggered? Does this rely on Cron or on PayPal systems?

If a non-renewing 1 week subscription was purchased at 11am on Saturday 1st Sept, when/how would it expire and what notifications should be received?

I ask these questions because I got a seemingly random email notification that a 1 year non-renewing subscription had been cancelled, but had only run for 1 day.

And repeat the same questions, but this time for auto-renewing products.

Also, I setup a 1 day auto-renewing subscription. The subscription was renewed ok, and the PayPal transaction and PayPal email could be seen in the sandbox account, however, I did not receive a renewal email from Drupal/PayPal Subs module - should I have done?

Thanks

Leighton Whiting
Offline
Joined: 06/02/2009
Jaybee, I was going to post

Jaybee,
I was going to post 4.9 last night, but I decided that the Subscription Modification workflow needs to be overhauled first, so I postponed it for one night to hammer out these issues. I'm going to explain this tonight once I release the 4.9 version. It is going to be a big release. Sorry for the wait~

Sincerely,
Leighton Whiting

jaybee
Offline
Joined: 08/14/2009
OK Leighton,  sounds

OK Leighton,  sounds good.

There is one more thing I have found: I setup a 1 day NON-renewing subscription yesterday, and although the 1 day renewing sub I set up at the same time has renewed, the non-renewing sub is still active - it looks like it hasn't expired. I can see the IPN for the renewal, but there is nothing for the expiry. Can you explain?

Thanks

Leighton Whiting
Offline
Joined: 06/02/2009
Jaybee, I have overhauled the

Jaybee,
I have overhauled the Subscription Management and Modification workflow, and I believe that a number of these bugs have been worked out. Please install the new 4.9 version and run update.php, then let me know if they are resolved. It *should* work with the existing subscriptions, but to be sure, try starting a new user and upgrading the subscriptions from there. I have also added in a number of new email templates and fixed some email related bugs.

Sincerely,
Leighton Whiting

jaybee
Offline
Joined: 08/14/2009
 Hi Leighton, I've given 4.9

 Hi Leighton,

I've given 4.9 a good shakedown now, and there are some good developments. However, I am still having issues with non-renewing subscriptions. They are not expiring and the role is not being removed. I setup a 1 day non-renewing subscription and it has been running now for 3-4 days and the user still has access. I also noticed that, when logged in as that user, I am unable to view the PayPal transaction details - I get a 403 error??

The log shows the page being accessed is:

http://mydomain-test.co.uk/paypal/view_transaction/3M2362418H666891Y

Any ideas?

 

Thanks

PS I've just noticed you've released 4.10, which I will test, but I don't believe that it will address these problems?

PPS: Okay, just now, 4 days after I created the '1 day non-renewing' subscription, I have just got 3 emails. The first is to the site owner reporting that a subscription was cancelled. The other two are to the user but have a blank subject and body. Also the user in question has been BLOCKED rather than having their role removed?

Leighton Whiting
Offline
Joined: 06/02/2009
James, Can you post a

James,
Can you post a screenshot of the settings you are using for the subscription? The only thing I can think of is that maybe Paypal has some issues with subscriptions that are so short. As for the user being blocked, did the role get removed AND they were blocked, or was the user simply blocked? I will take a look through the code and see if I can find anything that sticks out based on what you have said.

Sincerely,
Leighton Whiting

jaybee
Offline
Joined: 08/14/2009
 Hi Leighton - screenshots of

 Hi Leighton - screenshots of subscription settings attached. Also shots of emails received. Note that the email to the site admin (email1.jpg) states 'cancelled' rather than 'expired' - not sure if this is an issue either? The other email (which I received twice) is just blank.

The user was blocked, but retained the role....

 

Hope the screenshots are useful.

AttachmentSize
subssettings1.JPG 65.29 KB
subssettings2.JPG 60.69 KB
subssettings3.JPG 85.97 KB
subssettings4.JPG 74.85 KB
subssettings5.JPG 42.88 KB
subssettings6.JPG 13.74 KB
email1.JPG 30.64 KB
email2.JPG 27.3 KB
Leighton Whiting
Offline
Joined: 06/02/2009
James, For the first problem,

James,
For the first problem, I think the problem is that for a subscription that will expire, you have to set it as a 'recurring' subscription in the settings, even if there is only 1 payment. This is so that Paypal will treat it as a Subscription rather than a one-time purchase product. If it is a subscription, then paypal will send an IPN for when the subscription reaches 'End of Term'. So for what you are trying to do, you would set it as a 'Recurring' subscription, and put the number of payments as 1. I have just tested this and so far so good, but I have to wait until tomorrow to see if it expires correctly. If it doesn't I will find out why and get it fixed.
As for the emails, can you confirm that you have the Cancellation email filled in in the subscription settings? Did you run update.php when you updated the module?

Sincerely,
Leighton Whiting

Leighton Whiting
Offline
Joined: 06/02/2009
Also, regarding the 403 Error

Also, regarding the 403 Error when viewing the Transaction Details, you probably need to set the 'access paypal pages' permission to authenticated users, or else they can't see the transaction details. This used to be simply 'access content', but people wanted a separate permission for paypal pages, so it's there now.

Sincerely,
Leighton Whiting

jaybee
Offline
Joined: 08/14/2009
 Thanks for the info

 Thanks for the info Leighton,

The 403 issue: correct, I had not enabled this permission - thanks.

 

jaybee
Offline
Joined: 08/14/2009
 Leighton, I can see the

 Leighton,

I can see the logic in what you say regarding enabling the 'recurring' option and setting the number of payments to 1 - I was always confused about how your module would expire a non-renewing sub as there would be no IPN as these are not setup as subscriptions in PayPal. Please let me know if your testing confirms this.

However.... what were your original intentions for 'subscriptions' that didn't have the 'Recurring' option set? You may be better to remove this option completely as it is purely the 'Subscription Number of Payments' value that drives the renewing/non-renewing functionality.

Also.... what was it that triggered the 'cancellation' event for this non-recurring subscription I had set up? And what set the user to 'blocked'? I had not manually cancelled this, so somewhere, something generated the event (3 days later) and that event was handled in your module.

Finally, regarding the emails - yes they are setup in the individual subscription settings (screenshot attached) - and I have run update.php for 4.4, 4.8, 4.9 and 4.10.

Thanks.

AttachmentSize
emailtemplates.JPG 99.58 KB
Leighton Whiting
Offline
Joined: 06/02/2009
Jaybee, I had originally

Jaybee,
I had originally intended the non-recurring subscriptions to be a 1-time purchase membership, which isn't meant to expire. For example, the person pays $50 one time and gets membership for life. I figured that many people would want to do something like this. These memberships have no expiration (although I am working on storing the expiration server-side and using cron to check for expired memberships, mostly working now but needs some polishing before release). I agree that the process here needs a little more refining, and some better documentation. I will look more into the reason the user was blocked and if I can duplicate it. I am still waiting to hear back from Paypal if my subscription has expired or not. I suspect that there may be a day error margin when dealing with Paypal, just to be on the safe side. I will definitely post my findings here. In the mean time, I am going to be releasing 4.11 today, with some bug fixes and new features, so keep your eyes open for it.

Sincerely,
Leighton

jaybee
Offline
Joined: 08/14/2009
 Hi Leighton, I amended my

 Hi Leighton,

I amended my 'non-recurring' subscription and set it to 'recurring' with 1 payment only (as you describe above). However, I have today received a blank email (subject and body), addressed to the test subscriber, 24 hours after setting up the new subscription which I assume to be the 'expiry' notice - and again the user has been blocked but retains the role assigned during sign-up. I have not (yet) received an email sent to the site admin regarding the 'expiry'.

It sounds like the expiry process is 'sort-of' working (I can see the IPN in the watchdog), but the notifications are not working correctly and the user should not be blocked, but have their role removed.

Can you investigate?

Leighton Whiting
Offline
Joined: 06/02/2009
James, I just checked my logs

James,
I just checked my logs and it shows the eot IPN was received after 24 hours, which is perfect, and the role was removed like it should be. However, the user was blocked, and I think I know why. I put a check for whether or not 'Enforce Signup' was on and if it was, to block the user (thinking that if the user must pay to be a member, then when the subscription expires, he/she should be blocked). I see now the flaw in that assumption, so what I am going to do is add a configuration option to set whether to block the user at the end of term. Actually, I think the better place to put options like these is in the Subscription Configuration Screen, so that different subscriptions can have different options. I will add 4 new options to the subscriptions:

-Block the User (at expiry, cancellation, or never)
-Remove the Role (at expiry, cancellation, or never)
-Checkboxes for which roles should be able to purchase or upgrade to this membership
-Field to enter a url to show the subscription plan on (used for integration with the user_types module)

These will take me a couple of days to finish, so in the mean time I am going to test the 1 day subscription again with an email that works so I can debug any email problems as well for 4.11, so it will be a big release.

Sincerely,
Leighton Whiting

jaybee
Offline
Joined: 08/14/2009
Hi Leighton - that sounds

Hi Leighton - that sounds good - I use the taxonomy access control method to control what my subscribed users see, so I just need the role revoked, not the user blocked.

However - my user's role was definitely not removed (screenshot attached), so could you check that there isn't any conditional logic that might be causing this?

Thanks

 

James

AttachmentSize
blocked.JPG 18.72 KB
Leighton Whiting
Offline
Joined: 06/02/2009
James, Could you send me the

James,
Could you send me the log of the IPNs for that subscription? That would help me debug it.

Sincerely,
Leighton Whiting

Twitter Feed