close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

USPS International Shipping

Thread begun 12/10/2009 5:00 am by Dave Buchholz | Last modified 12/11/2009 4:48 pm by Jason Byrnes | 6438 views | 11 replies |

Dave BuchholzBeta Tester

USPS International Shipping

Using the standard wizard settings gives the following code block

$Shipping_Parameters["USPSServer"] = "http://Production.ShippingAPIs.com/ShippingAPI.dll";
$Shipping_Parameters["CarrierCode"] = "PRIORITY";
$Shipping_Parameters["DefaultIntl"] = "Airmail Parcel Post";
$Shipping_Parameters["ShipperZip"] = "10701";
$Shipping_Parameters["ShiptoZip"] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"") ."";
$Shipping_Parameters["ShiptoCountry"] = "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") ."";



but when testing with my own address shipping fails and returns the following

DomesticRatesV3;RateEngineV3.ProcessRequest - Please enter a valid ZIP Code for the recipient.
-2147219497
0
API=RateV3&XML=PRIORITY10701CV47 9QP50REGULAR
-2147219497DomesticRatesV3;RateEngineV3.ProcessRequestPlease enter a valid ZIP Code for the recipient. 1000440



What am I missing to get USPS to work with international addresses ?

Domestic US addresses seem to work just fine.

Sign in to reply to this post

Jason ByrnesWebAssist

The error is saying the Ship To Zip value is not valid.

When you get the error, what is the value of the $_POST["shipping_postcode"]?

Sign in to reply to this post

Dave BuchholzBeta Tester

<input type="hidden" name="shipping_postcode" id="shipping_postcode" value="CV47 9QP" />



This field contains the post value.

Sign in to reply to this post

Jason ByrnesWebAssist

Is this hidden form element code on the confirm page?

Usually with shipping rate lookup, it is triggered when the checkout page posts to the confirm page, then again when the confirm page posts to itself.

Are you getting the failure when the checkout page posts to the confirm page? What is the value of the shipping_postcode form element on the checkout page?

Sign in to reply to this post

Dave BuchholzBeta Tester

Hi Jason,

Yes the checkout posts to the confirm page and then it fails, the code in the USPS code block is like so:

$Shipping_Parameters["ShiptoZip"] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"")  ."";



and this is the same value as the hidden form field I posted earlier i.e. "CV47 9QP"

Sign in to reply to this post

Jason ByrnesWebAssist

What about the $_POST["shipping_country"]? For USPS Rate look up to use the international API, the $_POST["shipping_country"] cannot be set to US.

I just tested a rate lookup where I hardcoded the value for ship to country and ship to zip:

php:
$Shipping_Parameters["ShiptoZip"] = "CV47 9QP";

$Shipping_Parameters["ShiptoCountry"] = "UK";






and got a successful shipping rate back.

Sign in to reply to this post

Dave BuchholzBeta Tester

Jason,

thanks I am getting closer now the error message being returned is

-2147218046IntlPostage;clsIntlPostage.GetCountryInfo;clsIntlPostage.CalcAllPostage;IntlRate.ProcessRequestInvalid Country Name1000440

these are the post values

shipping_postcode	CV47 9QP
shipping_country UK
Sign in to reply to this post

Dave BuchholzBeta Tester

Having done a little more research interestingly a ShiptoCountry value of United Kingdom (Great Britain) returns a shipping value

But I cannot get a ShiptoCountry value of UK to return a value

Sign in to reply to this post

Jason ByrnesWebAssist

try GB instead of UK for the ship to country.

Sign in to reply to this post

Dave BuchholzBeta Tester

yep that returns a result as well

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...