I'm unable to run the Square cron job. I receive the following message when running from Plesk "Task ..../…./square_handler.php completed with error in 1 seconds."
No change in Personal AccessToken achieved. No error report in php (I changed square_handler.php to $verbose=true).
Using Zen Cart v1.5.5f; Square Module 0.94; php 7.1.19.
Any help appreciated.
Some instructions on setting up a plesk cron at http://tinyurl.com/y8eykjnu See if yours matches the info.
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
Since you've changed $verbose to true, what happens when you visit your_store.com/square_handler.php via your browser? It should tell you the status of the token.
I wonder if you have the wrong path. How is this "task" command different from the one you have for the currency cron?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thank you DrByte.
Status of the token shows not expired and it's logic since there have been transactions during the day. However the actual token in Square Dashboard (APPS) has not changed after the cron job.
I include screen of scheduled tasks. Currency Update has the same parameters except for the location of executable php.
Thank you again.
Yes, the actual token won't change unless Square issues an exchange for it, either because they've decided it's time to rotate it, or because it's expired. Since it hasn't expired (which doesn't happen unless unused for 30 days), it's unsurprising that there's no observable change.
It shouldn't be giving any error though. When there's nothing to renew, it exits with status code of 0, meaning no error.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Zen Cart v1.5.5f
Site was upgraded about a month ago from v1.5.4 to 1.5.5f
We had our ISP do the upgrade and they set up a test site so assume it was an official upgrade procedure.
We use plug-ins Cross-Sell (X-Sell), Image Handler, Flexible Footer Menu, Wishlist, Westminister theme.
Our problem is payment-related to the Square 0.94 plug-in. We also have Check/Money Order, PayPal Express Checkout enabled (green). Authorize.net (AIM) and COD options are yellow; all others in Payment Module are red.
PHP Version 5.6.37 ; mysqlnd 5.0.11-dev - 20120503 - $Id:
Everything was working as expected until we needed a new Access Token for our Square account about a month after the upgrade. We have updated these tokens in the past with no problems prior to the recent upgrade. We successfully replaced our Personal Access Token in our Square account (and received confirmation of that within Square), copied the new token into our Zen Cart Square payment module, and updated the module. However, we are still getting the following error via e-mail with every customer who tries to place an order paying via credit card:
Results Received back from Square: Array
(
[401] => [HTTP/1.1 401 Unauthorized] {"errors":[{"category":"AUTHENTICATION_ERROR","code":"ACCESS_TOKEN_REVOKED","detail":"Th e provided OAuth access token has been revoked."}]}
)
We have spoken with Square and they said the problem must be in the Zen Cart module because we are able to manually input orders successfully via the virtual terminal within our Square account. We have contacted our ISP about this and received this response:
"There has been no update to server recently. However, we have found that shopping cart does shift to HTTPS upon checkout, so that may be a factor.
"We have checked the six possible conditions listed under "Problems with OAuth Token Generation" at - https://www.zen-cart.com/content.php...Cart&styleid=3.
"None of these conditions are valid in this case.The files concerned have not been modified in months, and there is no .htredirect that is forcing redirects.
"As per the HTTP and HTTPS logs for holymtn.com for "square_handler.php", which Square accesses to complete transactions. In the past 2 weeks, there have been zero attempts to access this file from the outside. This suggests that either the plugin is misconfigured, or there is another error preventing Square from accessing the URL.
"At this point I think that Square should be contacted, as I have not found anything server-side that is generating errors."
We have replaced the access tokens three times but there has been no change in results.
We have read through the FAQs and searched for an answer in the forum area but without success. Can you please help? Here's our URL:
https://www.holymtn.com/catalog
Thank you in advance for any light you can shed on this.
Your store does NOT use your "Personal Access Token", so resetting that won't fix anything for your store.
The Oauth token referred to by the "ACCESS_TOKEN_REVOKED" message is NOT your "personal access token". it's a token that you can't see or set anywhere by hand. That token is generated by requesting it using the AppID/Secret from your account's OAuth settings after you enter those settings into your store.
The "ACCESS_TOKEN_REVOKED" message means that the token you've entered is no longer valid. More specifically, it's been forcefully deactivated/revoked on Square's end. (And I'm guessing that's probably because it's still referring to the old token that expired and then ran out past the grace-period for renewal.)
I'm sad that the Square rep didn't go further and make sure they were actually receiving requests for your AppID on their end. Their tech team could explain the token failure in more detail if they followed it through.
At this point I think there are 2 factors to consider:
1. Have you created more than one "app" in your Square account? You only need ONE.
Most merchants won't have more than one such "app", so this may be a non-issue. But if you have multiple, be sure you understand why you've done that, and be sure you're grabbing the AppID/Secret (and setting the OAuth Return URL) for the right one when configuring your ZC module in your store.
2. Let's do a reset:
a. in your ZC Admin, go to your Square module, and click Remove, and confirm it. This should also reset any old negotiated tokens so there should be no "revoked" response anymore.
b. Then click Install to re-add it. You will need to re-configure it from scratch again by entering your AppID and Secret from your Square "app". (explained in the "Configure the Square Module in your store Admin" of https://www.zen-cart.com/content.php...quare-Payments ) and clicking the green Access Token button so that it negotiates a new Oauth token for you.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks