[email protected] Posted September 9, 2009 Share Posted September 9, 2009 I have been struggling with getting the junior_callback.php to actually work with worldpay and now know exactly what the problem was and thought I'd post it for everyone else. Worldpay told me that if the call back page was returning an empty page they would just display their results page. So I guessed if it was returning an empty page it must have an error. The error was that I was running php 5 and the $http_post_vars was deprecated and so needed to be replaced by $_POST. That was pretty much it. I also realised at this point that worldpay seems to have disabled javascript so the button didn't work to return to the site as it uses onclick. So this would need to be changed for anyone using the default junior_postback.php. Worldpay suggested using a meta refresh which I didn't look to see if you could redirect to another page with but may well be able to! Hope this helps!! Quote Link to comment Share on other sites More sharing options...
Guest Posted September 15, 2009 Share Posted September 15, 2009 (edited) I was also having problems with this, and yes the javascript is stripped from the button stopping the user being able to click it. As a quick fix to this problem I replaced the code that generated the broken button: <p align="center"><input type="button" value="<?php echo sprintf(MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_CONTINUE_BUTTON, addslashes(STORE_NAME)); ?>" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CHECKOUT_PROCESS, tep_session_name() . '=' . $HTTP_POST_VARS['M_sid'] . '&hash=' . $HTTP_POST_VARS['hash'], 'SSL', false); ?>';"></p> With just a simple link shown below, so that the user can click it to go back to your shop. I didn't have it as a form button as the user will be prompted about submitting unencrypted information from the secure RBSWorldPay page, and it may throw some customers off, so by just having a link solves this problem: <p align="center"> <a href ="http://WEBSITEURL/checkout_process.php?osCsid=<?php echo $_POST['M_sid']; ?>&hash=<?php echo $_POST['hash']; ?>">Click here to return to the store to complete your order</a> </p> Only a quick fix and the first thing I have edited myself on osCommerce, hope this makes sense and helps some people out. Obviously, this still requires the user to press the button in order for the database to be updated. If anyone knows how to do it automatically without the user having to press the button that'd be most helpful. -Phill. Edited September 15, 2009 by PhillT Quote Link to comment Share on other sites More sharing options...
rgvsean Posted September 16, 2009 Share Posted September 16, 2009 That's a neat little solution. Thanks. Quote Link to comment Share on other sites More sharing options...
rgvsean Posted September 17, 2009 Share Posted September 17, 2009 out of curiosity why does your button solution work back to checkout_process.php even though I have the callback in the WP enviroment set to junior_callback.php? :blink: Can a basic html graphic be used instead of plain text? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2009 Share Posted September 17, 2009 out of curiosity why does your button solution work back to checkout_process.php even though I have the callback in the WP enviroment set to junior_callback.php? :blink: Can a basic html graphic be used instead of plain text? My link goes back to that page as that is where the original button sent you to. The junior_callback.php file is the one I edited to remove the broken button and replace with the text link. If you wish to use an image as the link then you can just put an image between the <a></a> tags rather than the text. -Phill. Quote Link to comment Share on other sites More sharing options...
rgvsean Posted September 17, 2009 Share Posted September 17, 2009 Ah great, so callback pulls the button code out of junior_callback and then the button sends you back to the cart, completing the whole process. That's brilliant. Thank you. A nice image should ensure customers are encouraged to click, the link on it's own looks a little lost. Quote Link to comment Share on other sites More sharing options...
rgvsean Posted September 22, 2009 Share Posted September 22, 2009 I used your button code and added some to get this: <p class="pageHeading"><?php echo STORE_NAME; ?></p> <p class="main" align="center"><?php echo MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_SUCCESSFUL_TRANSACTION; ?></p> <META http-equiv="refresh" content="4;URL=http://www.xxxxxxxxxxx.co.uk/store/checkout_process.php?osCsid=<?php echo $_POST['M_sid']; ?>&hash=<?php echo $_POST['hash']; ?>"> <p align="center"> <a href ="http://www.xxxxxxxxxxxx.co.uk/store/checkout_process.php?osCsid=<?php echo $_POST['M_sid']; ?>&hash=<?php echo $_POST['hash']; ?>">If you are not automatically returned after 5 seconds - Click here to return to the store to complete your order</a> </p> <p> </p> <WPDISPLAY ITEM=banner> What this does is give a link to press, and warn about a possible redirect. The auto redirect works in 4 seconds (content="4;) and causes all the updates and e-mails. You must have customer response enabled and have http://.........................................junior_callback as the response URL. I hope this helps someone. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 24, 2009 Share Posted September 24, 2009 What this does is give a link to press, and warn about a possible redirect. The auto redirect works in 4 seconds (content="4;) and causes all the updates and e-mails. I hope this helps someone. Thanks, I wasn't sure where to put that on the page, this ensures they get redirected back to the store and the order is complete. Thanks, -Phill. Quote Link to comment Share on other sites More sharing options...
rgvsean Posted September 24, 2009 Share Posted September 24, 2009 Nor me lol I just figured if RBS are collecting the code for the button from there I'll drop it right next to it. Lucky guess really :blush: You could get rid of the button but it's a good back up I think :) I also checked with RBS that it will continue to work after their changes planned for end of this month and they said it would. Quote Link to comment Share on other sites More sharing options...
mapletree Posted November 13, 2009 Share Posted November 13, 2009 I used your button code and added some to get this: What this does is give a link to press, and warn about a possible redirect. The auto redirect works in 4 seconds (content="4;) and causes all the updates and e-mails. You must have customer response enabled and have http://.........................................junior_callback as the response URL. I hope this helps someone. Great, I used your codes and it works well. But I curiuos what this" $_POST['M_sid'] " and" $_POST['hash'] " for. As I am trying for a few days to bring the worldpay transaction id to show on admin side orders.php page, does nay one know how to work it out? Appreciate your help. Quote Link to comment Share on other sites More sharing options...
mielag Posted December 3, 2009 Share Posted December 3, 2009 Great stuff, thanks for posting that here! had the same problem with with callback button and your solution is perfect! I do however have a small problem - when I am sent back to store my confirmation page is not showing the order number - it only shows "Transaction: /09" when it should be "Transaction: 1000/09"... any idea where maybe be the problem??? thanks again for helping me out! Quote Link to comment Share on other sites More sharing options...
peterbuzzin Posted December 6, 2009 Share Posted December 6, 2009 I had the same problem but unfortunately didn't find this post until after I spent ages figuring it out myself :( However the good news is I've made an updated version of the contribution which also includes a failed payment response and redirects customers back to the payment selection page (deletes previous order and restocks to prevent duplicate orders) Can be found here http://addons.oscommerce.com/info/7151 Pete 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...
rgvsean Posted December 13, 2009 Share Posted December 13, 2009 Sorry I've not been around to answer on these questions but I doubt I could have helped. I am not a programmer I just had a stab at it as there wasn't much help available. That looks like great work Peter :thumbsup: Quote Link to comment Share on other sites More sharing options...
april_floyd Posted December 22, 2009 Share Posted December 22, 2009 tried using above but you can't use php in world pay edit pages - anybody know what the url should be to make this work Quote Link to comment Share on other sites More sharing options...
mhsuffolk Posted December 23, 2009 Share Posted December 23, 2009 tried using above but you can't use php in world pay edit pages - anybody know what the url should be to make this work Use the code in post #7 above. It goes in \ext\modules\payment\worldpay\junior_callback.php. It replaces a similar block of code Do not get confused with the Worldpay payment page editor on their website Martin Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
april_floyd Posted December 23, 2009 Share Posted December 23, 2009 Thanks for the reply, I have added the code to the file, but not sure what the exact url is below 'You must have customer response enabled and have http://.........................................junior_callback as the response URL.' Quote Link to comment Share on other sites More sharing options...
april_floyd Posted December 23, 2009 Share Posted December 23, 2009 I would appreciate any help from anyone who has managed to get world pay and oscommerce to work. Payment is OK, but can't get the emails to send from oscommmerce Quote Link to comment Share on other sites More sharing options...
april_floyd Posted December 23, 2009 Share Posted December 23, 2009 Is this the correct url format? http://www.xxx.co.uk/ext/modules/payment/worldpay/junior_callback.php Quote Link to comment Share on other sites More sharing options...
peterbuzzin Posted December 23, 2009 Share Posted December 23, 2009 Is this the correct url format? http://www.xxx.co.uk/ext/modules/payment/worldpay/junior_callback.php Which contribution are you using? There shouldn't be any need for you to enter the full url for the callback page. 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...
april_floyd Posted December 28, 2009 Share Posted December 28, 2009 I am using - RBS Worldpay Form (which I think you created) Do you know what the url is for the callback? Quote Link to comment Share on other sites More sharing options...
Jos Medinger Posted February 24, 2010 Share Posted February 24, 2010 I've entered the link into the junior_callback.php file and this now presents the user with a clickable link When this is clicked however it adds a 2nd order entry into the databse marked with 'Preparing [WorldPay]' (and triggers an order success email) The automatic callback is marking the primary order as paid but not sending out the order success email. Any ideas? Is it a setting in Worlpay admin screens causing this? Thanks Quote =============== Simple yet Creative Get Online Web Design : getonlinedesign.com =============== Link to comment Share on other sites More sharing options...
match_858 Posted July 21, 2010 Share Posted July 21, 2010 Can I add my thanks to Martin. Great help and support Quote Heppiness Web Design - Web Design Bolton 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.