Paul
|
Posted Sun 31 Mar 2013
|
Group: Administrators
Last Active: Tue 10 Sep 2024
Posts: 807,
Visits: 2,748
|
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
-- If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.
If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb
|
|
|
Medz
|
Posted Wed 6 Oct 2010
|
Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99,
Visits: 1,400
|
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
|
|
|
mike
|
Posted Mon 4 Oct 2010
|
Group: Awaiting Activation
Last Active: Thu 25 Oct 2012
Posts: 15,
Visits: 210
|
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
|
|
|
Medz
|
Posted Mon 4 Oct 2010
|
Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99,
Visits: 1,400
|
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.
|
|
|
mike
|
Posted Thu 30 Sep 2010
|
Group: Awaiting Activation
Last Active: Thu 25 Oct 2012
Posts: 15,
Visits: 210
|
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!
|
|
|
Paul
|
Posted Wed 29 Sep 2010
|
Group: Administrators
Last Active: Tue 10 Sep 2024
Posts: 807,
Visits: 2,748
|
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?
-- If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.
If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb
|
|
|
mike
|
Posted Tue 28 Sep 2010
|
Group: Awaiting Activation
Last Active: Thu 25 Oct 2012
Posts: 15,
Visits: 210
|
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
|
|
|
Medz
|
Posted Tue 28 Sep 2010
|
Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99,
Visits: 1,400
|
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.
|
|
|
mike
|
Posted Tue 28 Sep 2010
|
Group: Awaiting Activation
Last Active: Thu 25 Oct 2012
Posts: 15,
Visits: 210
|
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
|
|
|
Medz
|
Posted Tue 28 Sep 2010
|
Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99,
Visits: 1,400
|
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
|
|
|