phppayment-gatewayworldpay

Unable to redirect on custom success page after payment in worldpay


I have follow all the below step and setup all the configuration for response redirect in worldpay panel, But still its not redirect on my custom success page.

I follow the below steps for setup worldpay:

  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"

I have set the Payment Response URL as : https://my_domain.com/worldpay-response.php and create worldpay-response.php file on my root server path.

But still i am unable to get the $_POST data on worldpay-response.php.

Docs for worldpay payment response : click here


Solution

  • After spend 2 days by searching for response i find the solution.

    Please follow the below steps :

    1. Login into worldpay.
    2. Click on "SETUP" menu on left side.
    3. Click on settings icon of "(Select Junior)" installation for response url setup. For more help see below screenshot

    enter image description here

    Set the payment response URL and Shopper Redirect url.

    <wpdisplay item="MC_callback"> 
    
    1. Click on "edit payment pages" button. For more help see below screenshot.

    enter image description here

    1. Select your current installation id and click on edit payments page.

    enter image description here

    1. Click on File Management left menu and upload both file resultC.html and resultY.html. See screenshots below.

    enter image description here

    Content of File resultC.html

    <html>
          <head>
            <title>Thank you for your payment</title>
          </head>
          <WPDISPLAY ITEM="MC_cancelurl" DEFAULT="" PRE="<meta http-equiv='refresh' 
          content='0;url=" POST="' />">
          <b style="text-align:center;">Please wait while you are being redirected.</b>
      </html>
    

    Content of file resultY.html

    <html>
        <head>
            <title>Thank you for your payment</title>
        </head>
        <WPDISPLAY ITEM="MC_returnurl" DEFAULT="" PRE="<meta http-equiv='refresh' content='0;url=" POST="' />">
        <b style="text-align:center;">Please wait while you are being redirected.</b>
    </html>
    
    1. Create your form field on your server for payments from where any user can make payments on wordlpay.
        <!-- For live payments url should be https://secure.worldpay.com/wcc/purchase -->
    
        <form action="https://secure-test.worldpay.com/wcc/purchase" method="POST">
    
            <!-- This next line contains the testMode parameter - it specifies that the submission is a test submission -->
    
            <input type="hidden" name="testMode" value="100" > <!-- testmode value sholud be 100 , for live mode 0  -->
    
            <!-- This next line contains a mandatory parameter. Put your Installation ID inside the quotes after value= -->
    
            <!-- You will need to get the installation ID from your Worldpay account. Login to your account, click setting and under installations
            you should have an option called select junior and a number, put the number between “” e.g. “123456”-->
    
            <input type="hidden" name="instId" value="YOUR_INSTALLATION_ID">
    
            <!-- Another mandatory parameter. Put your own reference identifier for the item purchased inside the quotes after value= -->
    
            <input type="hidden" name="cartId" value="CART_NAME">
    
            <!-- Another mandatory parameter. Put the total cost of the item inside the quotes -->
    
            <!-- Another mandatory parameter. Put the code for the purchase currency inside the quotes after value= like GBP,INR-->
    
            <input type="hidden" name="currency" value="CURRENCY_CODE">
    
            <!-- This creates the button. When it is selected in the browser, the form submits the purchase details to us. -->
    
            <input type="hidden" name="MC_callback" value="YOUR_RESPONSE_URL">
    
            <input type="hidden" name="MC_returnurl" value="YOUR_RETURN_URL">
    
            <input type="hidden" name="MC_cancelurl" value="YOUR_CANCEL_URL">
    
            <input type="text" name="MC_username" value=""  placeholder="Name">
    
            <input type="text" name="tel" value=""  placeholder="Contact Number">
    
            <input type="email" name="email" value=""  placeholder="Email Address">
    
            <input type="text" name="address1" value="" placeholder="House Name/Number">
    
            <input type="text" name="address2" value=""  placeholder="Street Name">
    
            <input type="text" name="postcode" value=""  placeholder="Postcode">
    
            <input type="text" name="amount" value="" required placeholder="amount (&pound;)" id="amount-cs">
    
            <input type="submit" name="make_wordpay_payment" id="make_wordpay_payment" value="Pay Now">
    
        </form>
    

    I hope this will help you, For more help please follow the below link. http://support.worldpay.com/support/kb/bg/customisingadvanced/custa6012.html

    Thanks