can you try now.
Does anyone know if this is compatible to Vs 2.1?
yes it is.
This month my Zen Cart Verson 2.1.0 came up with an issue that involves Square Up and the MxWorks Square Webpayment module 3.11. To make a credit card payment, the error message the buyer got was this: "Unable to process payment due to a communications error. You may try again or contact us for assistance." in a deep brownish red background after submitting the payment.
In the store logs was this message:
[09-May-2026 20:03:12 America/New_York] PHP Notice: Code: 401-> API request failed
Status code: 401
Body: {
"errors": [
{
"category": "AUTHENTICATION_ERROR",
"code": "UNAUTHORIZED",
"detail": "This request could not be authorized."
}
]
}
{} in /home/mystore/public_html/mystoredir/includes/modules/payment/square_webPay.php on line 535
>>>>This Is What Line 535 Says:<<<<
532 private function logSquareApiException(object $e, $body = ''): void
533 {
534 $message = 'Code: ' . $e->getCode() . '-> ' . $e->getMessage();
535 trigger_error($message . PHP_EOL . PHP_EOL . json_encode($e));
536 $this->logTransactionData([], $body, true, true, $message . print_r($e->getMessage(), true));
537 }
***************
I'm not sure if the the problem is the Square Webpayment module, or if it is with Square Up that is unsatisfied now with the Square Webpayment module??? I installed both Square Up tokens on the same day. My webhost had PHP 8.1 installed. So, I changed that to PHP 8.0, and that did not help either. Then again on another day, I reinstalled the Square Up tokens, and as before, that did not fix the problem either.
Any advice?
Also, I seen that my shopping cart has a new Version of Zen Cart 2.2.2. I checked the MxWorks website and see that he has Squarewebpay 3.1.2 which is a slightly corrected version of 3.1.1. Will that work with the newest version of ZenCart if I install it?
i can assure you as i stated here, the error message is pretty clear. you have a problem on your end. plenty of people are running 3.1.1 without problems.
your issue seems to be with your OAuth token. it is no longer valid. and you are now outside of the refresh token window.
i would go here:
admin -> payment module -> square webpay -> edit
once there, go up to your URL, and the add the following to your URL:
&sandbox=4
you will now see 3 new keys:
Live Merchant Token
Square Token TTL (read only)
Square Refresh Token (read only)
Delete all 3 of them.
then go back to the docs, and find out how to get a new OAuth token. the docs are here:
https://docs.zen-cart.com/user/payment/square/
you need to get the status light green again.
until you get a new OAuth token, no version of square webpay will work.
i would suggest creating a cronjob (which is listed somewhere in those docs) to automatically refresh your OAuth token.
best.
> i would suggest creating a cronjob (which is listed somewhere in those docs) to automatically refresh your OAuth token.
Here you go: https://docs.zen-cart.com/user/payme..._token_expiry/
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
This is fustrating! I don't work on the shopping cart very often, not an expert at all. But have been doing my own installing since 2012 of Zen Cart and Installing the Square payment module too. My biggest sales during the year have been for a cold weather calving item, and these last two warmer winters my sales are barley profitable. But just the same, I need this shopping cart working.
Where is the green light suppose to be located? Is that located in Square Up? Or is Google right, by telling me the green light is in the Square WebPay module, and I have not found it there either! I have Square Up module 2.1.1 by MxWorks, and never had a green light to push in this module. Also was working until over a week ago. On Square Up 2.1.1 module, I was told to push the Blue Edit button and put in the Application ID and Application Secret (oAuth) that Square provides me from their website. I have more then once the last few days. Then hit the Red Update button on the Square Webpay Module button found when Edit is opened. And that will update the module. I was told to do that a least a couple times a week. Also I did setup a cronjob in my website account for that module, maybe a couple years ago now too.
So why do I suddenly get the same error messages, for over a week now, everytime someone tries to make a payment? Like...
{
"category": "AUTHENTICATION_ERROR",
"code": "UNAUTHORIZED",
"detail": "This request could not be authorized."
}
]
}
{} in /home/mystore/public_html/mystoredir/includes/modules/payment/square_webPay.php on line 535
Maybe I should try reinstalling the file square_webPay.php, as that is where the problem seems to start???