Page 1 of 1

Change Landing Page after Paypal Subscription Modification

PostPosted: November 13th, 2011, 1:11 pm
by seczo
Hi,

i try to change the landing page after a subscription modification. I found this thread and tried what mentioned there: viewtopic.php?f=36&t=6386#p14932

I´ve create a mu-plugins directory and the s2-hacks.php

Code: Select all
<?php
if(!empty($_GET["s2member_paypal_return"]))
    {
        header("Location: http://screencastakademie.com/upgrade-danke/");
        exit();
    }
?>


I use this paypal button shortcode
Code: Select all
[s2Member-PayPal-Button modify="1" level="2" ccaps="" desc="Upgrade Screencast Akademie" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="screencastakademie.com" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="L" rr="BN" rrt="" rra="1" image="default" output="button" /]


My Auto-Return URL at PayPal is: http://screencastakademie.com/?s2member_paypal_return=1

When i click on the Auto-Return URL link inside the s2member paypal options, the right page opens: http://screencastakademie.com/upgrade-danke

If i go through paypal, i´m automatically redirected to the main page: http://screencastakademie.com

I don´t know what could be wrong. Hope you can help me :)

Thanks, Sebastian

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 13th, 2011, 1:19 pm
by Eduan
Hi,
just a question to know what to answer, do you have the Pro version of s2Member?

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 13th, 2011, 1:26 pm
by Eduan
If you have s2Member Pro, you can use the success attribute and customize it using the Membership Options Page variables. Maybe something like:

Code: Select all
[s2Member-PayPal-Button level="1" ccaps="" desc="Bronze Member / Description and pricing details here." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="yoursite.com" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="M" rr="1" rrt="" rra="1" image="default" output="button" <?php $_g = stripslashes_deep($_GET); if (isset($_g['_s2member_seeking']['_uri']) { echo 'success="' . site_url() . '/wp-login.php?action=register&redirect_to=' . base64_decode($_g['_s2member_seeking']['_uri']) . '"'; } ?> /]
* I haven't tested this code.

WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes -> success
WP Admin -> s2Member -> PayPal Pro-Forms -> Custom Return URLs On Success
WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variables

viewtopic.php?f=36&t=1604

Hope this helps. :)
Also remember to report back.
Otherwise you leave me worrying. ;)

I hope this helps. :)

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 13th, 2011, 2:27 pm
by seczo
Hi, i don´t have s2Member Pro. This should work with the normal version, but something is wrong: viewtopic.php?f=36&t=6386#p14932

If i click on that link, everything is fine: http://screencastakademie.com/?s2member_paypal_return=1

If the user returns from paypal, they get redirected to the home page...

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 15th, 2011, 12:48 am
by Cristián Lávaque
Sebastian, the hack should work, but I guess you're having some other problem with your PayPal integration.

Could you please post the entries related to the transactions that return you to the home page? (x'ing out any private info) WP Admin -> s2Member -> PayPal Options -> Account Details -> Enable Logging

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 15th, 2011, 4:16 am
by seczo
Here is the paypal-ipn.log. Hope it helps :)

PHP v5.2.17 :: WordPress® v3.2.1 :: s2Member® v111105
Memory 25.46 MB :: Real Memory 25.75 MB :: Peak Memory 25.61 MB :: Real Peak Memory 25.75 MB
screencastakademie.com/?s2member_paypal_notify=1
User-Agent:
array (
'mc_gross' => '0.01',
'invoice' => '4ec22b7e62255~195.37.69.11',
'protection_eligibility' => 'Ineligible',
'payer_id' => 'AFFLJ53AYNKKY',
'tax' => '0.00',
'payment_date' => '01:07:09 Nov 15, 2011 PST',
'payment_status' => 'Pending',
'charset' => 'windows-1252',
'first_name' => 'xxxxxxxxx',
'option_selection1' => '9',
'option_selection2' => '195.37.69.11',
'notify_version' => '3.4',
'custom' => 'screencastakademie.com',
'payer_status' => 'verified',
'business' => 'xxxxxxxxx@xxxxxxxxxx.com',
'quantity' => '1',
'verify_sign' => 'ArA1J1GorpBx2U7C.OgEymVR0DWhAfUbOSHJGSoOS6lnXSWbMKvBV12M',
'payer_email' => 'xxxxxxxxx@xxxxxxxxx.de',
'option_name1' => 'Referencing Customer ID',
'option_name2' => 'Customer IP Address',
'txn_id' => '9M538887AR442490L',
'payment_type' => 'instant',
'last_name' => 'xxxxxxxxx',
'receiver_email' => 'xxxxxxxx@xxxxxxxxx.com',
'receiver_id' => 'xxxxxxxxxxx',
'pending_reason' => 'multi_currency',
'txn_type' => 'web_accept',
'item_name' => 'Upgrade Screencast Akademie',
'mc_currency' => 'USD',
'item_number' => '2',
'residence_country' => 'DE',
'handling_amount' => '0.00',
'transaction_subject' => 'screencastakademie.com',
'payment_gross' => '0.01',
'shipping' => '0.00',
'ipn_track_id' => '.mvDRCx1UcXiPK-lIdB27Q',
's2member_log' =>
array (
0 => 'IPN received on: Tue Nov 15, 2011 9:07:14 am UTC',
1 => 's2Member POST vars verified through a POST back to PayPal®.',
2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
3 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ).',
4 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ) w/ update vars.',
5 => 's2Member Level/Capabilities updated w/ advanced update routines.',
6 => 'Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.',
7 => 'User exists. Handling `payment` for Subscription via ( `web_accept` ).',
8 => 'Storing IPN signup vars now. These are associated with a User\'s account record; for future reference.',
),
'subscr_gateway' => 'paypal',
'subscr_id' => 'xxxxxxxxxxxxx',
'eotper' => NULL,
'ccaps' => NULL,
'level' => '2',
'ip' => '195.37.69.11',
'period1' => '0 D',
'mc_amount1' => '0.00',
'period3' => '1 L',
'mc_amount3' => '0.01',
'initial_term' => '0 D',
'initial' => '0.01',
'regular' => '0.01',
'regular_term' => '1 L',
'recurring' => '0',
)

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 15th, 2011, 1:31 pm
by Cristián Lávaque
Thanks.

seczo wrote:If the user returns from paypal, they get redirected to the home page...


I don't see an error there, so I'm not sure yet what the problem is. I'm gonna email Jason about it.

Could you post the shortcode you're using for the button? And could you double check your PayPal integration settings? WP admin -> s2Member -> PayPal Options

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 15th, 2011, 3:25 pm
by seczo
Here is the button shortcode
Code: Select all
[s2Member-PayPal-Button modify="1" level="2" ccaps="" desc="Upgrade Screencast Akademie" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="screencastakademie.com" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="L" rr="BN" rrt="" rra="1" image="default" output="button" /]


I´ve checked all PayPal integration settings. It all looks right. The whole process is also working right. If the customer pays via paypal, his account is upgraded to the new level, gets the emails etc. Only the redirect is not working.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 15th, 2011, 6:21 pm
by Jason Caldwell
You might take a look at the attached screenshot. The success="" Attribute for Shortcodes does NOT apply to modifications in the way you might expect it to.

Short of that, I would take a look at your other plugins to be sure nothing is attempting to redirect visitors away from this page inadvertently. I just tried to access the page directly on your site, and I was redirected to your front page. That's not how s2Member behaves on a default installation of WordPress.
SNAG-0121.png
Please let us know if problems persist.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 4:07 am
by seczo
It´s really strange... if i click on http://screencastakademie.com/?s2member_paypal_return=1, i get redirected to http://screencastakademie.com/upgrade-danke

When the customers comes from paypal, the url shown in the browser is
Code: Select all
http://screencastakademie.com/?s2member_paypal_return=1&s2member_paypal_return_tra=fnIyOlNpRXZkbXdaWWVaYnlhaGRDQzlOWk13VmcySEZJSTFnfCmmFrtq-Ewabhe05sE4bFZVhrG1M5QvR5qD-ISkY0pAXtx2buAa62I_UcARO2okpIzGRcpCh29w1LThN8NXusUSMt9izlpD49Z5Y0nfFeq65_a4ECC3AlTX-goA1jo83o4bUKr2CDdyyw1nrW0DZozSMtBDF3qw61beU3nnEJJdWSfs4W0AqRwMEw0f_EKAxWAuDAPxRWBqk6_6RTx3bsrHl1WPi57QqDZE6HSMshtrWvXCwNxdQhCvWZ4XSoBumZeMT5mNwRAzn2qo_lyA30pskddjxCeaJAdFdpLOrE_OIzftrlL19kbn-J4m_vnp1dOppO_rRsdKucqBKkDWcE7jhP2PfCi-EZ-wGWp_mpQHt6naP9VTmjlJQCRJYX7o8Q&tx=6HJ20080MA205724U&st=Pending&amt=0.01&cc=USD&cm=screencastakademie.com&item_number=2


I´ve deactivated all other plugins, but the same happens. I ever get redirected to the home page.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 11:12 am
by Jason Caldwell
Are you running any s2Member hack files? Anything inside your /wp-content/mu-plugins/ directory?

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 11:22 am
by seczo
Yes, i have a s2-hacks.php in the mu-plugins directory. It looks like that:

Code: Select all
<?php
// Regsitrierungslink soll erst nach 200 Tagen ungültig werden
add_filter ('ws_plugin__s2member_register_link_exp_time''register_link_exp_time'102);
function 
register_link_exp_time($default_time '2 days'$vars = array()) {
  return 
'200 days';
}
// PayPal Weiterleitung nach Upgrade auf Danke Seite
if(!empty($_GET["s2member_paypal_return"]))
    {
        
header("Location: http://screencastakademie.com/upgrade-danke/");
        exit();
    }
// Automatische Nachricht nach der Hochstufung (Upgrade)
add_filter ("ws_plugin__s2member_modification_email_sbj""my_s2_modification_sbj"102);
function 
my_s2_modification_sbj ($s2member_default_sbj$vars = array ())
    {
        return 
"Ihr Upgrade wurde durchgeführt";
    }
add_filter ("ws_plugin__s2member_modification_email_msg""my_s2_modification_msg"102);
function 
my_s2_modification_msg ($s2member_default_msg$vars = array ())
    {
        return 
"Danke! Ihr neues Level ist:\n" $vars["paypal"]["item_name"] . "\n\nBitte loggen Sie sich ein, um auf Ihre neuen Inhalte zugreifen zu können:\n" wp_login_url ();
    }
?>

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 12:13 pm
by Jason Caldwell
Thanks for the follow-up.
This section of your custom code is what's causing that redirection.
Code: Select all
    // PayPal Weiterleitung nach Upgrade auf Danke Seite
    if(!empty($_GET["s2member_paypal_return"]))
        {
            header("Location: http://screencastakademie.com/upgrade-danke/");
            exit();
        } 

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 12:53 pm
by Cristián Lávaque
He wants that redirection, he got it from your other post where you suggested how to do it without s2Member Pro's success attribute. What he doesn't understand is why it doesn't happen when the customer returns from PayPal after checkout. Sorry I didn't explain it better to you in the email.

That said, seczo, that hack is from before the success attribute was available for PayPal buttons. I suggest you get s2Member Pro and use that to save yourself trouble.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 2:20 pm
by seczo
He wants that redirection, he got it from your other post where you suggested how to do it without s2Member Pro's success attribute. What he doesn't understand is why it doesn't happen when the customer returns from PayPal after checkout.


That is exactly what I want. It all seems right. The redirect works if the link is clicked. It only don't work wheb the customer comes back from PayPal.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 11:03 pm
by Jason Caldwell
So sorry. OK, let me read back through this thread. I'll reply shortly.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 16th, 2011, 11:18 pm
by Jason Caldwell
OK. I'm very sorry that it's taken me this long to figure out what you're reporting.
I think I understand now.

So yes, this is VERY strange indeed. From my tests, it actually looks like your web server is completely ignoring the query string when it includes ALL of those details that PayPal passed back in. If I'm right, this is most likely related to the mod_security extension for Apache. Please take a look and let me know if any of these solutions fix the issue for you. I think you'll find that it will.

See: viewtopic.php?f=36&t=14787
Although that article talks about 403/503 errors, I've also seen mod_security configured to just completely wipe the query string ( i.e. ignore it completely ). That's what I think is happening. If I'm wrong, please report back with some further details about your server and we'll take this a step further.
seczo wrote:It´s really strange... if i click on http://screencastakademie.com/?s2member_paypal_return=1, i get redirected to http://screencastakademie.com/upgrade-danke

When the customers comes from paypal, the url shown in the browser is
Code: Select all
http://screencastakademie.com/?s2member_paypal_return=1&s2member_paypal_return_tra=fnIyOlNpRXZkbXdaWWVaYnlhaGRDQzlOWk13VmcySEZJSTFnfCmmFrtq-Ewabhe05sE4bFZVhrG1M5QvR5qD-ISkY0pAXtx2buAa62I_UcARO2okpIzGRcpCh29w1LThN8NXusUSMt9izlpD49Z5Y0nfFeq65_a4ECC3AlTX-goA1jo83o4bUKr2CDdyyw1nrW0DZozSMtBDF3qw61beU3nnEJJdWSfs4W0AqRwMEw0f_EKAxWAuDAPxRWBqk6_6RTx3bsrHl1WPi57QqDZE6HSMshtrWvXCwNxdQhCvWZ4XSoBumZeMT5mNwRAzn2qo_lyA30pskddjxCeaJAdFdpLOrE_OIzftrlL19kbn-J4m_vnp1dOppO_rRsdKucqBKkDWcE7jhP2PfCi-EZ-wGWp_mpQHt6naP9VTmjlJQCRJYX7o8Q&tx=6HJ20080MA205724U&st=Pending&amt=0.01&cc=USD&cm=screencastakademie.com&item_number=2


I´ve deactivated all other plugins, but the same happens. I ever get redirected to the home page.

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 17th, 2011, 6:31 am
by seczo
It´s working now! :) I´m sooo happy. My .htaccess was the problem. I had Bulletproof Security Plugin installed before. (http://wordpress.org/extend/plugins/bul ... -security/). I think some entries caused the issues with the redirect.

Thanks for your very good support. Can I donate somewhere?

PS: Do you know a WP Security Plugin that works with S2Member?

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 17th, 2011, 8:17 am
by Eduan
@seczo
If you want to donate check this:
1. If you're using the free version then in the right side of your screen you should see a donate image, you have to be in the general options or another s2Member page in order to see it.
2. This is my favorite method: You can just buy the pro version on this page:
http://www.s2member.com/prices/
If you have already buyed the pro version the just buy a higher license!
If you already buyed the pro version for multisite then I think you've done enough. :D

Re: Change Landing Page after Paypal Subscription Modificati

PostPosted: November 17th, 2011, 11:26 am
by Jason Caldwell
Thanks for the reply. I'm glad to hear you found the problem.

Certainly, if you'd like to donate, please consider purchasing s2Member Pro so that you get something in return for yourself as well. Or, if you would prefer to send a donation straight to us, please use this link: http://www.primothemes.com/donate ( we thank you VERY much in advance ).