Zen Cart Logo
Forums / Addon Payment Modules / Server Error 406 on EBS Payment Gateway return URL

Server Error 406 on EBS Payment Gateway return URL

Views: 5,707

Results 1 to 10 of 10
26 Jan 2011, 9:37 AM
#1
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Server Error 406 on EBS Payment Gateway return URL

I am getting the below error when I am testing my integration with the payment gateway:

Server Error
406 - Client browser does not accept the MIME type of the requested page.
The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.

After checkout from Zencart, I am taken to the payment gateway, I enter the credit card details, the payment gets registered in the payment gateway database. However, when the payment gateway returns the message back to the zencart, the above message is displayed on the browser.

The URL is as below:

http://www.zencartFolder/index.php?main_page=checkout_payment&error_message=There+has+been+an+error+processing+your+credit+card.+Please+try+again.

So, from the URL, it appears that there was some error in the credit card details and hence the payment gateway returns the error message. However, if the user enters incorrect credit card details in a live scenario, it should take me back to Zencart and display the error message.

Any idea how I can resolve this?

26 Jan 2011, 10:03 AM
#2
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Server Error 406 on EBS Payment Gateway return URL

I am getting the below error when I am testing my integration with the payment gateway:

Server Error
406 - Client browser does not accept the MIME type of the requested page.
The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.

After checkout from Zencart, I am taken to the payment gateway, I enter the credit card details, the payment gets registered in the payment gateway database. However, when the payment gateway returns the message back to the zencart, the above message is displayed on the browser.

The URL is as below:

http:/ /www.my_zencartFolder/index.php?main_page=checkout_payment&error_message=There+has+been+an+error+processing+your+credit+card.+Please+try+again

So, from the URL, it appears that there was some error in the credit card details and hence the payment gateway returns the error message. However, if the user enters incorrect credit card details in a live scenario, it should take me back to Zencart and display the error message.

Any idea how I can resolve this?

26 Jan 2011, 11:35 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Server Error 406 on EBS Payment Gateway return URL

What gateway module are you using?

27 Jan 2011, 6:51 PM
#4
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Server Error 406 on EBS Payment Gateway return URL

I am using EBS Payment Gateway. secure.ebs.in

9 Feb 2011, 8:34 PM
#5
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Server Error 406 on EBS Payment Gateway return URL

I am integrating Zencart with the Payment Gateway EBS.

I am able to checkout, navigate to payment gateway, and provide CCard details. The URL returned by Payment gateway is

http://zencart/index.php?main_page=checkout_process&DR=$OP+dgG1+lqFQBe7E4kZcEkKEDKivrv9juvLUPmhNU2L7BzFg1aJTYfhIjEHCotqxDGsu0zXxmQgWO0UQp6kNh/kVsxEnaZ94X1YHt5r7D++ma9vcUhNiDA41LdMyIWaaWbfHRTbfxoLx0c9jCMlOWMLpBCz9UxooeJs6z58VRmjsN2U4oQVOqPL9bQKje/o9/n36vso6Q8ZeyQUEmj6xnekSkYKomjfmhsxMmVoXx6Q+dLWnQiOPwrgnDX2KtoPWr+GurtWTmZvj5AzcVhWO7aITspvT

This is giving me a 406 error on IIS (browser does not recognize page extension)

The Return URL has to be in the following format to receive the response from EBS Server,

http://www.yourdomainname.com/response.extension?DR={DR}

I am not sure why I am getting the "There was an error processing your credit card. Please try again" error.

Any idea what I can try out or change to get out of this problem soon?!

9 Feb 2011, 8:53 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Server Error 406 on EBS Payment Gateway return URL

That's because Zen Cart throws a 406 error whenever very long GET strings are passed in the URL, because that's one of the most common things that hackers/bots and other rogue visitors do to look for security holes.
It would be better to use another method to pass back a response.

10 Feb 2011, 3:44 AM
#7
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Server Error 406 on EBS Payment Gateway return URL

Thank you for your reply.

I have a difficulty understanding "It would be better to use another method to pass back a response."

The long URL that I am getting is from EBS i.e. the payment gateway. Are you suggesting I talk to my payment gateway people to send back a different kind of response that has a lesser URL length?

In case the Payment gateway provider is not ready to change the response, is there a way in Zencart to accept long URLs?
Can I change code in Zencart to be able to accept a long URL like this?

10 Feb 2011, 4:22 AM
#8
martinkneeshaw avatar

martinkneeshaw

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Server Error 406 on EBS Payment Gateway return URL

The piece of code that is throwing me the error is below:

  if (!isset($response['ResponseCode']) || !is_numeric($response['ResponseCode']) || $response['ResponseCode']  != '0') {

    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_TEXT_ERROR_MESSAGE), 'SSL', true, false));
  } 

:frusty:

10 Feb 2011, 7:45 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Server Error 406 on EBS Payment Gateway return URL

MartinKneeshaw:

The long URL that I am getting is from EBS i.e. the payment gateway. Are you suggesting I talk to my payment gateway people to send back a different kind of response that has a lesser URL length?Not exactly. I'm suggesting that they not send ANYTHING long via the URL.
MartinKneeshaw:

In case the Payment gateway provider is not ready to change the response, is there a way in Zencart to accept long URLs?
Can I change code in Zencart to be able to accept a long URL like this?Yes, you could break the protection logic in application_top and let it receive any junk you want to let through.

But that's not the recommended approach.

10 Feb 2011, 7:50 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Server Error 406 on EBS Payment Gateway return URL

MartinKneeshaw:

The piece of code that is throwing me the error is below:

  if (!isset($response['ResponseCode']) || !is_numeric($response['ResponseCode']) || $response['ResponseCode']  != '0') {

    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, **'error_message=' . urlencode(MODULE_PAYMENT_TEXT_ERROR_MESSAGE)**, 'SSL', true, false));
  } 

:frusty:
Okay, if that's the line that's causing you problems, then rewrite it by removing the long error message, like the existing built-in modules do. ie:```
[B] global $messageStack;
$messageStack->add_session('header', MODULE_PAYMENT_TEXT_ERROR_MESSAGE, 'error');
[/B] zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, [B]''[/B], 'SSL', true, false));