gaffneyc / usps

USPS Webtools API for Ruby
MIT License
63 stars 54 forks source link

Update API certification servers and test values; always use secure endpoints #24

Closed bensheldon closed 3 years ago

bensheldon commented 3 years ago

I saw the gem is no longer maintained, but hopefully this helps someone move forward.

USPS has updated its servers. This has all APIs working except for Tracking, which seems like it no longer has a working test API: USPS_USER=XXXXX bundle exec rake certify

mfkp commented 3 years ago

Via an email I got from USPS, looks like they have a new testing API endpoint (stg-production.shippingapis.com). Instead of deleting the testing code from this PR, maybe could update the endpoint URI

Environment Unsecure HTTP Endpoint Retirement Date New Secure HTTPS Endpoint
TEST http://stg-production.shippingapis.com 06/24/2021 https://stg-production.shippingapis.com
PROD http://production.shippingapis.com 06/24/2021 https://production.shippingapis.com

Also, since USPS will be deprecating the non-secure (non-https) endpoints on June 24th, 2021, maybe it would be best to remove the secure config option and just make it the default.

Since this gem hasn't been updated since 2014, maybe we could make a separate fork and publish a new gem? I'm open to publishing it from my company account if you don't want to run/maintain it.

bensheldon commented 3 years ago

@mfkp I just received that email too :-) That's a great suggestion of removing the insecure server. I emailed @gaffneyc about becoming a maintainer.

bensheldon commented 3 years ago

I've updated to use the new secure server. I'm a little confused by the difference between the test environments that are domain-based (stg-production) and DLL-based (ShippingAPITest.dll). TrackV2 is a bit of a snowflake because it does not seem to work with the test DLL, but doesn't have the correct value when using the test domain.

I had to email webtool support in order to get access to the stg-production environment:

To: webtools@usps.gov
Subject: Authorization error accessing https://stg-production.shippingapis.com/ShippingAPI.dll

Hello,

I am receiving an authorization error when using my production username (XXXXXXXX) on the external test environment: https://stg-production.shippingapis.com/ShippingAPI.dll

USPS::Error: Authorization failure.  Perhaps username and/or password is incorrect.

I am seeing this when using:

Verify
CityStateLookup
DeliveryConfirmationV3
DelivConfirmCertifyV3
TrackV2
ZipCodeLookup

Thank you for your assistance!
Ben
rmccown commented 3 years ago

Yay

-=Bob

On Apr 24, 2021, at 12:50 PM, bensheldon @.***> wrote:

 Merged #24 into master.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.