Worldpay Redirection Page After Payment

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #228441

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.6.17
-- Browser(s) name and version -- : Chrome 48

I can't see where to set the page to which users are redirected after payment using the Worldpay payment gateway.

I've looked at other forum posts but they all seem to relate to the notifications to update order status which i DO have working, it's just that after payment is made the user is redirected to the homepage and I was wondering if it was possible to show some sort of order confirmation page instead?


Part of the message is hidden for the guests. Please log in or register to see it.


I can see a CANCEL URL in the payment plugin settings but no redirect after payment setting.

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 9 months ago #228606

Hi,

Add the line:
'return_url' => array('RETURN_URL', 'input'),
after the line:
'cancel_url' => array('Cancel URL', 'input'),
in the file plugins/hikashoppayment/bf_rbsbusinessgateway/bf_rbsbusinessgateway.php and that should allow you to enter the URL you want in the settings of the payment method.

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #228749

Great, thanks for that - have done that now so i can see the field.

The only thing I'm not sure about now is what value should I be entering into there? What I'm looking for is for the user to be redirected back to an order detail page displaying/confirming their order, perhaps with links to download their files if it's been an electronic purchase?

And if that is going to require parameters being passed (ie the order number) then will I need to hardcode the URL into the payment plugin instead of entering it into the new payment plugin in the site admin?

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #228770

Okay I think I have figured out the URL should be

index.php?option=com_hikashop&cid=xxx&ctrl=order&lang=en&task=show
Where the cid value is the order number, however I'm still redirected to the site's homepage after payment. I've tried entering a test value into the new parameter field in the payment plugin as well as hard-coding it as an extra variable in the payment form by editing bf_rbsbusinessgateway_end.php but neither seem to work?

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #228777

Have been trying to work with this but no matter what I do the Worldpay payment page does a meta refresh to the site's homepage after 5 seconds.

I tracked down parts of code in the bf_rbsbusinessgateway.php and bf_rbsbusinessgateway_end.php files which had a meta refresh in them and also noticed that there were equivalent files in the administration area and tried adjusting both the meta refresh rate (to give me time to view the code) and the redirection page (so that I could tell which of those meta refreshes were performing the redirection) however none of them seemed to have any effect!

I spoke to Worldpay and they confirmed the instruction to metarefresh after 5 seconds and where to come from Hikashop - so where should I look to find the bit doing this so that I can change it?!

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #229253

Hi there

Still waiting for guidance on this issue?

Simon

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 9 months ago #229265

Hi,

You can enter such link:

http://mywebsite.com/index.php?option=com_hikashop&ctrl=order&task=show&order_id={order_id}
There will be a download link there if the order has been paid and that the product has a download file.

HikaShop tells WorldPay to redirect to the after_end URL of HikaShop: index.php?option=com_hikashop&ctrl=checkout&task=after_end
which then automatically redirects to the return URL that you specify in the payment method.
If you get redirected to the homepage, it's something else which interfers with that or that you entered a wrong URL in the return URL setting of the payment method.

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
8 years 9 months ago #231000

Just to say I finally managed to sort this after much to-ing and fro-ing between Hikashop and Worldpay config.

In the end I figured out that Worldpay's own representatives were giving me duff info in saying that it's not possible to supply a custom redirect URL to for successful and cancelled payments. For the information of others in need of this functionality the two fields which need to be supplied are:

<input type="hidden" name="MC_returncancel"  value="http://www.url.com/cancelled">
<input type="hidden" name="MC_returnsuccess"  value="http://www.url.com/success">

The options supplied in the payment config in Hikashop didn't seem to make a difference so I ended up manually adding both of these additional fields to plugins\hikashoppayment\bf_rbsbusinessgateway\bf_rbsbusinessgateway_end.php on/around Line 60.

And obviously you'd just need to adjust the actual value for the URLs in the example above.

The following user(s) said Thank You: Mohamed Thelji

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum