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

Results 261 to 280 of 835
28 Feb 2019, 4:24 PM
#261
drbyte avatar

drbyte

Sensei

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

Square Payment Module for Zen Cart [Support Thread]

cacoeman:

my square_handler appends the following code after the .php (square_handler.php?code=sq0cgp-j_F4unDPtGZ02XK5gVKs1Q&state=5c7806a1d350a#=) None of that extra stuff is my account creds. I changed to True as well on thatsquare_handler.php file and the word failure is all that shows up, as mentioned by radiowave above.

Those extra parameters/code after the ".php" in the URL are sent from Square, and are part of the handshake involved in setting the token between your site and Square's servers.

This afternoon I'll try to simulate the "failure" response you're talking about. Maybe they've recently changed something that's causing it? I'll post back when I have some findings.

28 Feb 2019, 4:29 PM
#262
cacoeman avatar

cacoeman

New Zenner

Join Date:
Feb 2019
Location:
Midwest USA
Posts:
3
Plugin Contributions:
0

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

Great, thank you. I tried the same things that other folks did on the Square side, replaced my access token, replaced app secret, made a new app, removed and reinstalled Square 0.96. Nothing changed the outcome.

28 Feb 2019, 6:18 PM
#263
drbyte avatar

drbyte

Sensei

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

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

Ya, there's definitely a problem here. Dunno where it came from yet ...
Investigating ...

28 Feb 2019, 6:47 PM
#264
drbyte avatar

drbyte

Sensei

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

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

Okay -- I think I've found a fix.
(Looks like Square changed how they do their responses ... as part of other improvements they're making.)

I believe you can resolve this problem by replacing the contents of your square_handler.php file with the code I've just updated here:
https://raw.githubusercontent.com/zencart/zencart/v156/square_handler.php

28 Feb 2019, 8:41 PM
#265
cacoeman avatar

cacoeman

New Zenner

Join Date:
Feb 2019
Location:
Midwest USA
Posts:
3
Plugin Contributions:
0

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

Dude... you straight up saved my bacon. That worked like a charm. I have to sell tickets from that website and they go on sale tomorrow. PM me your paypal or cryptocurrency address, I would like to very much send you a tip. Thank you.

28 Feb 2019, 9:14 PM
#266
jewelm avatar

jewelm

New Zenner

Join Date:
Apr 2015
Posts:
4
Plugin Contributions:
0

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

Did some more testing and still came up with the same issue. The last thing I tried was installing default zencart 1.5.6a on a separate server that my original site was not on nor has never had zen cart on it. Updated the square module to 0.96 before running the authorize process and again made a new square app for this test. Same results.

All these test were done on php 7. Tried rolling back to 5.6, but didn't change anything.

Edit: Posted this before I saw the most recent posts. Sorry about that. But DrBytes fix a few posts up did fix the issue on my end. Thank you!

1 Mar 2019, 3:27 AM
#267
drbyte avatar

drbyte

Sensei

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

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

Woot! Glad it fixed it for you. We'll roll the fix into a new release.

Thanks for reporting back!

1 Mar 2019, 3:27 AM
#268
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

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

worked for me

1 Mar 2019, 5:31 PM
#269
clebarron avatar

clebarron

New Zenner

Join Date:
Mar 2008
Posts:
3
Plugin Contributions:
0

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

I have installed when clicking the green button then logging into square the redirect says this page is not working, I have ssl and was able with a different cart to enable square, htaccess just says rewrite enabled. the redirect is correct in Oauth. at a loss, using 1.55f..default template.

1 Mar 2019, 8:52 PM
#270
clebarron avatar

clebarron

New Zenner

Join Date:
Mar 2008
Posts:
3
Plugin Contributions:
0

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

clebarron:

I have installed when clicking the green button then logging into square the redirect says this page is not working, I have ssl and was able with a different cart to enable square, htaccess just says rewrite enabled. the redirect is correct in Oauth. at a loss, using 1.55f..default template.

Sorry didnt see these pages, the fix worked for me and no longer a problem

8 Mar 2019, 1:20 PM
#271
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

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

Just to add another confirm with details for Google:

Had the Square "Access Token" issue described in prior posts. Page showed an HTTP 417 error.
Access Token was not updated in the database.

Applied fix mentioned in Post 264:
https://www.zen-cart.com/showthread.php?222449-Square-Payment-Module-for-Zen-Cart-Support-Thread&p=1355387#post1355387

Issue resolved.

9 Mar 2019, 1:56 PM
#272
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

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

having trouble figuring out how to fix the SQ-NONCE-FAILURE error when trying to process CC via Square.

helmet-decals.com

I have 3 errors (2 are "ReferenceError: Can't find variable: $" with index.php line references - lines 198 and 287). The other is "Failed to load resource: the server responded with a status of 404 (Not Found)" referencing https://helmet-decals.com/includes/templates/zencart_zen/images/sb_header.png. (which doesn't exist)

9 Mar 2019, 2:27 PM
#273
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

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

helmetdecals:

having trouble figuring out how to fix the SQ-NONCE-FAILURE error when trying to process CC via Square.

helmet-decals.com

I have 3 errors (2 are "ReferenceError: Can't find variable: $" with index.php line references - lines 198 and 287). The other is "Failed to load resource: the server responded with a status of 404 (Not Found)" referencing https://helmet-decals.com/includes/templates/zencart_zen/images/sb_header.png. (which doesn't exist)
Did you apply the changes that @DrByte suggested in post #264 of this support-thread?

9 Mar 2019, 3:53 PM
#274
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

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

I am using the Zencart_zen template. it works in the templates that come with Zen-Cart

9 Mar 2019, 3:59 PM
#275
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

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

I did and it did not work. I can get it to work with the default templates from zen-cart but not with my custom "Zencart_zen". btw this custom does not have a jscript folder

9 Mar 2019, 9:57 PM
#276
southbayer avatar

southbayer

New Zenner

Join Date:
Aug 2017
Location:
Southern California
Posts:
6
Plugin Contributions:
0

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

DrByte:

Okay -- I think I've found a fix.
(Looks like Square changed how they do their responses ... as part of other improvements they're making.)

I believe you can resolve this problem by replacing the contents of your square_handler.php file with the code I've just updated here:
https://raw.githubusercontent.com/zencart/zencart/v156/square_handler.php

I thought I was going crazy trying to get Square to work with v156a. I kept getting HTTP 417 errors. But then I saw this post and applied the copy/replace of the square_handler.php contents. Saved the file and re-tried it. And it works! Thank you!

10 Mar 2019, 12:55 PM
#277
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

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

I found the problem just don't know how to fix it. The problem is in my template/common/html_header.php. Once I remove this I can except payments with not problem but then my "success' page is missing "contact us" and other buttons. I think the problem is in the jscript (the html_header.php points to jscript but my template doesn't have a jscript folder). Here is my html_header.php:

<?php /** * Common Template * * outputs the html header. i,e, everything that comes before the \</head\> tag <br /> * * @package templateSystem * @copyright Copyright 2003-2010 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: html_header.php 15761 2010-03-31 19:31:27Z drbyte $ * @version $Id: html_header.php 0000 2007-02-25 10:37:00Z kuroi $ * Based on a post by duncanad */ /** * load the module for generating page meta-tags */ require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php')); /** * output main page HEAD tag and related headers/meta-tags, etc */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" /> <title><?php echo META_TAG_TITLE; ?></title> <meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" /> <meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="author" content="<?php echo STORE_NAME .', ' . TEMPLATE_DESIGN_TEXT . ', shopping cart program by Zen Cart™, <http://www.zen-cart.com> eCommerce';?>" /> <meta name="generator" content="shopping cart program by Zen Cart™, <http://www.zen-cart.com> eCommerce" /> <?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance') { ?> <meta name="robots" content="noindex, nofollow" /> <?php } ?> <?php if (defined('FAVICON')) { ?> <link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" /> <link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" /> <?php } //endif FAVICON ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" /> <?php if (isset($canonicalLink) && $canonicalLink != '') { ?> <link rel="canonical" href="<?php echo $canonicalLink; ?>" /> <?php } ?> <?php /** * load all template-specific stylesheets, named like "style*.css", alphabetically */ $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css'); while(list ($key, $value) = each($directory_array)) { echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n"; } /** * load all template-specific stylesheets, named like "ie_*.css", alphabetically * for stylesheets targeted at all versions of IE */ $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie_/', '.css'); while(list ($key, $value) = each($directory_array)) { echo '<!--[if IE]>' . "\n"; echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n"; echo '<![endif]-->' . "\n"; } /** * load all template-specific stylesheets, named like "ie7*.css", alphabetically * for stylesheets targeted at specific versions of IE */ $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie[5-9]_/', '.css'); while(list ($key, $value) = each($directory_array)) { $ver = substr ($value, 2, 1); echo '<!--[if IE ' . $ver . ']>' . "\n"; echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n"; echo '<![endif]-->' . "\n"; } /** * load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza. */ $manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : ''; $tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : ''; $tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base; if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id; $sheets_array = array('/' . $_SESSION['language'] . '_stylesheet', '/' . $tmp_pagename, '/' . $_SESSION['language'] . '_' . $tmp_pagename, '/c_' . $cPath, '/' . $_SESSION['language'] . '_c_' . $cPath, '/m_' . $manufacturers_id, '/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id, '/p_' . $tmp_products_id, '/' . $_SESSION['language'] . '_p_' . $tmp_products_id ); while(list ($key, $value) = each($sheets_array)) { //echo "<!--looking for: $value-->\n"; $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css'; if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n"; } /** * load printer-friendly stylesheets -- named like "print*.css", alphabetically */ $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css'); sort($directory_array); while(list ($key, $value) = each($directory_array)) { echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n"; } /** * load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically */ $directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js'); while(list ($key, $value) = each($directory_array)) { echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n"; } /** * load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically */ $directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js'); while(list ($key, $value) = each($directory_array)) { echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n"; } /** * load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically */ $directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php'); while(list ($key, $value) = each($directory_array)) { /** * include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically. * These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page */ require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n"; } /** * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically. */ $directory_array = $template->get_template_part($page_directory, '/^jscript_/'); while(list ($key, $value) = each($directory_array)) { /** * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically. * These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page */ require($page_directory . '/' . $value); echo "\n"; } // DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->'; ?> </head> <?php // NOTE: Blank line following is intended: ?>
11 Mar 2019, 3:02 AM
#278
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

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

earmsby:

I've had this payment module running nicely now for a month or two. Definitely prefer it over PayPal that I was using previously. However, I'm wondering if there is a way to modify the module to send the customer/cardholder name to Square. All the payments come through as "Unknown Name" in the square dashboard. It would be very handy to have the customer's name or the cardholder name for bookkeeping purposes in Square. I'm curious as to whether the module is already supposed to do this and it's just not working in my installation of it or whether this is functionality that could be added. I'm willing to tinker if I knew where to start.

I asked this question last year and got one answer of:

I believe that's something you need to take up with the folks at Square.

They would never process a card without the cardholder's name so, they must have it. If it doesn't show up in your Square report, it's probably because their system is not coded to do it.

But elsewhere in the thread I read:

At the present time, in v0.9 of the module, there is no creation of customers into your Square account.

I noticed that my store is still using version 0.90 o the plugin. I'm running ZC version 1.5.5e and PHP version 7.0

Would moving to the latest version of the Square module have any effect on the customer name (and other info) being brought in to Square rather than all sales showing as "unknown" or is this just not the way the module works?

14 Mar 2019, 5:57 PM
#279
clebarron avatar

clebarron

New Zenner

Join Date:
Mar 2008
Posts:
3
Plugin Contributions:
0

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

Just received an email from square developers about depreciating renew token.. just wondering does the current module cover these new changes.

14 Mar 2019, 6:32 PM
#280
drbyte avatar

drbyte

Sensei

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

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

clebarron:

Just received an email from square developers about depreciating renew token.. just wondering does the current module cover these new changes.
I received the same notice. I've been talking to their tech team about it. They assure me that right now no action is required since we're currently integrated with a prior API version. I'm investigating what cautions need to be taken for the next update. For now, according to them, you'll be fine. (fingers crossed)

EDIT/UPDATE: it turns out a change IS required. A new 0.97 version has been posted. See next post for details.