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.

Auto-Return Page (success) and Paypal buttons

Home Forums Community Forum Auto-Return Page (success) and Paypal buttons

This topic contains 7 replies, has 2 voices. Last updated by  Pierre 3 years, 11 months ago.

Topic Author Topic
Posted: Sunday Jan 27th, 2013 at 1:44 pm #39732

I have created my own custom paypal buttons using this code which I “manufactured” myself:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"></form>

Also, just so you know, I have the following advanced variables on the paypal side:

custom=www.mysite.com
notify_url=http://www.mysite.com/?s2member_paypal_notify=1
rm=2

Everything seems to work, except the success page redirect – which I want to bypass entirely and have the user go straight to the registration page (buddypress installed). I guessed the last hidden input, as I can’t use a shortcode for this. Can you give me the html for the success field please that I can use here? Or perhaps give me some function to add to my s2hacks.php. This is pretty much the main reason I purchased the plugin.

As a suggested solution, will it be possible to create a custom paypal-return.php with the following code:

This should simply redirect to the registration page. Is that ok? Will this break anything?

A second concern I have is that I’m using jquery to create the paypal buttons, so I want to avoid all php in the buttons code. I haven’t included the hidden fields “invoice”, “on0” / “on1” and “os0” / “os1” – is that a problem? I understand s2member will still track users when the attempt to login.

Many thanks.

Pierre

  • This topic was modified 3 years, 11 months ago by  Pierre.
  • This topic was modified 3 years, 11 months ago by  Pierre.
  • This topic was modified 3 years, 11 months ago by  Pierre. Reason: Included some text I had as a reply, as I wanted to delete the reply, as I wasn't getting any response

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Sunday Jan 27th, 2013 at 8:34 pm #39744

As a suggested solution, will it be possible to create a custom paypal-return.php with the following code:

<?php
header("Location: http://www.mysite.com/register");
exit;
?>

This should simply redirect to the registration page. Is that ok? Will this break anything?

Thank you.

Pierre

Posted: Tuesday Jan 29th, 2013 at 7:53 am #39877

Any help with this? I would appreciate any input. Thank you.

Posted: Thursday Jan 31st, 2013 at 8:35 am #40116
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

If you would like to use a custom success URL, please be sure to pass it through s2Member®, because s2Member® MUST process the Auto-Return data from PayPal first.

We recommend using the Shortcode Attribute success="http://..."

Or, if you’re dealing with a PayPal-generated Button, please use:

return=http://www.mysite.com/?s2member_paypal_return=1&s2member_paypal_return_success=http://...

A second concern I have is that I’m using jquery to create the paypal buttons, so I want to avoid all php in the buttons code. I haven’t included the hidden fields “invoice”, “on0″ / “on1″ and “os0″ / “os1″ – is that a problem? I understand s2member will still track users when the attempt to login.

Please see: Knowledge Base » Using Buttons Generated @ PayPal.com

To answer this question, no. It’s not a problem for new customers, only for existing customers that need to upgrade, that’s when s2Member needs those additional data fields. I recommend ALWAYS adding them if at all possible. If you would like to fill those values via JavaScript, please use this JavaScript function and variables included with s2Member®.

S2MEMBER_VALUE_FOR_PP_INV_GEN(); // Returns a string with a unique Invoice number.

JavaScript Variables for the others please.

S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0
S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0

S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1
S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1

See also: Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants

Posted: Monday Feb 4th, 2013 at 7:57 am #40674

Thank you for your response Jason, I know you guys must be busy.

I have updated my saved paypal button to include the following advanced variables:

custom=www.mysite.com
notify_url=http://www.mysite.com/?s2member_paypal_notify=1&s2member_paypal_return_success=http://www.mysite.com/register
rm=2

This unfortunately still takes me to the default paypal return form. Am I missing anything?

Thank you.

Posted: Monday Feb 4th, 2013 at 8:27 am #40688

Jason, I tried this and it worked:

Paypal Return URL “Take customers to this URL when they finish checkout:”

http://www.mysite.com/?s2member_paypal_return=1&s2member_paypal_return_success=http://www.mysite.com/register

This isn’t the notify url as you suggested, but it did take me straight to the register page.

That ok? Nothing broken?

Thank you.

Posted: Monday Feb 4th, 2013 at 1:10 pm #40747
Staff Member

Thanks for the follow-up :-)

Yes, I’m so sorry. That was my mistake.
It’s NOT notify_url, it’s a Return URL (i.e. return=). I updated my post above.

return=http://www.mysite.com/?s2member_paypal_return=1&s2member_paypal_return_success=http://...
Posted: Monday Feb 4th, 2013 at 9:00 pm #40804

Excellent, thanks for the help Jason!

Viewing 7 replies - 1 through 7 (of 7 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.