Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS.PHP cannot instatiate non-existent class


Guest

Recommended Posts

I receive the following error when I try to use Paypal's express checkout:

 

Fatal error: Cannot instantiate non-existent class: httpclient in /home/smell3/public_html/secure/catalog/includes/modules/shipping/usps.php on line 223

 

Seems that I need to define class httpClient. Here's the code from usps.php:

 

      $http = new httpClient();
     if ($http->Connect($usps_server, 80)) {
       $http->addHeader('Host', $usps_server);
       $http->addHeader('User-Agent', 'osCommerce');
       $http->addHeader('Connection', 'Close');

       if ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();

       $http->Disconnect();
     } else {
       return false;
     }

 

Any help is greatly appreciated.

 

Thanks,

Carlos

Link to comment
Share on other sites

  • 2 months later...

Did you ever figure this out? I've got the same problem.

-Neil

 

I receive the following error when I try to use Paypal's express checkout:

 

Fatal error: Cannot instantiate non-existent class: httpclient in /home/smell3/public_html/secure/catalog/includes/modules/shipping/usps.php on line 223

 

Seems that I need to define class httpClient. Here's the code from usps.php:

 

      $http = new httpClient();
     if ($http->Connect($usps_server, 80)) {
       $http->addHeader('Host', $usps_server);
       $http->addHeader('User-Agent', 'osCommerce');
       $http->addHeader('Connection', 'Close');

       if ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();

       $http->Disconnect();
     } else {
       return false;
     }

 

Any help is greatly appreciated.

 

Thanks,

Carlos

Link to comment
Share on other sites

It turns out that this error is returned when there's a problem using curl over SSL. Shared hosting accounts (with GoDaddy at least) require the use of a proxy. Just edit the setup parameters for the WPP module to include a proxy (proxy.shr.secureserver.net:3128 for Godaddy) and you will be able to get past this part.

I wish someone would make the error code more succinct, but anyways...

-Neil

 

 

I receive the following error when I try to use Paypal's express checkout:

 

Fatal error: Cannot instantiate non-existent class: httpclient in /home/smell3/public_html/secure/catalog/includes/modules/shipping/usps.php on line 223

 

Seems that I need to define class httpClient. Here's the code from usps.php:

 

      $http = new httpClient();
     if ($http->Connect($usps_server, 80)) {
       $http->addHeader('Host', $usps_server);
       $http->addHeader('User-Agent', 'osCommerce');
       $http->addHeader('Connection', 'Close');

       if ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();

       $http->Disconnect();
     } else {
       return false;
     }

 

Any help is greatly appreciated.

 

Thanks,

Carlos

Link to comment
Share on other sites

  • 3 months later...
It turns out that this error is returned when there's a problem using curl over SSL. Shared hosting accounts (with GoDaddy at least) require the use of a proxy. Just edit the setup parameters for the WPP module to include a proxy (proxy.shr.secureserver.net:3128 for Godaddy) and you will be able to get past this part.

I wish someone would make the error code more succinct, but anyways...

-Neil

 

greetings,

I'm having this exact problem w/ the UPS module, but am not certain what you mean by editting the setup parameters in for WPP module.

 

My client is using a shared host (mosso.com)...

 

i need a little help figuring this out...

Link to comment
Share on other sites

	  if (!class_exists('httpClient')) {
	include('includes/classes/http_client.php');
  }

  $http = new httpClient();

 

Jan, thank you so much for the quick reply.

i REALLY appreciate having someone help me out when my ignorance shines through...

Link to comment
Share on other sites

when my ignorance shines through...

I don't think you can call it ignorance. This fix was added to the USPS module in RC2 and must have been a problem spot for years without ever having been noticed in all these years...

Link to comment
Share on other sites

Excuse my ingnorance. What is the significance of this code. What does it do? Sjould it be added to usps.php?

 

if (!class_exists('httpClient')) {

include('includes/classes/http_client.php');

}

 

$http = new httpClient();

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...