kylewest / DotNetShipping

UPS, FedEx, USPS shipping rate calculators for .NET
MIT License
78 stars 66 forks source link

Canadian UPS Shipping #45

Open OpacityKelly opened 8 years ago

OpacityKelly commented 8 years ago

Hi guys! I can't seem to get Canadian addresses with postal codes to work. Please let me know if I'm missing something. Also, I need to get rates for Canada to US. US to US works great though. Any help would be great - Much appreciated!

            var packages = new List<Package>();
            foreach (var item in dovm.OrderItems.ToList())
                foreach (var box in item.Boxes)
                    packages.Add(new Package(box.Length, box.Width, box.Height, box.Weight, item.Price));

            var origin = new Address("", "", "V3S8E5", "CA");
            var destination = new Address("", "", "T8E2C7", "CA"); // US Address

            var rateManager = new RateManager();

            rateManager.AddProvider(new UPSProvider(upsLicenseNumber, upsUserId, upsPassword));
            Shipment shipment = rateManager.GetRates(origin, destination, packages);
kylewest commented 8 years ago

I just tried this in the same app with my account login and your addresses and it worked.

screen shot 2016-04-20 at 12 59 36 am

Kyle