USPS quote for international orders: undefined: Missing value for Country.
agilpwc - October 20, 2009 - 12:56
| Project: | Ubercart |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
After upgrading to RC7, all internaitonal shipping quotes for USPS get the following error: undefined: Missing value for Country.

#1
seems like there is new function function uc_usps_country_map
and only the countries defined in there will give quote. I added in some countries and now it works fine for those countries.
#2
Just ran into this problem myself.
Here's a patch to add all the countries that I could find in uc_store/countries
Notes:
- Monaco is independent (not part of France)
- Serbia and Montenegro are now both independent.
- I dropped some of the country names in parenthesis (Isle of Man, Republic of Korea) using the format of countries within uc_store/countries.
- Following the format of uc_store/countries I used 'United Kingdom' instead of 'Great Britain and Northern Ireland' and 'Georgia' instead of 'Georgia, Republic of'
#3
because .patch files taste better.
#4
And a patch including all the countries in uc_store/countries is even tastier. (was missing Canada and US)
#5
#6
The whole point of this function is to change the country name from the way it's stored in {uc_countries} to a format that USPS will recognize. I didn't include the ones that we don't yet have a country import file for, nor did I include the ones that don't need to be changed. I saw no reason to add a bunch of code that didn't even do anything.
Unfortunately, I somehow forgot to include the part that returns the identical country name. This patch adds it in so that it will work for any installed country.
#7
Well that's much simpler.
patch in #6 works for me.
#8
Thanks. Committed.
#9
I have uploaded the patches outlined in this forum and the countries are all configured correctly. But I am still not getting a shipping quote from USPS. When I put in the zip code for the US I get a quote. When I put in a postal code for Canada I do not get a shipping quote. My customers are world wide and now I cannot sell anything because I cannot generate a shipping quote.
#10
Only the patch in comment #6 should be applied.
#11
Code for United Kingdom should be Great Britain? I changed United Kingdom to Great Britain and started getting quotes for USPS Intl- previously I was not. Got 'invalid country name' error.
#12
I also get invalid country name for United States when entering an APO FPO address.
#13
It seems to me that the USPS API expects APO/FPO addresses to be served by the domestic rate calculator since it's based off of the American-style ZIP codes. However, I can't find any that actually work, so I don't know what to do about it. The domestic rate calculator only uses the ZIP code, so that's the only thing that has to be valid when shipping withing the US.
#14
You're right. What was relayed to me by the client and USPS representative that visited was that its USPS Intl since packages go through customs- but its only shippable USPS Domestic. Sorry for the confusion.