Page 1 of 1

PayPal not needed ...

PostPosted: November 27th, 2011, 4:27 am
by Loggy
I am setting up a site that I originally conceived as a membership site. I have been looking at various membership plugins and most roads point to s2member. However as I go through the setting up procedure (again) I am pleased to note that:

1) posts, pages and menu items are not available to members who should not see them
2) s2member does not wrap posts with shortcodes to do this, yet
3) I can restrict visibility down to individual post level.

so my question is:

Q) Is is possible to disable completely the PayPal settings? I realise that not setting them will have the same effect but I like things neat and tidy.... More importantly, will I still be able to use the 'paid' membership levels?

Re: PayPal not needed ...

PostPosted: November 27th, 2011, 8:26 am
by Eduan
Well you can disable PayPal, but you need the Pro version to have other payment gateways, but then you would only accept buttons unless you use Authorize.net.

If you want to disable PayPal completely you might wanna take a look at this post:
viewtopic.php?f=4&t=15914&p=53119&

Hope this helps. :)

Re: PayPal not needed ...

PostPosted: November 27th, 2011, 7:02 pm
by Cristián Lávaque
Loggy, do you mean not receiving payments at all and use s2Member to manage access to content and give that access to users manually editing their profiles? You could do that without a problem.

Re: PayPal not needed ...

PostPosted: November 28th, 2011, 5:14 am
by Loggy
@Eduan - thanks for that link although that's more to do with PayPal admin and transferring accounts I think.

@Cristian - that's right. There are lots of nice goodies in the s2member framework alone without the payment systems, for example checking how many logins there are and from what IPs. It avoids having loads of plugins that may do the same thing but would not necessarily be integrated properly and anyway would fill up my dashboard.

Level #0 and level #1 is all I need but while #0 is by definition free, my question is how someone would 'register' themselves at level #1 (or how I would 'promote' them subject to various conditions). I could use a subscribe plugin as the completely free membership and then just #0 for what I want but I would rather differentiate between a casual visitor, an interested visitor and a member by using s2m.

I am using AmberPanther's WP Include File which enables me to do pretty nearly anything I want in posts, pages or widgets. (This is by far the neatest way to do this - I just have a library of php files that access $wpdb etc). So if it is just a matter of hacking some code, that's OK. It's knowing which s2m function to call and ensuring that the database is not compromised.

The registration for Level 1 appears to need a paypal payment which is what I want to get round ... :-)

BTW the other membership plugins I have tried are the WPMUDEV Membership, which as an ugly registration page and the rather better Your Members plugin which wraps [private] round all your posts [/private] and only nods at categories and tags for membership level protection.

Re: PayPal not needed ...

PostPosted: November 29th, 2011, 2:55 am
by Cristián Lávaque
Ah, to let someone register for free at Level 1, you could use a free registration pro-form, which is available in s2Member Pro.

Jason shares a hack to allow free registration at Level 1 which would work in s2Member free, if I'm not mistaken: viewtopic.php?f=36&t=2819

I hope it helps. :)

Re: PayPal not needed ...

PostPosted: November 29th, 2011, 4:50 am
by Loggy
Cristian

Thanks for this. Now my question to myself is whether I upgrade to Pro or just hack the coding a little.

There are advantages in both but thanks so much for the direction and to Jason for the hack. (Well I guess the Lead Developer doesn't hack by definition but that's another discussion.... :-))

I will be interfacing with PayPal in fact but the charging etc is consumption-based and too complex to incorporate in any membership plugin so that will be done externally to S2M and a running account placed in a text widget. PP enables (with their permission) recurring payments that can be transaction ID based called Reference Transactions. This enables you to charge when the account reduces to a certain amount, which is what I want. But to do this I need the actual membership to be free.

Re: PayPal not needed ...

PostPosted: December 1st, 2011, 1:40 am
by Cristián Lávaque
Interesting, I didn't know about that. Could you explain a bit more about what you mean by consumption-based membership and how it's done with PayPal, please? :)

Re: PayPal not needed ...

PostPosted: December 1st, 2011, 4:27 am
by Loggy
Cristian

I am setting up a web hosting system where clients may have a number of websites under the same roof, use some of the tools I have developed and generally 'consume'. I originally thought I could just charge a membership rate of so much per month but in fact different clients will have different requirements - some may have a few websites, some may have more need for support than others.

Therefore each client will have different needs and 'consume' different amounts. The way I now envisage this is for them to have an account, fed by PayPal, which they can top up from time to time. PP allows recurring payments (which s2m includes) but also effectively authorised topups on demand so when an account falls too low, it is topped up by a given amount. I will implement this feature but not use s2m as I can't see how it can be implemented and pp+ipn etc is not that difficult (I've done it before by hand). And this way I can more easily integrate the payment system with the hosting management system, which sits on a different database.

I don't know how this sort of thing fits into a membership system but my basic registration which will be at level 0 will then prompt the client to add a hosting account, which will start off with a small amount for free and move them to level 1. With s2m I can easily limit what pages, posts etc are visible at these two levels. At the moment I don't envisage using levels 2, 3 and 4 but may do. When they run out of credit, they will be able to add funds or do it automatically by Reference Transactions. There are issues that for some support, it will need a committment for a certain length of time (essentially the support is bought on credit) but that is not too difficult to add.

Any ideas always welcome of course... :-)

Re: PayPal not needed ...

PostPosted: December 3rd, 2011, 11:13 pm
by Cristián Lávaque
Oh, I see now.

Hmm... Yeah, s2Member is not really built for that.

Let me know how you end up solving it, please!

Actually, I'll take a note to see how a credits system could be implemented.

Thanks! :)

Re: PayPal not needed ...

PostPosted: December 19th, 2011, 12:59 pm
by Loggy
I have tried calling http://myurl.com/register_level=1 or probably better, added into the end of my activation routine:

Code: Select all
$link = c_ws_plugin__s2member_register_access::register_link_gen ("none", time(), $_SERVER["HTTP_HOST"], 1, false);
wp_redirect ($link);


but I think I am missing something somewhere. I need to be able to migrate a member from free #0 to level 1 and nothing happens - the role remains Subscriber rather than migrating to S2Member Level 1., even after logging out and back in.

Clues? Is there a function? Any debug routines?

Re: PayPal not needed ...

PostPosted: December 19th, 2011, 3:33 pm
by Loggy
OK - I think I have the wrong end of the stick. The suggestion by Jason at viewtopic.php?f=36&t=2819 was really to do about defining a level, not joining it. So you can define level 1 to be free level by setting the payment gateway to 'none'. That is clearly necessary but the main thing I want to be able to do is to migrate a user under programmatic control from level 0 to 1 (and possibly futher).

Is there a function that does this? I can't find one at the moment ... ;)

Re: PayPal not needed ...

PostPosted: December 19th, 2011, 4:03 pm
by Loggy
Ah - I think I have a clue. It is all in the usermeta table. The subscriber level is set in a one-element serialised array with metakey {prefix}_capabilities (as standard - it's an extension of the usual Wordpress roles) with payment and time stamps in {prefix}_s2member_paid_registration_times again as a serialised array.

I just have to check the time format and what happens when people migrate from one to the other.... then a little php/mysql ... :-) I'll do that tomorrow with some dummy users set up.

Am I right? Can I migrate folk just by unserialising the array, changing the level and times, reserialising and writing it back? It seems too simple but elegant solutions generally are!! :D

Re: PayPal not needed ...

PostPosted: December 20th, 2011, 3:57 am
by Cristián Lávaque
This thread shows how you can change a user's role with PHP. viewtopic.php?f=36&t=2599

I hope it helps! :)

Re: PayPal not needed ...

PostPosted: December 20th, 2011, 5:20 am
by Loggy
That's great Cristian. :D I now automatically migrate a user from the subscriber level to level 1 (or further) by the set_role function. And this is revealed in the roles in the user/member table in the back end.

Mind you, the effect seems to be the same as add_cap('access_s2member_level1') - the level 1 pages are now visible on the menus for example and I can filter by the current_user_can('access_s2member_level1') or something.

The difference between roles and capabilities seems to be a rather fuzzy one.

Am I missing something? Could I just leave all users as subscribers and add the facilities as capabilities rather than elevating the membership level (and therefore involving myself in changing the payment gateway)? I can have an infinite number of capabilities (stored in the usermeta table).

Re: PayPal not needed ...

PostPosted: December 20th, 2011, 6:03 am
by Cristián Lávaque
Glad that helps. :)

Well, roles are defined in terms of capabilities, they're like grouped capabilities. https://codex.wordpress.org/Roles_and_Capabilities

You could work with capabilities only, but I suggest you prefix them the way s2Member does to create "custom capabilities" which you can then handle with s2Member for restrictions and access. http://www.s2member.com/custom-capabilities-video/