Page 1 of 1
Redirect Short Codes
Posted:
September 1st, 2011, 7:19 pm
by hcibrent
Hello, I am trying to find out on the redirect short codes I read in the documentation, do they go inside the Pro Form short code section as stated, or is there a special way to implement?
I appreciate the info.
Re: Redirect Short Codes
Posted:
September 1st, 2011, 11:24 pm
by Cristián Lávaque
What redirect shortcodes? Could you past a quote from the documentation or point me to it, please? Thanks!
Re: Redirect Short Codes
Posted:
September 2nd, 2011, 2:16 am
by hcibrent
Hey Cris,
This was actually found in your page. I am just trying to redirect the customer to a thank you page then auto redirect to an account login page. But this is where I seen the redirect info.
Is there a way to force a custom redirect after a successful purchase?
Yes. You can add the following attribute to the Shortcode for your Form. Like this: success="http://www.example.com/thank-you.php". s2Member will automatically redirect Customers to the URL you specify. s2Member can also add query string parameters, supplying all sorts of information about the transaction. Please see s2Member -> PayPal® Pro Forms -> Custom Return URLs on Success. This also works with Pro Forms for Authorize.Net®.
Re: Redirect Short Codes
Posted:
September 2nd, 2011, 7:36 pm
by Cristián Lávaque
Ah, you mean the success shortcode attribute? Yes, that'd take the person to the URL you specify after checkout. This is an s2Member Pro feature. Works with the pro-forms or the PayPal buttons.
Re: Redirect Short Codes
Posted:
September 2nd, 2011, 7:55 pm
by hcibrent
Yes, can we do the same thing for declines?
Just curious. Thanks.
Re: Redirect Short Codes
Posted:
September 2nd, 2011, 11:20 pm
by Cristián Lávaque
Hmm... You mean if the card is declined, show him a certain page when PayPal returns him to your site?
Re: Redirect Short Codes
Posted:
September 2nd, 2011, 11:53 pm
by hcibrent
Yes, I use Authorize.net and use S2 Member Pro.
Thanks
Re: Redirect Short Codes
Posted:
September 3rd, 2011, 12:39 pm
by Cristián Lávaque
Got it. I don't know if it can be done. I emailed Jason about it.
Re: Redirect Short Codes
Posted:
September 6th, 2011, 1:51 pm
by Jason Caldwell
Thanks for the excellent question.hcibrent wrote:Yes, can we do the same thing for declines?
Just curious. Thanks.
Sorry, no. While it IS possible to handle redirection in a custom way on
success, it is NOT possible to do this when an error occurs, s2Member handles this with error messages sent back to the Customer, at the top of your Pro Form integration.
That being said, you CAN Filter the error messages if you like.Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
- Code: Select all
<?php
add_filter ("ws_plugin__s2member_paypal_api_response", "my_s2_errors");
function my_s2_errors ($response = array ())
{
if (!empty ($response["__error"]) && !empty ($response["L_ERRORCODE0"]))
{
if ((int)$response["L_ERRORCODE0"] === 10422)
$response["__error"] = "Transaction declined. Please use an alternate funding source.";
}
return $response;
}
?>
* For a full list of error codes, please check the /paypal-pro-api.pdf file, which is included with the s2m-pro-extras.zip file, available for download inside your account at s2Member.com.
Re: Redirect Short Codes
Posted:
September 6th, 2011, 1:56 pm
by hcibrent
Thanks Jason. I appreciate the info.
Keep rockin!