Zen Follower
- Join Date:
- Apr 2012
- Location:
- Los Angeles, CA
- Posts:
- 185
- Plugin Contributions:
- 2
Views: 366,701
Zen Follower
Zen Follower
After the 1st failures I have tried again. I uploaded my back up copy of the store and started fresh at 1st I could install and make changes to the payment modules with no issues. After following the installation directions for Square Payment Module, I can no longer see any installation or make changes to the payment modules and the Square module is not listed as in the image in the previous post. I now have 4 new debug logs which I don't understand:
[07-Aug-2017 23:34:16 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:20 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:23 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:50 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
My assumption is I need to change a [ to a ) somewhere on line 34 in the square.php file but I don't want to mess anything else up, if that is not what it means. Please advise.
Sensei
@sammirah, what version of PHP are you using? I see from your screenshot you're using Zen Cart v1.5.5, which is great.
The Square module is designed for PHP 5.4 or newer, and Zen Cart v1.5.4 or newer.
The message you've quoted suggests that you're using an older version of PHP that doesn't recognize the square-bracket short-array syntax added in PHP 5.4 in 2012.
Perhaps you can ask your hosting company to switch you to PHP 5.6 instead?
Zen Follower
It says that I am using PHP version 5.6.30 but I think I make need to add it to the .htaccess file because the current one has AddHandler application/x-httpd-php53 .php listed when there was a problem with another plugin
Zen Follower
Yippe Ki Yay! That worked. I added a line AddHandler application/x-httpd-php56 .php to the .htaccess file in the store directory and it works just fine and I can see the square module. Thanks Dr. Byte:cool:
Totally Zenned
Nevermind, I got it fixed. I had to remove the module then re-installed it.
Totally Zenned
Just noticed this on one of our customers.```
PHP Fatal error: Square Payment Module token expired on 2017-07-21T02:46:56Z. Payment module has been disabled. Please login to Admin and re-authorize the module. in /home/********/public_html/includes/modules/payment/square.php on line 528
One is 1.5.4 with PHP 5.4 and the other is 1.5.5e with PHP 5.6.
Has Square set some time limit between orders, an annual reset date, ....? If so, can we set a heads up call/text/email?
Sensei
Quick fix: go back into the Admin, to the Square module settings, and get a new token manually.
The module is supposed to auto-renew if the token is more than 3 weeks old.
It tests for need for auto-renew on every transaction, and you can also set up a cron job to do it too.
But, I saw this same thing happen on another site ... so am investigating.
**Update: **3 sites. Grrr ... something's amuck, that "was" working before. Will post further once a resolution is found.
Sensei
dbltoe:
PHP Fatal error: Square Payment Module token expired on zzzzzzzzz. Payment module has been disabled. Please login to Admin and re-authorize the module.
There was a bug in the token-refresh code. The module has been updated. Install v0.90 to prevent the problem from happening again.
Download latest: [Square Payments for Zen Cart](https://www.zen-cart.com/downloads.php?do=file&id=156)
Totally Zenned
Quick fix got me the same result as my previous post without the gibberish.
But, just overwrote with the updated 0.90 files and am back up and working again.
THANX Doc:clap:
Totally Zenned
Got a square question?
I need to ether turn it off or feed it something when $_SESSION['free_virtual'] or freecharger is activated.
ZC1.5.5e
PHP7.1
One-Page Checkout v1.4.0
Square Payment v0.90
COWAA v1.0
and many modified
Free and Virtual checkout with COWAA is only using name and email address for a free download.. one-page template is modified so only name, email, payment and cart is displayed, all other is bypassed.
It works as expected with COD, COP, Money-order/check and PayPal standard active and shows as freecharger. If I turn Square on then the page errors and the button fails to submit.
Error from WebConsol is:
Error: SqPaymentForm element with id `square_cc-number` not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform paymentform:1:5997
[6]</n.prototype.buildIframeController https://js.squareup.com/v2/paymentform:1:5997
[6]</n.prototype.buildIframeControllers https://js.squareup.com/v2/paymentform:1:5839
[6]</n.prototype.build https://js.squareup.com/v2/paymentform:1:5640
[8]</n.prototype.build https://js.squareup.com/v2/paymentform:1:14150
bound self-hosted:913:17
setFormSubmitButton, payment-module: freecharger
Showing "confirm"
Setting orderConfirmed (0), submitter (null)
jQuery version: 3.2.1
I'm thinking now it has more to do when freecharger is active..
This is the error I get with a logged in user.
setFormSubmitButton, payment-module: freecharger index.php:210:13
Showing "confirm" index.php:210:13
Setting orderConfirmed (0), submitter (null) index.php:210:13
jQuery version: 3.2.1 index.php:210:13
Error: SqPaymentForm element with id `square_cc-number` not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform paymentform:1:5997
[6]</n.prototype.buildIframeController https://js.squareup.com/v2/paymentform:1:5997
[6]</n.prototype.buildIframeControllers https://js.squareup.com/v2/paymentform:1:5839
[6]</n.prototype.build https://js.squareup.com/v2/paymentform:1:5640
[8]</n.prototype.build https://js.squareup.com/v2/paymentform:1:14150
bound
The only thing I haven't tried is to drop jQuery back to 1.12!
with square turned off, not removed, this is what WebConsol has and submit works.
setFormSubmitButton, payment-module: freecharger index.php:210:13
Showing "confirm" index.php:210:13
Setting orderConfirmed (0), submitter (null) index.php:210:13
jQuery version: 3.2.1 index.php:210:13
No error logs show up ether. The more I play with this, the more its looking like something is going on when Freecharger is active and Square is on.
Sensei
Is it only an issue when COWAA is in play?
On my end, with Square and FreeCharger, checkout works fine, without COWAA or OPC.
So, I suspect something to do with the HTML changes (different elements on the page, perhaps some unclosed HTML tags, or improperly nested form elements) that you've done when customizing your site. I don't think it has anything to do with the Square module's code or javascript.
Totally Zenned
I assume the Square sign-up link on https://www.zen-cart.com/content.php?349-Square-Payments-for-Zen-Cart is an affiliate link. If it is do you happen to have one for the UK. That link gives no choice on the country that can be selected - only United States.
(If I go to their site without your token then I can choose my country).
Wanted to check so ZC can get the commission.
Sensei
simon1066:
I assume the Square sign-up link on https://www.zen-cart.com/content.php?349-Square-Payments-for-Zen-Cart is an affiliate link. If it is do you happen to have one for the UK. That link gives no choice on the country that can be selected - only United States.
(If I go to their site without your token then I can choose my country).
Wanted to check so ZC can get the commission.
Based on a signup I helped someone else with, I think if you "first" visit thru the referral link, it'll drop the necessary cookie, and if on the same page you just change the URL to remove the code so that it lets you choose your country, it'll still give the credit.
My UK contact with more specific instructions, is currently on holiday. Go ahead with the signup.
Totally Zenned
Tiny change to the readme instructions for Compatibility With Various Zen Cart PluginsFor One-Page Checkout to work, you must [B]copy[/B] the jscript_square.php file from /includes/modules/checkout_payment/ into the /includes/modules/pages/checkout_one folder.should be ```
For One-Page Checkout to work, you must [B]copy[/B] the jscript_square.php file from /includes/modules/pages/checkout_payment/ into the /includes/modules/pages/checkout_one folder.
Sensei
Thanks. Will include the correction in the next release.
Totally Zenned
DrByte:
Based on a signup I helped someone else with, I think if you "first" visit thru the referral link, it'll drop the necessary cookie, and if on the same page you just change the URL to remove the code so that it lets you choose your country, it'll still give the credit.
My UK contact with more specific instructions, is currently on holiday. Go ahead with the signup.
That's great, I'll try that.
New Zenner
I am newbie to ZC. I have Square Payments for Zen Cart - Version: 0.82 installed. Do I follow the directions for newer version as if it was the first time I installed it?
Sensei
Yes. Essentially just replace the files with the new ones.
Totally Zenned
A smooth step for me was to remove the payment method in the admin first. Seemed to hang without doing that.
Fields marked required must be completed.
Tell staff why this post should be reviewed.