lplplpx3 Posted July 16, 2012 Share Posted July 16, 2012 (edited) On version 2.2. Got webtools account and ugraded to the production server. No mods are on the USPS files. When checking out, I get the following error: An error occured with the USPS shipping calculations. If you prefer to use USPS as your shipping method, please contact the store owner. The unaltered code looks like this: $http = new httpClient(); if ($http->Connect('production.shippingapis.com', 80)) { $http->addHeader('Host', 'production.shippingapis.com'); $http->addHeader('User-Agent', 'osCommerce'); $http->addHeader('Connection', 'Close'); if ($http->Get('production.shippingapis.com/shippingapi.dll?' . $request)) $body = $http->getBody(); If the transaction is performed from a secure page (that starts with https) does this code need to be changed in any way? Any ideas why I'm getting an error? I have enabled the module, updated my zip (5 characters only), set the Sort Order to 1, of course added my username and password but not joy. Any help would be much appreciated. Thanks. Edited July 16, 2012 by lplplpx3 Quote Link to comment Share on other sites More sharing options...
Praful Kamble Posted July 17, 2012 Share Posted July 17, 2012 (edited) @@lplplpx3 What version of USPS module are you using? Try to debug and check the error log. Edited July 17, 2012 by Praful Kamble Quote Like post..hit LIKE button. osCommerce | Joomla | WordPress | Magento | SEO | CakePHP | CI Guaranteed Website Speed Optimization!! Link to comment Share on other sites More sharing options...
lplplpx3 Posted July 17, 2012 Author Share Posted July 17, 2012 (edited) @@Praful Kamble Not sure what module this is but the top of the file reads: $Id: usps.php 1783 2008-01-10 01:16:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2008 osCommerce Not sure how to debug and check the error log. If I need to update module. Please advise. Thanks. Edited July 17, 2012 by lplplpx3 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2012 Share Posted July 18, 2012 @@lplplpx3 I suggest installing USPS Methods which has updated code for USPS Chris Quote Link to comment Share on other sites More sharing options...
Praful Kamble Posted July 18, 2012 Share Posted July 18, 2012 @@lplplpx3 Go with the module Chris suggested. Quote Like post..hit LIKE button. osCommerce | Joomla | WordPress | Magento | SEO | CakePHP | CI Guaranteed Website Speed Optimization!! Link to comment Share on other sites More sharing options...
lplplpx3 Posted July 21, 2012 Author Share Posted July 21, 2012 (edited) @@DunWeb @Praful Kamble I saw this page but got completely stuck as to which version or what exactly I needed to install. I went with 3.0 as I read this worked flawlessly for someone else recently who was getting the same error. Did the install and attempted to follow steps BUT step 6 required code be changed in the catalog/admin/includes/functions/general.php file. When I searched for the code it wasnt in the file at all and therefore couldnt be replaced so I was back to square 1. What is your suggestion? When you say USPS methods do you mean start with the very first version (with no version no) from 16 Nov 2002? Please explain what number I need exactly and how its done ie do I need to start with nov 2002 and then do each one after that (which would be over 30-something installs)? Confused!!! Im a newbie but can (usually) follow directions well. Thanks much. Edited July 21, 2012 by lplplpx3 Quote Link to comment Share on other sites More sharing options...
lplplpx3 Posted July 21, 2012 Author Share Posted July 21, 2012 OK installed version 3.0...still get error. Did a dump and here's the output: string(310) "<Error> <Number>80040b1a</Number> <Description>API Disabled: Rate. This API has been retired. Please use RateV4. Documentation can be found at https://www.usps.com/business/webtools-technical-guides.htm</Description> <Source>UspsCom::DoAuth</Source> </Error>" Quote Link to comment Share on other sites More sharing options...
lplplpx3 Posted July 21, 2012 Author Share Posted July 21, 2012 Fixed. Thanks for everyones help and just in case anyone has this nightmare...from Version 3.0 installed "USPS Methods 5.2.0 V4IntlV2 Compatible" which has everything working fine. Also, got the browser dump error message by adding the the line to includes/modules/shipping/usps.php: var_dump(htmlspecialchars($body, ENT_QUOTES)); right after: $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(); // mail('[email protected]','USPS rate quote response',$body,'From: <[email protected]>'); if ($transit && is_array($transreq) && ($order->delivery['country']['id'] == STORE_COUNTRY)) { while (list($key, $value) = each($transreq)) { if ($http->Get('/' . $api_dll . '?' . $value)) $transresp[$key] = $http->getBody(); } } $http->Disconnect(); } else { return false; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.