Automattic / woocommerce-services

WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes automated tax rates and the ability to purchase and print USPS shipping labels.
GNU General Public License v2.0
107 stars 20 forks source link

Unable to retrieve USPS shipping rates. #2485

Open briancwelch opened 2 years ago

briancwelch commented 2 years ago

WooCommerce Shipping and Tax is failing at pulling the latest shipping rates from USPS.

<Error><Number>80040B1A</Number><Description>Authorization failure.  You are not authorized to connect to this server.</Description><Source>USPSCOM::DoAuth</Source></Error> (calculate_shipping)
10-13-2021 @ 12:08:21 - Error: Unexpected USPS Response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  You are not authorized to connect to this server.</Description><Source>USPSCOM::DoAuth</Source></Error> (calculate_shipping)
10-13-2021 @ 12:33:28 - Error: Unexpected USPS Response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  You are not authorized to connect to this server.</Description><Source>USPSCOM::DoAuth</Source></Error> (calculate_shipping)
10-13-2021 @ 12:33:28 - Error: Unexpected USPS Response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  You are not authorized to connect to this server.</Description><Source>USPSCOM::DoAuth</Source></Error> (calculate_shipping)
10-13-2021 @ 12:33:28 - Error: Unexpected USPS Response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  You are not authorized to connect to this server.</Description><Source>USPSCOM::DoAuth</Source></Error> (calculate_shipping)
turboedge commented 2 years ago

Same here. Recently installed WooCommerce 5.8.0. Related?

briancwelch commented 2 years ago

Same here. Recently installed WooCommerce 5.8.0. Related?

@turboedge I don't believe so personally. It looks like API auth is broken which would not be anything that is dependent on our sites, rather the plugin itself. We have been running 5.8 since release but this issue only just cropped up for us between 7:57 am PST and 10:14 am PST 10/13. The order at 8am was able to pull rates fine, but the order at 10am was unable to and nothing within our site configuration had changed. Suffice to say, I don't think that's the rabbit hole you're after. Hopefully the devs have an answer for us ASAP.

sisaacrussell commented 2 years ago

24 hours later and no resolution on a cart-breaking bug... :(

Response from support:

WP.comThu, Oct 14, 6:40 PM As a workaround: This is specifically related to our account (150WOOTH2143), which is pre-populated in the USPS plugin and used by nearly everyone. If you want to create your own USPS "Web Tools API" account and update that ID on the WooCommerce> Settings> Shipping> USPS page, you can get rates via the plugin. It only takes a moment to sign up and create the account by clicking the "Register Now" button on this page: https://www.usps.com/business/web-tools-apis/welcome.htm

That doesn't work for this plugin of course, only for the paid USPS Shipping Method plugin. Has anyone found a way to override the USPS API key for this plugin?

chuklz commented 2 years ago

Have the same issue. Support isn't supporting it, and forums aren't find much to assist either.

It was briefly back late last week with no intervention and then it went back down.

snjrose commented 2 years ago

Having this same issue. Is there no way to get support from Woocommerce Shipping and Tax plug in?

asuh commented 2 years ago

Sadly, this appears to be a problem with the USPS plugin that WooCommerce offers. This is bad.

I'm not quite sure what this USPS Shipping & Tax plugin is doing to fetch rates for buying postage, it's not clear in their code. However, the issues I'm having are related to another plugin that's used to fetch USPS shipping rates directly from the API.

USPS Shipping Method lists in their documentation that its default USPS User ID works. For whatever reason, 150WOOTH2143 is giving multiple people issues. It's possible the ID is now invalid.

Instructions for updating the USPS User ID on self-hosted WordPress sites (not hosted on wordpress.com):

  1. Go to the Web Tools API page
  2. Click Register, which sends you to the USPS Web Tools Registration page
  3. Add all relevant information on the page, which is attached below. It's okay if you don't exactly know what to put for some blanks, just do the best you can. USPS isn't pedantic.
  4. Check your email that you filled in below to get your custom USPS custom User ID. This is the ID you will use to replace the USPS Shipping Method plugin ID that says 150WOOTH2143. You'll find that page by going to the WordPress URL that ends like this: wp-admin/admin.php?page=wc-settings&tab=shipping&section=usps.
Screen Shot 2021-10-19 at 19 40 16
snjrose commented 2 years ago

I appreciate this so much, but I still can't access the USPS settings from my admin. My new USPS username is 214LEGEN7901 but when I go to https://www.legendaryletters.com/Wp-admin/admin.php?page=wc- settings&tab=shipping&section=usps it just redirects me to a sign in page over and over. Are you able to access it to put in my new username?

Stacy On Tue, Oct 19, 2021, 7:47 PM Micah @.***> wrote:

Sadly, this appears to be a problem with the USPS plugin that WooCommerce offers. This is bad.

USPS Shipping Method https://woocommerce.com/products/usps-shipping-method/ lists in their documentation that its default USPS User ID works https://docs.woocommerce.com/document/usps-shipping-method/#section-3. For whatever reason, 150WOOTH2143 is giving multiple people issues. It's possible the ID is now invalid.

Instructions for updating the USPS User ID:

  1. Go to the Web Tools API page https://www.usps.com/business/web-tools-apis/welcome.htm
  2. Click Register, which sends you to the USPS Web Tools Registration page https://registration.shippingapis.com/
  3. Add all relevant information on the page, which is attached below. It's okay if you don't exactly know what to put for some blanks, just do the best you can. USPS isn't pedantic.
  4. Check your email that you filled in below to get your custom USPS custom User ID. This is the ID you will use to replace the USPS Shipping Method plugin ID that says 150WOOTH2143. You'll find that page by going to the WordPress URL that ends like this: wp-admin/admin.php?page=wc-settings&tab=shipping&section=usps.

[image: Screen Shot 2021-10-19 at 19 40 16] https://user-images.githubusercontent.com/454064/138019313-797c70b5-88f7-466f-b63d-13c0e90dd4cb.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Automattic/woocommerce-services/issues/2485#issuecomment-947272108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWEDWRE536POKCUT4MRHVBTUHYUSLANCNFSM5F57NYJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

asuh commented 2 years ago

Hey Stacy, am I right that you are hosting your site on wordpress.com? I wrote the above instructions for self-hosted WordPress websites. LMK and I'll update the instructions to include wordpress.com hosted sites, I just need to know what your URL is to get to the USPS page in the Shipping section inside of WooCommerce.

snjrose commented 2 years ago

It's not on WordPress.com. It's self hosted on dreamhost. There is no USPS section under my shipping settings. When I read some solutions in the forums most people said they did have that, but I don't. I can't find anywhere I can enter the new username.

On Tue, Oct 19, 2021, 8:12 PM Micah @.***> wrote:

Hey Stacy, am I right that you are hosting your site on wordpress.com? I wrote the above instructions for self-hosted WordPress websites. LMK and I'll update the instructions to include wordpress.com hosted sites, I just need to know what your URL is to get to the USPS page in the Shipping section inside of WooCommerce.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Automattic/woocommerce-services/issues/2485#issuecomment-947283688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWEDWRCRNC7CTCEOO37MB2TUHYXQ5ANCNFSM5F57NYJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

asuh commented 2 years ago

Okay good to know. The plugin that I'm using which is having issues is named WooCommerce USPS Shipping (actually called USPS Shipping Method), which shows up like this in my plugins section:

Screen Shot 2021-10-19 at 20 17 50

if you're using this plugin, you'll see the following in WooCommerce > Shipping.

Screen Shot 2021-10-19 at 20 21 33

If you're not using this same plugin, you might be having a similar issue with another plugin.

snjrose commented 2 years ago

I am using the Woocommerce Shipping & Tax free plugin that uses Jetpack. It won't let me enter my own USPS user name. I just experienced the issue today, but some forum posts are almost a week old and they say it comes and goes. I am hoping it just starts working again.

On Tue, Oct 19, 2021, 8:22 PM Micah @.***> wrote:

Okay good to know. The plugin that I'm using which is having issues is named WooCommerce USPS Shipping https://woocommerce.com/products/usps-shipping-method/ (actually called USPS Shipping Method), which shows up like this in my plugins section: [image: Screen Shot 2021-10-19 at 20 17 50] https://user-images.githubusercontent.com/454064/138022627-1356e58d-7e80-4375-b319-06a9b9da5056.png

if you're using this plugin, you'll see the following in WooCommerce > Shipping. [image: Screen Shot 2021-10-19 at 20 21 33] https://user-images.githubusercontent.com/454064/138022956-a3160c6a-98ea-48e6-a197-cf3227535faa.png

If you're not using this same plugin, you might be having a similar issue with another plugin.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Automattic/woocommerce-services/issues/2485#issuecomment-947287515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWEDWRDK6QY65QVAT34LMV3UHYYWPANCNFSM5F57NYJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

asuh commented 2 years ago

@frosso @harriswong I don't know who we can reach out to, but is it possible the private API that this plugin is using also uses the flaky 150WOOTH2143 USPS User ID to fetch rates? Or something similar? This could very well be a USPS issue?

That said, I've posted a solution in this thread for fetching shipping rates on the front-end based up signing up for the USPS Web Tools API and using a custom User ID. I'm concerned that buying postage in the Orders section will have issues if the private API that this plugin is using is also having similar issues.

EDIT: USPS Shipping Method plugin does seem to additionally fix the ability to buy postage for an order, so no issues there. It's just too bad the recommendation is to buy a $79 plugin for those who aren't currently using it.

Hope someone on your side can shed some light into what's going on. Thanks guys!

frosso commented 2 years ago

Apologies for the delay everyone, but the account we were using for retrieving USPS rates has been deactivated by USPS without giving us notice. We are currently still waiting for approval on a brand new account.

In the meantime, if you're using the USPS live rates functionality, we recommend either using a fallback rate or temporarily switch to be using the USPS shipping method plugin with your own personal account.