Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS


Barcelona

Recommended Posts

I have been having the same problem for a while, calculations work perfectly for certain adresses (United states) but I get:

 

United States Postal Service United States Postal Service

An error occured with the USPS shipping calculations.

 

Whenever I fill in other foreign addresses (testing south african adresses, all give me that error)

 

does anyone know what this is from? need to get this fixed asap.

Link to comment
Share on other sites

Me too, it seems the USPS site is down for calculating postage.

 

 

Call 1-800-344-7779 and ask them to switch you to te production server and you will be up and running in minutes

Link to comment
Share on other sites

Glad you asked this question, I too have the same problem and was about to post the same.

Wallyr41

 

 

 

First, go on line and get a USPS Account at USPS.com. Call USPS (1-800-344-7779 and asked them to be switched, tell them that you have a oscommerce website and you want your account moved from test to the production server. They will ask you for your USPS account number. It will take them a couple minutes to complete the process. After they give you the ok you will have to enter a postal code in the

admin->configuration->Shipping/Packaging. Be sure to switch the test module to production; enter the word "password" in the password location. All done. Good Luck.

Wallyr41

Link to comment
Share on other sites

I have been on the production server for about a year and half with no problem and using the standard OSC USPS shipping module. I have been getting this same error for orders outside of the US for about a week now.

 

Something has definitely changed on the USPS end and my OSC is fairly unmodified with add-ons and I haven't touched it.

 

~Mark

Link to comment
Share on other sites

I updated the USPS Methods and still most of my customers are getting error messages therefore unable to order.

 

This must be a major problem for others out there besdies myself.

Link to comment
Share on other sites

I updated the USPS Methods and still most of my customers are getting error messages therefore unable to order.

 

This must be a major problem for others out there besdies myself.

 

Mine has been working fine up to a few days ago and I'm getting the same error now. If your using the USPS Methods you can uncomment a certain line and have the XML reponse Emailed to you. I did and it says that the username/password is incorrect. Been using the same one for over a year with no problmes and suddenly it's incorrect.

 

I emailed tech support at USPS, still waiting back to hear, but from what I can tell they don't use passwords anymore and the contrib is trying to send one.

 

Will post back when I hear from them.

Currently running 76 contibutions.

Link to comment
Share on other sites

Mine has been working fine up to a few days ago and I'm getting the same error now. If your using the USPS Methods you can uncomment a certain line and have the XML reponse Emailed to you. I did and it says that the username/password is incorrect. Been using the same one for over a year with no problmes and suddenly it's incorrect.

 

I emailed tech support at USPS, still waiting back to hear, but from what I can tell they don't use passwords anymore and the contrib is trying to send one.

 

Will post back when I hear from them.

 

I had to change my password to "password" and change the production server to $usps_server = 'production.shippingapis.com';

 

It seems they changed things again.

Currently running 76 contibutions.

Link to comment
Share on other sites

  • 2 weeks later...
I had to change my password to "password" and change the production server to $usps_server = 'production.shippingapis.com';

 

It seems they changed things again.

 

 

Tried that, didnt work for me.

 

Still get the error for international shipping.

 

Also, yes, I called them a year ago and got changed to the production server.

 

Seems what fixes this error for some people, doesnt for others.

Link to comment
Share on other sites

Ok...I decided to re-install the "USPS Methods_2.8d" & "USPS Methods Update for Postal Rates & Services Changes 5.14.07"

 

1.) Turn off ("remove") the USPS shipping module in your admin first (be sure to save all your USPS server login / password info first)

 

2.) Install "USPS Methods_2.8d" per the instructions

 

http://www.oscommerce.com/community/contri...ch,usps+methods

 

3.) Install "USPS Methods Update for Postal Rates & Services Changes 5.14.07" per the instructions

 

4.) In PHPAdmin, run the SQL queries.

 

5.) In OSC Admin, re-install the USPS shipping module and edit the info for you server login/password and make sure you're on the "production" server.

 

Works like a charm now. I believe the the error is caused by an improper installation during the editing of the USPS.php file. Instead of replacing code, comment out the old code by placing a /* before and a */ after the old code. Then paste in the new code.

 

Here's my tip - go slow...some the code that needs to be replaced in the USPS.php file looks the same in 5 places but read CAREFULLY and make sure you are replacing the EXACT same code. Not sure if this was my problem but it's working now, so I am pretty sure that's what occurred.

 

Either that or I ran the first SQL query and didn't run BOTH SQL queries

 

Good luck!

 

~Mark

Link to comment
Share on other sites

I have tried to follow the installation procedures many times, and each time I get the same error when I go to edit the usps in the admin where everything shows up except the list of checkboxes for international options:

 

Parse error: syntax error, unexpected T_GLOBAL, expecting ')' in /home/hsphere/local/home/esilk/thepicturemug.com/admin/modules.php(216) : eval()'d code on line 1

 

Also, when I tried to run the sql command:

ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

I got an sql error:

#1074 - Too big column length for column 'set_function' (max = 255). Use BLOB instead

 

I tried changing it from 555 to 255, but then got the error:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE latin1_swedish_ci NULL DEFAULT NULL' at line 1

 

Before I do the USPS51407RateServiceChangeUpdates.zip, the parse error does not show, but of course I get the usps error when trying to checkout from the store.

 

The parse error also does not appear if the only things I DON'T do are changing the "tep_db_query("insert into..." statement in the /catalog/modules/shipping/usps.php file AND don't run the sql queries.

 

It seems so straightforward but I'm very confused since I've repeated the steps so many times and still no go.

 

Any ideas where I'm going wrong with this?

 

Thanks!

Link to comment
Share on other sites

OK...Nevermind. I found the problem is that my server is running MySQL v4.0.26

 

I changed the first MySQL command to:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` TEXT

 

instead of:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

 

and everything worked fine.

 

I'm going to see if I can update the USPSMethods_2.8d Updates for May 14 Rates & Service Changes (minor correction) contribution with the requirements for servers with MySQL below version 5.0.3

 

cheers!

Link to comment
Share on other sites

Thanks to All

 

I have also the same problem and getting the same error on checkout page.

 

An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner.

Actually, I have installed osCommerce on my local machine.And trying the USPS on my local machine.

I have created the account and got my web tool user ID which I set to the Username while editing the USPS information.

But after getting the ID I did not mail to usps to switch to "production" server.

I am having doubt about this as I am trying USPS on my local machine.

So, I want to know weather it is necessary to mail to usps if I am using osCommerce on my local machine.

Please help me out.

 

Thanks,

Link to comment
Share on other sites

  • 2 years later...

oh boy, im having the same exact error as the first person on here. do we have any solutions or is this an unresolved osCommerce problem?

i contacted usps and set up a webtools account, had them switch me to a production server and they say its all fine and dandy on their end....

i need a solution fast...

Edited by wheatco1
Link to comment
Share on other sites

I have some code that will create a file of returned errors... but in the meantime, make sure you have your zip code in the SHIPPING ORIGIN on the Administration -> Shipping and Packaging page, and be sure that USPS has you on the production server. No tests are required for OS Commerce users.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

Around line 418 find and insert this code...

 

 

     $response = array();
     while (true) {
       if ($start = strpos($body, '<Package ID=')) {
         $body = substr($body, $start);
         $end = strpos($body, '</Package>');
         $response[] = substr($body, 0, $end+10);
         $my_response = substr($body, 0, $end+10); // DEBUG CODE
         //print_r("<br>response=$my_response"); // DEBUG CODE
// ******* error responses ************
$myFile = "/home/username/public_html/usps_errors.txt";   // change this path as appropriate and create the usps_errors.txt file
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $my_response;
fwrite($fh, $stringData);
fclose($fh);
// *********************************
         $body = substr($body, $end+9);
       } else {
// ******* error responses ************
$myFile = "/home/username/public_html/usps_errors.txt";   // change this path as appropriate and create the usps_error.txt file
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $body;
fwrite($fh, $stringData);
fclose($fh);
// *********************************
         break;

 

This will place the error, in plain text language in that file. You MUST create the file manually ahead of time and it must be writable by the server process, and, change the paths to match that of your server.

 

Edit: Do I really need to say what file this is in?

 

/%catalog_root%/includes/modules/shipping/usps.php

Edited by mdtaylorlrim

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

Hi all,

 

I am getting this message:An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner.

 

when I spoke to usps technical support, they told me that they change my account to the production server. However the same message still showing. What should I do in the admin area to correct the problem.What kind of set up I have to do?(I have online merchant v2.2 RC2)

 

Please Help...Thanks a lot

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...