Okay, since a 500 is being triggered, what's the PHP error recorded for it?
Printable View
PHP Fatal error: Uncaught Error: Class 'square' not found in /home/my_username/public_html/square_handler.php:19
thrown in /home/my_username/public_html/square_handler.php on line 19
Thanks FYI & Dr Byte for your replies. After trying a lot of things and hitting brick walls, while I'm not sure if I've resolved the issue...something has changed: I'm no longer getting any emails or error logs when the cron job runs.
I came across an internet reference to running cron jobs with a slightly different command - and that seemed to do the trick:
(with extra text in red compared to Zen Cart info)Quote:
/usr/local/bin/php /home/<myUserID>/public_html/square_handler.php
A Question: Is there any way to confirm that token has been refreshed (no indicator that I can find in ZC Admin/Square dashboard)? I've set our ISP cPanel to receive an email "every time it runs a command which produces output". So...if there's no email generated and no error log, does that mean I can safely assume the cron job has run - and that no email is normal?
BTW:
- to try and force some cron job output - I tried (1) adding an extra line to the square_handler.php to force some output
, (2) changing setting in Square Config to always send an email (not just logging/emailing on errors) - but neither worked;Quote:
echo "done";
- FYI dbltoe, prior to attempting the solution above, I confirmed that Perl Module for https was installed.
Thanks again
New topic: while trying to resolve the error log above, I came across this API alert on my Square Dashboard:
and then the changelog states:Quote:
There is a newer version of the Connect APIs available. Please consider upgrading.
Changing your API version may break your implementation. We recommend checking the changelog before upgrading.
Obviously a recent change. I haven't clicked the Change Version button yet. Since I may not have even fixed the cron job issue above, I thought I should check back with you experts first for your recommendation - and it may be relevant to other ZC Square users.Quote:
Square-Version: 2018-09-18
Adds a new Connect v2 API for inventory tracking, and updates the Customers API to support birthdays in customer profiles.
The extra path parameters you added (shown in red) are fine. There's no way for us to know "for sure" what directory PHP is installed in, so the instructions we provide are the most generic, and then if more specificity is required then your own hosting company knows your server best so they should be consulted for that. Setting up and supporting cron jobs is something best done in collaboration with your hosting company.
But adding the specific path to the php binary, as you've done, does control and force the specific version of PHP to be used ... which is generally better.
To get descriptive output for debugging, you can TEMPORARILY edit square_handler.php and change line 11, which says:
and change false to true.Code:$verbose = false;
NOTE that this may prevent normal transactions from operating properly until you put it back to false.
With $verbose=true, it will give output with one of:
not configured = module doesn't have an Application ID set
failure = token expired more than 15 days ago, or no token available to refresh
refreshed = the job refreshed the token
not refreshed = a refresh was attempted, but did not complete properly
not expired = a token exists but it is younger than 3 weeks old, so no need to refresh
Starting using Square and it seems as if its working, just one question. Is there anyway to fix this or edit the layout of it? Thanks
Attachment 18062
Thanks for quick reply. There's no issue when using Authorizenet-AIM. The template im using is a TemplateMonster template called 'Spare Parts Zen Cart'
This is how it looks with Authorizenet-AIM:
Attachment 18063