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

Results 421 to 440 of 835
9 Apr 2020, 11:30 PM
#421
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Square Payment Module for Zen Cart [Support Thread]

If I recall, it will fail if you do.

9 Apr 2020, 11:46 PM
#422
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]

Thanks, I'll try to make a note to self so that I don't check that box. Based upon the last couple of weeks, I'll be uninstalling and reinstalling square a few times soon.

Still get myDEBUG-adm when refunding. Seems that there were questions regarding your fix... Did that end up being the official fix to eliminate the debugs?

[09-Apr-2020 16:41:43 America/Los_Angeles] Request URI: /ADMINFOLDER/orders.php?selected_box=customers&status=2&page=1&oID=920123&action=doRefund, IP address: 98.146.xxx.yyy
#1  square->_doRefund() called at [/home/chainwea/public_html/ADMINFOLDER/orders.php:254]
--> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/chainwea/public_html/includes/modules/payment/square.php on line 1110.
10 Apr 2020, 7:37 PM
#423
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]

I was never told if the code to repair the warning would work or not. An on-line tester said that should have taken care of the PHP 7.2 warning. I have not had an occasion to see if the correction stops the warning

The refund that brought up the warning worked just exactly as it should.

Hopefully you'll find an answer.

10 Apr 2020, 9:29 PM
#424
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:

I was never told if the code to repair the warning would work or not. An on-line tester said that should have taken care of the PHP 7.2 warning. I have not had an occasion to see if the correction stops the warning

The refund that brought up the warning worked just exactly as it should.

Hopefully you'll find an answer.

TNX for the reply. FWIW, I am using php 7.3.16

12 Apr 2020, 7:22 PM
#425
phosphoric avatar

phosphoric

New Zenner

Join Date:
Jan 2011
Posts:
3
Plugin Contributions:
0

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

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.

13 Apr 2020, 7:48 PM
#426
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]

RixStix:

TNX for the reply. FWIW, I am using php 7.3.16There is a github PR for 1.5.7 showing```
1110 - if (count($errors_object)) {
1110 + if (is_array($errors_object) && count($errors_object)) {

13 Apr 2020, 8:14 PM
#427
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]

not merged as of yet.

13 Apr 2020, 8:15 PM
#428
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]

TNX dbltoe

Got it added

13 Apr 2020, 8:29 PM
#429
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]

carlwhat:

not merged as of yet.
Hence the term PR

Do you dispute the change?

Asking for a friend:P

13 Apr 2020, 9:23 PM
#430
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]

AND no debug generated today. We will see if square refunds the processing fee for the $1 test charge made yesterday and refunded today.

I'm still keeping the Auth.net account open because I don't yet fully trust Square processing for reliability and overall processing rate.

17 Apr 2020, 2:21 PM
#431
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]

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.

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?
17 Apr 2020, 2:50 PM
#432
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]

Previously I noted that 'Captures can ONLY be done via your store Admin'. Now I see that in my Square dashboard there is an option to Charge an authorised transaction (not sure when that feature appeared). So I'm wondering whether it's ok to capture through Square dashboard? Presumably the order in ZC will not be updated accordingly.

17 Apr 2020, 3:21 PM
#433
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]

simon1066:

Previously I noted that 'Captures can ONLY be done via your store Admin'. Now I see that in my Square dashboard there is an option to Charge an authorised transaction (not sure when that feature appeared). So I'm wondering whether it's ok to capture through Square dashboard? Presumably the order in ZC will not be updated accordingly.

the square dashboard is the DEFINITIVE statement of your square transactions. doing anything there will directly affect your payments, and will not change anything on the ZC order.

it is perfectly fine to capture on the square dashboard to get your money.

17 Apr 2020, 4:21 PM
#434
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]

carlwhat:

the square dashboard is the DEFINITIVE statement of your square transactions. doing anything there will directly affect your payments, and will not change anything on the ZC order.

it is perfectly fine to capture on the square dashboard to get your money.

Great, thanks @carlwhat, I'll prob do it that way. It would be best if I could do it in Admin to have a full record of the order - I'll double check my files from the last v1.1 upgrade to make sure I didn't miss anything.

17 Apr 2020, 4:39 PM
#435
drbyte avatar

drbyte

Sensei

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

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

I have on my list to re-test the "capture" feature in 1.1 -- I had thought I'd gone through that, but the error you're reporting suggests otherwise. Apologies. Hopefully I can look into it over the weekend.

Yes in the meantime you can probably capture it in the Square dashboard and then manually update your Zen Cart order from Pending to Processing.

17 Apr 2020, 5:03 PM
#436
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]

DrByte:

I have on my list to re-test the "capture" feature in 1.1 -- I had thought I'd gone through that, but the error you're reporting suggests otherwise. Apologies. Hopefully I can look into it over the weekend.

Yes in the meantime you can probably capture it in the Square dashboard and then manually update your Zen Cart order from Pending to Processing.

Thanks @DrByte, if you need any more info let me know.

17 Apr 2020, 6:21 PM
#437
phosphoric avatar

phosphoric

New Zenner

Join Date:
Jan 2011
Posts:
3
Plugin Contributions:
0

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

simon1066:

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

I had 3 orders. 1 captured 2 uncaptured with 1.1.

I uninstalled 1.1 through the zen cart interface, then overwrote all files with 1.0 then reinstalled and updated all the relevant fields and went back in and captured. I checked my transaction list within squares website and they were all there.

DrByte:

I have on my list to re-test the "capture" feature in 1.1 -- I had thought I'd gone through that, but the error you're reporting suggests otherwise. Apologies. Hopefully I can look into it over the weekend.

Yes in the meantime you can probably capture it in the Square dashboard and then manually update your Zen Cart order from Pending to Processing.

Thank you for your work. I really like square over paypal.

19 Apr 2020, 3:53 PM
#438
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]

SQUARE 1.0
ZC 156C
OPC 2.3.0

Credit Card processing should not be this difficult or complex so I must be doing something wrong when I follow the instructions. Auth.net does it with a handful of files. Square needs half-kazzillion files. Maybe someone can make heads or tails from the logfile attached.

Why am I not surprised. It seems as though I must remove/reinstall square a couple times a week. Test it each time after reinstalling and CC is processed as expected. Test is Authorized and Captured. Test, Wait to see is deposited and then refund. Several days later, logfiles for SQUARE errors. Attempt to look at Square within Admin/Modules/Payment. After selecting Square, click EDIT and the entire right panel for settings just goes WHITE.

The only repair is to remove/reinstall.

My expectation is for SQUARE to function, accept credit card payments every time a customer selects CC as their preferred payment. I should not have to remove/reinstall seemingly a couple times a week. I never have to do this with Auth.net

FWIW, I had our host install the CRON as copy/pasted from the Square readme to run every 3rd day at 2am.

/usr/local/bin/php /home/WEBSERVERACCOUNT/public_html/square_handler.php
[19-Apr-2020 08:04:44 America/Los_Angeles] PHP Fatal error:  Uncaught Error: Call to undefined method SquareConnect\Configuration::callApi() in /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php:134
Stack trace:
#0 /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php(78): SquareConnect\Api\OAuthApi->obtainTokenWithHttpInfo(Object(SquareConnect\Model\ObtainTokenRequest))
#1 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(689): SquareConnect\Api\OAuthApi->obtainToken(Object(SquareConnect\Model\ObtainTokenRequest))
#2 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(554): square->renewOAuthToken()
#3 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(489): square->token_refresh_check()
#4 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(355): square->getAccessToken()
#5 /home/WEBSERVERACCOUNT/public_html/includes/classes/payment.php(246): square->before_process()
#6 /home/WEBSERVERACCOUNT/public_html/includes/modules/checkout_process.php(92): payment->before_process()
#7 /home/WEBSERVERACCOUNT/public_html/includes/modules/pages/checkout_process/header_php.php(14): require('/home/WEBSERVERACCOUNT/...')
#8 /home/WEBSERVERACCOUNT/public_html/index.php(36): require('/home/WEBSERVERACCOUNT/...')
#9 {main}
  thrown in /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php on line 134

[19-Apr-2020 08:04:44 America/Los_Angeles] Request URI: /index.php?main_page=checkout_process, IP address: 146.115.136.38
--> PHP Fatal error: Uncaught Error: Call to undefined method SquareConnect\Configuration::callApi() in /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php:134
Stack trace:
#0 /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php(78): SquareConnect\Api\OAuthApi->obtainTokenWithHttpInfo(Object(SquareConnect\Model\ObtainTokenRequest))
#1 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(689): SquareConnect\Api\OAuthApi->obtainToken(Object(SquareConnect\Model\ObtainTokenRequest))
#2 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(554): square->renewOAuthToken()
#3 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(489): square->token_refresh_check()
#4 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(355): square->getAccessToken()
#5 /home/WEBSERVERACCOUNT/public_html/includes/classes/payment.php(246): square->before_process()
#6 /home/WEBSERVERACCOUNT/public_html/includes/modules/checkout_process.php(92): payment->before_process()
#7 /home/WEBSERVERACCOUNT/public_html/includes/modules/pages/checkout_process/header_php.php(14): require('/home/WEBSERVERACCOUNT/...')
#8 /home/WEBSERVERACCOUNT/public_html/index.php(36): require('/home/WEBSERVERACCOUNT/...')
#9 {main}
  thrown in /home/WEBSERVERACCOUNT/public_html/includes/classes/vendors/square/connect/lib/Api/OAuthApi.php on line 134.
19 Apr 2020, 4:24 PM
#439
drbyte avatar

drbyte

Sensei

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

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

RixStix:

SQUARE 1.0
ZC 156C

[19-Apr-2020 08:04:44 America/Los_Angeles] Request URI: /index.php?main_page=checkout_process, IP address: 146.115.136.38
--> PHP Fatal error: Uncaught Error: Call to undefined method SquareConnect\Configuration::callApi() in
#1 /home/WEBSERVERACCOUNT/public_html/includes/modules/payment/square.php(689): SquareConnect\Api\OAuthApi->obtainToken(Object(SquareConnect\Model\ObtainTokenRequest))


The fix for that in 1.0 was posted in [#382](https://www.zen-cart.com/showthread.php?222449-Square-Payment-Module-for-Zen-Cart-Support-Thread&p=1366675#post1366675) back in March. It is included in 1.1 already. Here it is again:

lines 676-677:
change this:

$this->setSquareConfig();
$oauthApi = new SquareConnect\Api\OAuthApi($this->_sqConfig);

to this:
     $this->setApiClient();
     $oauthApi = new SquareConnect\Api\OAuthApi($this->_apiConnection);
19 Apr 2020, 5:29 PM
#440
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]

TNX Dr Byte,

I saw that but "I think the fix" doesn't say to me "this IS the fix", so I did not treat that as such.

We will see & hopefully don't have to Remove/Install several times a week any more because it cannot be set to false so that Auth.net can be set to true in its place.