You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
There seems to be a change or problem with the countries for USPS.
Client is trying to ship to Russia and USPS returns an "invalid country" error.
THIS IS NOT THE ONLY COUNTRY WITH AN ERROR.
This is the returned USPS error
<?xml version="1.0" encoding="UTF-8"?>
<IntlRateResponse><Package ID="0">
<Error>
<Number>-2147218046</Number>
<Source>IntlPostage;clsIntlPostage.GetCountryAndRestirctedServiceId;clsIntlPostage.CalcAllPostageDimensionsXML;IntlRate.ProcessRequest</Source>
<Description>Invalid Country Name</Description>
<HelpFile/><HelpContext>1000440</HelpContext>
</Error>
This is part of what was sent
<IntlRateRequest USERID="notDisclosedOnForum">
<Package ID="0"><Pounds>3</Pounds><Ounces>10</Ounces><MailType>Package</MailType>
<Country>Russian Federation</Country>
</Package></IntlRateRequest>
Can you list all the countries and codes for USPS so that we can check that the db is correct.
Offline
I found this: According to the Universal Postal Union, Russian Federation is the official Country name.
The USPS API does not always conform to the preferred address format of the postal service in the receiver's country. That's a USPS bug, not the application that interfaces with their api. What tech support gave you is a workaround for the USPS api.
Offline
Tech support gave me nothing. That was the XML return code from USPS when your database country name was wrong.
CCP DATA ARE WRONG - NOT USPS
This client has been loosing money because the default rates were used when the CCP db was wrong.
I finally tracked it down to errors in the country database.
USPS is not wrong - it is not a bug. They are the ones who define what countries they use for their api.
E.g., Look at what USPS uses for the UK countries.
Your database is wrong and should comply with what each carrier uses regardless of the official name of the country.
Is our official name "United States" or "United States of America" or "The United States of America"? What is in your db? The official name?
(The official name for the Andromeda solar system is Andromeda. What is the official name of our solar system?)
You should use the country what the carriers use OTHERWISE CCP USERS WILL GET ERRORS and the default rate will be used, not the Real-Time Rate.
Thus, your shipping logic needs to have the country names that each carrier uses - not what you want them to use otherwise CCP users will not be getting the Real-Time Rates all the time.
Offline
The proper name for the country Russia is Russian Federation. This is the name commonly used to identify that country across all platforms which use a name and not an abbreviation. If USPS uses some other name for Russia, I would recommend you add that as an entry in the countries table and delete the Russian Federation entry.
Most services use abbreviations (like US, GB, etc.) to identify countries because those abbreviations are standardized. Unfortunately USPS doesn't do that.
Offline
Then your software doesn't work.
Do you plan to fix it?
Offline
And, apparently you recognized the country issue because in usps.php you corrected for UK and Ireland.
How about the other countries? Russia is not the only one.
if ($dest_country == 'United Kingdom') {$dest_country = 'Great Britain and Northern Ireland';}
if ($dest_country == 'Ireland') {$dest_country = 'Great Britain and Northern Ireland';}
if (preg_match('/^UK \- /',$dest_country)) {$dest_country = 'Great Britain and Northern Ireland';}
Offline
You have yet to produce any documentation as to what country name should be passed to USPS for Russia. I have seen no such documentation on the USPS website or in this thread. If the country name in fact cannot be 'Russian Federation' you would modify usps.php adding:
if ($dest_country == 'Russian Federation') {$dest_country = 'Russian Federation USPS Name';}
That's what we would do with a software update, if and when anyone can tell us what USPS wants 'Russian Federation' passed as.
Offline
USPS does need "Russia" passed as the country name. I simply changed 'Russian Federation" to "Russia" in the country list and now it returns real-time rates for USPS.
I do remember this happening with one other country also and USPS not returning real-time rates. Unfortunately, I can't recall the country. I think I added the country to the countries list or did a name change again to get it working.
Offline
As stated in my initial post, "THIS IS NOT THE ONLY COUNTRY WITH AN ERROR."
How about providing a complete list for editing. I am certain we are not the only ones with this issue. Those seeing this may not know how to troubleshoot, especially when it is not every shipping rate for a method.
Offline