How Do I Create Returning Page Setting with WorldPay?

As of 2020 This is still very undocumented and many links are now broken :(

After doing the accepted answers by @www.amitpatil.me it still did not work for me.

I have made it work by adding this extra form field into the form post, I found this after many seeming unrelated google tabs.

<input type="hidden" name="successURL" value="https://www.example.com/thanks/">

I hope it helps someone else.


Can totally sympathise, this was a bit of a nightmare to setup for me too. I've not used the MC_success parameter before, but as far as I know you can't do a straight redirect, it has to display a Worldpay page after payment, but you can customise this page.

Once the payment is successful (or not), Worldpay shows an HTML page to the user. These HTML pages are stored in your Worldpay control panel, and if you want to customise them you have to upload a new file here. The files shown on transaction success and failure are resultY.html and resultC.html respectively.

You need to have a look at the Advanced Customising Guide, and search for resultY.html in the top right of that guide, this will give you some help.

In these files, Worldpay automatically substitues certain tags like <wpdisplay item=cartId> and <wpdisplay item=banner default=""> for actual data. I would login to your Worldpay control panel and download the files it currently uses, then customise from there.

In an installation I have I just include a line in my resultY.html page like the following...

<p><a href="http://example.com/worldpay/cartid/<wpdisplay item=cartId>">Redirect back to my shop</a></p>

...which will take the user back to my site with their cartId in the URL, from which I pull their order details and show a success page of my own. But you can create your own tags by sending along extra post fields in your sample form above. The names of the variables must be prefixed MC_, but you can then include them in your resultY.html file. Ie.

<form action="https://secure.wp3.rbsworldpay.com/wcc/purchase" method="post">
    <input type="hidden" name="testMode" value="0">
    <input type="hidden" name="instId" value="<?= $this->INST_ID ?>">
    <input type="hidden" name="cartId" value="<?= $this->CART_ID ?>">
    <input type="hidden" name="amount" value="<?= $this->AMOUNT ?>">
    <input type="hidden" name="currency" value="<?= $this->CURRENCY_CODE ?>">
    <input type="hidden" name="desc" value="Photos">

    <input type="hidden" name="MC_myText" value="This is my custom text">

    <input type="submit" value="Click here for the secure payment form">
</form>

And in your resultY.html file just include the tag <WPDISPLAY ITEM=MC_myText>. You need to be conscious that all your form fields are visible to a user if they view the source of your payment pages, hence putting a valid MC_downloadLink to some valuable download is a bad idea.

Check out these pages, they're the most useful ones in the customising guide:

  • Structure of the Result Pages
  • Dynamic Information Parameters
  • Custom Parameters

I hope this has been of some help, if you have any questions just add a comment. Good luck!!


After spending 3-4 days and reading all the confusing and poor documentation of Worldpay, somehow I found how to return to some page and process the response returned by Worldpay. I wanted to insert a record in a database with transaction details. So I was looking for solution. Well, here is the solution that worked for me:

  1. login to Worldpay, open desired installation to edit
  2. Tick on "Payment Response enabled?"
  3. Provide "Payment Response URL" to the page which will be receiving/processing the POST data from worldpay.
  4. Enter same url in "Shopper redirect url"
  5. Tick on "Shopper Redirect button enabled"
  6. Tick on "Enable the Shopper Response"
  7. If you use print_r($_POST) (For php users) on url entered in "Payment Response URL" you can see all the details returned by Worldpay.
  8. After processing you can use meta refresh technique to redirect user to some other page or you can print "thank you" message to the user on same page.

I know this thread is 1+ year old but in case if someone finds this helpful I am posting my solution here.

Edit : "WorldPay Payment Response Guide" documentation

Edit : Here is a screenshot of my settings that worked for me screenshot of my settings


Editing resultY.html is not strictly necessary, you can skip using the Payment Page Editor by using the 'Payment Response' feature.

In the installation settings provide a URL for a script on your server and WorldPay will POST the following parameters to it once a payment has been authorised (or the shopper clicks Cancel on the payment page): http://www.worldpay.com/support/kb/bg/paymentresponse/pr5201.html

If you also enable the setting "Enable the shopper response" WorldPay will download any HTML the script you specified outputs and use this as the result page (hosted on their own server). (If you want any images hosted securely they'll need to be uploaded in the Payment Page Editor)

This allows you to build a dynamic results page without needing to use resultY.html (OSCommerce and may other shopping carts use this method to customise the results page)

I believe there is no problem with using a META refresh on your results page provided it is not in anyway misleading (you need to give the shopper the outcome of the payment and not immediately send them to your home page for example).