Canada USPS Shipping


https://forum.kartris.com/Topic6989.aspx
Print Topic | Close Window

By SAbow - Wed 24 Jan 2018
I have several Kartris websites. At least two of them do not show USPS shipping estimates for addresses in Canada.I tried many other countries - they are all getting the shipping estimates fine.

Can you think of anything that I may be doing wrong? Otherwise it looks like it may be a bug in kartris...?
By SAbow - Tue 30 Jan 2018
I printed the xml to the error logs and found that it was receiving this error from USPS:

TheOrigin ZIP Code and the Destination Postal Code is required for Priority MailInternational when mailing to Canada.


After searching online, I found this documentation from USPS

https://www.usps.com/business/web-tools-apis/2015-may-webtools-release-notes.rtf

which says that

UnitedState origin ZIP Code will be required to obtain Priority Mail Internationalnon-Flat Rate pricing and availability for Canada destinations

By SAbow - Tue 30 Jan 2018
I changed the code in USPS.vb (in the dll)

from:


If LCase(objShippingDetails.RecipientsAddress.CountryIsoCode) <> "us" Then


url = "?API=IntlRateV2&XML=<IntlRateV2Request USERID=""{0}""><Package ID=""0""><Pounds>{1}</Pounds><Ounces>{2}</Ounces><Machinable>{3}</Machinable><MailType>{4}</MailType><ValueOfContents>{5}</ValueOfContents><Country>{7}</Country><Container>{6}</Container><Size>{8}</Size><Width>{9}</Width><Length>{10}</Length><Height>{11}</Height><Girth>{12}</Girth></Package></IntlRateV2Request>"


Else
url = "?API=RateV4&XML=<RateV4Request USERID=""{0}""><Revision/><Package ID=""0""><Service>{1}</Service><ZipOrigination>{2}</ZipOrigination><ZipDestination>{3}</ZipDestination><Pounds>{4}</Pounds><Ounces>{5}</Ounces><Container>{6}</Container><Size>{8}</Size><Width>{9}</Width><Length>{10}</Length><Height>{11}</Height><Girth>{12}</Girth><Machinable>{7}</Machinable><ReturnLocations></ReturnLocations><ReturnServiceInfo></ReturnServiceInfo><ShipDate>{13}</ShipDate></Package></RateV4Request>"
End If



to




If LCase(objShippingDetails.RecipientsAddress.CountryIsoCode) <> "us" Then

If LCase(objShippingDetails.RecipientsAddress.CountryIsoCode) = "ca" Then
url = "?API=IntlRateV2&XML=<IntlRateV2Request USERID=""{0}""><Revision>2</Revision><Package ID=""0""><Pounds>{1}</Pounds><Ounces>{2}</Ounces><Machinable>{3}</Machinable><MailType>{4}</MailType><ValueOfContents>{5}</ValueOfContents><Country>{7}</Country><Container>{6}</Container><Size>{8}</Size><Width>{9}</Width><Length>{10}</Length><Height>{11}</Height><Girth>{12}</Girth><OriginZip>11219</OriginZip></Package></IntlRateV2Request>"
Else
url = "?API=IntlRateV2&XML=<IntlRateV2Request USERID=""{0}""><Package ID=""0""><Pounds>{1}</Pounds><Ounces>{2}</Ounces><Machinable>{3}</Machinable><MailType>{4}</MailType><ValueOfContents>{5}</ValueOfContents><Country>{7}</Country><Container>{6}</Container><Size>{8}</Size><Width>{9}</Width><Length>{10}</Length><Height>{11}</Height><Girth>{12}</Girth></Package></IntlRateV2Request>"
End If

Else
url = "?API=RateV4&XML=<RateV4Request USERID=""{0}""><Revision/><Package ID=""0""><Service>{1}</Service><ZipOrigination>{2}</ZipOrigination><ZipDestination>{3}</ZipDestination><Pounds>{4}</Pounds><Ounces>{5}</Ounces><Container>{6}</Container><Size>{8}</Size><Width>{9}</Width><Length>{10}</Length><Height>{11}</Height><Girth>{12}</Girth><Machinable>{7}</Machinable><ReturnLocations></ReturnLocations><ReturnServiceInfo></ReturnServiceInfo><ShipDate>{13}</ShipDate></Package></RateV4Request>"
End If
By Tiggywiggler - Wed 28 Feb 2018
Hello sir,

Did this solve the problem you were experiencing? Are you still seeing issues?
By SAbow - Wed 28 Feb 2018
I resolved the issue by adding the code that i posted above. I was able to add it because you gave me the uncompiled code for the USPS dll - but I would suggest that you modify the dll since most people just use your compiled dll
By Paul - Fri 2 Mar 2018
Will update this for the next release, thanks.