WorldPay Submission Error


https://forum.kartris.com/Topic116.aspx
Print Topic | Close Window

By mike - Fri 24 Sep 2010
Hello again,

I've been trying to integrate a shop with WorldPay and been getting a bit stuck. I've been getting an error message from WorldPay when the transaction is submitted:


The information sent from the merchant's site is invalid or incomplete. Please send the following information to the merchant:

The transaction cannot be processed due to one or more of the following:

    * the installation ID field is blank or contains invalid characters
    * a different submission protocol is required. For instance, a more secure submission may be required
    * the installation number is invalid


The only thing I've noticed that could account for the error is that the names of the input elements on the form sending the transaction are all lowercase, when all of WorldPay's documentation uses capital letters. For example 'instid' on Kartris' form is 'instId' in WorldPay's instructions. It could mean WorldPay's systems aren't finding the relevant fields when the form is posted (thus a message saying the installation ID is invalid or blank).

I'm not sure if this is really making a difference, but it's all I can see at the moment.


Thanks as always,
Mike
By mike - Tue 28 Sep 2010
Hi Medz,
I've tried out the two .dlls and those have got me past the error message! WorldPay is now processing the test transactions - so my next question regards getting the order information back into the shop.

Is it still the same page for the payment response as before with PayPal (CheckoutComplete.aspx)? The payment process seems to get to WorldPay's thankyou page and then stall (i.e. just sit there and not do anything, with no further options presented to the shopper), so I assume it should be redirecting. No order information is getting returned to Kartris.

Thanks as always,
Mike
By Medz - Tue 28 Sep 2010
In your Worldpay configuration page (on worldpay.com), you need to specify the worldpay_callback link back to your site. You also need to tick the "callback enabled" and "callback response" checkboxes. Once done, Kartris should then be able to automatically catch and recognise completed orders.

callback url format->  http://www.yourkartrissite.com/callback.aspx?g=rbsworldpay
By mike - Tue 28 Sep 2010
OK I've tried the callback url as specified - I take it when you say 'worldpay_callback' you actually mean the 'Payment Response URL' setting. No luck so far it seems - nothing has come through to the Orders page in the shop admin (after having put some more test transactions through). I'll keep trying though - anything else I could be looking for?

Cheers (I really appreciate your quick response on this),
Mike
By Medz - Tue 28 Sep 2010
Hi Mike, can you check your Kartris error logs and see if something is coming up there?

Backend -> Configuration -> Database Admin -> Error Logs

Sorry about the incorrect field names. Those came from an outdated manual!

Payment Response URL -> http://www.yourkartrissite.com/callback.aspx?g=rbsworldpay

Payment Response enabled? -> check

Enable the Shopper Response -> check

Also, it might be worth setting the 'Payment Response failure email address' field to your email address so that you'll receive an email whenever a callback failure occurs.
By mike - Tue 28 Sep 2010
Hi Medz,

The settings all seem to be OK - except I've now changed it so I'm receiving the Payment Response Failure emails, which has thrown up something interesting.

The email is quite specific about the error:

Error reported: Callback to http://-----------------/callback.aspx?g=rbsworldpay:NOT OK, recevied HTTP status: 302

From what I can tell, status 302 involves redirection - perhaps this is a response from Kartris to attempt to redirect the user back to the front page of the shop? I vaguely remember somewhere in WorldPay's instructions it saying that it doesn't like it when sites start trying to redirect people around (probably because of the fraud potential in it). Perhaps all that might be needed would be to disable that feature when dealing with WorldPay callbacks? Something to try at least.

Cheers,
Mike


By Paul - Wed 29 Sep 2010
If you switch the Worldpay config settings to 'fake' mode, this should simulate a worldpay callback. It's a form of test mode built into most payment gateway support on kartris. Basically what happens is that at the point you'd normally be sent to Worldpay, kartris instead formats a page containing the data that Worldpay would normally post back to the callback, and then allows you to submit this.

If you do this, what happens? Does the callback.aspx page redirect you, or does it display some message?
By mike - Thu 30 Sep 2010
I've tried this, when it submits I'm redirected to a page with all the order details, titled 'Your transaction was successful.' I'm guessing this is what was originally meant to be seen!
By Medz - Mon 4 Oct 2010
Hi Mike, can you confirm that you're not getting anything in the error logs on the Kartris backend? I suspect that the callback page is hitting an error and is trying to redirect to error.htm thus the 302 status.

By mike - Mon 4 Oct 2010
I've had another look, and there are definitely no error messages coming up in the logs. All there is, is the 'Successful Callback Log' ones generated when I checked it out with WorldPay in 'fake' mode last week.

Cheers,
Mike
By Medz - Wed 6 Oct 2010
Hi Mike,

I think I finally figured out whats happening. Apparently the callback from worldpay causes request validation exception. We're handling this specific exception by redirecting the user back to the same page with an injected javascript alert message saying "html input is not allowed". Worldpay doesn't like the redirect thus causing the error. To fix this we need to disable request validation in the callback.aspx page. You need to open up callback.aspx in notepad and add the "ValidateRequest=false" attribute to the page directive.


Callback Page Directive


<%@ page language="VB" buffer="true" masterpagefile="~/MasterPages/Kartris.master" autoeventwireup="false" inherits="callback, KartrisCompiled" enableEventValidation="false" viewStateEncryptionMode="Always" %>


add ValidateRequest attribute -->


<%@ page language="VB" buffer="true" masterpagefile="~/MasterPages/Kartris.master" autoeventwireup="false" inherits="callback, KartrisCompiled" enableEventValidation="false" viewStateEncryptionMode="Always" ValidateRequest="false" %>


Also, since Worldpay only grabs the response from callback page and displays the output inside one of its pages we need to add the "d=off" querystring to the configured Payment Response URL in Worldpay.

e.g.
http://www.yourkartrissite.com/callback.aspx?g=rbsworldpay&d=off

Please let me know how it goes.

Cheers

Medz
By Paul - Sun 31 Mar 2013
Just wanted to add an update to this thread. ASP.NET 4.0 by default breaks this solution, because the instruction in the page directive not to requestValidate is ignored. So you need to add code into your web.config to overcome this. The KB below should help out...

http://www.kartris.com/Knowledgebase/Worldpay-callback-issues---302-redirect-Not-OK__k-48.aspx