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

Results 281 to 300 of 835
15 Mar 2019, 11:50 PM
#281
drbyte avatar

drbyte

Sensei

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

Square Payment Module for Zen Cart [Support Thread]

IMPORTANT NOTE:

Square made some changes on March 13, 2019 which change how the module authorization tokens work.
You NEED to update your module to version 0.97 (just released today) in order for your token refreshes to work properly. And new installs won't work if you're using an older version of this module (ie: 0.96 or older).

This 0.97 update includes TWO important factors:
a) the square_handler.php update mentioned a few posts back (#264 on Feb 28)
b) a forced (slightly older) API Version header sent with each transaction (so you don't have to override it manually in your Square account)

Fortunately, if you were already using 0.96, updating to 0.97 involves only updating 2 files. See details in the module download at: Square Payments for Zen Cart

21 Mar 2019, 4:03 PM
#282
kadeepro avatar

kadeepro

New Zenner

Join Date:
Sep 2017
Location:
White City
Posts:
15
Plugin Contributions:
0

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

version 0.97 Square Payment not working.
I have my Application ID & Application Secret filled from my square APP like instructions call for. Location ID is blank and wont show my store numbers.
I get (Access Token needed) in red.
When I run my square_handler.php I get a HTTP ERROR 417
I don't have any url redirects in turned on in my htaccess
This is a sub domain with its own url, that shouldn't affect anything?

I am so confused why something that is so straight forward looking doesn't working.

Any thoughts or should I call Square?

Thanks

21 Mar 2019, 6:47 PM
#283
drbyte avatar

drbyte

Sensei

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

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

kadeepro:

I am so confused why something that is so straight forward looking doesn't working.Agreed. But let's collaborate to find a solution.
kadeepro:

version 0.97 Square Payment not working.
I have my Application ID & Application Secret filled from my square APP like instructions call for. Location ID is blank and wont show my store numbers.
I get (Access Token needed) in red.
I don't have any url redirects in turned on in my htaccess
kadeepro:

This is a sub domain with its own url, that shouldn't affect anything?A subdomain technically shouldn't be a problem, as long as the complete URL is set in your Square OAuth settings.
kadeepro:

When I run my square_handler.php I get a HTTP ERROR 417How EXACTLY are you getting that?
... cuz in the code, unless altered, a 417 is only sent if running it from a command-line, not a browser
... further, the text string "HTTP ERROR 417" is never sent in human-visible text
That said, a 417 response means that either the module is Disabled in your admin (status set to 'false'), or the token is not set/valid.

Next, what exactly happens when you click the green button in your Admin to get an access token? Step by step.

22 Mar 2019, 5:08 PM
#284
kadeepro avatar

kadeepro

New Zenner

Join Date:
Sep 2017
Location:
White City
Posts:
15
Plugin Contributions:
0

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

I got it working.
The green button logging back in to square this time fixed it. I had tried it before but it didn't activate module it just logged in to square.
I was had got the HTTP ERROR 417 by going to my https://www.url/square_handler.php before I had logged back in to square using the green button in Admin.

Thanks

17 May 2019, 11:26 PM
#285
mvstudio avatar

mvstudio

Zen Follower

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

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

Quick question.
In the previous version I was able to see in admin/orders.php a detail of the sale, which included the fee squareup charged for the transaction, quite useful for bookkeeping to process all the sales for the day from one screen. Is it possible to bring that feature back?

Thanks.

31 May 2019, 5:54 PM
#286
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]

Anyone had a chance to peruse the proposed changes for the Square API and the ability to sell in decimal quantities? Looks like beta is up and finalization is 12 June.

Something we need to plan for?

31 May 2019, 8:23 PM
#287
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

dbltoe:

Anyone had a chance to peruse the proposed changes for the Square API and the ability to sell in decimal quantities? Looks like beta is up and finalization is 12 June.

Something we need to plan for?

Are you saying Square does not/will not currently accept fractional units/decimal units?

I had only tested our Square account using integer units and am getting ready to disable our merchant account & enable Square to see how the fees worked out in the real world test.

90% of our products are sold in tenth ounce increments.

5 Jun 2019, 12:24 AM
#288
drbyte avatar

drbyte

Sensei

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

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

dbltoe:

Anyone had a chance to peruse the proposed changes for the Square API and the ability to sell in decimal quantities? Looks like beta is up and finalization is 12 June.

Something we need to plan for?

RixStix:

Are you saying Square does not/will not currently accept fractional units/decimal units?

I had only tested our Square account using integer units and am getting ready to disable our merchant account & enable Square to see how the fees worked out in the real world test.

90% of our products are sold in tenth ounce increments.

I don't recall having any trouble with fractional quantities. Hmmmm...

2 Jul 2019, 4:41 AM
#289
styrak avatar

styrak

New Zenner

Join Date:
Jul 2019
Posts:
7
Plugin Contributions:
0

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

Having an issue, found out when a customer tried to make a purchase. "The provided OAuth access token has expired. You must renew the access token via the Renew Access Token endpoint".

As far as I can tell, you should be able to do this through the Square payment module in the admin panel, but I don't see any buttons or functions to do that. I'm also on 0.97 so I'm not sure what's going on.

3 Jul 2019, 7:40 PM
#290
styrak avatar

styrak

New Zenner

Join Date:
Jul 2019
Posts:
7
Plugin Contributions:
0

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

And now I had a payment go through with no issues. I'm not sure what's going on here...

19 Jul 2019, 9:51 AM
#291
heresy_miniatures avatar

heresy_miniatures

New Zenner

Join Date:
Jul 2011
Posts:
59
Plugin Contributions:
0

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

You may need to set up a CRON job on your server to renew the token every three days or so. There's instructions in the README.html file in the mod package

Automatic Token Refreshing via cron
This is optional. For low-traffic stores, this is recommended.

In the initial setup, you clicked that "green button" to activate the module by setting what's called a Refresh Token. This token will expire in 45 days if no transactions are made. (30 days expiration, plus 15 days grace period.) After the 30 days you will see the green "Get Access Token" button again in your store Admin, and will need to click it to reactivate the module as you did during initial setup.

With regular transaction activity the token will refresh itself, but this can come at the expense of a brief delay for random customers. To avoid the possibility of such delays, or expiration due to inactivity, we recommend that you set up a "cron job" on your server to automatically handle token refreshes without interfering with customer checkout activity.

To set up the cron job, go to the cron settings in your website hosting company's control panel, and create a new task to run every 3 days at 1am. The command for the task will be:

php /home/user/your/path/to/wherever/is/square_handler.php

Again, if your token expires, Square will no longer show up during checkout for your customers. But you can fix it manually by clicking the green button to "login and authorize your account" as described in the Configuration section above.

19 Jul 2019, 3:39 PM
#292
billj avatar

billj

New Zenner

Join Date:
Sep 2013
Location:
Devon, UK
Posts:
88
Plugin Contributions:
1

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

Thank you for this module, Dr. Byte. We've been using Paypal for card payments for years but some people seem to run a mile as soon as they see the Paypal brand. I set up a Square account a few days ago along with this module. It took me about half an hour from not having an account to running a test transaction in Zen Cart.

Anyway, I see that Square has just updated their API to handle the European PSD2/SCA (Strong Customer Authentication) regulations that come into force in a couple of months. I'm assuming this module will need an update to handle that?

5 Aug 2019, 1:10 PM
#293
mvstudio avatar

mvstudio

Zen Follower

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

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

I looked around but couldn't locate the similar occurrence I'm experiencing with one of my stores.

This is what I'm getting all of the sudden in the log files after everything was working just fine.
The payment module isn't giving me any error on the admin side for which I assumed the installation was done correctly (?). I've removed the module and installed it again, no error messages, but it isn't working as it should. Some credit card payments do go through just fine though, which is strange.

ZC Version 1.5.6a
Square version 0.97

[05-Aug-2019 03:55:55 America/Detroit] Request URI: /index.php?main_page=checkout_process, IP address:XXXXXXXXX
#1 trigger_error() called at [/includes/modules/payment/square.php:340]
#2 square->before_process() called at [/includes/classes/payment.php:245]
#3 payment->before_process() called at [/includes/modules/checkout_process.php:85]
#4 require(/includes/modules/checkout_process.php) called at [/includes/modules/pages/checkout_process/header_php.php:14]
#5 require(/includes/modules/pages/checkout_process/header_php.php) called at [/home/koolwedd/public_html/index.php:36]
--> PHP Notice: Square Connect [configuration] error.
Response Body:
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[category] => INVALID_REQUEST_ERROR
[code] => NOT_FOUND
[detail] => Card nonce not found in this application environment. Please ensure an application ID belonging to the same environment is used to generate the nonce.
)

    )

)

Response Headers:
Array
(
[0] => HTTP/1.1 404 Not Found
[Content-Type] => application/json
[Square-Version] => 2018-12-05
[Vary] => Origin, Accept-Encoding
[X-Content-Type-Options] => nosniff
[X-Download-Options] => noopen
[X-Frame-Options] => SAMEORIGIN
[X-Permitted-Cross-Domain-Policies] => none
[X-Xss-Protection] => 1; mode=block
[Date] => Mon, 05 Aug 2019 07:55:41 GMT
[keep-alive] => timeout=60
[Strict-Transport-Security] => max-age=631152000
[content-length] => 230
)
in /includes/modules/payment/square.php on line 340.

Any idea what could be happening?

Thank you.

5 Aug 2019, 1:33 PM
#294
drbyte avatar

drbyte

Sensei

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

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

all of the sudden ... after everything was working just fine.

reinstalled ... no error messages, but it isn't working as it should. Some credit card payments do go through just fine though, which is strange.

That sort of message usually means you've generated an app token for one store but are using it on another. But that wouldn't happen on already-running stores like yours unless someone is in your admin and messing with your own configuration settings, which is unlikely.

Due to the intermittent nature of the problem, I'd suggest reaching out to Square Support. It feels like maybe something amuck on their servers.

If you can get a tech person on their end to look into their logs (on their end) for those specific rejections (or new ones you can trigger in real time) then they can probably tell you what's causing it, or identify whether something's operating oddly on their end.

For context, you can tell them that you're using Square-Connect-PHP/2.20181205.0 (and passing 'Square-Version: 2018-12-05' with each transaction).

(In case they ask: I haven't upgraded it to a newer one yet for 2 reasons: you're not using any of the newer features they've added, and upgrading it requires a huge rewrite to the token infrastructure that I had to create long before they built one in. They've advised me that passing the API version number as described above is exactly the right approach in this case.)

5 Aug 2019, 1:36 PM
#295
drbyte avatar

drbyte

Sensei

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

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

BillJ:

Thank you for this module, Dr. Byte.
I set up a Square account a few days ago along with this module. It took me about half an hour from not having an account to running a test transaction in Zen Cart.Woot!

BillJ:

Anyway, I see that Square has just updated their API to handle the European PSD2/SCA (Strong Customer Authentication) regulations that come into force in a couple of months. I'm assuming this module will need an update to handle that?Yes, I need to find some time to review what's needed for that. My schedule for August is pretty full, so unlikely to explore until next month. PM me if you need to talk about accelerating that.

5 Aug 2019, 7:27 PM
#296
mvstudio avatar

mvstudio

Zen Follower

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

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

Thank you DrByte for the quick reply.

I would think something else is happening since nothing has changed in the square account, just updated ZC to 1.5.6a and installed the module with the exact same information it's had. Also weird the event seems to be intermittent.

I'll post whatever solution square provides me with in case someone else here has a similar issue.

26 Aug 2019, 10:06 AM
#297
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]

ZC v1.5.6c
PHP v7.2.10
Square v0.97

Successfully captured funds within Admin (Square) but received this warning when doing so

[22-Aug-2019 16:51:02 Europe/London] Request URI: /myadmin/orders.php?page=1&oID=1271&action=doCapture, IP address: my.ip.123.456
#1  square->_doCapt() called at [/home/mydomain/public_html/myadmin/orders.php:285]
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/mydomain/public_html/includes/modules/payment/square.php on line 1017.

Lines 1017 - 1022 of square.php

if (count($errors_object)) {
            $error = $this->parse_error_response($errors_object);
            $messageStack->add_session(MODULE_PAYMENT_SQUARE_TEXT_UPDATE_FAILED . ' [' . $error['detail'] . ']', 'error');

            return false;
        }
26 Aug 2019, 10:17 AM
#298
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]

Also, just noticed this warning, at time of above order

[17-Aug-2019 11:22:25 Europe/London] Request URI: /index.php?main_page=checkout_process, IP address: my.customersip.123.456
#1  square->before_process() called at [/home/mydomain/public_html/includes/classes/payment.php:246]
#2  payment->before_process() called at [/home/mydomain/public_html/includes/modules/checkout_process.php:92]
#3  require(/home/mydomain/public_html/includes/modules/checkout_process.php) called at [/home/mydomain/public_html/includes/modules/pages/checkout_process/header_php.php:14]
#4  require(/home/mydomain/public_html/includes/modules/pages/checkout_process/header_php.php) called at [/home/mydomain/public_html/index.php:36]
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/mydomain/public_html/includes/modules/payment/square.php on line 355.

Lines 355 - 359 of square.php

if (count($errors_object)) {
            $error = $this->parse_error_response($errors_object);
            $messageStack->add_session('checkout_payment', MODULE_PAYMENT_SQUARE_TEXT_ERROR . ' [' . $error['detail'] . ']', 'error');
            zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
        }
4 Sep 2019, 9:23 PM
#300
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

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

Have Just received this as email from Square. A little worrying given the short notice.> Square’s Payment Form and Connect v2 APIs have been updated with everything you need to make your website or application compliant with Strong Customer Authentication (SCA) -- the new European regulation to make customer-initiated online payments more secure. SCA requires that merchants pass additional information about their customers to their payments provider with each transaction in order to reduce online fraud.

You’ll need to make updates to your integrations by September 14th, 2019, when the regulation goes into effect. Don’t wait until the last minute! If you have questions about the update process, please contact developer support.
https://developer.squareup.com/docs/sca-overview

Is zen cart compliant or am I going to have to stop using square for Payments?

I could forward e-mail if required.