kylewest / DotNetShipping

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

USPS Expected Delivery Date #35

Closed MichaelQuint closed 8 years ago

MichaelQuint commented 8 years ago

Im getting some strange results with the USPS Expected Delivery Date, even tho the packages are more expensive the date stays the same. Also I havent found a way to remove certain service types by USPS, I currently do so like this:

shipment.Rates.Where(r => r.Name != "USPS Library Mail Parcel" && r.Name != "USPS Media Mail Parcel" && !r.Name.Contains("Hold For Pickup") ).OrderBy(s => s.TotalCharges).ToArray();

MichaelQuint commented 8 years ago

Never mind, I found the API documentation and added support to add a ShipDate to the request, this then returns a CommitmentDate to be used as the expected delivery date.

Documentation https://www.usps.com/business/web-tools-apis/rate-calculator-api.htm

kylewest commented 8 years ago

@MichaelQuint glad you got it figured out. this something I should consider adding to core? if so do you mind putting together a pull request? thanks,

kyle

MichaelQuint commented 8 years ago

Im not really sure how to do that, but here is my changes. very small.

USPSProvider.cs.txt

kylewest commented 8 years ago

merged this in. thanks @MichaelQuint !