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=http://www.example.com/thanks.html” />
[carousel keywords=”ecommerce development” tag=”fetchit-21″]