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

Results 461 to 480 of 835
26 May 2020, 10:26 PM
#461
mrsawyer avatar

mrsawyer

New Zenner

Join Date:
Oct 2019
Location:
Georgia, USA
Posts:
54
Plugin Contributions:
0

Square Payment Module for Zen Cart [Support Thread]

Hello,

I installed Square Payments 1.1 today. I processed a test payment using the "authorize" setting. After logging into the admin area, I attempted to capture the payment, but received an http 500 error, with the following as the URL: https://tempcart.m a r i n l a t i n f o o d s.com/adminfolder/orders.php?page=1&oID=1960&action=doCapture . The complete message text was: "This page isn’t working, tempcart.m a r i n l a t i n f o o d s.com is currently unable to handle this request. HTTP ERROR 500"
I am using ZC v1.5.6c .
Please advise...
mrsawyer

27 May 2020, 8:09 PM
#462
mrsawyer avatar

mrsawyer

New Zenner

Join Date:
Oct 2019
Location:
Georgia, USA
Posts:
54
Plugin Contributions:
0

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

mrsawyer:

Hello,

I installed Square Payments 1.1 today. I processed a test payment using the "authorize" setting. After logging into the admin area, I attempted to capture the payment, but received an http 500 error, with the following as the URL: https://tempcart.m a r i n l a t i n f o o d s.com/adminfolder/orders.php?page=1&oID=1960&action=doCapture . The complete message text was: "This page isn’t working, tempcart.m a r i n l a t i n f o o d s.com is currently unable to handle this request. HTTP ERROR 500"
I am using ZC v1.5.6c .
Please advise...
mrsawyer

I forgot to mention in my original post yesterday that we are using PHP Version 7.2.24.
Thanks

27 May 2020, 10:20 PM
#463
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]

Scroll up to post # 421 and see if that helps.

I think I read somewhere where v1.0 captures without a hiccup and v1.1 might have hiccups.

27 May 2020, 11:28 PM
#464
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]

Visit with your host about the 500 error.

28 May 2020, 6:39 PM
#465
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

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

Looks like Square is having some major issues at the moment.
I have been trying to test the newer APIs since twitchtoo mentioned 0.97 (which I am on still) works with the latest API.

I can say that the latest API (2020-05-28) gives communications error when I try to use it ("Square will be right back"),
but that the one I originally used (2019-06-12) still works, although the 502 errors from Square prevent me from seeing any transactions.

On my test shop I have the payment module set to authorize, so I expect I need to manually capture it in the Square dashboard (there is no such capture in the Zen Cart order screen). At the moment I cannot check that, and it seems Square does not send out any emails on authorized transactions (they do send notification emails for payment transactions that have gone through).

28 May 2020, 6:58 PM
#466
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,954
Plugin Contributions:
8

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

gernot:

...so I expect I need to manually capture it in the Square dashboard (there is no such capture in the Zen Cart order screen).

i do not believe this is true. your square order may not be in the right status to do a capture on the ZC admin (or something else). if you search for _doCapt, you can see the modules that have this function, in theory, integrated with the ZC process of capturing a transaction in it.

includes/modules/payment/square_support/square_admin_notification.php
includes/modules/payment/paypaldp.php
includes/modules/payment/paypalwpp.php
includes/modules/payment/square.php
includes/modules/payment/authorizenet_aim.php
includes/modules/payment/authorizenet/authorizenet_admin_notification.php
includes/modules/payment/paypal/paypalwpp_admin_notification.php
admin/orders.php

i have never integrated with square or with a _doCapt, so i have no more info to provide on the topic.

best.

28 May 2020, 9:49 PM
#467
mrsawyer avatar

mrsawyer

New Zenner

Join Date:
Oct 2019
Location:
Georgia, USA
Posts:
54
Plugin Contributions:
0

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

dbltoe:

Visit with your host about the 500 error.

I am getting a totally blank page when using firefox. with Chrome, I get an "i" indicating that the URL is not secure, even though the URL starts with https://.
In the ZC error log, it says I am passing the wrong number of arguments to Square.

See: [28-May-2020 21:12:54 UTC] Request URI: /adminfolder/orders.php?page=1&oID=1960&action=doCapture, IP address: 173.231.nnn.nnn
--> PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SquareConnect\Api\PaymentsApi::completePayment(), 1 passed in /home/xyz/tempcart.m a r i n l a t i n f o o d s.com/includes/modules/payment/square.php on line 1158 and exactly 2 expected in /home/xyz/tempcart.m a r i n l a t i n f o o d s.com/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php:266

So looks like a coding error in the plugin.
Please advise...
mrsawyer

29 May 2020, 8:16 AM
#468
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

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

carlwhat:

i do not believe this is true. your square order may not be in the right status to do a capture on the ZC admin (or something else). if you search for _doCapt, you can see the modules that have this function, in theory, integrated with the ZC process of capturing a transaction in it.

includes/modules/payment/square_support/square_admin_notification.php
includes/modules/payment/paypaldp.php
includes/modules/payment/paypalwpp.php
includes/modules/payment/square.php
includes/modules/payment/authorizenet_aim.php
includes/modules/payment/authorizenet/authorizenet_admin_notification.php
includes/modules/payment/paypal/paypalwpp_admin_notification.php
admin/orders.php

i have never integrated with square or with a _doCapt, so i have no more info to provide on the topic.

best.

Hi carlwhat,
Thanks for the information.
I checked again today (https://jp.issquareup.com still shows Square as having serious issues) and could at least see my transactions in the dashboard this time. And I could do a refund on my test transaction there.

Then, when I logged into my ZenCart testshop admin again and looked at the order, lo and behold, the expected grey area for handling Square transactions was there!! So I assume that the reason it was not there before was because of transmissions failure to Square.

Now it would be really useful to have an indication of this kind of issue in the Zen Cart order screen (there was no missing space underneath the payment method information with last line "Credit Card Expires: xx/xx" and the start of the Products listing).
It looks like if there is some communication error that section of the order page is simply not rendered.
Note that when testing the API versions when I updated to 2020-05-28 I got a transaction error mail with the contents "Square will be right back" but with 2019-06-12 the transaction had gone through (the test transaction under discussion), so maybe the error for the API version was related to the general Square issue and not specifically to the API. I will try again...

Back to the transaction. I tried to do a refund from Zen Cart just to check, and got the expected error(s) in reply (in red at the top of the page) since I had already refunded from the Square dashboard:

  1. Unable to process payment due to a communications error. You may try again or contact us for assistance.
  2. Sorry, the attempted transaction update failed unexpectedly. See logs for details. [REFUND_AMOUNT_INVALID: The requested refund amount exceeds the amount available to refund. One or more refunds might already have been applied to this payment.]

So that seems to be working fine, and I can delete the test order.

Will report back with more API tests.

4 Jun 2020, 11:40 AM
#469
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]

The only Payment Modules I have enabled are Square and PayPal EC. In the Square config in Admin I have,

Set Order Status = Processing [2]

This is not reflected in the Orders Status column of the Payment Modules listing where it is shown as Pending. I have tried switching between various Set Order Status values but Pending still persists.

As changes to the PayPal EC Order Status are reflected in the Orders Status column, I wonder if this is a bug in the Square mod?

4 Jun 2020, 1:31 PM
#470
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]

simon1066:

The only Payment Modules I have enabled are Square and PayPal EC. In the Square config in Admin I have,

Set Order Status = Processing [2]

This is not reflected in the Orders Status column of the Payment Modules listing where it is shown as Pending. I have tried switching between various Set Order Status values but Pending still persists.

As changes to the PayPal EC Order Status are reflected in the Orders Status column, I wonder if this is a bug in the Square mod?

Now I see, this is normal behaviour. If the Transaction Type is set to Authorize then Pending is the default. Set Order Status is the status of a paid order - as the description states.

15 Jun 2020, 2:55 PM
#471
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

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

I am not seeing the credit card entry details boxes in safari. Any idea why? Firefox and Chrome seem to be ok though.

Attachment 19048

21 Jun 2020, 5:58 PM
#472
drbyte avatar

drbyte

Sensei

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

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

Nick1973:

I am not seeing the credit card entry details boxes in safari. Any idea why? Firefox and Chrome seem to be ok though.
The only times I've seen something akin to that are:

  • with Chrome when using a template that's using specialized CSS column directives for responsive controls.
  • or javascript errors blocking the Square calls to build the hosted fields
21 Jun 2020, 6:30 PM
#473
drbyte avatar

drbyte

Sensei

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

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

RixStix:

When updating the Square App to the one that matches the latest ZC square plugin, there is a checkbox

Change my webhook endpoints to use this API version

Should that box be checked or unchecked?
I've added a note to the Readme:
"When switching API versions in your Square Dashboard, you can ignore the "Webhooks" switch because this module doesn't use Webhooks presently."

21 Jun 2020, 6:33 PM
#474
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 have the same/similar issue capturing funds with v1.1 of this mod (PHP v7.2.24, API 2020-3-25). I have a live, authorised, order awaiting capture. Error log is:

[17-Apr-2020 14:01:51 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SquareConnect\Api\PaymentsApi::completePayment(), 1 passed in /home/mydomain/public_html/includes/modules/payment/square.php on line 1158 and exactly 2 expected in /home/mydomain/public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php:266
Stack trace:
#0 /home/mydomain/public_html/includes/modules/payment/square.php(1158): SquareConnect\Api\PaymentsApi->completePayment('[simon1066_string_hidden]...')
#1 /home/mydomain/public_html/myadmin/orders.php(285): square->_doCapt('1275', 'Complete', '2.5000', 'GBP')
#2 {main}
thrown in /home/mydomain/public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php on line 266

[17-Apr-2020 14:01:51 UTC] Request URI: /myadmin/orders.php?page=1&oID=1275&action=doCapture, IP address: 11.222.333.444
--> PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SquareConnect\Api\PaymentsApi::completePayment(), 1 passed in /home/mydomain/public_html/includes/modules/payment/square.php on line 1158 and exactly 2 expected in /home/mydomain/public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php:266
Stack trace:
#0 /home/mydomain/public_html/includes/modules/payment/square.php(1158): SquareConnect\Api\PaymentsApi->completePayment('[simon1066_string_hidden]...')
#1 /home/mydomain/public_html/myadmin/orders.php(285): square->_doCapt('1275', 'Complete', '2.5000', 'GBP')
#2 {main}
thrown in /home/mydomain/public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php on line 266.

> 
> If I have to revert to v1.0 will it affect the order?

> **Phosphoric:**
>
> Had some issues using 1.1.
> 
> Seemed to authorize transactions but in admin it would just load a blank page on capture; and not actually capture. Server php is 7.0,  zen cart version is 1.5.6c, and the square API is set to 2020-3-25. 
> 
> 
> Gives me a warning then a error:
> ```
PHP Warning: Missing argument 2 for SquareConnect\Api\PaymentsApi::completePayment(), called in /public_html/includes/modules/payment/square.php on line 1158 and defined in /public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php on line 266.

PHP Fatal error:  Uncaught InvalidArgumentException: Missing the required parameter $body when calling completePayment in /public_html/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php:292

I cant remember which version I tried to upgrade from, But 1.1 will not capture transactions. To get 1.1 to function at all I had to uninstall and reinstall the module.

I uninstalled 1.1 module -I downloaded 1.0, overwrote all files and its working.

I'm not sure what is going on between to two versions, But Ill keep a eye out for this token refresh bug for now.

mrsawyer:

I am getting a totally blank page when using firefox. with Chrome, I get an "i" indicating that the URL is not secure, even though the URL starts with https://.
In the ZC error log, it says I am passing the wrong number of arguments to Square.

See: [28-May-2020 21:12:54 UTC] Request URI: /adminfolder/orders.php?page=1&oID=1960&action=doCapture, IP address: 173.231.nnn.nnn
--> PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SquareConnect\Api\PaymentsApi::completePayment(), 1 passed in /home/xyz/tempcart.m a r i n l a t i n f o o d s.com/includes/modules/payment/square.php on line 1158 and exactly 2 expected in /home/xyz/tempcart.m a r i n l a t i n f o o d s.com/includes/classes/vendors/square/connect/lib/Api/PaymentsApi.php:266

So looks like a coding error in the plugin.
Please advise...
mrsawyer

mrsawyer:

Hello,

I installed Square Payments 1.1 today. I processed a test payment using the "authorize" setting. After logging into the admin area, I attempted to capture the payment, but received an http 500 error...The complete message text was: "This page isn’t working, [domain name redacted] is currently unable to handle this request. HTTP ERROR 500"
I am using ZC v1.5.6c .
Please advise...
mrsawyer

Yes, there was a bug in the capture code in v1.1. Unfortunately Square's documentation wasn't mentioning that the Connect SDK requires an empty dataset parameter to be passed to the capture request, making it a little hard to track down.
The fix, which is in v1.2 is:
https://github.com/zencart/square_payments_for_zencart/commit/e58317272c7ae9dbb47ea79409b8a26bd8c129b1

21 Jun 2020, 7:35 PM
#475
drbyte avatar

drbyte

Sensei

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

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

Some new versions have just been released:

v1.2 - includes fixes for the refund and capture PHP errors, and adds an extra display field for custom text on checkout screen. Uses API 3.20200325.0

v1.3 - Updates to SquareConnect SDK version 3.20200528.1
(Note: This is the last release of SquareConnect SDK that is compatible with PHP 5. Future versions will require PHP 7.1+, and will be integrated to the SquarePHP SDK (not SquareConnect). A version 2 of this module will be released to work with the new SDK, but this will also limit which Zen Cart versions the module is compatible with. If you are not using Zen Cart 1.5.6 or newer and PHP 7.1 or newer, now is the time to upgrade!)
(this is a full upgrade of all files: see the changelog.md file for instructions)

v1.4 - simply adds display of the API / SDK versions in the admin sidebar so you can easily reference it for setting the API version in your Square account.
(this is just an update to the square.php payment module file)

v1.5 - Added improvements to catching errors that could occur during capture/void/refund.
(this is just an update to the square.php payment module file)

23 Jun 2020, 2:54 AM
#476
drbyte avatar

drbyte

Sensei

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

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

v1.5 has been uploaded. (details in post above)

Apologies for the series of rapid updates. I was testing some edge cases for potential error situations, and found a few places where blank screens could occur, so fixed those.

23 Jun 2020, 5:09 PM
#477
brittainmark avatar

brittainmark

Totally Zenned

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

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

Just upgraded to 1.5 from 1.1 and I am getting a warning MODULE_PAYMENT_SQUARE_TEXT_NOTICES_TO_CUSTOMER not defined. Have I missed something?

23 Jun 2020, 5:23 PM
#478
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]

Did you follow the instructions in the readme.md for upgrade? You may have a file still there that is no longer used.

23 Jun 2020, 5:31 PM
#479
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]

Once the customer has upgraded the Square API, we've been able to upgrade them on the fly by deleting the two folders and uploading the "files to upload" by ftp with overwrite.

So far, no need to get other codes BUT, we don't do the FTP till the API is current.

BTW jscript_square.php has no change so there's no need to add to OPC.

23 Jun 2020, 6:24 PM
#480
brittainmark avatar

brittainmark

Totally Zenned

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

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

Yes Deleted the two folders and uploaded new ones. Just found it. I have the square file in my template that i did not change. I will change it and hopeful that will fix it.