-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
That error occurred when the customer attempted a payment which was declined, exactly as the message says.
You said that an order came through later, so most likely the customer chose a different credit card to complete their purchase.
Ok. Weird looking email though. I'm still new at using the module, so let me understand. When a CC card is denied, then the customer cannot checkout. So he sees whatever notification this module throws in his screen saying his CC was denied whatever and to enter another CC and I get this weirdly configured email, correct?
Is this a normal email notification for this event or can/should the email look different?
-
Re: Square Payment Module for Zen Cart [Support Thread]
It's "normal" insomuch as you have the module's Logging settings set to "Email on Failures".
The case of a "declined card" is only one sort of "failure". More critical failures are actual errors which might be reported if something technically goes wrong.
And, yes, if the card is rejected, the customer gets taken back to the payment screen and is asked to use a different card.
Try it out: go through checkout and put in a fake card number like 4242424242424242 with any expiry date and any CVV code. You'll see exactly what the customer sees if their card is refused. It's good to experience that so you know what they face.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
It's "normal" insomuch as you have the module's Logging settings set to "Email on Failures".
The case of a "declined card" is only one sort of "failure". More critical failures are actual errors which might be reported if something technically goes wrong.
And, yes, if the card is rejected, the customer gets taken back to the payment screen and is asked to use a different card.
Try it out: go through checkout and put in a fake card number like 4242424242424242 with any expiry date and any CVV code. You'll see exactly what the customer sees if their card is refused. It's good to experience that so you know what they face.
Thank you DrByte.
Actually the setting was on "Log Always and Email on Failures". Email on Failures doesn't seem to send anything when I test with a fake CC. I'm guessing that email is sent if the CC actually gets denied instead of by entering the wrong CC number(?).
Thank you for the help.
-
Re: Square Payment Module for Zen Cart [Support Thread]
ZC v1.5.5e
Square v0.90
On a low traffic site I have set up a cron job to run every few days so to refresh the Square access token. A recent purchase failed to complete as the token had expired, it must have been more than 45 days between orders. Looking further into the cron which is
Code:
php /home/mywebsite/public_html/square_handler.php
I get 'No output generated' if I run the cron from within my hosting control panel (I should have done that when I first set it up). I've checked file permissions - 644 (read for all and write for owner) and owner/group (I'm running the cron as root), there's nothing in the cron logs. Not sure where else to look.
Edit,
Thinking about it a bit more, the problem may lie with the way my host runs php cron jobs, I use Virtualmin on a VPS, I'll look into it.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Once you have v0.90 installed (all the files updated), after your token expires you need to re-activate it once, using the normal process of:
Go to the Square module in your Admin->Modules->Payment, click on Square. There you will see a button to authorize a token. Click it: it will take you to the Square site to login there (if not already logged in to Square), and then redirect back to your site.
At this point, if you have v0.91 or newer installed, it will auto-refresh your store's admin page. otherwise you'll need to click Refresh (or F5) to reload the screen. You'll see that the button goes away. At this point your module is re-authorized, and things should work normally. Including the cron script.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I'm a little confused about the new inclusion of Square payment module in zc 1.5.5F. In comparing the Square files from a clean copy of ZC 1.5.5F with the module I installed recently for a client on 1.5.5E (I am in the process of upgrading him) I can't tell which version is most current. For example in the file: includes/modules/payment/square.php I see these differences in the header info:
v155E - @version $Id: Author: Chris Brown <[email protected]> New in v1.5.6 $
v155F - @version $Id: Author: Chris Brown <[email protected]> New in v1.5.5f $
This would make it seem like the current version installed on the 155E shop is more current the version included with build 155F
But then there is also this:
v155E - Integrated using SquareConnect PHP SDK v2.5.1
v155F - Integrated using SquareConnect PHP SDK v2.2.1
These lines seem to indicate that the square module included in v155F is newer than the stand alone module I added to my client's shop a few months ago.
Can someone in the know clarify which version is newest and preferred to use?
Thanks!
-
Re: Square Payment Module for Zen Cart [Support Thread]
Just to clarify my question above, I'm trying to determine whether to leave the square module files as is in the client's shop or update them with the 155F upgrade.
Sorry if the above wasn't clear. :)
-
Re: Square Payment Module for Zen Cart [Support Thread]
I'm coming back to the issue of "Access token needed" disused before in this thread.
Using Zen Cart 1.5.4 - PHP 5.4.23
Tried reinstalling module, reissuing Application Secret and Personal Access Token, to no avail. "Access token needed" doesn't go away.
I can see that "Token set. You may now continue configuring the module" message appears when trying to authorize the account, but nothing happens after.
One detail is that if I edit the module there is no Location Id (appears blank).
What am I doing wrong?
Thank you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
@earmsby: use the latest version of the Square module, at https://www.zen-cart.com/downloads.php?do=file&id=156
-
Re: Square Payment Module for Zen Cart [Support Thread]
@RobRiv,
Which version of the Square module do you have installed? (It should say in the top of the right-hand-sidebar.)
If the "access token needed" won't go away, even after pressing Refresh in your browser, it suggests that Square isn't able to reach the square_handler.php file on your server in order to set the new access token. This can happen if there is no SSL (https) on your site. It can also happen if you've got URL-rewriting happening that's intercepting the incoming request.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you Dr.Byte for your replay.
Square Payments Module 0.90
I believe that Square is able to set the new access token (I can see that "Token set. You may now continue configuring the module" message is displayed) however I don't know if square_handler.php is changed.
Could it be because the site only is SSL secured at log-in/registration (not the full site)?
Thank you again.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
@RobRiv,
Which version of the Square module do you have installed? (It should say in the top of the right-hand-sidebar.)
If the "access token needed" won't go away, even after pressing Refresh in your browser, it suggests that Square isn't able to reach the square_handler.php file on your server in order to set the new access token. This can happen if there is no SSL (https) on your site. It can also happen if you've got URL-rewriting happening that's intercepting the incoming request.
@DrByte
Could it be because the site only is SSL secured at log-in/registration (not the full site)?
Thank you again.
-
Re: Square Payment Module for Zen Cart [Support Thread]
We've been using square for a few months now, and so far so good on the web end accepting card payments. On our square dashboard however all transactions appear as unknown, meaning no customer is created at all, no card is tied to the customer, etc, which presents a set of problems in trying to match the purchases with the clients, adding or swapping products to already placed orders and charging the corresponding credit card, etc. It was my understanding the client information was captured and stored in square's dashboard during the processing of the card, but it's not so.
Could you clarify how the capturing of the payment is done in terms of storing the customer's info directly on square dashboard?
Thank you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Trying to have this module working.
After following all instructions still "Access token needed" doesn't go away.
Looked at log and have the following message: "PHP Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"
No idea how to fix this. Anyone?
Thks.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
mvstudio
We've been using square for a few months now, and so far so good on the web end accepting card payments. On our square dashboard however all transactions appear as unknown, meaning no customer is created at all, no card is tied to the customer, etc, which presents a set of problems in trying to match the purchases with the clients, adding or swapping products to already placed orders and charging the corresponding credit card, etc. It was my understanding the client information was captured and stored in square's dashboard during the processing of the card, but it's not so.
Could you clarify how the capturing of the payment is done in terms of storing the customer's info directly on square dashboard?
At the present time, in v0.9 of the module, there is no creation of customers into your Square account.
I had thought that the transaction-id was available in both places though. Hmmm...
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
RobRiv
Looked at log and have the following message: "PHP Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"
Not sure why hundreds of others using Square aren't complaining of the same issue.
Most hosts who set the open_basedir parameter are doing it for security reasons, so I doubt your host will change that for you.
As an alternative you could alter the PHP code by adding // as shown here:
/includes/modules/payment/square.php, lines 521 and 625:
Code:
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
At the present time, in v0.9 of the module, there is no creation of customers into your Square account.
I had thought that the transaction-id was available in both places though. Hmmm...
Unless I'm missing something, no, the transaction ID is not in both places, nor I have found a way to search for it in our square dashboard. We can only refund the customer, but cannot adjust orders up if needed.
Would the creation of the customer in full with the CC number, and Apple Pay be included in future versions of the plugin?
Thank you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Not sure why hundreds of others using Square aren't complaining of the same issue.
Most hosts who set the open_basedir parameter are doing it for security reasons, so I doubt your host will change that for you.
As an alternative you could alter the PHP code by adding
// as shown here:
/includes/modules/payment/square.php, lines 521 and 625:
Code:
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
Thank you DrByte.
Made changes to square.php as indicated and curl_ error no longer appears. Still however, "Access token needed" doesn't go away.
I noticed that you commented lines 521 and 625; in my version of square.php lines are 540 and 602; may be there is something affecting there?
Version is latest from plugins (V.9).
Thanks again
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
RobRiv
Thank you DrByte.
Made changes to square.php as indicated and curl_ error no longer appears. Still however, "Access token needed" doesn't go away.
Hmmm
Quote:
Originally Posted by
RobRiv
I noticed that you commented lines 521 and 625; in my version of square.php lines are 540 and 602; may be there is something affecting there?
Version is latest from plugins (V.9).
I think I was quoting from v0.91 which is built-in to v1.5.5f
I don't have my tools with me to do a proper comparison at the moment, so I can't speak to whether any differences are significant in your case.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Zen Cart version: 1.5.5f
Plugin version: 0.91 and 0.90
Template used: Fidelity
Issue: unable to enter credit card information, there are no fields to type in
I looked at the FAQ, which says
Code:
If you find the input fields for credit card numbers are flat with no text box to type into, this typically means you're missing the jscript_square.php file as described earlier in the Installation Instructions.
Or you've got a firewall or browser plugin blocking access to Square's javascript code.
Or you've got a plugin having jQuery conflicts.
I am not missing the "jscript_square.php" file. It is in the correct location as per the PHP Files section of the Square Payments for Zen Cart page.
I ran it in an incognito tab (no browser plugins) and on my mobile phone with wireless turned off (no firewall).
I do not see any indication of jQuery conflicts.
I switched to the Responsive Classic template and the Classic Contemporary Green template and experienced the same issue.
Not realizing until the last post that 0.91 is included with 1.5.5f, I downloaded and uploaded the files for 0.90 and saw the same behavior.
I know a lot of other people have this installed and working without issue. What am I doing wrong? If you want to see it, the site is https://www.yaybeads.biz.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Gamethrall
Zen Cart version: 1.5.5f
Plugin version: 0.91 and 0.90
Template used: Fidelity
Issue: unable to enter credit card information, there are no fields to type in
I looked at the FAQ, which says
Code:
If you find the input fields for credit card numbers are flat with no text box to type into, this typically means you're missing the jscript_square.php file as described earlier in the Installation Instructions.
Or you've got a firewall or browser plugin blocking access to Square's javascript code.
Or you've got a plugin having jQuery conflicts.
I am not missing the "jscript_square.php" file. It is in the correct location as per the PHP Files section of the Square Payments for Zen Cart page.
I ran it in an incognito tab (no browser plugins) and on my mobile phone with wireless turned off (no firewall).
I do not see any indication of jQuery conflicts.
I switched to the Responsive Classic template and the Classic Contemporary Green template and experienced the same issue.
Not realizing until the last post that 0.91 is included with 1.5.5f, I downloaded and uploaded the files for 0.90 and saw the same behavior.
I know a lot of other people have this installed and working without issue. What am I doing wrong? If you want to see it, the site is
https://www.yaybeads.biz.
If you look in your browser's Console errors, you'll see:
You need to fix your HTTPS (SSL) on your site. It's currently redirecting away from https to just http URLs. Maybe just edit your configure.php and make both the HTTP_SERVER and HTTPS_SERVER urls begin with "https://...." instead of both being http://
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
If you look in your browser's Console errors, you'll see:
You need to fix your HTTPS (SSL) on your site. It's currently redirecting away from https to just http URLs. Maybe just edit your configure.php and make both the HTTP_SERVER and HTTPS_SERVER urls begin with "https://...." instead of both being http://
That was it! I changed both files and I can enter cc numbers!
Thanks again, DrByte!
-
Re: Square Payment Module for Zen Cart [Support Thread]
I'm a newbie and this is exactly what I'm coming up against. Where do I find the configure.php that you reference?
-
Re: Square Payment Module for Zen Cart [Support Thread]
I located and changed both configure.php files and that worked! Thanks Dr. Byte and Gamethrall!
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
I have now successfully configured Square as a payment option. However, there is no logo or text identifying that Square is the processor. I've attached a screenshot from Step 2 of 3 - Payment Information. www.kaylieskandles.com
Attachment 17804
-
Re: Square Payment Module for Zen Cart [Support Thread]
Here's one way to add an image:
In \includes\languages\english\modules\payment\YOUR_TEMPLATE\square.php you can edit
Code:
define('MODULE_PAYMENT_SQUARE_TEXT_CATALOG_TITLE', 'Credit Card'); // Payment option title as displayed to the customer
to a description of your choice.
If you want an icon there instead change it to
Code:
define('MODULE_PAYMENT_SQUARE_TEXT_CATALOG_TITLE', '<img class="spIcon" alt="credit card" title="Secure payments with Square SSL" src="images/AN_IMAGE.png" />'); // Payment option title as displayed to the customer
replace AN_IMAGE with a credit card image of your choosing, and you can position the image by adding the spIcon class to your stylesheet.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Zen Cart version: 1.5.5f
Plugin version: 0.91
Template used: Fidelity
When I try to go through the checkout process, on Step 2, Payment Information, I receive the following error:
"We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE"
I've been through the FAQ which suggests
"The module expects the checkout page to have a <form> element with a name='checkout_payment' in it."
I've checked the HTML and there is a form that has the name "checkout_payment."
It also suggets making sure that jscript_framework.php has been copied to /includes/templates/YOUR_TEMPLATE_FOLDER/jscript (yes, I've copied it to my template folder, not YOUR_TEMPLATE_FOLDER). I copied the file there myself.
It works well under the Responsive Classic Template, so obviously there's an issue in the Fidelity template.
Any suggestions?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Gamethrall
It works well under the Responsive Classic Template, so obviously there's an issue in the Fidelity template.
Whether it's a general problem with that template or just with whatever javascript the template uses and/or javascript you've added, if there are any javascript errors on the checkout pages, the Square code won't be able to do its task, and therefore it won't receive a NONCE, and therefore it can't complete a payment.
Fix your javascript errors/conflicts. See the browser's javascript console for details.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I'm seeing the following error in the logs after an attempt to use Square.
PHP Warning: Illegal string offset 'id' in /home/devsite/public_html/includes/modules/payment/square.php on line 142
The module code hasn't been edited in any way.
Site is a clean install of 1.5.5f
Server is running PHP Version: 5.6.35 (Zend: 2.6.0). It was on PHP 7.1.12, but I switched to an older PHP version to see if it cleared the issue. No change.
I checked the array key is wrapped in quotes, and it is.
$sql = "SELECT zone_id FROM " . TABLE_ZONES_TO_GEO_ZONES . " WHERE geo_zone_id = '" . (int)MODULE_PAYMENT_SQUARE_ZONE . "' AND zone_country_id = '" . (int)$order->billing['country']['id'] . "' ORDER BY zone_id";
Any suggestions?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
strelitzia
I'm seeing the following error in the logs after an attempt to use Square.
PHP Warning: Illegal string offset 'id' in /home/devsite/public_html/includes/modules/payment/square.php on line 142
The module code hasn't been edited in any way.
Site is a clean install of 1.5.5f
Server is running PHP Version: 5.6.35 (Zend: 2.6.0). It was on PHP 7.1.12, but I switched to an older PHP version to see if it cleared the issue. No change.
I checked the array key is wrapped in quotes, and it is.
$sql = "SELECT zone_id FROM " . TABLE_ZONES_TO_GEO_ZONES . " WHERE geo_zone_id = '" . (int)MODULE_PAYMENT_SQUARE_ZONE . "' AND zone_country_id = '" . (int)$order->billing['country']['id'] . "' ORDER BY zone_id";
Any suggestions?
That's essentially saying that $order->billing['country']['id'] doesn't exist, which suggests that $order->billing['country'] isn't defined as an array ... which suggests something's amuck with the address, which suggests that either the customer is connected to an invalid address (ie: a prior address_book entry that no longer has a corresponding country record), or your order class isn't populating the country data properly when passing it to the module. You didn't say whether this was triggered by a customer purchase or if it was from an Admin attempt to look up an order paid by Square.
Lots of moving parts.
It's only a Warning, so isn't causing a fatal/crash (blank page) situation.
Can you shed more light on the actual transaction and why the country data wouldn't be set properly when that Warning was generated?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
You didn't say whether this was triggered by a customer purchase or if it was from an Admin attempt to look up an order paid by Square.
This error is being logged when viewing an order in admin.
Address and country details all appear to be correct.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Whether it's a general problem with that template or just with whatever javascript the template uses and/or javascript you've added, if there are any javascript errors on the checkout pages, the Square code won't be able to do its task, and therefore it won't receive a NONCE, and therefore it can't complete a payment.
Fix your javascript errors/conflicts. See the browser's javascript console for details.
Thank you, DrByte. I haven't added any code myself. I'll see about finding someone to assist with the errors.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello and good day.
First time poster, new Zen-Cart user, 26 years of internet experience.
I have just installed Zen-Cart v1.5.4 on a clean domain with PHP 7.0, everything is baby powder fresh. I did install the sample items during set-up.
I renamed my /admin/ folder, deleted the install folder, and all recommended steps of making the config files read only.
Everything seems to be working as it should for Zen Cart.
I downloaded Square Payments for Zen Cart - Version: 0.90
I uploaded the specified files in the correct locations. I have confirmed this.
I now go to Zen Cart Admin, Modules->Payments menu, and there is no Square option or entry.
I'm stuck at this point.
If anyone could assist me with where my error was I would be grateful.
Sidenote: If you access this forum using a VPN there is an automatic permaban in place that locks your account and registered email, that was fairly annoying. Future correspondance may be from Blackburd3,4,5,etc depending on whether or not I remember to disable it temporarily.
-YIS
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Blackburd2
Hello and good day.
First time poster, new Zen-Cart user, 26 years of internet experience.
I have just installed Zen-Cart v1.5.4 on a clean domain with PHP 7.0, everything is baby powder fresh. I did install the sample items during set-up.
I renamed my /admin/ folder, deleted the install folder, and all recommended steps of making the config files read only.
Everything seems to be working as it should for Zen Cart.
I downloaded Square Payments for Zen Cart - Version: 0.90
I uploaded the specified files in the correct locations. I have confirmed this.
I now go to Zen Cart Admin, Modules->Payments menu, and there is no Square option or entry.
I'm stuck at this point.
If anyone could assist me with where my error was I would be grateful.
Sidenote: If you access this forum using a VPN there is an automatic permaban in place that locks your account and registered email, that was fairly annoying. Future correspondance may be from Blackburd3,4,5,etc depending on whether or not I remember to disable it temporarily.
-YIS
Good thing it's a brand new install, because it's already time to upgrade. Issue is/was ZC 1.5.4 with php 7.0 as can be seen in the server requirements section of this website from the main page (http://www.zen-cart.com/content.php?...o-run-zen-cart).
Basically, and for continued troubleshooting, you are probably experiencing a partial blank page for which there is a FAQ that would help identify where the issue is (http://www.zen-cart.com/content.php?124-blank-page). Specifically though one of the payment modules (no longer in ZC 1.5.5) is not php 7.x compatible.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Awesome. Thank you very much.
I guess I'll just start over and upgrade PHP to 7.2 while I am at it.
-
Re: Square Payment Module for Zen Cart [Support Thread]
PHP 7.2 was a bad idea, reverting to 7.1
-
Re: Square Payment Module for Zen Cart [Support Thread]
Zen-Cart 1.5.5e, PHP 5.4.44, MySQL 5.6.15, Square Payment Module 0.90.
I have the files placed correctly, with square_handler.php in the domain/shop folder and the rest in domain/shop/includes. Application ID and Application Secret are entered correctly from the SquareUp.com app I created. I am seeing the red (Access Token needed). When I click on the green Click here I get the prompt and I enter the login and password for Square which then closes the tab and returns me to my Zen-Cart admin tab. Where can I find a log of the error?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Aha, a clue perhaps... When I get sent back to Payment Modules I see:
ERROR: module not loaded due to missing language file: C:/Web Files/localuser/CHCG/Shop/includes/languages/english/modules/payment/square_handler.php
And that folder contains a file called square.php, not square_handler.php. Do I need to rename? The setting for the location for domain/shop/square_handler.php is correct on Square, so it doesn't make sense for it to be looking in the languages folders.
-
Re: Square Payment Module for Zen Cart [Support Thread]
No one has any ideas? I'm kind of stuck...
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
ERROR: module not loaded due to missing language file: C:/Web Files/localuser/CHCG/Shop/includes/languages/english/modules/payment/square_handler.php
Can you verify that this is what you are seeing?
The system should NOT be looking for that file in that location.
Square.php should be the correct file.
Square_handler.php should be in the root of your site.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello,
Thank you for this wonderful plugin. I have installed it and followed the instructions to the letter. I did a test purchase and it worked just fine with no errors given. The log folder was also error log free. What I have may not even be a real problem , but I just noticed something. When I login to my test buy customer account it shows 2 people logged in as a members. This can't be right since I am the only person logged in. Did i miss something during the install ? It shows up correctly in my payment options and works with the test sell.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I tried again a few minutes ago and didn't get that message again. I still just get returned without a request to authorize from Square. Where should I look for log files that might shed some light on this?
-
Re: Square Payment Module for Zen Cart [Support Thread]
OK, I found what looks to be a logfile tied to the error. I've tweaked it just to hide the admin directory name. Looks like something to do with checking a version number?
[03-May-2018 20:40:54 America/Los_Angeles] Request URI: /shop/...../modules.php?set=payment&module=square, IP address: 71.95.106.83
#1 trigger_error() called at [C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\Web Files\localuser\CHCG\Shop\includes\modules\payment\square.php:87]
#3 square->__construct() called at [C:\Web Files\localuser\CHCG\Shop\.....\modules.php:185]
[03-May-2018 20:40:54 America/Los_Angeles] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php on line 68
[03-May-2018 20:40:56 America/Los_Angeles] Request URI: /shop/...../modules.php?set=payment&module=square, IP address: 71.95.106.83
#1 file_get_contents() called at [C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php:70]
#2 plugin_version_check_for_updates() called at [C:\Web Files\localuser\CHCG\Shop\includes\modules\payment\square.php:87]
#3 square->__construct() called at [C:\Web Files\localuser\CHCG\Shop\.....\modules.php:185]
[03-May-2018 20:40:56 America/Los_Angeles] PHP Warning: file_get_contents(https://plugins.zen-cart.com/versioncheck/156): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
in C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php on line 70
[03-May-2018 20:40:56 America/Los_Angeles] Request URI: /shop/...../modules.php?set=payment&module=square, IP address: 71.95.106.83
#1 trigger_error() called at [C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php:72]
#2 plugin_version_check_for_updates() called at [C:\Web Files\localuser\CHCG\Shop\includes\modules\payment\square.php:87]
#3 square->__construct() called at [C:\Web Files\localuser\CHCG\Shop\.....\modules.php:185]
[03-May-2018 20:40:56 America/Los_Angeles] PHP Notice: file_get_contents() error checking plugin versions.
Trying http instead. in C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php on line 72
[03-May-2018 20:40:56 America/Los_Angeles] Request URI: /shop/...../modules.php?set=payment&module=square, IP address: 71.95.106.83
#1 file_get_contents() called at [C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php:73]
#2 plugin_version_check_for_updates() called at [C:\Web Files\localuser\CHCG\Shop\includes\modules\payment\square.php:87]
#3 square->__construct() called at [C:\Web Files\localuser\CHCG\Shop\.....\modules.php:185]
[03-May-2018 20:40:56 America/Los_Angeles] PHP Warning: file_get_contents(http://plugins.zen-cart.com/versioncheck/156): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
in C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php on line 73
[03-May-2018 20:40:56 America/Los_Angeles] Request URI: /shop/...../modules.php?set=payment&module=square, IP address: 71.95.106.83
#1 trigger_error() called at [C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php:76]
#2 plugin_version_check_for_updates() called at [C:\Web Files\localuser\CHCG\Shop\includes\modules\payment\square.php:87]
#3 square->__construct() called at [C:\Web Files\localuser\CHCG\Shop\.....\modules.php:185]
[03-May-2018 20:40:56 America/Los_Angeles] PHP Notice: file_get_contents() error checking plugin versions.
Aborting. in C:\Web Files\localuser\CHCG\Shop\includes\functions\plugin_support.php on line 76
-
Re: Square Payment Module for Zen Cart [Support Thread]
No other idea? Is there a different way to get Square support with Zen Cart? If not is there a suggestion for a replacement for Zen Cart that will work?
-
Re: Square Payment Module for Zen Cart [Support Thread]
This could be a problem...
Code:
60:SSL certificate problem: self signed certificate in certificate chain
Are you using a self signed certificate for your SSL?
Have you tried running your website thru https://www.ssllabs.com/ssltest/
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
billsey5
Aha, a clue perhaps... When I get sent back to Payment Modules I see:
ERROR: module not loaded due to missing language file: C:/Web Files/localuser/CHCG/Shop/includes/languages/english/modules/payment/square_handler.php
That would only appear if you put a file named square_handler.php into the /includes/modules/payment directory. The system looks for the module files, and their corresponding matching filename for language file. That error message means you've got a module file present without a matching language file.
And in this situation you should not have a "square_handler.php" file in the /includes/modules/payment directory. It belongs in the root directory of your shop.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
jasonshanks
Hello,
Thank you for this wonderful plugin. I have installed it and followed the instructions to the letter. I did a test purchase and it worked just fine with no errors given. The log folder was also error log free.
What I have may not even be a real problem , but I just noticed something. When I login to my test buy customer account it shows 2 people logged in as a members. This can't be right since I am the only person logged in. Did i miss something during the install ? It shows up correctly in my payment options and works with the test sell.
I'm guessing the whos-online tracker is still seeing that a separate session exists from a prior shopper. Or maybe it's reporting that you've got an admin session open? Usually inactive sessions get cleaned up automatically every 20 minutes.
But this has nothing to do with the Square module at all. The Square module doesn't change or add anything related to other visitor logins/sessions.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
billsey5
Zen-Cart 1.5.5e, PHP 5.4.44, MySQL 5.6.15, Square Payment Module 0.90.
Is it possible to upgrade to a more current version of PHP? PHP 5.4 is really old: its last update was Sept 2015.
Quote:
Originally Posted by
billsey5
I am seeing the red (Access Token needed). When I click on the green Click here I get the prompt and I enter the login and password for Square which then closes the tab and returns me to my Zen-Cart admin tab.
The normal flow is:
- Click green button
- it takes you to the Square site, asking for login if you're not already logged in. Presents an authorization prompt if not already authorized.
- returns you to your store admin
- If the "Access Token Needed" alert is still showing, press F5 to reload the admin page in your browser.
Quote:
Originally Posted by
billsey5
I tried again a few minutes ago and didn't get that message again. I still just get returned without a request to authorize from Square.
Is the directory you've been quoting (C:/Web Files/localuser/CHCG/Shop/) a local development PC? Or is it the live production server for your domain?
What browser/s are you doing this Admin / SquareLogin in?
Quote:
Originally Posted by
billsey5
Where should I look for log files that might shed some light on this?
Any logs generated by the module are stored with other error reports in the /logs/ folder as "myDebug-xxxxxxxx.log" filenames.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Let me try to cover everything, I have gotten closer though. The server is live, but not visible to the public yet. I'm using Firefox 59 and have tested with IE and Edge as well.
The cert is a Let's Encrypt cert. It seems like curl has problems with those even though no one else seems to. After using the test script for curl and putting a replacement cacert.pem file in the PHP environment, and upgrading the site to 5.6 the test script was able to run completely.
Once curl would work correctly the green button acted as it should and Square was active on the site.
I now find that I can add things to my cart, go through the checkout process until I get to the confirm my order where after I push the button it waits for a minute or two and then gives me a 500 - internal server error. A refresh of the page gives the warning about resending data the take me back to the payment information page with a "Unable to process payment due to a communications error. You may try again or contact us for assistance." notice.
Let me know where I can look for more info on fixing this.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
billsey5
After ... putting a replacement cacert.pem file in the PHP environment, and upgrading the site to 5.6 the test script was able to run completely.
Once curl would work correctly the green button acted as it should and Square was active on the site.
Excellent. Glad the curl issue is sorted. And the SSL.
Quote:
Originally Posted by
billsey5
... go through the checkout process until I get to the confirm my order where after I push the button it waits for a minute or two and then gives me a 500 - internal server error.
In web terms, a "500 Internal Server Error" is a general message that's generic publicly because being more specific could put your site at risk. The actual system details that caused the issue will be found in server logs. If the problem occurred at the Zen Cart level, then it will be logged in the /logs directory as myDebug-xxxxxx.log files. Will need to see those messages to understand better what's up.
-
Re: Square Payment Module for Zen Cart [Support Thread]
On a checkout page with multiple payment options I was looking into a way to tidy it up by hiding the Square Payments credit card info until that payment type was selected. Having tinkered around with some javascript and given the console error messages I get, am I right in assuming that Square requires the credit card fields to be visible i.e. not hidden by css?
Edit: just realised those were console warnings not errors, so that may not be the reason my edits are not working. However, being warnings I guess my question still stands.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Short answer: I don't know.
Longer answer: They probably don't enforce it one way or the other.
If toggling display "is not working" for you, then you're probably not targeting the right DOM object, or you need another one to nest things into.
With Square each of those inputs is its own frame, and you can't control the contents of that frame using CSS. But you can control a wrapper that contains them.
-
Re: Square Payment Module for Zen Cart [Support Thread]
OK, I seem to have it working smoothly now by putting the site on a different server running Linux instead of Windows. I'm trying to figure out how to issue a refund for an order or a portion of an order. The blurb says that when I'm viewing an order there should be a refund button and I'm not seeing it. Has anyone got a screen shot or a click by click walk through for me?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
billsey5
OK, I seem to have it working smoothly now by putting the site on a different server running Linux instead of Windows. I'm trying to figure out how to issue a refund for an order or a portion of an order. The blurb says that when I'm viewing an order there should be a refund button and I'm not seeing it. Has anyone got a screen shot or a click by click walk through for me?
billsey,
In order to issue an refund you must go through the Admin. Go to the customers order you should able click on a button to refund.
-
2 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
Yeah, I'm not seeing that entire middle section.
Attachment 17882
-
Re: Square Payment Module for Zen Cart [Support Thread]
It seems that the transaction id being returned from Square is longer than it was when we first started storing those responses in order for this admin refund feature to "find" the detail.
Version 0.94 and newer will detect and fix the storage for future transactions. Unfortunately not able to lookup prior transactions between when Square changed it and when v0.94 fixes it. (older transactions prior to the change should show up for refunds fine, if they're within the allowed # of days where refunds are permitted)
You can apply the fix yourself by going to Admin->Tools->Install SQL Patch
and pasting in the following:
Code:
ALTER TABLE square_payments MODIFY transaction_id varchar(255) NOT NULL;
This will allow future transactions to be remembered and the refund option should show again.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks, I've made the change (had to prefix the table name with zen_ to match my configuration) and will upgrade to 0.94 when possible. I'm still on 0.90 I think.
-
Re: Square Payment Module for Zen Cart [Support Thread]
In our experience, the worst that has happened from just dropping the new files over the old is that one user had to log in to Square to update. That customer was at 9.0 but I didn't notice if the "yellow light" was on before the drop (ftp).
There's more to this than the database table settings. While they may not currently effect performance, we prefer to keep shipping and payment as current and correct as possible.
-
Re: Square Payment Module for Zen Cart [Support Thread]
So pretty much just upload the new build over the old one and it does any database changes for you? That sounds easy enough. :)
-
Re: Square Payment Module for Zen Cart [Support Thread]
Remember, since you said you're upgrading from 0.90 to 0.94, there are a lot of files to replace, including the "vendor" directory. Don't skip those. :)
But, yes, replacing all the files is enough. It takes care of the db updates for you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello.
I'm excited for the possibility of Square working directly with Zencart. Is there a plugin or way for Square POS orders to be integrated with Zencart? We would like to centralize into one system for both online and in-person orders but current the Square orders are in their own area with no integration. If there is another way to think about this, we'd be happy to look at it. We traditionally used a custom mod for USB swipe CC payments with Firstdata/Linkpointbut this functionality will no longer be possible soon.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I began with square when you entered all items individually. I've got a few emails letting me know that, just because your latest suggestion showed up, we ain't paying you for it. Did some testing with DrByte and the Square Team on the current module
That's just to let you know that they do listen to the little guy. Over a dozen suggestions are now in the dashboard. One of the ones NOT there yet is the ability to automatically tie the databases together. That would be a definite plus to the store owner trying to keep online inventory current while (as one of our customers does) going around the country from rodeo to rodeo selling their wares.
I can also attest that the idea of tying thousands of databases into a central Square database is mind boggling. Perhaps it will be easier to have some addition to the configure files if using Square or a dropshipper. A database connection for product availability only in the configure.php is still daunting.
Still, we keep getting more and more with Square on a regular basis. Right now, they seem to be spending time figuring out a way to get more money through services. You can always put a bug in their ear either in their forum or the contact us in their website.
We'll keep our fingers crossed.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks, this is good to know. The inventory thing would be helpful, and basic order info would be better. I know in order to actually get Email address from Square, you have to enter it in customer data or they won't give you access to it. The temp solution may be to write a script to import orders/customer info from Square to ZC and run it manually.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Thanks for reporting back.
The Location ID is normally automatically set to the first available location. But if you're using multiple locations, or have somehow tricked the system into storing a wrong location value, then there will be errors during checkout. Choosing one from the dropdown will resolve that.
What if the drop down is blank?
-
Re: Square Payment Module for Zen Cart [Support Thread]
When the dropdown is blank it means ZC hasn't been able to retrieve a list of Locations from Square, which means you haven't Saved valid credentials and obtained a Token.
NOTE: It may be blank the "first" time you enter credentials and attempt to retrieve a token, but if you click Save and then get the Token, and then click Edit again it should show your defined Locations from your account.
Of course this assumes you've followed the setup instructions for creating the App inside your Square account, as that must be assigned to a Location, and if you don't have a Location set up in Square they'll make you set one first before you can get your Oauth credentials in the first place.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi people,
Trying to authorize new Square account on our Zen Cart Admin. I receive the following message "Missing client by that `client_id`" in new window after pressing the green button.
Any suggestion what I'm doing wrong?
Zen Cart v1.5.5f ; php 7.1.18
Thanks.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
RobRiv
Hi people,
Trying to authorize new Square account on our Zen Cart Admin. I receive the following message "Missing client by that `client_id`" in new window after pressing the green button.
Any suggestion what I'm doing wrong?
Zen Cart v1.5.5f ; php 7.1.18
Thanks.
The "client_id" it's referring to behind the scenes is the value you're supposed to enter into the module's configuration as "Application ID". You need to supply your Application ID and oAuth Application Secret before clicking the Green get-a-token button.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
The "client_id" it's referring to behind the scenes is the value you're supposed to enter into the module's configuration as "Application ID". You need to supply your Application ID and oAuth Application Secret before clicking the Green get-a-token button.
Thank you DrByte for your prompt response.
Both Application ID and OAuth are inserted in the module's configuration.
Possible issues: 1-account is Canadian Square account (however when pressing "Log in To Your Square Account" in Admin module it correctly opens the proper Square account.)
2-When creating the APP in Square I used Developer Portal (however in "My Apps" in Square it shows permission from account.)
Any help will be appreciated.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hmm, I haven't seen any problem when using a Canadian Square account.
- created the App in Square
- obtained the oAuth stuff, and told Square the URL to the store
- put the app credentials into Zen Cart, saved those settings
- click the green Token button
- login to Square
- return to store admin, refresh the page, green button goes away
- click Edit and choose the Location from the dropdown, click Save
- ready to take payments
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Hmm, I haven't seen any problem when using a Canadian Square account.
- created the App in Square
- obtained the oAuth stuff, and told Square the URL to the store
- put the app credentials into Zen Cart, saved those settings
- click the green Token button
- login to Square
- return to store admin, refresh the page, green button goes away
- click Edit and choose the Location from the dropdown, click Save
- ready to take payments
Thank you DrByte.
Found the problem looking at the reference link of the error message. The Application ID inserted in Zen Cart module repeated the few characters "sq0idp-" that were left from initial blank module.
Now working.
Thank you again.
-
Re: Square Payment Module for Zen Cart [Support Thread]
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Some instructions on setting up a plesk cron at http://tinyurl.com/y8eykjnu See if yours matches the info.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
Some instructions on setting up a plesk cron at http://tinyurl.com/y8eykjnu See if yours matches the info.
Thank you dbltoe.
I read your link and it's not applicable to me. I'm with A2 Hosting and other schedule tasks work fine. In particular I have the currency update cron job for Zen Cart working without problems.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
RobRiv
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.
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?
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
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?
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
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.
I changed the Schedule Task in Plesk from Run a Command to Fetch a URL and now no error.
Thank you DrByte
-
Re: Square Payment Module for Zen Cart [Support Thread]
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you so much, DrByte! That was it -- due to the e-mail error codes we received we were substituting our personal access token for the OAuth application secret and wondering why were weren't seeing the green button to authorize the app. Thank you for highlighting that difference for us. Once we reinstalled the app and tested it, everything is now working perfectly again. Much gratitude to you -- we really appreciate your quick answer, insight and direction!
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi. I was hoping someone could please help with an error re the cron job to automatically handle token refreshes.
Cron job installed via cPanel on server:
Quote:
php /home/my_username/public_html/square_handler.php
Error Log:
Quote:
[12-Sep-2018 12:05:02 Australia/Brisbane] PHP Fatal error: Uncaught Error: Class 'square' not found in /home/my_username/public_html/square_handler.php:19
Stack trace:
#0 {main}
thrown in /home/my_username/public_html/square_handler.php on line 19
Email returned:
Quote:
Status: 500 Internal Server Error
X-Powered-By: PHP/7.0.31
Access-Control-Allow-Origin: *
Set-Cookie: cookie_test=please_accept_for_session; expires=Fri, 12-Oct-2018 02:05:02 GMT; Max-Age=2592000; path=/; domain=recoveredheritage.com.au
Set-Cookie: zcrm_ac08606c3ae64282ac69e5945c47bda5=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=recoveredheritage.com.au
Content-Type: text/html; charset=utf-8
My situation:
Square v0.94 installed successfully and all looks OK in Admin
ZC1.5.5e (modified with plugins)
Website: recoveredheritage.com.au. Still under development (maintenance mode currently on but the error persists even when its off).
Line 19 of that file states
Quote:
$square = new square;
. I tried re-uploading all the SQUARE plugin files in case I missed one in the classes directory somehow - but error persists. As yet, I haven't been able to find a solution or the problem discussed in either the zencart or general community. Can anyone point me in the right direction to resolve this please?
Thanks.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Getting similar results on four sites, but sporadically. All four cron settings are exactly the same (Other than the username, of course)
None error every time the cron is run.
One only throws a debug file occasionally.
Two throw no debug files but email with different cron errors. Both are 500 errors with different coding.
One actually resets the mod to false.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Discovered that our 500 errors was that Perl Module for https was not installed on the server for some reason. One was a typo.
Still can't tell what caused the debug or whether the Perl fix will stop that from happening.
We will see after cron run.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Discovered that our 500 errors was that Perl Module for https was not installed on the server for some reason.
Thank you dbltoe. I appreciate your assistance.
I'm a real newie here so don't really know what I'm doing...but I tried to muddle my way through. But, my attempt was unsuccessful: same error log generated when cron job ran. Are you able to give more specific instructions?
Attempt details: My ISP server (inDesign) was showing no Perl modules installed. l looked at the available Perl modules and there's one called Business::OnlinePayment:HTTPS. Installed this. Now the installed Perl includes that one + Net::HTTPS::Any + Tie::IxHash.
Thanks
-
Re: Square Payment Module for Zen Cart [Support Thread]
@DrBytes which .php file generates the call for the text to appear when you start typing in your credit card number?
Example when start typing 42 I notice the page refresh and visa appears. Notice it’s lower case but their logo is VISA. I notice the same when typing in 52 which shows masterCard and I want it to show MasterCard. Also americanExpress & discover.
It’s just cosmetic if you have the time please.
I used the developers tool kit and could not find masterCard & also search in the database with no avail. Is the call embed in hex code?
With @lat9 help I received this answer.
On further inspection (aren't demo sites wonderful?), it appears that the text is being added by the Square payment method's jQuery (see /includes/modules/pages/checkout_one/jscript_square.php). The values displayed appear to be coming back from an AJAX call to Square.
Mark
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by GerriM
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
Line 19 is trying to execute the Square module code, but it's not been loaded into memory yet.
Line 18 does the loading by passing the name of the module whose files should be loaded. But they won't load if the files aren't found in the proper locations.
I suspect you've missed uploading some files for the module. Line 18 expects at least these 2 files:
/includes/modules/payment/square.php
/includes/languages/english/modules/payment/square.php
There are lots of other important files related to the Square module, but if these aren't present then line 18 will fail, which will cause line 19 to give the error you quoted.
-
Re: Square Payment Module for Zen Cart [Support Thread]
All sites getting this debug file has the files in the required places. The debug happens when the cron job runs in cpanel or when square_handler.php is run from the browser.
An example of the emailed code:
Code:
Status: 500 Internal Server ErrorAccess-Control-Allow-Origin: *
Set-Cookie: **************; domain=.*******.com; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=utf-8
This is after the Perl fix.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Could be that the cron job is running a different (older) version of PHP too.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Sites are running 5.6
Server 7.1
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
Getting similar results on four sites, but sporadically. All four cron settings are exactly the same (Other than the username, of course)
None error every time the cron is run.
One only throws a debug file occasionally.
Two throw no debug files but email with different cron errors. Both are 500 errors with different coding.
One actually resets the mod to false.
Quote:
Originally Posted by
dbltoe
All sites getting this debug file has the files in the required places. The debug happens when the cron job runs in cpanel or when square_handler.php is run from the browser.
An example of the emailed code:
Code:
Status: 500 Internal Server ErrorAccess-Control-Allow-Origin: *
Set-Cookie: **************; domain=.*******.com; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=utf-8
This is after the Perl fix.
Okay, since a 500 is being triggered, what's the PHP error recorded for it?
-
Re: Square Payment Module for Zen Cart [Support Thread]
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
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
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:
Quote:
/usr/local/bin/php /home/<myUserID>/public_html/square_handler.php
(with extra text in red compared to Zen Cart info)
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;
- FYI dbltoe, prior to attempting the solution above, I confirmed that Perl Module for https was installed.
Thanks again
-
Re: Square Payment Module for Zen Cart [Support Thread]
New topic: while trying to resolve the error log above, I came across this API alert on my Square Dashboard:
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.
and then the changelog states:
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.
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
GerriM
New topic: while trying to resolve the error log above, I came across this API alert on my Square Dashboard:
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.
and then the changelog states:
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.
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.
Not necessary at this time.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
GerriM
I came across an internet reference to running cron jobs with a slightly different command - and that seemed to do the trick:
Quote:
/usr/local/bin/php /home/<myUserID>/public_html/square_handler.php
(with extra text in red compared to Zen Cart info)
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.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
GerriM
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?
To get descriptive output for debugging, you can TEMPORARILY edit square_handler.php and change line 11, which says:
and change false to true.
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
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
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
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
JakeLawless
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
That seems like a CSS issue with your template. Do you get the same display issue if you enable Authorizenet-AIM module? Which template are you using?
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
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