.
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.
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
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
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)/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;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: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.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.
.
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.
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.
.
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.
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
.
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 - 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