Posted: 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. |
|
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. |
|
This reply has been marked as private. | |
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: |
|
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. |
|
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? |
|
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? |
|
No, not for now, keep it as it helps when checking if the cron is set.
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.
OK, so we are starting fresh, but…
Yes, that’s good news, it means your key correctly connected and is valid for 30 days, but…
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:
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). |
|
Will do. Thanks! |
|
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 Hover over it and click run now. Then re-run that test code I gave you above, still 19? |
|
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? |
|
It should be instant. If you now go to Tools -> Log HTTP Requests. Do you see a request to 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: |
|
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 |
|
This reply has been marked as private. | |
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. |
|
This reply has been marked as private. | |
This reply has been marked as private. | |
Hmmm ok! Very strange. The request to reconnect doesn’t provide a I’ve asked for some feedback on this and will let you know what we find. |
|
Thanks! I look forward to learning the reason. |
|
Do you have any updates on this post that is now closed to new comments: https://eventespresso.com/topic/square-plugin-failed-again/ Is there a way you can keep support posts open to new comments until they’re resolved? I have had create several while this issue has been open. |
|
Hi there, I’ve reopened your thread and merged your latest reply into it, the forum automatically closes threads after a set amount of time but we can re-open them and merge new threads. I have a new version of the Square add-on available to test a fix for this, we’ve updated the payment method to use the latest Square API version, refactored the authorization workflow and added some additional logged to the connect server. I’ll include a link to download the latest version in a follow up reply to this. Download the .zip then install it through Dashboard -> Plugins -> Add new -> Upload plugin, select the zip. WordPress should tell you there is a version already installed and ask if you want to replace it, do so. Make sure the Log HTTPS Requests plugin is enabled after replacing the Square plugin, disconnect and reconnect. If you can then send me login details again I’ll review the logs again: |
|
This reply has been marked as private. | |
I have installed the plugin and disconnected and reconnected Square. |
|
This reply has been marked as private. | |
Any updates? |
|
This reply has been marked as private. | |
Any update? |
|
This reply has been marked as private. | |
Hi there, My apologies for the delayed reply, we are currently waiting on a response from Square regarding this and I don’t have any extra info until they respond, but I realised it looks like I’m just ignoring your thread. The issue currently is that the request to generate an The odd part, is that the requests are set up to work as the documentation states, it works for some and not others so it appears to be account specific (which also explains why we had such a hard time tracking this down, our accounts work!). So, we’ve opened up a case with Square and asked them to investigate this which is what we are currently waiting on.
Thank you for checking this, it does indeed help to confirm the issue. To prevent you running into issues after 16 days you can manually disconnect and reconnect at any time to ‘reset’ that limit back to 30 days, you don’t need to wait for it to expire. — Side note – today I tried logging back into the site to copy the request details again and confirm but it looks like the password has been changed, could you resubmit the details again? |
|
While the debug says we have 16 days left, we have this message in our dashboard, “Authorization health check failed with error: “Could not refresh the token” Please try to re-authorize (reConnect) for the Square payment method to function properly.” If that debug run was something we could rely on to tell us when the refresh token was to expire, it does not appear to be the case. We don’t have any failed transactions yet, but I will need to reconnect anyway. A few questions about the refresh/reauthorization: 1) Does an EE or EE Square plugin update require us to disconnect and reconnect Square? |
|
This reply has been marked as private. | |
Not usually no, updates do not require re-auth, they still us the same keys. However, a That’s not something you should need to do once we get this fixed.
No, two-factor authentication shouldn’t be a problem. You use that to log into the account and grant access.
No, it shouldn’t.
This is telling you the access_token could not be refreshed, when you connect the Square payment method will no try to refresh the access_token there less than 24 days remaining on the
We’ve made some changes to the payment method Square API version number and made a couple of changes server side to see if it helps so if you are about to reconnect I’ll upload the latest changes and add a link in private reply for you to try that and see if pulls in a refresh_token. |
|
This reply has been marked as private. | |
This reply has been marked as private. | |
I’ve uploaded the new plugin. FYI, the “Please try to re-authorize (reConnect) for the Square payment method to function properly.” is on the dashboard all of the time even though I’ve reconnected last week and even though transactions continue to process correctly. |
|
The above message sitting on the admin page means the Square payment method couldn’t refresh the oauth token (yours can’t as it has no refresh_token). It’s intended as a ‘nag’ notice to show there is an issue with Square which needs to be fixed before the Auth token expires. Just noting, we are still waiting on a response from Square to move forward with this. |
|
The support post ‘Square Plugin Failed Again’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.