Jump to content
Sign in to follow this  
CMoebius

USPS Module

Recommended Posts

I would like to use the USPS shipping module with my store, but I can't seem to get it working.

 

I have signed up for a WebTools account and received my username and password. In osCommerce Administration, I installed the USPS module, entered my username and password, and set it to the "test" server.

 

The problem is that when I test the checkout process, I get the following message:

 

An error occured with the USPS shipping calculations.

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

 

Am I doing something wrong or is there a problem with this working?

 

Any help is greatly appreciated!

 

Chris

Share this post


Link to post
Share on other sites

This is all over the forum.

In the directions that come with your webtools user name it says the test sever will only accept a certain query. You can email webtools and tell them you are using oscommerce and ask to be moved to production server.

Share this post


Link to post
Share on other sites

I am having the same problem. I installed a clean osCommerce, activated USPS Module. I received an id from USPS and have had them upgrade me to the production server. I am still receiving the same error message I have been.

 

I have made no modifications or edits to anything related to shipping.

 

Could it maybe be something different with their server?

Share this post


Link to post
Share on other sites

A short while ago, I requested to be moved to the production server. After I received the e-mail confirming that I was moved, I changed the setting in osCommerce and everything works fine.

 

Thanks for the assistance!

 

Chris

 

:D

Share this post


Link to post
Share on other sites

Ok, here is something I discovered. I had a test account I was using to test an order. I put in junk data. THe state and zip did not match. I fixed this and it now works A-OK.

 

It makes sense that a bad zip would give an error, guess the module/method should have some better control over displaying a better error...

Share this post


Link to post
Share on other sites

OK Well I am still having the problem. I am on the production server, and I talked to USPS and they said I'm accessing the server fine. The test address I'm using is perfectly valid, and I still get the error:

 

United States Postal Service

An error occured with the USPS shipping calculations.

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

 

PLEASE HELP

Share this post


Link to post
Share on other sites

you're not alone. I'm still utterly frustrated with it...I have no idea what to do to fix it. I've talked to USPS several times and posted here several times, but unfortunately no one can seem to help me get it resolved. I've had to set up table rates for all the zones in the US and i'm going to have to start doing it for international customers as well, but that is going to take a LOT of work to do (and I'll have to do it all over again if they change the rates!). I'd much prefer to get the USPS module working but i don't even know where to begin. If you get it working, let me know!

Share this post


Link to post
Share on other sites

The idea of adding all of the table rates for all the US zones and all the International zones is a daunting one! Let me see if I can be of assistance on this issue with my own experience.

 

After reading thru all of the technical documentation on the USPS website, reviewing the "usps.php" shipping module code, and performing manual tests, this is what I have discovered...

 

 

1) You must specifically sign up for the "USPS Web Tools"! If you have signed up for "USPS online services", you are working with the wrong USER ID / PASSWORD.

 

Here is the URL for the USPS Web Tools:http://www.uspswebtools.com/registration/

 

 

2) After completing the USPS Web Tools registration and agreeing to the "Terms and Conditions of Use", you will receive an e-mail from the USPS ICCC (Internet Customer Care Center). The e-mail you receive will include the USER ID / PASSWORD required for the USPS module.

 

NOTE: You should NEVER share your USPS Web Tools USER ID / PASSWORD with anyone!

 

 

3) Once the USER ID / PASSWORD is received, you can perform some limited testing against the "testing.shippingapis.com" USPS TEST Server. The valid test requests and the valid test responses can be found in documentation on the USPS web site... It is important to note that the USPS TEST Server is not meant to provide shipping information for any requests EXCEPT for the specific "VALID" requests that are outlined in their documentation.

 

Any attempt to use the USPS Test Server with test cases other than the ones expected will result in the "An error occured with the USPS shipping calculations" message.

 

NOTE: These tests are not intended for use by the typical user, but are actually intended for use by developers. Please see below for a test that you can perform from within your web browser.

 

Here is an example of one of the ACTUAL test requests that you can submit from your web browser:

 

Valid Test Request #1 (You must copy and paste the entire URL on one line)

------------------------------------------------------

http://testing.shippingapis.com/ShippingAP...<RateRequest USERID="<<<ENTER_YOUR_USERID_HERE>>>" PASSWORD="<<<ENTER_YOUR_PASSWORD_HERE>>>"><Package ID="0"><Service>EXPRESS</Service><ZipOrigination>20770</ZipOrigination><ZipDestination>20852</ZipDestination><Pounds>10</Pounds><Ounces>0</Ounces><Container>None</Container><Size>REGULAR</Size><Machinable></Machinable></Package></RateRequest>

 

Here is an example of one of the ACTUAL test responses that you can receive from your web browser:

 

Response to Valid Test Request #1 (You should receive the exact output as shown below)

------------------------------------------------------

<?xml version="1.0" ?>

<RateResponse>

<Package ID="0">

<Service>Express</Service>

<ZipOrigination>20770</ZipOrigination>

<ZipDestination>20852</ZipDestination>

<Pounds>10</Pounds>

<Ounces>0</Ounces>

<Container>None</Container>

<Size>REGULAR</Size>

<Zone>1</Zone>

<Postage>33.65</Postage>

</Package>

</RateResponse>

 

 

4) If the test of the XML to the "testing.shippingapis.com" USPS TEST Server returns the correct output, you can then request that the USPS ICCC (Internet Customer Care Center) switch your account to the USPS PRODUCTION server. You can either e-mail them or you can call them directly to have your account moved to the USPS PRODUCTION server. Please remember to reference your USER ID and the fact that you are using the osCommerce USPS shipping module.

 

NOTE: The use of the PRODUCTION server will allow for you to perform testing from osCommerce using the USPS shipping module.

 

 

5) When your account has been successfully moved to the USPS PRODUCTION server, you can begin testing of the USPS shipping module by adding an item to your cart, viewing your shopping cart, and then attempting to "check-out". The USPS shipping methods and shipping costs should be properly displayed!

 

 

If this helps out, please let me know.... =) Good luck!

 

~Muaddib~

Share this post


Link to post
Share on other sites

Muaddib,

I just found your post and I really want to thank you for your clear instructions also!

 

J.

Share this post


Link to post
Share on other sites

I had the same error: "An error occured with the USPS shipping calculations.

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

So I called the USPS webtools tech support, and they switched my account over to the production server about an hour ago, I'm still getting the same error. I have my USER ID and Password both correct with the USPS webtools account.

 

Does anybody know why I am still receiving the same error? And do I just need to wait a few hours?

 

I will post later if the problem solves itself.

 

Thanks!

Highway of Life


I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites
I had the same error: "An error occured with the USPS shipping calculations.

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

So I called the USPS webtools tech support, and they switched my account over to the production server about an hour ago, I'm still getting the same error. I have my USER ID and Password both correct with the USPS webtools account.

 

Does anybody know why I am still receiving the same error? And do I just need to wait a few hours?

 

I will post later if the problem solves itself.

 

Thanks!

Highway of Life

 

Make sure that your zip code is set correctly in the Admin section under Configuration > Shipping/Packaging > Postal Code. If that doesn't work, give the USPS around 24 hours and try again.

Share this post


Link to post
Share on other sites
Make sure that your zip code is set correctly in the Admin section under Configuration > Shipping/Packaging > Postal Code. If that doesn't work, give the USPS around 24 hours and try again.

Thanks Tim, I just checked, the zip code is set correctly.

 

I also tested with 3 different correct addresses.

 

Hopefully it will be solved in about a day or so.

 

Thanks,

Highway


I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites

An update: I uninstalled the old USPS mod, and installed this new one: http://www.oscommerce.com/community/contributions,487

 

But I am getting this error when I try to edit the information in the Admin:

Fatal error: Call to undefined function: tep_cfg_select_multioption() in .../public_html/catalog/admin/modules.php(212) : eval()'d code on line 1

If any of you know how to fix this, let me know. In the meantime, I am using FedEx for my customers.

 

Dave

Edited by Highway of Life

I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites

Ah! found the problem, I forgot to add the supplied code from the mod to admin/includes/modules.php and admin/includes/functions/general.php

 

Problems seems to be solved.

 

Dave

Edited by Highway of Life

I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites

MAKE SURE THAT IN IN ADMIN Configuration-Shipping/Packaging YOU HAVE THE POSTAL CODE SET TO YOUR ZIPCODE.

 

 

If not it will give you the error.

 

 

 

 

 

 

Sumfun

Share this post


Link to post
Share on other sites

Dave, can you tell me what the code is that you are speaking of?

 

Thanks!

Leslie

Share this post


Link to post
Share on other sites

In the instructions, I forgot to add the code for

admin/includes/modules.php

and

admin/includes/functions/general.php

 

For me help, go to: http://forums.oscommerce.com/index.php?showtopic=146950&st=0

 

Let me know if this helped you.

 

Are you getting the same error?

 

Billy: That was not the problem, my zip code was correct.

 

- David

Edited by Highway of Life

I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites

NOTICE TO ALL USERS HAVING PROBLEMS WITH THE USPS MODULE.

 

Once you have successfully completed all steps of registering and your Web Tools account has been granted access to the Production server, you must install the USPS module (easily done through administration) and check the radio button configuring the shipping module for ?PRODUCTION? mode. IT WILL NOT WORK IN TEST MODE

 

Hope this clears up all the issues. I had a hell of a time figuring this one out!

 

 

Share this post


Link to post
Share on other sites

I would like to add that once you have finished the installation of the USPS module contribution, you must call USPS Web Tools, and they will switch your account over to the Production server. The USPS module WILL NOT work on the Test server.

 

The official USPS module contribution support thread: http://forums.oscommerce.com/index.php?showtopic=146950&st=0

 

- David


I am a little pencil in the hand of a writing God who is sending a love letter to the world.

--Mother Teresa

Share this post


Link to post
Share on other sites

if you change includes/modules/shipping/usps.php to send one of the canned requests when test mode is chosen, then test mode works just fine.

 

this is mildly ugly, but works great:

 

switch (MODULE_SHIPPING_USPS_SERVER) {

case 'production': $usps_server = 'production.shippingapis.com';

$api_dll = 'shippingapi.dll';

break;

case 'test':

default: $usps_server = 'testing.shippingapis.com';

$api_dll = 'ShippingAPITest.dll';

$request = '<RateRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">';

$request .= '<Package ID="0"><Service>EXPRESS</Service><ZipOrigination>20770</ZipOrigination><ZipDestination>20852</ZipDestination\

><Pounds>10</Pounds><Ounces>0</Ounces><Container>None</Container><Size>REGULAR</Size><Machinable></Machinable></Package></RateRequest>';

$request = 'API=Rate&XML=' . urlencode($request);

break;

}

Share this post


Link to post
Share on other sites
An update: I uninstalled the old USPS mod, and installed this new one: http://www.oscommerce.com/community/contributions,487

 

Fatal error: Call to undefined function: tep_cfg_select_multioption() in .../public_html/catalog/admin/modules.php(212) : eval()'d code on line 1

 

But I am getting this error when I try to edit the information in the Admin:

If any of you know how to fix this, let me know. In the meantime, I am using FedEx for my customers.

 

Dave

i was getting the same error on line 1. i was using USPS Method 2.8b. i reverted to the original files, then installed v2.7, and it seems to work, i have not checked the rates or anything yet, but it is actually working!! w00t...

Edited by trustco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×