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

Results 341 to 360 of 835
26 Jan 2020, 3:31 AM
#341
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Square Payment Module for Zen Cart [Support Thread]

Does anyone know if zen cart passes the details of each sale (items purchased) and sales tax to square? Looking for order details when viewing the record, and looking for the ability to report on sales tax. Reporting on items purchased would also be awesome... I know there is amazing reporting using the square point of sale system, just not sure what gets passed when integrating it w/ zen cart. Thanks in advance!

27 Jan 2020, 5:09 PM
#342
drbyte avatar

drbyte

Sensei

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

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

BRDS:

I am unable to make this module work and am confronted with the SQ-NONCE-FAILURE error at every turn.

I am running zencart 1.5.6c on php 7.3

I have check and tried all the previous advise in this thread and the Square set up common problems, but still no luck. All files are in the right place, the module is installed and activated with a valid token and date. I also have no js errors... I have even removed my custom js code and just tried with plain jquery (deferred and not).

One thing I have noticed is that in the console the following error is logged...

0: Unable to get property 'SavePersonalAndPaymentData' of undefined or null reference - Autoformfill_ContentScript.js (1,20660)

I am getting a nonce code, I amended the code to log this in the console to ensure one is generated... and even unhid the input field that this is placed in to see it is actually placed in the input field before the submit confinues.... but it just refuses to work.

What else can I try, I have been at this all day, and going crazy :wacko:
I'm pretty sure your javascript error is interfering with the execution of the rest of the script. Whatever conflicts are introduced by other javascript on your site will need to be addressed before it will work properly for you.

27 Jan 2020, 5:14 PM
#343
drbyte avatar

drbyte

Sensei

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

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

cindygordon:

Does anyone know if zen cart passes the details of each sale (items purchased) and sales tax to square? Looking for order details when viewing the record, and looking for the ability to report on sales tax. Reporting on items purchased would also be awesome... I know there is amazing reporting using the square point of sale system, just not sure what gets passed when integrating it w/ zen cart. Thanks in advance!

Version 0.x of the Square module only transmits the payment portion of the transaction, not the actual line-item details (items, taxes, etc).

As a workaround, you can do that reporting in your store: The Sales Report plugin gives the ability to slice that data in significant detail.

27 Jan 2020, 5:22 PM
#344
drbyte avatar

drbyte

Sensei

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

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

dkerfoot:

Do I understand correctly that there is no address verification service (AVS) with Square?
Square does AVS with postal/zip code.

4 Feb 2020, 3:44 PM
#345
ianhg avatar

ianhg

Zen Follower

Join Date:
Jul 2007
Posts:
345
Plugin Contributions:
3

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

How do I resolve the following PHP Warning with Square?
[04-Feb-2020 13:26:21 UTC] Request URI: /index.php?main_page=checkout_process, IP address: 0000000
#1 square->before_process() called at [/var/www/vhosts/domain/httpdocs/includes/classes/payment.php:246]
#2 payment->before_process() called at [/var/www/vhosts/domain/httpdocs/includes/modules/checkout_process.php:92]
#3 require(/var/www/vhosts/domain/httpdocs/includes/modules/checkout_process.php) called at [/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_process/header_php.php:14]
#4 require(/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_process/header_php.php) called at [/var/www/vhosts/domain/httpdocs/index.php:36]
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/domain/httpdocs/includes/modules/payment/square.php on line 355.

4 Feb 2020, 3:57 PM
#346
drbyte avatar

drbyte

Sensei

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

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

ianhg:

How do I resolve the following PHP Warning with Square?
[04-Feb-2020 13:26:21 UTC] Request URI: /index.php?main_page=checkout_process, IP address: 0000000
#1 square->before_process() called at [/var/www/vhosts/domain/httpdocs/includes/classes/payment.php:246]
#2 payment->before_process() called at [/var/www/vhosts/domain/httpdocs/includes/modules/checkout_process.php:92]
#3 require(/var/www/vhosts/domain/httpdocs/includes/modules/checkout_process.php) called at [/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_process/header_php.php:14]
#4 require(/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_process/header_php.php) called at [/var/www/vhosts/domain/httpdocs/index.php:36]
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/domain/httpdocs/includes/modules/payment/square.php on line 355.

For this specific instance, you can change line 355 of the square.php module from

if (count($errors_object)) {

to

if (!empty($errors_object)) {
4 Feb 2020, 4:38 PM
#347
drbyte avatar

drbyte

Sensei

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

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

**BETA TESTING INVITATION
**
I've recently worked on an update to the Square module, aiming to call it v1.0, to integrate their 2020-01-22 SDK code, which reduces some of the complexity in the module, embraces some of Square's newer API code, and prepares the way to integrate even more of their capabilities in the future.

I've done a bunch of testing and it seems to work fine, but I'd like to get some feedback from people running live stores. Especially non-US stores (although US stores are needed too).

I've attached the zip of the v1.00-beta.
(beta zip removed, because v1.0 has now been released, and has includes several newer updates since the 1.00-beta was posted)

**Upgrade instructions: **

  • Delete the server's /includes/classes/vendors/square directory and the /includes/modules/payment/square_support directory (You will replace these in a moment, but this deletes older obsolete files first).
  • Then upload all the files from the files_to_upload directory, putting them into the same directory on the server as you find them in this zip.
4 Feb 2020, 5:47 PM
#348
ianhg avatar

ianhg

Zen Follower

Join Date:
Jul 2007
Posts:
345
Plugin Contributions:
3

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

DrByte:

For this specific instance, you can change line 355 of the square.php module from

if (count($errors_object)) {

> to
> ```
if (!empty($errors_object)) {

Thank you for a speedy response

5 Feb 2020, 3:50 PM
#349
dkerfoot avatar

dkerfoot

New Zenner

Join Date:
Mar 2007
Posts:
72
Plugin Contributions:
0

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

DrByte:

Square does AVS with postal/zip code.

Thanks, but I am confused. When I was using the FirstData/Linkpoint module, I would see the YYxM code results. I don't see any results at all with Square transactions. Does it do it in the background and simply reject the transaction if it isn't a perfect match?

Thanks,

5 Feb 2020, 4:02 PM
#350
drbyte avatar

drbyte

Sensei

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

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

dkerfoot:

When I was using the FirstData/Linkpoint module, I would see the YYxM code results. I don't see any results at all with Square transactions. Does it do it in the background and simply reject the transaction if it isn't a perfect match?
At this time the module doesn't report any AVS response details. But, more importantly, if the customer's bank chooses to reject the transaction (for any reason, including avs) then Square will tell your store that the payment was rejected. It's the cardholder's bank that does the determination of AVS adequacy, since they're the ones assuming the risk. Square (or any card processor) is just the middle-man.

5 Feb 2020, 9:45 PM
#351
brds avatar

brds

New Zenner

Join Date:
Jan 2020
Location:
UK
Posts:
2
Plugin Contributions:
0

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

DrByte:

BRDS:

I am unable to make this module work and am confronted with the SQ-NONCE-FAILURE error at every turn.

I am running zencart 1.5.6c on php 7.3

I have check and tried all the previous advise in this thread and the Square set up common problems, but still no luck. All files are in the right place, the module is installed and activated with a valid token and date. I also have no js errors... I have even removed my custom js code and just tried with plain jquery (deferred and not).

One thing I have noticed is that in the console the following error is logged...

0: Unable to get property 'SavePersonalAndPaymentData' of undefined or null reference - Autoformfill_ContentScript.js (1,20660)

I am getting a nonce code, I amended the code to log this in the console to ensure one is generated... and even unhid the input field that this is placed in to see it is actually placed in the input field before the submit confinues.... but it just refuses to work.

What else can I try, I have been at this all day, and going crazy :wacko:
I'm pretty sure your javascript error is interfering with the execution of the rest of the script. Whatever conflicts are introduced by other javascript on your site will need to be addressed before it will work properly for you.

The error that is logged is created by Square, there are no other js errors. I have even removed all js on the site and just left jquery, but still the same issue. I really do not think the js is the issue with this one.

5 Feb 2020, 10:38 PM
#352
drbyte avatar

drbyte

Sensei

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

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

BRDS:

DrByte:

BRDS:

I am unable to make this module work and am confronted with the SQ-NONCE-FAILURE error at every turn.

I am running zencart 1.5.6c on php 7.3

I have check and tried all the previous advise in this thread and the Square set up common problems, but still no luck. All files are in the right place, the module is installed and activated with a valid token and date. I also have no js errors... I have even removed my custom js code and just tried with plain jquery (deferred and not).

One thing I have noticed is that in the console the following error is logged...

0: Unable to get property 'SavePersonalAndPaymentData' of undefined or null reference - Autoformfill_ContentScript.js (1,20660)

I am getting a nonce code, I amended the code to log this in the console to ensure one is generated... and even unhid the input field that this is placed in to see it is actually placed in the input field before the submit confinues.... but it just refuses to work.

What else can I try, I have been at this all day, and going crazy :wacko:
I'm pretty sure your javascript error is interfering with the execution of the rest of the script. Whatever conflicts are introduced by other javascript on your site will need to be addressed before it will work properly for you.

The error that is logged is created by Square, there are no other js errors. I have even removed all js on the site and just left jquery, but still the same issue. I really do not think the js is the issue with this one.
After re-reading your first post and re-interpreting the messages you quoted, I agree: probably not js issue. Granted, the Square error is worth noting and perhaps investigating, perhaps via their Slack channel.

Let's take it a step further then:

  • the SQ-NONCE-FAILURE error appears when the nonce is not received by the payment module.
    (Since you indicate you understand code, you could try dumping out the value of the nonce field from inside the payment module, to see what/why it's invalid/missing).
  • therefore something else on your site is blocking it from passing through as normal POST data like it does on a properly functioning site

Therefore I must ask: in what ways is your store different from a fresh new install of Zen Cart? Therein will be the clues to the cause of your problem.
I don't mean just what plugins/addons. I mean any extra files that have been added (intentionally or unintentionally).

To ascertain those differences, I recommend taking a complete copy of the /includes/ directory from your server, and running a compare locally against a fresh clean copy of Zen Cart. This is to be certain that you don't have unexpected files on the server that you didn't know about, as they could be contributing to the problem too.
A great summary of similar comparison process is described in this article: https://www.zen-cart.com/wiki/index.php/Recovering_From_Hacks

Also, since we're looking for something possibly obscure in your case, checking all configuration_value entries in the configuration table might be worthwhile, to make sure no unexpected contents are found there.

7 Feb 2020, 11:19 PM
#353
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

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

DrByte:

**BETA TESTING INVITATION
**
I've recently worked on an update to the Square module, aiming to call it v1.0, to integrate their 2020-01-22 SDK code, which reduces some of the complexity in the module, embraces some of Square's newer API code, and prepares the way to integrate even more of their capabilities in the future.

I've done a bunch of testing and it seems to work fine, but I'd like to get some feedback from people running live stores. Especially non-US stores (although US stores are needed too).

I've attached the zip of the v1.00-beta.
[Attachment no longer available]

**Upgrade instructions: **

  • Delete the server's /includes/classes/vendors/square directory and the /includes/modules/payment/square_support directory (You will replace these in a moment, but this deletes older obsolete files first).
  • Then upload all the files from the files_to_upload directory, putting them into the same directory on the server as you find them in this zip.

Upgraded to one of my stores and I'm getting the "Please contact the store owner; some required elements of this page are missing."
Is there anything we should be upgrading in Square?

7 Feb 2020, 11:30 PM
#354
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

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

mvstudio:

Upgraded to one of my stores and I'm getting the "Please contact the store owner; some required elements of this page are missing."
Is there anything we should be upgrading in Square?

Never mind. Forgot to reinstall. All seems ok so far. I'll update as I get more info.

9 Feb 2020, 5:24 PM
#355
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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

Haven't installed square in a very long time but new client website now needing it. php 7.1, zc 1.5.5f, square version .97

New square account. The issue may be that I'm just missing something at square. I was able to retrieve everything to put in admin but it insists no access token. I did put in the Redirect URL at square but it states completely for everything that it is sandbox credentials. I see no way to reset if it's needed for a live site. If I click to authorize, it says "Client requires a Redirect URL to use OAuth"

What am I missing here?

10 Feb 2020, 3:01 AM
#356
nipinuk avatar

nipinuk

Zen Follower

Join Date:
Oct 2005
Location:
Hampshire, UK
Posts:
96
Plugin Contributions:
0

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

I've just installed Square to hopefully replace Paypal. Zen Cart v 1.5.5.e, php v5.6 using Westminster_New template from Picaflor Azul. Website is in the UK. Configuration was fine.
I tried adding something to my basket and clicked to checkout and noticed that the fields for the credit card information was 'greyed out' so I couldn't type it in.

Using Chrome Developer Tools, under Console, I noticed this error:

Uncaught ReferenceError: jQuery is https://www.qbis.co.uk/min/?f=/includes/templates/westminster_new/jscript/jscript_imagehover.js,/includes/templates/westminster_new/jscript/jscript_jquery.easing.1.3.js&1572439093:21
not defined at https://www.qbis.co.uk/min/?f=/includes/templates/westminster_new/jscript/jscript_imagehover.js,/includes/templates/westminster_new/jscript/jscript_jquery.easing.1.3.js&1572439093:21

What does that mean? Both links are the same.

I've tried changing permissions on my config files from 444 to 644, copied over jscript_jquery.easing.1.3.js from gsgd.co.uk.

I've tried searching on the forums but no joy. Any advice would be much appreciated.

10 Feb 2020, 10:08 AM
#357
nipinuk avatar

nipinuk

Zen Follower

Join Date:
Oct 2005
Location:
Hampshire, UK
Posts:
96
Plugin Contributions:
0

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

I had that happen to me as well. My redirect URL was definitely in at Square Developer Portal. I tried using both live and sandbox access tokes to see if there was a difference but was getting "Client requires a Redirect URL to use OAuth" too.

In the end, what worked for me (if I remember correctly as it was late last night) was to use the live access token.

  1. From Zen Cart admin, Modules-Payment-Square, click on 'Log In To Your Square Account' and log on
  2. From Square Dashboard, on the left column, select 'Apps'
  3. My Apps - Manage App
  4. On left column select OAuth. Check that Redirect URL https://www.your_website/square_handler.php is there
  5. Show Application Secret and copy and paste this into Zen Cart and update

Fingers and toes crossed!

10 Feb 2020, 10:11 AM
#358
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]

This is at the limit of my expertise but looking at the Network tab in dev tools (firefox) I think you might have two copies of jquery loaded.

one from your template folder:

/includes/templates/westminster_new/jscript/jquery/jquery-1.10.2.min.js

and another loaded from your html_header.php:

<script type="text/javascript">
if (typeof jQuery == 'undefined') {
    document.write(unescape("%3Cscript src='//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>

If I was debugging this I would remove one of the jquery instances and also turn off CSS/JS Loader.

Beyond that I would probably be stuck.

10 Feb 2020, 7:01 PM
#359
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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

The issue at square is that they now setup only the sandbox first. In order for the site to go live, go to Oauth page, look to bottom left - button needs to be turned on. I found out through sheer serendipity while talking with a support person (not square) he got another phone call and she had had the issue so the info I got while he had two phones to his ears! No help from square at all.

10 Feb 2020, 10:48 PM
#360
nipinuk avatar

nipinuk

Zen Follower

Join Date:
Oct 2005
Location:
Hampshire, UK
Posts:
96
Plugin Contributions:
0

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

Thanks for your reply Simon. I'm really not technical so when you say remove one of the jquery instances you mean delete one of the files right? I've removed /includes/templates/westminster_new/jscript/jquery/jquery-1.10.2.min.js

Under CSS/JS Loader Configuration, I put the values of Minify CSS and Javascript to False.

It hasn't seem to have made any difference as I still can't input any data into the credit card fields.

Site is https://bit.ly/2HdFdVO if anyone wanted to have a look

I'm stuck!