How to fix Worldpay Junior junior_callback.php going straight to results screen in rbsworldpay
#1
Posted 09 September 2009, 09:29
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!!
#2
Posted 15 September 2009, 13:45
<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 by PhillT, 15 September 2009, 13:52.
#3
Posted 16 September 2009, 21:04
#4
Posted 17 September 2009, 11:04
Can a basic html graphic be used instead of plain text?
#5
Posted 17 September 2009, 14:31
rgvsean, on Sep 17 2009, 11:04 AM, said:
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.
#6
Posted 17 September 2009, 14:54
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.
#7
Posted 22 September 2009, 19:44
Quote
<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.
#8
Posted 24 September 2009, 09:37
rgvsean, on Sep 22 2009, 08:44 PM, said:
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.
#9
Posted 24 September 2009, 10:52
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
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.
#10
Posted 13 November 2009, 15:26
rgvsean, on 22 September 2009, 19:44, said:
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.
#11
Posted 03 December 2009, 22:36
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!
#12
Posted 06 December 2009, 13:45
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
#13
Posted 13 December 2009, 16:45
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
#14
Posted 22 December 2009, 20:58
#15
Posted 23 December 2009, 09:50
april_floyd, on 22 December 2009, 20:58, said:
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
#16
Posted 23 December 2009, 12:05
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.'
#17
Posted 23 December 2009, 12:15
Payment is OK, but can't get the emails to send from oscommmerce
#18
Posted 23 December 2009, 12:21
http://www.xxx.co.uk/ext/modules/payment/worldpay/junior_callback.php
#19
Posted 23 December 2009, 12:24
april_floyd, on 23 December 2009, 12:21, said:
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.
#20
Posted 28 December 2009, 14:35
Do you know what the url is for the callback?














