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™

Circumventing s2Member PayPal Return URL

s2Member Plugin. A Membership plugin for WordPress®.

Circumventing s2Member PayPal Return URL

Postby PseudoNyhm » September 1st, 2011, 12:15 pm

I'm seeking a slight clarification to this: viewtopic.php?f=4&t=10300#p22105

Somewhere I read (but I can't find the reference) that s2Member can use PayPal PDT payment return data to provisionally and immediately set a member's new level, without having to await the IPN message.

That is, suppose a user buys a Level0-to-Level1 (upsell) subscription. Using button code return URL (or AutoReturn), with PDT configured, and if the URL contains /?s2member_paypal_return=1, then s2Member can interpret the PDT data to determine if the transaction was a success. If so, then s2Member can immediately set the user's level to Level1.

(Notice that this scenario does not include a PayPal Free Trial period, because PayPal does not provide PDT data when no payment was actually made... which is unfortunate, but true.)

If I do not use a URL with /?s2member_paypal_return=1, then s2Member won't see the PDT, and cannot immediately set the user to Level1 (and I must await the IPN, which could be seconds or minutes depending on various issues).

  1. Am I correct that s2Member will use PDT information to set a user's Level (before IPN comes through)?
  2. By not using /?s2member_paypal_return=1, am I losing this capability (such that IPN is then the ONLY way level will be upgraded)?

Many thanks for any additional insight.
User avatar
PseudoNyhm
Experienced User
Experienced User
 
Posts: 79
Joined: June 19, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Jason Caldwell » September 2nd, 2011, 7:12 pm

Hi there. Yes, you are correct in both A and B assumptions.

Note, starting with s2Member Pro v110815+, it is now possible to either customize the Thank-You Return Page template, using the instructions provided in your Dashboard, under: s2Member -> PayPal Options -> Auto-Return/PDT Integration, or you can use the success="" Shortcode Attribute ( made available by s2Member Pro ) for each Button and/or Pro Form that you integrate; and, now in s2Member Pro v110815+, this WILL still allow PDT processing to take place automatically ( made possible in v110815+ ).

For instance, here is an example:
Code: Select all
[s2Member-PayPal-Button ... success="http://www.example.com/my-thank-you-page/" ... /]
( this Shortcode is abbreviated for clarity in this regard )

This forces s2Member to do the following after PayPal checkout:
Code: Select all
/?s2member_paypal_return=1&s2member_paypal_return_success=http://www.example.com/my-thank-you-page/
In other words, s2Member processes PDT, and then redirects the Customer to your own custom page, specified in the success="" Shortcode Attribute, which ends up in the query string like you see here.

BUT, please note. ... excerpt from Shortcode Attributes ( Explained ) in your Dashboard...
success="" Success Return URL ( optional ). s2Member handles this automatically for you. However, if you would prefer to take control over the landing page after checkout ( i.e. your own custom Thank-You Page ), you can. If supplied, this must be a full URL, starting with http://. Note, s2Member will NOT use this value if an existing account holder is being modified. s2Member handles account updates ( i.e. billing modification ) in a more dynamic way. Your Success Return URL is only applied to (new) Customers.



In your test case, you describe an "existing" Free Subscriber upgrading to Level #1. In that case, the success="" Attribute would NOT help you, as explained above. So instead, you can either customize your Auto-Return / Thank You Page template, using the instructions provided in your Dashboard, under: s2Member -> PayPal Options -> Auto-Return/PDT Integration...

Or, you can use this Filter, perhaps something like this:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter 
("ws_plugin__s2member_redirection_url_after_modification", "my_redirection_url_after_modification");
function my_redirection_url_after_modification ($s2member_default_value, $vars = array ())
    {
        return ($my_custom_url = "http://example.com/thanks-for-upgrading/");
        // print_r($vars); for debugging, if you need more information before creating this URL.
    }
?>
Using this Filter, makes it possible for you to redirect an "existing" User/Member after they complete checkout ( i.e. after a modification takes place ), and s2Member's PDT processing WILL still take place, even though you're re-routing the Customer to your own custom URL here. This Filter is the recommended way to handle "existing" User/Member modifications, with your own custom URL, like you see here.

However, the success="" Shortcode Attribute is recommended for "new" Users/Members, as that's easier to integrate than custom PHP code with a Filter, needed only with modifications.
~ 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: Circumventing s2Member PayPal Return URL

Postby PseudoNyhm » September 2nd, 2011, 8:47 pm

Jason Caldwell wrote:Hi there. Yes, you are correct in both A and B assumptions.


Well, my "assumptions" were actually based on your prior advice, so I had a good chance of "guessing" right!

Thanks for this thorough answer. I think the filter option is just what I need. Existing members can upgrade, I can specify a custom landing page, and I get the benefit of s2Member's PDT handling logic (to avoid any confusion with delayed IPN messages).
User avatar
PseudoNyhm
Experienced User
Experienced User
 
Posts: 79
Joined: June 19, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Jason Caldwell » September 2nd, 2011, 9:01 pm

Very welcome.

Just to note also ( someone asked me this via email just now ).
A "modification" takes place any time an existing User/Member is going through the checkout process, period. In other words, anytime s2Member is "modifying" an existing account within WordPress ( i.e. if they already have a User ID in the database, all transactions are modifications, because s2Member is modifying an existing account. ).
~ 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: Circumventing s2Member PayPal Return URL

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

Great! Thanks Jason. :)
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: Circumventing s2Member PayPal Return URL

Postby kregg » September 12th, 2011, 12:35 am

is there any way to do this in the free version (i.e. an analog to the success="") or is an upgrade to pro the only way to dynamically set a return url for a CCAP buy now button shortcode?

Thanks
User avatar
kregg
Registered User
Registered User
 
Posts: 6
Joined: September 12, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Jason Caldwell » September 12th, 2011, 6:00 pm

Yes, but you would need to hard-code the value of &s2member_paypal_return_success=
Jason Caldwell wrote:This forces s2Member to do the following after PayPal checkout:
Code: Select all
/?s2member_paypal_return=1&s2member_paypal_return_success=http://www.example.com/my-thank-you-page/
In other words, s2Member processes PDT, and then redirects the Customer to your own custom page, specified in the success="" Shortcode Attribute, which ends up in the query string like you see 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: Circumventing s2Member PayPal Return URL

Postby kregg » September 12th, 2011, 9:04 pm

OK Great! I understand the principle. Can you do this for each CCAP paypal button or is this hard coded once for every instance of success=""? Sorry if I am asking a dense question but this gets me so close to what I need I would just like an example of how the mechanics work in the dashboard and page coding.

Thanks
User avatar
kregg
Registered User
Registered User
 
Posts: 6
Joined: September 12, 2011

Re: Circumventing s2Member PayPal Return URL

Postby kregg » September 13th, 2011, 9:59 pm

How and where do I create that code. The paypal button generator is a new thing for me so can I place the &s2member_paypal_return_success=http://www.example.com/my-thank-you-page/in the long code window below to have it created with the short code?
User avatar
kregg
Registered User
Registered User
 
Posts: 6
Joined: September 12, 2011

Re: Circumventing s2Member PayPal Return URL

Postby kregg » September 17th, 2011, 6:32 pm

Any help"

Thanks
User avatar
kregg
Registered User
Registered User
 
Posts: 6
Joined: September 12, 2011

Re: Circumventing s2Member PayPal Return URL

Postby lolsmg » September 23rd, 2011, 2:51 pm

When my users pay via paypal to sign up (subscription level 1, paid subscriptions is the only level we are doing), they are not reliably getting to the step where they create thier own username and password. We have no free membership level.

http://zendaya.com/?s2member_paypal_return=1 is the page that comes up, and there is a very small link on that page for them to click on to register -- I think they are getting confused, and not doing that, and/or they are going directly from paypal back to our site, and missing the registration step at all.

What is the best, most cost effective way to help get members through the payment process, registered, and able to use the site?
User avatar
lolsmg
Registered User
Registered User
 
Posts: 1
Joined: September 23, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Cristián Lávaque » September 25th, 2011, 12:26 am

Kregg, that variable that Jason suggested, would go in the return URL you enter in your PayPal settings. PayPal -> Account Profile -> Website Payment Preferences -> Auto-Return URL
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: Circumventing s2Member PayPal Return URL

Postby Jason Caldwell » September 27th, 2011, 7:25 pm

I recommend s2Member Pro integrated with PayPal Pro, as described below.
What is the best, most cost effective way to help get members through the payment process, registered, and able to use the site?

Registration Before Checkout? ( reversing the process )
By default, s2Member will send a Customer directly to PayPal®, and only after checkout is completed does the Customer have the ability to register a Username/Password for access to your site. This process works very well in most cases, and it has the benefit of increasing conversion rates; because there are fewer obstacles for the Customer on their way to the actual checkout process at PayPal®.

That being said, we believe the "ideal" approach is a combined Checkout/Registration process; in just one simple step ( available with s2Member Pro via PayPal® Pro integration ). But even with PayPal® Standard integration, there is a way to accomplish (registration before checkout), thereby reversing the process — if you prefer it that way. This is accomplished by turning Open Registration (on), and then making a PayPal® Button available to Free Subscribers at Level #0. In other words, you can let visitors register for free at Level #0, then charge them for access to higher Member Levels [1-4]. For further details, please check your WordPress® Dashboard under: s2Member -> General Options -> Open Registration. If you're running a Multisite Network, see: s2Member -> Multisite (Config) -> Registration Configuration.

s2Member's Simple Conditionals can help you further integrate this process, by allowing you to integrate a special PayPal® Button on your Login Welcome Page; one that will be seen only by Free Subscribers at Level #0. Please check your WordPress® Dashboard under: s2Member -> API Scripting -> Simple Conditionals. We also suggest reading over the documentation on PayPal® Modification Buttons. See: s2Member -> PayPal® Buttons -> Subscription Modifications.
~ 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: Circumventing s2Member PayPal Return URL

Postby roflmao » September 30th, 2011, 12:36 pm

Jason Caldwell wrote:Or, you can use this Filter, perhaps something like this:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter 
("ws_plugin__s2member_redirection_url_after_modification", "my_redirection_url_after_modification");
function my_redirection_url_after_modification ($s2member_default_value, $vars = array ())
    {
        return ($my_custom_url = "http://example.com/thanks-for-upgrading/");
        // print_r($vars); for debugging, if you need more information before creating this URL.
    }
?>
[i]Using this Filter, makes it possible for you to redirect an "existing" User/Member after they complete checkout ( i.e. after a modification takes place ), and s2Member's PDT processing WILL still take place, even though you're re-routing the Customer to your own custom URL here. This Filter is the recommended way to handle "existing" User/Member modifications, with your own custom URL, like you see here.


Thank you for posting this. Very useful!
User avatar
roflmao
Registered User
Registered User
 
Posts: 4
Joined: May 23, 2011

Re: Circumventing s2Member PayPal Return URL

Postby kregg » October 10th, 2011, 12:53 am

Cristián Lávaque wrote:Kregg, that variable that Jason suggested, would go in the return URL you enter in your PayPal settings. PayPal -> Account Profile -> Website Payment Preferences -> Auto-Return URL

Thanks for the reply. I need to be able to have a different return url for each or our packages to be sold so they have a package specific page to return to. I don't mind going the pro route but I have no need at all to use paypal pro other than this and the monthly fee for that doesn't seem justified for just this function if there is a PHP solution.
User avatar
kregg
Registered User
Registered User
 
Posts: 6
Joined: September 12, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Cristián Lávaque » October 11th, 2011, 12:26 pm

Ah, got it. Yes, with s2Member Pro you can specify the return URL for each order, and it doesn't just work with PayPal Pro. With s2Member Pro, the regular PayPal button also gets this functionality. WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes -> success

I hope this 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: Circumventing s2Member PayPal Return URL

Postby eizil » October 30th, 2011, 10:26 pm

i tried to hard code the return url /?s2member_paypal_return=1&s2member_paypal_return_success=http://www.example.com/my-thank-you-page/ in a free version of s2member, after successfull transaction, the url is return to that code, but no redirection, only page stating please login back again appear.

Did i forgot to set something else?
User avatar
eizil
Registered User
Registered User
 
Posts: 2
Joined: October 20, 2011

Re: Circumventing s2Member PayPal Return URL

Postby Jason Caldwell » October 31st, 2011, 10:42 am

Thanks for the follow-up.

This feature is connected to the use of the success="" Shortcode Attribute, available and supported only with s2Member Pro. I believe the confusion here on this issue might be solved with this documentation from s2Member Pro: s2Member -> PayPal Buttons -> Shortcode Attributes (Explained )

( click to enlarge )
SNAG-0090.png
~ 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: Circumventing s2Member PayPal Return URL

Postby eizil » October 31st, 2011, 4:02 pm

I read it wrong from the previous replies, thanks for the explaination.
User avatar
eizil
Registered User
Registered User
 
Posts: 2
Joined: October 20, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron