latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Custom capabilities and End of Term (EOT)

Home Forums Community Forum Custom capabilities and End of Term (EOT)

This topic contains 8 replies, has 2 voices. Last updated by  Glyn Davidson 3 years ago.

Topic Author Topic
Posted: Saturday Dec 28th, 2013 at 5:58 pm #62215

Hi guys,

It’s been quite a steep learning curve but I think I’ve got everything working on my site now, what a powerful and comprehensive plugin you guys have developed!

Although I appear to have everything working, there’s still some basic understanding that I’m missing and was hoping you could clarify for me:

(1) What does the “Custom String Value” do (i.e. custom=”” on a ProForm) and why does it contain the domain name?
(2) What happens to a (level 1,2,3, or 4) user’s recurring payments if I change their role to author, editor or admin? What happens if I then change them back to level 1 again?
(3) I understand that all financial details are held by PayPal, but does s2Member keep any record of how much a user has paid, which ProForm was used during signup, and which coupon codes were used?

Let me explain Question 3 a little further…
All users on my site will either be level 0 (free subscriber) or level 1 (paying member).
Level 1 members will pay an annual, recurring fee.
I’d like to offer varying level 1 discounts to students, unemployed persons, and additional family members.
All paying members will have the same capabilities regardless of how much they pay.

To register normal members, students, and unemployed persons I have set up nested ProForms with a drop-down-select. This works well.
For additional family members (who might also be students and/or unemployed) I have created voucher codes.
What I haven’t yet been able to work out is how to identify if a level 1 member is a full member, a student, unemployed and/or an additional family member.

My guess is that the answer to question 1 will also answer question 3?

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Sunday Dec 29th, 2013 at 3:45 am #62224
Bruce
Username: Bruce
Staff Member

Hi Glyn,

I think I can help answer your questions. :-)

(1) What does the “Custom String Value” do (i.e. custom=”” on a ProForm) and why does it contain the domain name?

The custom attribute is an attribute that PayPal gives s2Member access to, and s2Member uses it to verify that the transaction is meant for s2Member to process. s2Member checks that the custom attribute is set to your domain name (along with checking a few other values) to make sure that the transaction it’s getting is not meant for, say, an eBay sale, or a different site that you have your PayPal account hooked into. This should always stay as your domain name to prevent conflicts.

(2) What happens to a (level 1,2,3, or 4) user’s recurring payments if I change their role to author, editor or admin? What happens if I then change them back to level 1 again?

s2Member does not perform any changes when a recurring payment is performed to users. In fact, you could take someone that is paying for level 1 and manually push their account up to level 3, and s2Member will not demote at any point other than when they stop paying and lose access.

If you don’t want a User to be demoted even if they stop paying for access, you can simply remove their Paid Subscription ID from their profile, and s2Member won’t link the User’s transaction to their account anymore, making it impossible for s2Member to automatically demote them.

See: Dashboard -› Users -› Edit

(3) I understand that all financial details are held by PayPal, but does s2Member keep any record of how much a user has paid, which ProForm was used during signup, and which coupon codes were used?

No, s2Member won’t store any information like that by default. If you want to track your User types, I would suggest that you check out Custom Capabilities (ccaps). These (Custom Capabilities) are standalone capabilities that are given to Users on signup or upgrade and can be used to protect content or separate members aside from Membership Levels.

See: Dashboard -› s2Member® -› API / Scripting -› Custom Capabilities

To give you an example, you might give your Student members the Custom Capability “student”. Then, you can check if any particular User is a student with Shortcode Conditionals.

Example of using Shortcode Conditionals:

[s2If current_user_can('access_s2member_ccap_student')]
	You are a Student User!
[/s2If]

See: Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals

You can generate Pro Forms / Buttons with Custom Capabilities baked right in, or add them in later by editing the ccaps attribute that’s in your Buttons and Pro Forms’ Shortcodes.

Does that help?

Posted: Sunday Dec 29th, 2013 at 12:07 pm #62229

Wow, thanks Bruce. Really appreciate your taking the time to give me a full response.

Your solution seems to be working perfectly and I’m able to access all of the custom capabilities:

foreach (get_user_field ("s2member_access_ccaps") as $ccap) echo $ccap;

However…

Before diving right in I thought I’d follow your advice and read up about ccaps in the Dashboard but found that

Dashboard -› s2Member® -› API / Scripting -› Custom Capabilities

Doesn’t exist.

Most of the PayPal ProForm shortcodes are explained here, but not ccaps:

Dashboard -› s2Member® -›  PayPal Pro Forms  -› Shortcode Attributes Explained 

As I said, it seems to be working for me though. My only problem now is that I no longer seem to be receiving the EOT from PayPal. And, when a level-1-user cancels their subscription, their recurring payment is cancelled in PayPal, but nothing appears to happen on site.

Q1) Is this likely to be a configuration error, or should I allow more time for communication between s2member and PayPal?
Q2) What is the usual time-frame for s2Member to receive the EOT from PayPal?

P.S. For anybody else who arrives at this topic, you can also find out which Pro Form was used during checkout by looking at your PayPal account.

Posted: Sunday Dec 29th, 2013 at 4:08 pm #62233

Sigh…

I’ve been banging my head against this all day and not made any progress whatsoever :(

Further to my previous post, I found that the reason I wasn’t seeing anything related to custom capabilities is because I was working in a child blog. All the custom capability stuff is only available to the primary blog.

Anyway, that’s not my problem, the problem is that I can’t get the EOT to work. Or more specifically, the field is always empty.

I’ve tried deleting all my PayPal options and copying them from paypal again.
I tried deleting all sandbox account and completely starting from scratch (twice)
I’ve been through the videos on Youtube and followed them step by step
I now have all plugins disabled except for s2Member but still no joy
I need somebody to tell me it’s going to be alright before I curl up in a heap and spend the next few days feeling sorry for myself :(

P.S. It works fine for one off payments, but not for recurring payments. Although that’s most likely because s2Member calculates EOT for one-off payments itself and doesn’t rely on IPN.

I’m at a loss what else to try, any pointers very much appreciated.

Posted: Sunday Dec 29th, 2013 at 4:08 pm #62234
Bruce
Username: Bruce
Staff Member

However…

Before diving right in I thought I’d follow your advice and read up about ccaps in the Dashboard but found that

So sorry, I linked to that from memory. That’s the old location of the documentation for Custom Capabilities. The real name of this section is Custom Capabilities (Packages).

My only problem now is that I no longer seem to be receiving the EOT from PayPal. And, when a level-1-user cancels their subscription, their recurring payment is cancelled in PayPal, but nothing appears to happen on site.

s2Member won’t immediately demote a User when they stop paying usually. Instead, it will set an Automatic End of Term time on their profile. I’d recommend looking at the profiles that have been canceled by a User and see if that EOT Time is set. If it is, then s2Member is working correctly, and that User will be demoted after the time that they have paid for is up (i.e. when they hit their EOT time).

s2Member should get notification of the recurring subscription being cancelled almost immediately.

There’s detailed information on Auto EOTs here:

Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior

If the EOT time isn’t set on the profile for the User it’s supposed to be, that probably means that there’s something wrong with your PayPal IPN setup. Try turning on logging here, and checking your PayPal settings to make sure that IPN is set up correctly:

Dashboard -› s2Member® -› Log Files (Debug) -› Logging Configuration

Posted: Sunday Dec 29th, 2013 at 4:11 pm #62235
Bruce
Username: Bruce
Staff Member

Sorry that you’re having so many problems with this.

I’ve tried deleting all my PayPal options and copying them from paypal again.
I tried deleting all sandbox account and completely starting from scratch (twice)
I’ve been through the videos on Youtube and followed them step by step
I now have all plugins disabled except for s2Member but still no joy
I need somebody to tell me it’s going to be alright before I curl up in a heap and spend the next few days feeling sorry for myself :(

I would definitely make sure logging is turned on. Make sure that logs are generated when you create a subscription, and when a cancellation is done. If not, then it could be some kind of blacklisting, or a caching problem. Look at the errors. If you see any and don’t know what they mean, post them here and I’ll try to clarify for you. :-)

Posted: Sunday Dec 29th, 2013 at 6:47 pm #62246

So sorry, I linked to that from memory. That’s the old location of the documentation for Custom Capabilities. The real name of this section is Custom Capabilities (Packages).

Don’t apologies Bruce, I’d be in real bother if I wasn’t able to realise that Custom Capabilities were stored in Custom Capabilities (Packages)! As I said, I was looking at s2Member in a child blog which (in my installation) doesn’t have Custom Capabilities (Packages). Custom Capabilities are restricted to the parent blog only. Similarly, all ccap shortcodes in ProForms etc aren’t visible in child blogs. Getting ccaps working was straight forward enough though so not an issue and I completely understand why they should be hidden from child blogs, in fact I’m glad that they are.

s2Member won’t immediately demote a User when they stop paying usually.

If my understanding of what I read in

Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior

is correct, that’s because you get better customer satisfaction by allowing a grace period right? I changed the grace period to 300. Once the site goes live I’ll up the grace period to 1 week, but during dev, I thought 5 mins would be sufficient for s2 and PayPal to talk to each other?

s2Member won’t immediately demote a User when they stop paying usually. Instead, it will set an Automatic End of Term time on their profile. If it is, then s2Member is working correctly, and that User will be demoted after the time that they have paid for is up (i.e. when they hit their EOT time).

WOAH!!!
That’ll be why I thought it was working this morning then… I just cancelled a (1 year recurring) subscription and their EOT was changed to January 12th 2015 :D . WooHoo, something’s working! :D

Ahah! Duh!
Of course, I understand now (I think). I remember reading somewhere, probably in the awesome dashboard documentation, that if a user cancels their subscription, they still get access for the remaining term. i.e. If a level-1-user has paid for a 1 year subscription but cancel their subscription after 5 days, they will remain a level-1-user for the remaining 360 days until their EOT is up. Is that right?

If that is right, that’s cool, I get that, but… forgive me if I’m being stupid here, after a level-1-user registers (with a 1 year recurring membership), do I have a mechanism to show them when their next (i.e. the first recurring payment) is due? Shouldn’t the EOT be populated as soon as the first payment is made?

s2Member should get notification of the recurring subscription being cancelled almost immediately.

What if I cancel (refund) a subscription via PayPal, should s2Member get notification almost immediately then? And if it does, I presume it will honor the grace period, but not the EOT right?

Posted: Monday Dec 30th, 2013 at 4:13 pm #62252

Duh!!!

Like you said Bruce, everything appears to be working fine. I just issued a refund via paypal and the account was demoted to free subscriber. I’d pulled everything apart for nothing!!! Oh well, at least I learnt a few things in the process.

The problem was caused by my understanding of what the phrase “End of term” meant. In my mind it meant when the next payment was due. Once I (eventually) realised that it doesn’t mean the end of this payment period, everything became clear.

An amazing plugin guys, congratulations to all who have been involved in its creation.

Posted: Monday Dec 30th, 2013 at 4:15 pm #62253

I’ve renamed the topic title so that it reflects the content

Viewing 8 replies - 1 through 8 (of 8 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.