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

USPS shipping Method is not showing #2488

Open sarun007 opened 2 years ago

sarun007 commented 2 years ago

WooCommerce Shipping and Tax is failing at pulling the latest shipping rates from USPS. Due to this issue, USPS shipping option is not showing on the website.

10-19-2021 @ 01:44:45 - Error: Unexpected USPS Response: <?xml version="1.0" encoding="UTF-8"?>

80040B1AAuthorization failure. You are not authorized to connect to this server.USPSCOM::DoAuth (calculate_shipping) 10-19-2021 @ 03:54:01 - Error: Unexpected USPS Response: 80040B1AAuthorization failure. You are not authorized to connect to this server.USPSCOM::DoAuth (calculate_shipping) 10-19-2021 @ 03:55:47 - Error: Unexpected USPS Response: 80040B1AAuthorization failure. You are not authorized to connect to this server.USPSCOM::DoAuth (calculate_shipping) 10-19-2021 @ 03:55:47 - Error: Unexpected USPS Response: 80040B1AAuthorization failure. You are not authorized to connect to this server.USPSCOM::DoAuth (calculate_shipping) 10-19-2021 @ 03:57:02 - Error: Unexpected USPS Response: 80040B1AAuthorization failure. You are not authorized to connect to this server.USPSCOM::DoAuth (calculate_shipping Please fix the issue asap
dmchale commented 2 years ago

Can confirm, had this happen to us as well and have been debugging this for a client today. Not sure when precisely the issue started (they are a low-volume site doing zero to three orders per day) but their last successful order was four days ago on 10/15

It seems the 150WOOTH2143 account number that comes pre-filled with the extension is no longer allowed to make API calls

edit: just came back to say, we seem to be back in business after simply creating our own free API key, which no one ever even knew we needed to do since the plugin "just worked" out of the box. https://www.usps.com/business/web-tools-apis/welcome.htm

I can't find the original source of when this issue was introduced, but it seems like conversations started back in 2016 when they eventually decided to pre-fill an account number instead of making users get their own. Worked until it didn't :-/ A better methodology would be to force everyone to make their own key so they're responsible for their own access IMO, and then we're not all reliant on a single point of failure when the shared account stops working https://github.com/Automattic/woocommerce-services/issues/283

asuh commented 2 years ago

@dmchale is correct, wow. 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 also 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:

  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
asuh commented 2 years ago

@dmchale With your solution, are you only applying that solution to this plugin, WooCommerce Shipping & Tax? Or is your solution with the same one I referenced above?

With this plugin, I cannot find where 150WOOTH2143 exists in the Dashboard's WooCommerce section.

dmchale commented 2 years ago

@asuh sorry for the confusion - you're correct, I updated my settings in the USPS Shipping Method plugin. I grabbed the code for the WooCommerce Services plugin but didn't find any hits on that user account or even the .dll URI used by the API ... perhaps it's hidden behind something Automattic is doing as some type of SaaS with this plugin?

asuh commented 2 years ago

I previously asked the authors if they were using a private API for the USPS API fetches, and they confirmed it to be true.

With that said, after your customer successfully made an order, were you successful in buying postage for the order? That's where I believe this Shipping & Tax plugin would have to also fetch the USPS API for these prices, and it's possible they're using a similar or identical User ID with similar issues.