
Originally Posted by
sle39lvr
The new ups.php file in modules was significantly different from the old one. The new one did not have any references to ports. It has:
Code:
if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';
$host = 'https://www.ups.com/using/services/rave/qcostcgi.cgi?';
$request = implode('&', array('accept_UPS_license_agreement=yes',
'10_action=' . $this->_upsActionCode,
'13_product=' . $this->_upsProductCode,
'14_origCountry=' . $this->_upsOriginCountryCode,
'15_origPostal=' . $this->_upsOriginPostalCode,
'19_destPostal=' . $this->_upsDestPostalCode,
'22_destCountry=' . $this->_upsDestCountryCode,
'23_weight=' . $this->_upsPackageWeight,
'47_rate_chart=' . $this->_upsRateCode,
'48_container=' . $this->_upsContainerCode,
'49_residential=' . $this->_upsResComCode));
$url = $host . $request;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Zen Cart quote inquiry');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$error = curl_error($ch);
Above is the only reference to 'https' and no references to any ports.
This module update came out two days ago, Jan 8th.
this module is now using curl. and my guess is you have a curl error.
when using curl with UPS and/or Fedex i like to log everything. that way if there is a problem you can see the last transaction in the log. i would modify your code as such:
PHP Code:
if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';
$ups_log = fopen(DIR_FS_LOGS . '/ups_error.log', 'w');
$host = 'https://www.ups.com/using/services/rave/qcostcgi.cgi?';
$request = implode('&', array('accept_UPS_license_agreement=yes',
'10_action=' . $this->_upsActionCode,
'13_product=' . $this->_upsProductCode,
'14_origCountry=' . $this->_upsOriginCountryCode,
'15_origPostal=' . $this->_upsOriginPostalCode,
'19_destPostal=' . $this->_upsDestPostalCode,
'22_destCountry=' . $this->_upsDestCountryCode,
'23_weight=' . $this->_upsPackageWeight,
'47_rate_chart=' . $this->_upsRateCode,
'48_container=' . $this->_upsContainerCode,
'49_residential=' . $this->_upsResComCode));
$url = $host . $request;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Zen Cart quote inquiry');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_STDERR, $ups_log);
$response = curl_exec($ch);
$error = curl_error($ch);
we have now established a var called $ups_log that should have the last transaction for every curl call made in your code. it resides in your logs directory.
we have upped the logging to verbose, so that we can see everything. and we are sending the standard output for the curl call to the $ups_log.
i have not looked at this code before, so i'm not sure what it does with the $error; i can only assume something, that should point us to any potential errors with this call.
but in my experience debugging common carrier curl calls, this is the easiest way to figure out what is going on. and the beauty is that only the last transaction is stored..... we could change that but this is sufficient for my debugging.
you can try a transaction and post the contents of the ups_error.log. if it has any 'sensitive' information, i would modify it accordingly.
good luck.
Bookmarks