Hi, I am using ZC 1.5.5 and was running Canada post 1.6. out of nowhere it is no longer able to get quotes. error "internal" which when I dug deeper says unable to reach sever and I only see that when I change from $errno>0 to $errno>=0
PHP Code:
function _sendToHost($data)
{
$url = 'https://' . (MODULE_SHIPPING_CANADAPOST_CPCID == 'CPC_DEMO_XML' ? 'qa-' : '') . 'sellonline.canadapost.ca/sellonline/Rating';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
// curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Zen Cart merchant at ' . urlencode(HTTPS_SERVER));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
$errno = curl_errno($ch);
curl_close($ch);
if ($errno > 0) {
$response = '<?xml version="1.0" ?><eparcel><error><statusMessage>' . MODULE_SHIPPING_CANADAPOST_COMM_ERROR . ($errno != 0 ? '<br /><strong>' . $errno . ' ' . $error . '</strong>' : '') . '</statusMessage></error></eparcel>';
}
return $response;
}
I tried the updated version too 1.6.1 and still getting the same error.
I did try curl from terminal of that server "curl https://sellonline.canadapost.ca/sellonline/Rating" and I get method not allowed which is normal since I used et method.
Is anyone else experiencing this? not sure how to fix it.
Bookmarks