Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-17T15:32:59-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14132 2011-07-17T15:32:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28581#p28581 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>

Statistics: Posted by Cristián Lávaque — July 17th, 2011, 3:32 pm


]]>
2011-07-17T07:58:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28570#p28570 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
Problem RESOLVED!!

This was a nice one, the 403 forbidden was a red hiring brought on by my
htaccess (set to only allow my ip address on my demo server but did not include
the server ip address so it was effectively blocking itself whilst doing a url check).

Line 278 in file s2member-pro\includes\classes\gateways\paypal\paypal-checkout-in.inc.php

Had the follow compare check

Code:
substr ($ipn["s2member_paypal_proxy_return_url"], 0, 2) === substr ($post_vars["attr"]["success"], 0, 2)


This check continued to fail even though the variables appeared the same . this is probably due to the
More precise ‘===’ part of the compare.

In order to filter out any noise I simply added a trim around the two variables making it:

Code:
substr (trim($ipn["s2member_paypal_proxy_return_url"]), 0, 2) === substr (trim($post_vars["attr"]["success"]), 0, 2)


and just to make sure I didn’t break anything I added a trim around the

Code:
$ipn["s2member_paypal_proxy_return_url"])


variable on line 279.

By adding the trim statement and testing a number of times the redirect on success consistantly worked which appears to have resolved the fault.

Jason could you confirm and add to your subsequent update.

Peter.

Statistics: Posted by peterhuk — July 17th, 2011, 7:58 am


]]>
2011-07-16T20:19:10-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28543#p28543 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
Code:
c_ws_plugin__s2member_utils_urls::remote (site_url ("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array ("timeout" => 20));


returning a 403 forbidden error. this is causing the

Code:
substr ($ipn["s2member_paypal_proxy_return_url"], 0, 2) === substr ($post_vars["attr"]["success"], 0, 2)


compare to fail (sorry can't give line numbers at present as have inserted a number of check points which has altered the line numbers).

currently investigating

Code:
c_ws_plugin__s2member_utils_urls::remote
to see what it is doing which is causing
the 403 forbidden error.

Peter..

Statistics: Posted by peterhuk — July 16th, 2011, 8:19 pm


]]>
2011-07-16T19:19:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28540#p28540 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
Many thanks for your feed back, remember when I said (above)
that I experienced a mini explosion in the centre of my cerebral
cortex? Well that was roundabout the time my home server
crashed and all data was lost and then I discovered that the redirect
failed to work on the new hosted server.

So I have nothing to compare notes with. Solraco provided a
very good lead. I have just added a print_r($post_vars); to a
point in paypal-checkout-in.inc.php (between line 66 and line 67)
and the success variable shows up in the returned vars array.

What I am going to check is the conditions for the success vars
to be executed. Once I have found this it should shed some like
on why it is not working.

Will update when I have found something.

Many thanks

Peter

Statistics: Posted by peterhuk — July 16th, 2011, 7:19 pm


]]>
2011-07-16T16:22:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28514#p28514 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
peterhuk wrote:
The redirect worked perfectly on my home system but now I have moved it to a hosted demo for more tests. Not sure if the problem is related to the move to the hosted environment or the updated
version of S2Member / S2Member Pro.


I don't know. Try updating s2Member/Pro in the server where it was working before and see if the success attribute works then: If not it'll be the update, if yes then it'd be the new host.


Quick question, should the logs show any info on the redirect on success value?


I don't know. Why don't you check the logs in the install where the redirection works? I haven't tried this myself.

Statistics: Posted by Cristián Lávaque — July 16th, 2011, 4:22 pm


]]>
2011-07-16T16:17:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28513#p28513 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
solraco wrote:
This is the short code im using to pull the form.

[s2Member-Pro-AuthNet-Form level="2" ccaps="" desc="$77.00 USD / One Time ( for lifetime access, non-recurring, no trial )" cc="USD" custom="www.clearwateremc.com" ta="0" tp="0" tt="D" ra="77.00" rp="1" rt="L" rr="BN" accept="visa,mastercard,amex,discover" coupon="" accept_coupons="0" default_country_code="US" captcha="0" success="http://www.clearwateremc.com/workshop/conditionsmagic/thank-you" /]


Peter is correct about the success address format. Try this success="/workshop/conditionsmagic/thank-you". Here's the documentation for it WP Admin -> s2Member -> Auth.Net Pro-Forms -> Custom Return URLs On Success

You can add a special attribute to any Form Shortcode ( success="/my-thank-you-page/" ). This makes it possible to integrate Authorize.Net® Pro Forms in very creative ways; and even receive/verify Replacement Code variables, as needed. For example, ( success="/my-thank-you-page/?subscr_id=%%subscr_id%%" ).


I hope that works for you. :)

Statistics: Posted by Cristián Lávaque — July 16th, 2011, 4:17 pm


]]>
2011-07-16T12:02:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28505#p28505 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
I am using Paypal, so I will look for the equivalent. Then try and trace the fault.

The biggest problem I find with hacking is, as so as you update S2Member you
will be back at square one and have to fix the problem again (if you remember
what the fix was).

Will let you know when I find something.

Many thanks


Peter..

Statistics: Posted by peterhuk — July 16th, 2011, 12:02 pm


]]>
2011-07-16T09:38:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28498#p28498 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
I found a way to override this function. I don't know if this is the best way to do it but I needed to get it working today for a client and I decided to do it.

I'm using authorize.net for this so I found the file where the success message is coming from.

s2member-pro\includes\classes\gateways\authnet\authnet-checkout-in.inc.php

and changed the $global_response attributes on lines 241 440 691 to this:
Code:
global_response = array ("response" => header( 'Location: https://www.clearwateremc.com/workshop/conditionsmagic/thank-you/' ));


And its working for me now... i know this is more of a hack but I had to get this up and working.

If anyone here knows how to fix this without having to edit the s2member code... let me know.

Thanks!

Statistics: Posted by solraco — July 16th, 2011, 9:38 am


]]>
2011-07-16T03:46:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28485#p28485 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
Quick question, should the logs show any info on the redirect on success value?

Many thanks


Peter..

Statistics: Posted by peterhuk — July 16th, 2011, 3:46 am


]]>
2011-07-15T17:36:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28452#p28452 <![CDATA[Re: Forcing custom redirect after a successful purchase]]>
I seem to be having the same problem as Solraco, having tried everything I finally
realised it was time to asked for help after experiencing a mini explosion in the
centre of my cerebral cortex :o .

Having said that Solraco according to the documentation you should only enter
the page / folder name only i.e success="/my-thank-you-page/".

Jason / Chris what events trigger the success redirect does
the plugin require jquery v1.6 as I am currently using v1.4.

The redirect worked perfectly on my home system but now I have
moved it to a hosted demo for more tests. Not sure if the problem
is related to the move to the hosted environment or the updated
version of S2Member / S2Member Pro.

Any ideas?

Kind Regards

Peter

Statistics: Posted by peterhuk — July 15th, 2011, 5:36 pm


]]>
2011-07-15T09:57:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14132&p=28428#p28428 <![CDATA[Forcing custom redirect after a successful purchase]]>
The custom redirect after purchase is not working. It stays on the same page and give me this message.


Thank you. Your account has been approved.
— Please login.


Instead of redirecting to our thank you page.

Here is a link to the form. http://www.clearwateremc.com/workshop/conditionsmagic/membership-options-page/

This is the short code im using to pull the form.
Code:
[s2Member-Pro-AuthNet-Form level="2" ccaps="" desc="$77.00 USD / One Time ( for lifetime access, non-recurring, no trial )" cc="USD" custom="www.clearwateremc.com" ta="0" tp="0" tt="D" ra="77.00" rp="1" rt="L" rr="BN" accept="visa,mastercard,amex,discover" coupon="" accept_coupons="0" default_country_code="US" captcha="0" success="http://www.clearwateremc.com/workshop/conditionsmagic/thank-you" /]


I've tried everything I could come up with but it just wont work for me... is there something I'm doing wrong here?

Thanks for your help.

Statistics: Posted by solraco — July 15th, 2011, 9:57 am


]]>