Page 1 of 1

Paypal Button (upgrade) 7 Days Trial not working

PostPosted: March 31st, 2011, 5:28 am
by OWeekly
Hi all,

I have having issues, and have done the screenshot to better explain myself.

Problem one: 7 days trial from Paypal Button / Modification not giving end result of 7 Days Trial

http://optionsweekly.org/wp-content/upl ... ton-7D.png

Image


Problem 2: Coding error?

http://optionsweekly.org/wp-content/upl ... orm-FM.png

Image

Please help, Thanks

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 3rd, 2011, 7:05 am
by Jason Caldwell
Hi Allan. Thanks for the great questions.

Problem #1, appears to be related to this confusing aspect of PayPal®.
~ It's not a bug, it just creates some confusion during testing.
viewtopic.php?f=4&t=2894&p=8710#p8710

Problem #2, not a bug, but this configuration is hard-coded into the current release.
@TODO :: We need to at least provide Filters with the ability to change these values.

In the mean time, you can open this file and make the changes necessary.
/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php

Find all occurrences of:
Code: Select all
$paypal["MAXFAILEDPAYMENTS"] = "2";
$paypal["AUTOBILLOUTAMT"] = "AddToNextBilling"; 

Change the occurrences to this, if you prefer:
Code: Select all
$paypal["MAXFAILEDPAYMENTS"] = "1";
$paypal["AUTOBILLOUTAMT"] = "NoAutoBill";  

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 3rd, 2011, 9:56 am
by OWeekly
Hi Jason,

WRT:

Problem #1, appears to be related to this confusing aspect of PayPal®.
~ It's not a bug, it just creates some confusion during testing.
viewtopic.php?f=4&t=2894&p=8710#p8710

My situation is as such, a free registered member, trying to modify/upgrade to paying member, from $0 to $29.95 via a 7 days free trial 1st..

So I am not understanding why the modification button did not function as it is supposed to.

Thank you again.

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 3rd, 2011, 11:02 am
by Jason Caldwell
Thanks for the follow-up Allan.
~ and thanks for clarifying. I see now.

Your Shortcode in that screen shot has modify="1". In cases where you have Free Subscribers, who are also going to receive an Initial/Trial Period when paying, you will need to change it to modify="0".

That will work just fine. s2Member is still capable of updating the existing account after checkout. So in your case, setting modify="0" will only affect the PayPal interface in the way you need it to.

The modify="" Attribute explained.
0 – allows subscribers to only create new subscriptions
1 – allows subscribers to modify their current subscriptions or sign up for new ones
2 – allows subscribers to only modify their current subscriptions

@TODO :: update documentation in PayPal Modification Button Generator,
and/or build in a dynamic solution for this specific scenario in the next release.

( done, a dynamic solution has been included with s2Member v110605+, see below. )

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 4th, 2011, 2:08 am
by OWeekly
Thanks Jason, I will do both soon... But just wondering if i change this, will the next upgrade will have this set of code on it?

Thanks..


Jason Caldwell wrote:Hi Allan. Thanks for the great questions.

Problem #1, appears to be related to this confusing aspect of PayPal®.
~ It's not a bug, it just creates some confusion during testing.
viewtopic.php?f=4&t=2894&p=8710#p8710

Problem #2, not a bug, but this configuration is hard-coded into the current release.
@TODO :: We need to at least provide Filters with the ability to change these values.

In the mean time, you can open this file and make the changes necessary.
/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php

Find all occurrences of:
Code: Select all
$paypal["MAXFAILEDPAYMENTS"] = "2";
$paypal["AUTOBILLOUTAMT"] = "AddToNextBilling"; 

Change the occurrences to this, if you prefer:
Code: Select all
$paypal["MAXFAILEDPAYMENTS"] = "1";
$paypal["AUTOBILLOUTAMT"] = "NoAutoBill";  

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 4th, 2011, 2:43 am
by Jason Caldwell
Changes that you make directly in the source code for s2Member will be lost upon upgrading s2Member in the future. This is why we suggest Hooks/Filters instead, because they survive future upgrades.

In your case though, there is no way to use a Hook/Filter, because it's hard-coded in.
So you'll have to modify the source code in order to accomplish what you need. In the next release, we'll be sure to add a Hook/Filter onto this behavior, so it's possible to modify it dynamically.

I'm marking this thread in our TODO list, so you'll be updated at that time, along with any other important information related to changes that take place regarding this topic.

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 4th, 2011, 3:56 am
by OWeekly
Cool! Thanks .... I just did the change and tested it, it works perfectly now.

Jason, This is not a issue, but mor like request,

I mean, what I am about to do is to offer 7 days free trial to the public, but what is there is a cheapskate guy, who does the 7 days free trial and cancel b4 7 days, then sign up a new free trial again, doing it upteem times... Can this happen?

Is there any way to limit the signing up of the free trial the 2nd time, if the user is using the same paypal email to pay?

Thanks..

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 4th, 2011, 4:36 am
by Jason Caldwell
Thanks Allan. We are working on a new feature that will help to secure this further.
Until then, I recommend finding a good plugin that is designed to block registration by email address and/or by IP address.

I've not tested any of these,
but you might have a look.
http://wordpress.org/extend/plugins/ip-ban/
http://wordpress.org/extend/plugins/ban-hammer/

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 4th, 2011, 5:19 am
by OWeekly
Thanks John, but i have a good think, I still wish to have free subscribers even if they decided to dropout, and but banning them, it would nt be possible o hve them ard anymore. I think it woul be Paypal side if anything is to restrict them... for now at least... looking forward to it!

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: April 7th, 2011, 7:34 am
by Jason Caldwell
That's a very good point Allan.
I'm not aware of anything on the PayPal side that would allow this. In other words, I don't think PayPal offers a way for site owners to block payments from specific email addresses, is there?

We'll be taking a closer look at this. @TODO :: block payments?

Re: Paypal Button (upgrade) 7 Days Trial not working

PostPosted: June 5th, 2011, 9:03 pm
by Jason Caldwell
@TODO :: update documentation in PayPal Modification Button Generator,
and/or build in a dynamic solution for this specific scenario in the next release.

Code: Select all
/* Automatically adjust to `modify="0"` ( when an Initial/Trial Period is configured ), and a User is either NOT logged-in, or has nothing to modify. */
$attr["modify"] = ($attr["modify"] === "1" && (!is_user_logged_in () || !get_user_option ("s2member_subscr_id")) && $attr["tp"]) ? "0" : $attr["modify"]; 
( done, included in the official release of s2Member v110605+ available now )