We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Expire Users with SCM Extension & Cron Job -- Does this work?

Development and Programming

Greg Aker's avatar
Greg Aker
6,022 posts
17 years ago
Greg Aker's avatar Greg Aker

Hello,

I’m working on an online education site that will have a six month membership with an option to renew. I REALLY don’t want to have to do it manually, as I am a part owner of the company. So I came up with the following extension & php script to run as a cron job to try to do the trick.

I would appreciate it if people would be willing to look at this, tell me what they think & feel free to borrow if it would help them out. However, I have a couple of concerns. This method is completely depends on getting the ping back from Paypal and changing their member group. I have read that it’s not always reliable (is this true?)

So a member who has not paid is in the default member group of ‘4’. I will have their member group change to ‘7’ upon the ping from PayPal. Do you think the page they are returned to after purchase could have a “success” message, or conditionals to see if they are still in member group ‘4’ and tell them there was a problem receiving info from paypal, and they should email us with their info. Or is this unprofessional?

Other admins will have access to SCM, but not Extensions, so I have this making a new table with the info I want, to help to protect from other Admins from “cleaning things up” and messing up the system. That being said, I would love suggestions on how to get stuff into the DB without having to enter stuff manually.

Any and all suggestions/feedback is much appreciated.

Regards,

-greg

       
Boyink!'s avatar
Boyink!
5,011 posts
17 years ago
Boyink!'s avatar Boyink!
This method is completely depends on getting the ping back from Paypal and changing their member group. I have read that it’s not always reliable (is this true?)

Hi Greg -

I’m using SCM & member group changes on one of my own sites. I’m interested in this extension for use there as well, so will find time to look at it over the next couple of days.

I’ve not yet had any issues with people paying through PP and not getting the ping back - and that’s with a few hundred instances.

       
Greg Aker's avatar
Greg Aker
6,022 posts
17 years ago
Greg Aker's avatar Greg Aker

Michael:

Thanks for the reply. Looking over it again, I made a couple of changes and re-uploaded above. I look forward to hearing what you have to say! =)

Many Thanks! 😊

-greg

       
ms's avatar
ms
274 posts
17 years ago
ms's avatar ms

Sounds interesting. I’ll have a look as well as soon as time permits. Thus a feature could really be very useful in some cases.

Of course, every action handled by the SCM (or any shop automation using PayPal) will depend to the IPN PayPal sends as a pingback. My concern always was when having multiple courses/products - I only can change the member group tio the one associated with the last successful payment. But I’ll need to digg into your code over the weekend first to give some qualified comments.

Thanks for sharing! Markus

       
Greg Aker's avatar
Greg Aker
6,022 posts
17 years ago
Greg Aker's avatar Greg Aker

Markus:

For what it’s worth, at this time, we are only running one course, but in the next couple of years it could expand, so that’s something I definitely need to take into consideration. Off the top of my head, maybe have different member groups, but also reference the id of the purchase in the db to give them permissions? Oh wow, this could grow into a monster! 😉

If you care, I’m using code igniter to populate a dynamic flash-driven practice test, and I’m using standard EE weblog stuff to do the rest of the site with some custom modules & plugins. I’m EXTREMEMLY excited that the 2.0 will be on top of CI, as I can’t wait to see how it will all integrate! =)

I appreciate you checking this out, and look forward to comments!

Regards,

-greg

       
Boyink!'s avatar
Boyink!
5,011 posts
17 years ago
Boyink!'s avatar Boyink!

OK - taking a couple minutes to look at this.

Keep in mind I’m not a PHP guy - so it’s likely I’m not fully understanding the code..😉

I think overall the approach looks promising for my needs - which are essentially just rolling back a person from a “customer” member group to a “member” member group if their last purchase date is older than a set amount of time.

However I’d want an interface where I could set/choose the member group ID’s, change the text of the emails that get sent, change the timeframe for the rollback etc. I almost wonder if what I’m after is more of a module rather than an extension.

       
Greg Aker's avatar
Greg Aker
6,022 posts
17 years ago
Greg Aker's avatar Greg Aker

Michael,

Thanks for the response.

I am a PHP guy “wanna-be,” so I’m trying hard here. 😉

I have been thinking about this, and I am expanding to allow for different user groups to have different expiration times, etc.

I think this can be accomplished with settings on the extension & a plugin for the cron-job.

I will keep tinkering, probably ask some questions on the boards for the real “php guys & gals” and re-upload on this thread when I have something.

Kindest Regards,

-greg

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi Greg, this looks to be a really interesting extension. On first inspection of the code my first thoughts are could this be achieved by just adding a custom member field for renewal date rather than adding a new table?

I’m sure there is a simple reason for having taken this approach but if you had the renewal date in a custom member field you could call it up on member pages so that a member could see when they renewed and you could also then display an expiry date. :?

Finally, perhaps I am being daft but which file do you call with the CRON job? Or are you using the EE Cron Plug-in? It would be great to see this develop into a module with an interface to show subscriptions, expiry dates etc for members.

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Some more feedback for you Greg!

It looks as though this extension sets the ‘renewal_date’ for a returning (not new) member to ‘today’. Would it not make more sense to set the renewal date to the expiry date ‘if’ the renewal date has not yet passed? This would allow members to renew prior to membership expiring if they wished.

😊

       
communicatedesign's avatar
communicatedesign
35 posts
16 years ago
communicatedesign's avatar communicatedesign

Hi there What’s the latest on this plugin please? It looks like it would be very useful for me…

Thanks Matt

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

Sorry,

I haven’t had the time to do much with it. I might try to pick it back up sometime soon. 😊

-greg

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi Greg, I’m about to pick this ext up and use it to try and implement expiry of membership on a site we are working on so I just wanted to check if you had any further updates for us. Could you also confirm where we should be placing the ‘expireUSers.php’ file? I’m assuming it should be a page template with PHP enabled which is called by a EE cron job?

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

Hey nathan,

Still haven’t had time to do anything with it. 😊 Anyhoo, my original plan, which to be honest, I didn’t test, was to put that in a template and run it with the cron plugin.

-ga

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Thanks for the clarification Greg. I’ll give it a shot and let you know how I get on! 😊

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Well I’m right in the thick of using this script as a starting point, just thought I should point out that while the extension creates a table called ‘exp_paid_members’ the PHP in the actual extension tries to interact with a table called ‘exp_paid_users’ so I’ve had to update the table references in the PHP at this end to reflect that. I’m also setting the renew date in the exp_paid_members table to $today+31556926 (12 months) in my case and setting the renew date for already paid members to the previous renew date plus 12 months.

Will keep you updated…

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.