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,732

Results 121 to 140 of 835
16 Apr 2018, 3:04 AM
#121
drbyte avatar

drbyte

Sensei

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

Square Payment Module for Zen Cart [Support Thread]

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

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:

> HttpsRequiredError: SqPaymentForm can only be embedded on sites that use HTTPS. See: <https://docs.connect.squareup.com/payments/sqpaymentform/sqpaymentform-overview#requirements-and-limitations>
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://
17 Apr 2018, 7:21 PM
#122
gamethrall avatar

gamethrall

New Zenner

Join Date:
Aug 2016
Posts:
20
Plugin Contributions:
0

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

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!

18 Apr 2018, 1:30 AM
#123
adpastor avatar

adpastor

New Zenner

Join Date:
Jan 2005
Posts:
9
Plugin Contributions:
0

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?

18 Apr 2018, 2:37 AM
#124
adpastor avatar

adpastor

New Zenner

Join Date:
Jan 2005
Posts:
9
Plugin Contributions:
0

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!

18 Apr 2018, 2:55 AM
#125
adpastor avatar

adpastor

New Zenner

Join Date:
Jan 2005
Posts:
9
Plugin Contributions:
0

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. https://www.kaylieskandles.com

Attachment 17804

18 Apr 2018, 10:29 AM
#126
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]

Here's one way to add an image:

In \includes\languages\english\modules\payment\YOUR_TEMPLATE\square.php you can edit

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

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.

18 Apr 2018, 4:58 PM
#127
gamethrall avatar

gamethrall

New Zenner

Join Date:
Aug 2016
Posts:
20
Plugin Contributions:
0

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?

19 Apr 2018, 2:55 PM
#128
drbyte avatar

drbyte

Sensei

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

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

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.

19 Apr 2018, 5:36 PM
#129
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

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?

19 Apr 2018, 5:43 PM
#130
drbyte avatar

drbyte

Sensei

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

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

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?

22 Apr 2018, 2:11 PM
#131
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

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

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.

22 Apr 2018, 9:12 PM
#132
gamethrall avatar

gamethrall

New Zenner

Join Date:
Aug 2016
Posts:
20
Plugin Contributions:
0

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

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.

25 Apr 2018, 5:59 PM
#133
blackburd2 avatar

blackburd2

New Zenner

Join Date:
Apr 2018
Location:
Texas
Posts:
3
Plugin Contributions:
0

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

25 Apr 2018, 6:19 PM
#134
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

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?48-what-are-the-server-requirements-to-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.

25 Apr 2018, 6:30 PM
#135
blackburd2 avatar

blackburd2

New Zenner

Join Date:
Apr 2018
Location:
Texas
Posts:
3
Plugin Contributions:
0

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.

25 Apr 2018, 7:16 PM
#136
blackburd2 avatar

blackburd2

New Zenner

Join Date:
Apr 2018
Location:
Texas
Posts:
3
Plugin Contributions:
0

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

PHP 7.2 was a bad idea, reverting to 7.1

28 Apr 2018, 11:42 PM
#137
billsey5 avatar

billsey5

New Zenner

Join Date:
Apr 2018
Location:
Oregon
Posts:
13
Plugin Contributions:
0

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?

28 Apr 2018, 11:56 PM
#138
billsey5 avatar

billsey5

New Zenner

Join Date:
Apr 2018
Location:
Oregon
Posts:
13
Plugin Contributions:
0

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.

2 May 2018, 4:35 PM
#139
billsey5 avatar

billsey5

New Zenner

Join Date:
Apr 2018
Location:
Oregon
Posts:
13
Plugin Contributions:
0

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

No one has any ideas? I'm kind of stuck...

2 May 2018, 10:28 PM
#140
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]

ERROR: module not loaded due to missing language file: C:/Web Files/localuser/CHCG/Shop/includes/languages/english/modules/payment/square_handler.phpCan 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.