Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SSL Login / HSBC XML API Module


000---000

Recommended Posts

I have recently added SSL for my site, which I thought was working fine, until I have come to test it with the HSBC XML API module. Further more, to reduce the costs from my ISP I am sharing the secure area with another domain. Site www.firstsite.com redirects over to www.secondsite.com/hsbc-payment-area-for-firstsite/ to take the payment, login and account details. Although I haven't fully got the API module working yet, I think it is ok.

 

The problem I was/am having is that the login did not redirect to a valid page (once SSL installed) despite the URL showing what should be a valid page. Instead I got a 404 error. I fixed this by editing catalog/includes/functions/general.php and changing

 

 

 

function tep_redirect($url) {

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL

}

}

header('Location: ' . $url);

 

tep_exit();

}

 

 

 

 

 

to

 

 

 

 

function tep_redirect($url) {

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTP_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL

}

}

header('Location: ' . $url);

 

tep_exit();

}

 

 

This edit resulted in the login page going back to the index.php page and showing the welcome screen rather than an error 404 page which seemed fine.

 

However, when coming to test the payment section, I give 3 choices. Cheque, Paypal or Credit Card via HSBC XML API. The first two work fine. But the HSBC module redirects me back to the login, where even when the correct u&p are entered it simply reloads the login page.

 

I'm assuming the HSBC module should not redirect me to the login page when I'm already logged in??

Changing the HTTPS to HTTP is not the cause of the issue as have tested the payment area with and without the extra "S".

 

I am inclined to think that the login page issue I originally had with regards to the error 404 page may have something to do with this error as they both centre around the login.php page.

 

Any idea greatfully received.

 

Thanks

 

Matt

oscommerce_community_forums.gif
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...