kylewest / DotNetShipping

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

UPS Rates Not being returned #61

Closed mathis1337 closed 7 years ago

mathis1337 commented 7 years ago

I have copied the code exactly from test page and I am not getting anything back. Is my UPS license number my account number, or access key? Mind you I have tried both. I am using Origin zip of 79403 and destination of 34769. Any help is appreciated it. here Is what I have.

NameValueCollection appSettings = ConfigurationManager.AppSettings;

string upsLicenseNumber = appSettings[""]; //removed for security reasons string upsUserId = appSettings[""]; //removed for security reasons string upsPassword = appSettings[""]; //removed for security reasons

var packages = new List(); //packages.Add(new Package(12, 12, 12, 35, 150)); packages.Add(new Package(6, 6, 6, 2, 149));

var origin = new DotNetShipping.Address("", "", "79403", "US"); var destination = new DotNetShipping.Address("", "", "34769", "US"); // US Address

var rateManager = new RateManager();

rateManager.AddProvider(new UPSProvider(upsLicenseNumber, upsUserId, upsPassword));

Shipment shipment = rateManager.GetRates(origin, destination, packages);

foreach (Rate rate in shipment.Rates) { Console.WriteLine(rate.ToString()); }

mathis1337 commented 7 years ago

Nevermind, figured it out, however, I don't see SurePost as an option. Is this not included in here?

kylewest commented 7 years ago

Is your code compiling? Should be var packages = new List<Package>();

kylewest commented 7 years ago

SmartPost is it's own provider ... and a FedEx thing.

https://github.com/kylewest/DotNetShipping/pull/51

mathis1337 commented 7 years ago

No I said SurePost. That is UPS not fedex feature.

kylewest commented 7 years ago

Never heard of it. I'm sure it can be implemented. Send me a pull request!