Support

Home Forums Event Espresso Premium Square Plugin Failed Again

Square Plugin Failed Again

Posted: November 7, 2023 at 7:29 pm


mkreik

November 7, 2023 at 7:29 pm

The Square plugin failed to reauthorize again. This has been happening every month since we started using the plugin in February. Nine months of this issue without it being resolved. You can see all of my prior support tickets. Please fix it.

Also, why do you prevent comments on open tickets? It requires us to create a new support ticket while the previous ones remain open without comments.


mkreik

November 14, 2023 at 11:33 am

Do you have a status on this issue? In the last support post we were told it was a high priority, but it would be helpful to know where you are in the process of fixing the plugin.


Tony

  • Support Staff

November 14, 2023 at 4:38 pm

This reply has been marked as private.


mkreik

November 16, 2023 at 11:13 am

Thanks for this information. I uploaded and updated the plugin from the link and checked the cron events to see if the AHEEA_Square_oauth_health_check showed up, and it did with the recurrence set to twice daily. In previous support post, you requested that I test that, and it didn’t show up so that’s a good sign.

Regarding the debug run, the output I received is string(2) “21”. Is that good?

Previous support post:
https://eventespresso.com/topic/square-oauth-token-expires-regularly/


Tony

  • Support Staff

November 16, 2023 at 11:45 am

That’s great so far!

So now… the oAuth key should renew after the 6th day (they are valid for 30days)… so 21 means you over that.

The next time the cron runs that should reset and shot 30 again.

So either later or tomorrow, run that code again and see if the number updates to 30/29…. if it does… its working!

Side note… please don’t force the cron go run manually to check the above, that’s going to reset the days but you don’t know if that will happen automatically and will need to wait another 6 days to test again.


mkreik

November 16, 2023 at 12:59 pm

Sounds good. I’ll let you know what I find. As far as the cron jobs, I didn’t do anything manually. I just searched the term AHEEA_Square_oauth_health_check, to see if it was there because the last time we worked on this it wasn’t. Do you recommend deleting the WP-Cron plugin?


mkreik

November 16, 2023 at 1:14 pm

When I logged into the WP dashboard this morning I saw the re-authorization failure message. Since I updated the plugin and ran the tests you requested, I decided right now to disconnect and reconnect Square to start fresh with 30 days. After doing that I ran the code and received this output: string(2) “29”. I’m assuming that’s good news. And that on 12/15 around this time it should refresh for another 30 days. Is that correct? Should I run the debug code on 12/15 to see if it shows 30 days?


Tony

  • Support Staff

November 16, 2023 at 3:39 pm

Do you recommend deleting the WP-Cron plugin?

No, not for now, keep it as it helps when checking if the cron is set.

When I logged into the WP dashboard this morning I saw the re-authorization failure message.

That means the cron ran but couldn’t renew your key… the key is valid for 30 days so if it can’t renew it keeps the current key and displays a notice to give time to fix it.

Since I updated the plugin and ran the tests you requested, I decided right now to disconnect and reconnect Square to start fresh with 30 days.

OK, so we are starting fresh, but…

After doing that I ran the code and received this output: string(2) “29”. I’m assuming that’s good news.

Yes, that’s good news, it means your key correctly connected and is valid for 30 days, but…

And that on 12/15 around this time it should refresh for another 30 days. Is that correct?

No, Square recommends refreshing the key every 6 days and the reason for that is part of what I mentioned above. When you obtain a key, it’s valid for 30 days, if we wait until day say day 29/30 and it doesn’t refresh it doesn’t give you any time to fix it before payments stop working (similar situation you were getting into when the key wouldn’t renew).

So that means:

Should I run the debug code on 12/15 to see if it shows 30 days?

No, you should run that code again in 6/7 days and it should ‘reset’ to show 30/29 days again each time. If the key doesn’t renew on day 6 the notice is displayed in the admin, the square payment method should still work at that point but the key couldn’t renew and will stop working after the key expires at the end of the days.

Give it 6 days, run the code and let me know what it shows…. if at any point from now over the next say 7 days you get a notice about the key not renewing let me know. At that point we’ll need to add some code to the site and see the specific request/response to figure this out (hopefully once and for all).


mkreik

November 16, 2023 at 9:43 pm

Will do. Thanks!


mkreik

November 27, 2023 at 11:51 am

It’s been 11 days and I reran the code and got this: string(2) “19”
which would get me to Dec 16. I will run it again on Dec 4 to see what I get.


Tony

  • Support Staff

November 27, 2023 at 2:19 pm

It’s been 11 days and I reran the code and got this: string(2) “19”

The token should have already refreshed and that gives us 19 days to troubleshoot before you end up back in the same old situation.

This is why this has been so tricky to troubleshoot, that version is refreshing the access token fine for me on multiple different servers/sites.

Install this plugin: https://wordpress.org/plugins/log-http-requests/

Once that has been installed and activated… go to Settings -> Cron Events.

Find ‘AHEEA_Square_oauth_health_check’, is that set to run EED_OAuthHealthCheck::scheduledHealthCheck() within the action column?

Hover over it and click run now.

Then re-run that test code I gave you above, still 19?


mkreik

November 28, 2023 at 2:07 pm

In cron events, I clicked on Run Now under AHEEA_Square_oauth_health_check where the action is EED_OAuthHealthCheck::scheduledHealthCheck() and then re-ran the test code in the Debug Console and the output is 17. How long does it take for the Run Now to complete. Is it instantaneous? Or should I wait a few minutes and re-run the debug?


Tony

  • Support Staff

November 28, 2023 at 2:23 pm

How long does it take for the Run Now to complete. Is it instantaneous?

It should be instant.

If you now go to Tools -> Log HTTP Requests.

Do you see a request to https://connect.eventespresso.com/square_sandbox/refresh?

If so, what is the request/response for that?

Or if you prefer I take a look directly within the admin you can send temp login details over using this form:

https://eventespresso.com/send-login-details/


mkreik

November 28, 2023 at 2:29 pm

When I go to Tools> Log Http Requests, there isn’t a request for https://connect.eventespresso.com/square_sandbox/refresh

I only see URLS for ipecho.net, tnedi.me, ident.me, font.google.apis, and api.wordpress.org


mkreik

November 28, 2023 at 2:36 pm

This reply has been marked as private.


Tony

  • Support Staff

November 28, 2023 at 3:44 pm

Thank you, so you’re site is missing the refresh token so Square isn’t going to refresh.

Can you disconnect Square and Reconnect it please, I want to view the logs ona connect request to confirm a value for the refresh token is being received by Square when you connect.


mkreik

November 28, 2023 at 4:58 pm

This reply has been marked as private.


mkreik

November 28, 2023 at 5:14 pm

This reply has been marked as private.


Tony

  • Support Staff

November 28, 2023 at 6:00 pm

Hmmm ok! Very strange.

The request to reconnect doesn’t provide a refresh_token when you authorize.

I’ve asked for some feedback on this and will let you know what we find.


mkreik

November 28, 2023 at 9:50 pm

Thanks! I look forward to learning the reason.

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso