PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Fixed end of time (EOT)

s2Member Plugin. A Membership plugin for WordPress®.

Fixed end of time (EOT)

Postby lucjager » March 29th, 2011, 5:04 pm

Hi is it or would it be possible to set a fixed term or fixed date for the products / membership to expire?

for example alot of membership programs use fixed times where you can registrer from 1 janauri untill the end of december but the account / membership is only available untill the end of december. And next year the membership could be renewed or something.

Another thing i would like to see in the (Pro) is a way of letting people registrer by coupon code / registration code. This because i would like give some free membership code's to clients / "new" members on seminars etc.

Just think about i like a free code that allows you to go directly to level 2 or something which you can fill in at you membership page.

Thank you,

Best wishes,


Luc de Jager
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Cristián Lávaque » March 29th, 2011, 7:22 pm

s2Member Pro has a coupons feature which you can find at WP Admin -> s2member -> Coupon Codes. Currently they are only compatible with Pro Forms for PayPal and Authorize, so they won't work for you if you're using another gateway.

By a set EOT, do you just mean that it'll stop the recurring billing after a certain number or periods, or do you also want to know how to make it start at a date other than when the order is placed?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed end of time (EOT)

Postby lucjager » March 30th, 2011, 3:17 pm

Thank you for your quick reply,

What i mean with the coupon codes is something that a free member or lvl 1 member can fill in a code in their account to upgrade it to an lvl 2 or specific custom capability.

For example,
normaly a lvl 2 membership cost like 20$
but a student which has a free account fill in the code: freeupgrade3344 and gets the lvl 2 member for free

And for the fixed EOT i mean you pay today but your account is only valid untill a specific "fixed date" instead of 1 / 2 / 3 month from the first payment.

Example normal situaties:
User pays on 1 april 2011 for a lvl 2 membership 20$ - this will last one year untill 1 april 2012

Requested situation (ideal)
User pays on 1 april 2011 for a lvl 2 membership 20$, the account will last untill a fixed preset date something like 1 januari 2012
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Cristián Lávaque » March 30th, 2011, 4:22 pm

Ah ok, thank you for explaining that. I think I understand better what you're trying to do.

Well, I suggest you take a look at these WP Admin -> s2Member -> PayPal Pro-Forms -> PayPal Pro Billing Modification Forms and PayPal Pro Free Registration Forms.

You can set the EOT the way you described it when you generate the form. Where it says "Then, I want to charge:", from the dropdown select the option that says "One Time (for 1 year access, non-recurring, no trial)".

I hope that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed end of time (EOT)

Postby lucjager » March 30th, 2011, 4:41 pm

Hi thanks aggain for you quick reply,

but the option 1 year access will be in the normal situation which i dont want,
the option One Time (for 1 year access, non-recurring, no trial)". means or atleast this is how S2member uses it: end date= registration date + 1 year

What i would like to see =
end date = fixed (so not registration date + 1 year)

One more example how it should be.

If i am a custommer i registrer on 1 april 2011, but i would like to see that this account will be demoted to a free subscriber on a fixed date which i can set in the s2member button option like 23 april 2011.

So if a member registrers itself on whatever date it is (for example we use these details:
Member 1: registrers on 24 march 2011 ($20)
member 2: registrers on 20 march 2011 ($20)
member 3: registers on 1 april 2011 ($20)

But they will all be demoted to a free member on a fixed date (for example: 30 april 2011)

i hope this will clear thinks up,

thanks!

~Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Cristián Lávaque » March 30th, 2011, 5:05 pm

Ah ok, got it.

I will check how it could be done. One more question: Will those buying access on different dates, be charged according to the time they have left until that fixed date you set or they'll be charged the same regardless of how far or close to that date they are?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed end of time (EOT)

Postby lucjager » March 30th, 2011, 5:31 pm

no that won't be needed but, there might be a super nice pro function ;-) but for now it is not needed,

just let me set the fixed date

thanks alot!!!

~Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Cristián Lávaque » March 30th, 2011, 9:20 pm

Well, I don't know if the term attribute would allow a very high number, but if it did, you could calculate how many days to the EOT date you chose, and dynamically enter that term in days to your form.

Maybe it won't take more than 30 days because then you'd normally use months... I don't know. Nothing stops you from trying it. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed end of time (EOT)

Postby Jason Caldwell » April 4th, 2011, 4:03 am

Thanks for an excellent question.
lucjager wrote:If i am a custommer i registrer on 1 april 2011, but i would like to see that this account will be demoted to a free subscriber on a fixed date which i can set in the s2member button option like 23 april 2011.

Yes, you can do something like this.
But this requires s2Member Pro Form integration.

Code: Select all
<?php
$now 
= strtotime("now");
$fixed_time = strtotime("30 April 2011");
$days_until_fixed_time = round(($fixed_time - $now) / ($seconds_in_one_day = 86400));
?>

[s2Member-Pro-PayPal-Form ... ra="10.00" rp="<?php echo $days_until_fixed_time; ?>" rt="D" rr="BN" /]
* The Shortcode in this example has been abbreviated for clarity.

Reference articles:

Variables in your Shortcode:
viewtopic.php?f=36&t=1604

PHP strtotime() function:
http://php.net/manual/en/function.strtotime.php

s2Member Pro Forms ( video intro ):
http://www.s2member.com/video-pro-intro/

Shortcode reference. Please check your WP Dashboard under:
s2Member -> PayPal Pro Forms -> Shortcode Attributes Explained
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby lucjager » April 4th, 2011, 4:39 am

hi i have currently already the pro version of the plugin (bought it a few months ago), it works superb but Paypal website payment pro isn't available in the netherlands just like authorize.net

I'll try this function in the pro forms,

p.s. is it possible to open an "paying" support part of the forum which is dedicated to the pro version of the plugin?

gr

Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Jason Caldwell » April 4th, 2011, 5:07 am

Oh, I see! ~ please let us know if we can assist you.
p.s. is it possible to open an "paying" support part of the forum which is dedicated to the pro version of the plugin?

We'll certainly consider it. For now, all priority support is handled via email.
UPDATE. All support is now handled in our support forums ( here ).
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby Jason Caldwell » April 4th, 2011, 5:09 am

PayPal "Pro" is not absolutely
required to use PayPal Pro Forms.

Video
Take a look at the second video listed here,
regarding "Express Checkout".

viewtopic.php?f=4&t=304
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby lucjager » April 4th, 2011, 5:20 am

Hi i currently use the pro forms for a nice display and information gathering (like custom fields etc) but i use the paypal but (express payment for checkout)

I'll let you know if it works, thanks for helping me so far!

~ Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed end of time (EOT)

Postby Jason Caldwell » April 7th, 2011, 7:29 am

Very welcome.
Thanks for reporting back Luc.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby man-O-media » August 29th, 2011, 8:50 pm

Jason Caldwell wrote:Yes, you can do something like this.
But this requires s2Member Pro Form integration.

Code: Select all
<?php
$now 
= strtotime("now");
$fixed_time = strtotime("30 April 2011");
$days_until_fixed_time = round(($fixed_time - $now) / ($seconds_in_one_day = 86400));
?>

[s2Member-Pro-PayPal-Form ... ra="10.00" rp="<?php echo $days_until_fixed_time; ?>" rt="D" rr="BN" /]
* The Shortcode in this example has been abbreviated for clarity.

Hi Jason,

I would like to follow up on this question as I have the same issue... I have s2 pro however, can I do the same thing with s2 generated buttons instead of forms?
My plan is to have some if/else code combined into the template which I use for "My Profile" which will show specific text and specific membership pay buttons.

And just as important, where can that "$days_until_fixed_time code" live?
Can I simply have it in the template for my form along with the rest or must it live in theme functions?


Thanks, DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby Jason Caldwell » August 30th, 2011, 3:49 pm

Thanks for the follow-up on this thread.

You could *try* this with Buttons, but it gets VERY hairy, because unlike s2Member's Pro Form integrations, PayPal requires your "Button" code to adhere to specific limitations they have at PayPal regarding a maximum number of days. In other words, if the calculation comes out to something like 35 days in your "Button" code, PayPal will hit you with an error, because the maximum number of "Days" they allow is 7; beyond that, they require that you move to using weeks/months instead. So, it IS possible, but you would need to change rp="35" and rt="D" to a Button-compatible configuration, make sense?

For instance, this WILL work with s2Member Pro Forms: rp="60" rt="D"
( because s2Member's Pro Forms will handle internal calculations of this dynamically )

But, for a PayPal "Button", they will require that you use: rp="2" rt="M" ( i.e. 2 months ).
( because Button codes result in a direct submission to PayPal, and you must adhere to PayPal rules )

And just as important, where can that "$days_until_fixed_time code" live?
Can I simply have it in the template for my form along with the rest or must it live in theme functions?

The PHP code that I posted could go right inside your Post/Page that contains the Shortcode, but you will need to install the PHP Execution plugin for that to work. Either that, or yes, it's fine to put that code inside your theme's functions.php file, or even create this file if you prefer:

/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
$now 
= strtotime("now");
$fixed_time = strtotime("30 April 2011");
$days_until_fixed_time = round(($fixed_time - $now) / ($seconds_in_one_day = 86400));
?>

* Note, although your PHP calculation code could go just about anywhere, I recommend the PHP Execution route, because that keeps the variables confined only to the scope of the Shortcode, as it exists inside a particular Post/Page, thereby reducing your risk of creating a plugin conflict within WordPress.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby man-O-media » August 30th, 2011, 5:55 pm

Jason Caldwell wrote:You could *try* this with Buttons, but it gets VERY hairy, because unlike s2Member's Pro Form integrations, PayPal requires your "Button" code to adhere to specific limitations they have at PayPal regarding a maximum number of days.

Yea, I get that and it indeed would require a bit of study and also brings up something I should confirm... As far as I know, Pro Forms are for on-site credit card processing which requires a PayPal Pro acct and can not be used in place of buttons for performing transactions on the PayPal site with a standard acct.
It would be cool though to be able to take the info into the form and push it into the PayPal site.

Anyway, my task is based on a year membership with an expiration at or near Jan 31.
The members can and sometimes do pay as early as October and as late as March for the year.

I do recall your video discussing particularly the PayPal number of days restriction but did not think much of it at the time :)
Judging by the button generator it seems that weeks are more flexible but still hit a wall at a year.
If someone renewed today; Aug 30 2011 to Jan 31 2012 is 22 weeks or about 5.5 months. Obviously I can't do 74 weeks. Can I do 17, 17.5 or 18 months as a Buy Now?
And is this even a discussion without having Recurring payments or a PayPalPro account?

The PHP code that I posted could go right inside your Post/Page that contains the Shortcode, but you will need to install the PHP Execution plugin for that to work. ... I recommend the PHP Execution route, because that keeps the variables confined only to the scope of the Shortcode, as it exists inside a particular Post/Page, thereby reducing your risk of creating a plugin conflict within WordPress.

Actually, I meant putting the code into the template file where you can fully execute php but actually, I like the idea of php exec so I could keep all the related code in one place.
Is PHP Execution fully compatible with all the shortcodes, meaning you can mix shortcodes and standard php?


Many thanks, DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby Jason Caldwell » August 30th, 2011, 6:07 pm

Thanks for the reply.

If you integrate this with Buttons ( that is, if you manage that ), then no, you don't need to worry about PayPal Pro or any additional recurring services, because PayPal Standard ( i.e. Button integration ) is a completely free service provided by PayPal. However, if you choose to integrate this with s2Member Pro Forms, then yes; it's best to have a PayPal Pro account, and if you want to charge on a recurring basis, you would also need their Recurring Billing service as well. See: viewtopic.php?f=36&t=2634

Yes, the PHP Execution plugin allows you to incorporate PHP tags into your Shortcodes as well. For instance, here is an example usage that I posted awhile back: viewtopic.php?f=36&t=1604
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby man-O-media » August 30th, 2011, 6:33 pm

Jason Caldwell wrote:If you integrate this with Buttons ( that is, if you manage that ), then no, you don't need to worry about PayPal Pro or any additional recurring services...

Right... And in terms of "managing" that, can I do for example, 17.5 or 18 months as a Buy Now?
And actually, perhaps a better question is, if I generate a 6 month Buy Now button and change the code to: rp="18" rt="M" and embed and click on the button. Does the fact that it sends me to PayPal mean that PayPal is OK with it? And will S2 be OK with 18 months?
However, if you choose to integrate this with s2Member Pro Forms, then yes; it's best to have a PayPal Pro account...
I don't mean to be a stickler but what do you mean "it's best to have a PayPal Pro account"?
I thought that Pro forms, except the free registration form, only work with a Pro account.
Is there a way (now) to use a Pro form for accepting credit cards that does not require a PayPal pro account and would not require the buyer to have a PayPal account?

Yes, the PHP Execution plugin allows you to incorporate PHP tags into your Shortcodes as well....

Cool!


DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby Jason Caldwell » August 30th, 2011, 11:24 pm

Thanks for the reply!

No, PayPal does not accept decimals, at least not to my knowledge.
I know of the following limitations for PayPal "Buttons", and I just checked the docs again and it looks like they've increased the limitation for days, now up to 90.

See: https://merchant.paypal.com/us/cgi-bin/ ... 8A6HI00JQU
D – for days; allowable range is 1 to 90
W – for weeks; allowable range is 1 to 52
M – for months; allowable range is 1 to 24
Y – for years; allowable range is 1 to 5

* s2Member will understand any of these, there are no limitations for s2Member itself. If were up to us, we'd allow 3000+ days. So as long as you can get the Button to work with PayPal, you're good. During your testing, if you do something that won't work with PayPal, you'll get an error immediately, right at that point where you reach PayPal checkout ( i.e. when you click the Button ).

Sorry, no. While it's true that s2Member Pro Forms will work with only PayPal Express Checkout; if you do that, all of your Customers are required to have a PayPal account, or be willing to sign up for one during checkout ( i.e. on-site credit card processing absolutely requires PayPal Pro ). That's the only reason I said, it's "best" to have PayPal Pro.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed end of time (EOT)

Postby man-O-media » August 31st, 2011, 7:32 pm

Excellent...

24 months is more than enough and I only need a rough end date, give or take a week or two will be OK for what I need which will make the math much easier :D

I'm out of pocket for a few days but will get cracking on this when I get back as this is the last big thing that needs to happen before roll-out.

Many thanks.. DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby man-O-media » September 2nd, 2011, 4:14 am

Hey Jason,

I am getting a bit of push back.
I have a function which gives me the months so I am pretty sure that will work but the desire is really to have the annual membership expire Jan 31st of each year, regardless of when members actually pay. And again, they could pay several months before the 1 year renewal date so counting days won't work.

I presume the actual EOT is written to the users database record after PayPal reports back to S2 that payment was a success.What is the EOT process and how difficult would it be to recalculate the EOT after payment is complete?

So for example the EOT could be recalculated based on the initial amount of months plus the number of days to get to the end of the month or, being as s2 doesn't have he same limits as PayPal, the EOT could be recalculated based on the number of days between now() and Jan 31st of the next year or what ever ?


DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby man-O-media » September 2nd, 2011, 12:57 pm

In searching through the forum some more and keeping in mind that the task is to set an EOT which expires Jan 31st, regardless of when they actually pay, I wonder if I couldnt use the actions described in ths thread: http://www.primothemes.com/forums/viewtopic.php?f=4&t=10100&p=21701&hilit=reset+eot#p21726

It discuses adding actions to:
"ws_plugin__s2member_during_configure_user_registration_front_side"
"ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars"
"ws_plugin__s2member_during_paypal_notify_during_subscr_modify

I already add an action using: ws_plugin__s2member_during_configure_user_registration to set a default Jan 31 EOT which would have taken care of everything except that the EOT gets erased if someone is demoted.

Anyway, honestly, I cant see the forest for the trees in paypal-notify-in.inc.php but I would presume that an action can be triggered when it receives a confirmation from PayPal that the Buy Now payment was received and then, based on the month count originally sent with the PayPal Buy Now button or a new calculation, the "real" EOT could be generated and written.


Many thanks, DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Re: Fixed end of time (EOT)

Postby Cristián Lávaque » September 2nd, 2011, 9:46 pm

Do you mean this hack? viewtopic.php?f=4&t=14384&p=30321#p30321

Well, you can just add more actions with the same function.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed end of time (EOT)

Postby man-O-media » September 2nd, 2011, 11:24 pm

Cristián Lávaque wrote:Do you mean this hack? viewtopic.php?f=4&t=14384&p=30321#p30321
Well, you can just add more actions with the same function.

Yes indeed, the hack you helped me with...

What I am trying to confirm is which actions (or perhaps its all three of those and perhaps there are more?) are triggered by PayPal returning a sucessful payment and what the rest are for...

I presume that "ws_plugin__s2member_during_configure_user_registration_front_side" is essentially the same as ws_plugin__s2member_during_configure_user_registration' but I wonder what the "front_side" is all about.

I am not really sure what this one does: " ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars"

And I presume this is triggered when an existing paid subscription is active and it is somehow modified: "ws_plugin__s2member_during_paypal_notify_during_subscr_modify" and if that is the case I guess I don't need it as we will only be doing 1 year Buy Now payments.

So bottom line, which actions are triggered when there is a successful BuyNow payment?

Thanks, DP
User avatar
man-O-media
Experienced User
Experienced User
 
Posts: 117
Joined: February 10, 2011

Next

Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron