WorldPay Response URL and Shopper Return for Thanks

Update May 2011 – This may be against terms and conditions. See Martin Brown’s comment below

It took a while to get my head around it, so here it is incase I need it again.

Integrating with WorldPay is not the simplest of tasks. The documentation is poor at best.

I was integrating by using a form on my site, which posts the order total and an order id etc to WorldPay. WorldPay then deal with taking the money from the user. What I couldn’t understand was how to get the user back to my site for thanks after they had paid.

Turns out it’s quite simple.

In the WorldPay control panel, enable Payment Response and add a url to which Worldpay will ping information about the transaction (the user is not sent here, nore are they ever aware this url exists). Also Enable Shopper Response.

When WorldPay pings your Payment Response file with the details of the transaction, if you have enabled Shopper Response then you can send back some html which WorldPay shows to the user. I had a better solution for the thanks page on my own site and so simply sent a meta redirect tag back. Nothing more, nothing less.

So the user is redirected to a url of my choice, and because I send that url to them after the transaction completes, I can choose where to send the user at that moment using the data WorldPay have send me.

<meta http-equiv=”refresh” content=”0;url=” />

[carousel keywords=”ecommerce development” tag=”fetchit-21″]

5 Replies to “WorldPay Response URL and Shopper Return for Thanks”

  1. Hi there,

    I’m reading this post on your details about the redirect. But I really dont get it. I have been working on a website, and have now been using to much time on this. I have set up WP e-commerse, with the Worldpay merchant file this guy made. And it seems like payment is made in testmode, but I’m still stuck on the Worldpay payment page. And the shopping cart is not updated/reset on the e-commerse website.

    Could you give me a little help on this please?

  2. It may only be a matter of time before this stops working. To quote from the WorldPay manual:

    “Warning: Automatic redirection using the payment response server-side script, client-side coding or 301/302 server redirects are prohibited and will result in a failure being logged and a possible suspension of the feature.”

    I’m not quite sure why they have this restriction, but there it is.

Comments are closed.