kylewest / DotNetShipping

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

FYI - USPS API Changed Names (July 28th, 2013) #12

Closed jwar-gilson closed 10 years ago

jwar-gilson commented 10 years ago

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

jwar-gilson commented 10 years ago

The "REMOVE_FROM_RATE_NAME" in the DotNetShipping solution also changed and now has multiple variations from the USPS API.

Special characters (e.g. ™, ®) are returned in their HTML form.

OLD: private const string REMOVE_FROM_RATE_NAME = "& l t ; s u p & g t ; & a m p ; r e g ; & l t ; / s u p & g t ; "

NEW (Suggestions): PRIORITY MAIL ™ private const string REMOVE_FROM_RATE_NAME_PRIORITY = "& l t ; s u p & g t ; & # 8 4 8 2 ; & l t ; / s u p & g t ;"

FIRST CLASS MAIL ® private const string REMOVE_FROM_RATE_NAME_FIRSTCLASS = "& l t ; s u p & g t ; & # 1 7 4 ; & l t ; / s u p & g t ;"

OLD: string name = r.Name.Replace(REMOVE_FROM_RATE_NAME, string.Empty);

NEW (Suggestion): string name = String.Empty;

if (r.Name.Contains(REMOVE_FROM_RATE_NAME_PRIORITY)) name = r.Name.Replace(REMOVE_FROM_RATE_NAME_PRIORITY, string.Empty);

if (r.Name.Contains(REMOVE_FROM_RATE_NAME_FIRSTCLASS)) name = r.Name.Replace(REMOVE_FROM_RATE_NAME_FIRSTCLASS, string.Empty);

jwar-gilson commented 10 years ago

Sorry, I don't know how to put the REMOVE_FROM_RATE_NAME, REMOVE_FROM_RATE_NAME_PRIORITY or REMOVE_FROM_RATE_NAME_FIRSTCLASS assignments in "blocks"? So the assignments are without the spaces.

kylewest commented 10 years ago

Hey @jwahr, thanks for the report! I'm not entirely sure what you're referring to here. Can you put this into a pull request so I can merge it in? Thanks so much!

Kyle