active_shipping icon indicating copy to clipboard operation
active_shipping copied to clipboard

USPS Address Standarization

Open pborel opened this issue 9 years ago • 4 comments

I don't see any way to standardize addresses in this library; however, USPS has this capability. Am I missing something or is there an opportunity for this feature to be added? If there is no address standardization feature, I'm happy to work on it.

pborel avatar Nov 09 '16 20:11 pborel

I don't believe it exists.

What did you have in mind? I'd love to review and merge it.

kmcphillips avatar Nov 09 '16 22:11 kmcphillips

Started on it. Will push an MVP before I check out for the night.

It looks like USPS will standardize addresses, but only in the U.S.

Send in an incomplete or misspelled address and it will return the full, correct address.

USPS docs on Address Standardization: https://www.usps.com/business/web-tools-apis/address-information-api.htm#_Toc410982981

pborel avatar Nov 09 '16 22:11 pborel

Turns out that this also does address validation for USPS

pborel avatar Nov 09 '16 22:11 pborel

@kmcphillips not sure if you've had a chance to view the PR yet.

I got a working MVP up. Still needs tests and probably some changes to the response formatting. Let me know if you have any ideas or if I made any glaring blunders. Haven't programmed anything in Rails in over a year so it's a little rusty ;)

pborel avatar Nov 10 '16 22:11 pborel