Zen Cart Logo
Forums / Addon Payment Modules / Square Payment Module for Zen Cart [Support Thread]

Square Payment Module for Zen Cart [Support Thread]

Sticky

Views: 366,701

Results 21 to 40 of 835
8 Aug 2017, 1:59 AM
#21
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Square Payment Module for Zen Cart [Support Thread]

Nevermind! I had to extract to my desktop and upload the files before moving it to folder in which I usually save my templates. I managed to upload all of the files, and the module still is not showing up in the list.

Attachment 17207

8 Aug 2017, 4:05 AM
#22
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: Square Payment Module for Zen Cart [Support Thread]

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.

8 Aug 2017, 4:25 AM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

@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?

8 Aug 2017, 5:12 AM
#24
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: Square Payment Module for Zen Cart [Support Thread]

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

8 Aug 2017, 5:18 AM
#25
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: Square Payment Module for Zen Cart [Support Thread]

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:

10 Aug 2017, 6:25 PM
#26
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,675
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Nevermind, I got it fixed. I had to remove the module then re-installed it.

14 Aug 2017, 5:59 PM
#27
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

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?
14 Aug 2017, 6:25 PM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

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.

14 Aug 2017, 10:04 PM
#29
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

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)
15 Aug 2017, 5:16 AM
#30
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

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:

16 Aug 2017, 8:57 PM
#31
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Square Payment Module for Zen Cart [Support Thread]

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.

16 Aug 2017, 9:05 PM
#32
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

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.

17 Aug 2017, 4:50 PM
#33
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

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.

17 Aug 2017, 5:32 PM
#34
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

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.

17 Aug 2017, 8:25 PM
#35
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

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.

18 Aug 2017, 12:16 AM
#36
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

Thanks. Will include the correction in the next release.

18 Aug 2017, 6:33 AM
#37
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

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.

31 Aug 2017, 9:02 PM
#38
maxbodine avatar

maxbodine

New Zenner

Join Date:
Apr 2009
Posts:
60
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

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?

31 Aug 2017, 9:09 PM
#39
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

Yes. Essentially just replace the files with the new ones.

31 Aug 2017, 9:12 PM
#40
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

A smooth step for me was to remove the payment method in the admin first. Seemed to hang without doing that.