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