justinswaa Posted June 7, 2011 Share Posted June 7, 2011 Had callback in 2.2 working for RBS worldpay junior installation after making sure I had the latest junior_callback.php file in ext/modules. Have now upgraded to 2.3. There is no junior callback mod with the default package and I can't find a contrib for worldpay junior that is for 2.3. The mod that ships with 2.3, called "RBS WorldPay Hosted" seems to work with the Select Junior installation that I have, except for the callback. Although callback was working in test mode... Any help much appreciated... Quote Link to comment Share on other sites More sharing options...
justinswaa Posted June 7, 2011 Author Share Posted June 7, 2011 or maybe the junior callback mod from 2.2 will work on 2.3. Has anybody tried that? Quote Link to comment Share on other sites More sharing options...
peterbuzzin Posted June 9, 2011 Share Posted June 9, 2011 Ello, Couple of points. 1: WorldPay Hosted and WorldPay Junior are the same thing (That's marketing for you) . Since the release of the OSC 2.3 WorldPay has changed their payment URLs so the URL's contained in the default WorldPay Modules will need updating. (The official response was "The old URL's may or may not work all the time") From https://select.wp3.rbsworldpay.com/wcc/purchase To https://secure.wp3.rbsworldpay.com/wcc/purchase 2: OSC 2.3 ext/modules/payment/hosted_callback.php still contains deprecated code. Depending on your server it could fail on the very first line of code (line 13) if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { There are compatibility functions within OSC that will check if $HTTP_POST_VARS is valid/supported and if not change them to the new standard $_POST, however the line of code that does this is executed AFTER if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { chdir('../../../../'); require ('includes/application_top.php'); So line 13 (or 1 depending on your perspective) checks to see if M_sid value is set and not empty, if it's set and exists it moves on and on line 15 (or 3) includes application_top.php which will then start the compatibility code conversions. That's not going to help if you continuously fail at line 13 (or 1). So change the above to $_POST. Make sure you have set up different order status for prepairing and successful WorldPay transactions. Check the field (in html source code) of checkout_confirmation.php to make sure the field MC_callback contains a valid return link. Make sure your "Production/Live" configuration in your WorldPay configuration is set up correctly. If your test environment works then just copy the settings from your "Text/Development" WorldPay configuration settings (at the bottom of the page in your WorldPay control panel) to the "Live/Production". Also just so you know if your callback page is being accessed by WorldPay you could insert code to the top of your callback page which will send you an email when it's being accessed with the post values (see below). // Define your debug email address $RBSPostEmail = ''; // e.g $RBSPostEmail = '[email protected]'; $RBSDebugActive = false; //Change to false to disable debug emails. // Build Email $message = "RBS WorldPay Post Values\n".'\n'; foreach($_POST as $name => $value) { $message .= "$name : $value "; } // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); if($RBSDebugActive){ // Send Email mail($RBSPostEmail, 'RBS WorldPay Post Values', $message); } Good Luck! Quote If it still don't work, hit it again! Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. Link to comment Share on other sites More sharing options...
justinswaa Posted June 9, 2011 Author Share Posted June 9, 2011 Ello, Couple of points. 1: WorldPay Hosted and WorldPay Junior are the same thing (That's marketing for you) . Since the release of the OSC 2.3 WorldPay has changed their payment URLs so the URL's contained in the default WorldPay Modules will need updating. (The official response was "The old URL's may or may not work all the time") From https://select.wp3.rbsworldpay.com/wcc/purchase To https://secure.wp3.rbsworldpay.com/wcc/purchase 2: OSC 2.3 ext/modules/payment/hosted_callback.php still contains deprecated code. Depending on your server it could fail on the very first line of code (line 13) if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { There are compatibility functions within OSC that will check if $HTTP_POST_VARS is valid/supported and if not change them to the new standard $_POST, however the line of code that does this is executed AFTER if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) { chdir('../../../../'); require ('includes/application_top.php'); So line 13 (or 1 depending on your perspective) checks to see if M_sid value is set and not empty, if it's set and exists it moves on and on line 15 (or 3) includes application_top.php which will then start the compatibility code conversions. That's not going to help if you continuously fail at line 13 (or 1). So change the above to $_POST. Make sure you have set up different order status for prepairing and successful WorldPay transactions. Check the field (in html source code) of checkout_confirmation.php to make sure the field MC_callback contains a valid return link. Make sure your "Production/Live" configuration in your WorldPay configuration is set up correctly. If your test environment works then just copy the settings from your "Text/Development" WorldPay configuration settings (at the bottom of the page in your WorldPay control panel) to the "Live/Production". Also just so you know if your callback page is being accessed by WorldPay you could insert code to the top of your callback page which will send you an email when it's being accessed with the post values (see below). // Define your debug email address $RBSPostEmail = ''; // e.g $RBSPostEmail = '[email protected]'; $RBSDebugActive = false; //Change to false to disable debug emails. // Build Email $message = "RBS WorldPay Post Values\n".'\n'; foreach($_POST as $name => $value) { $message .= "$name : $value "; } // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); if($RBSDebugActive){ // Send Email mail($RBSPostEmail, 'RBS WorldPay Post Values', $message); } Good Luck! Thanks for your help. In the end, I found that all I needed to do was change the callback URL within the worldpay account from http://<WPDISPLAY ITEM=MC_callback> to <WPDISPLAY ITEM=MC_callback> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.