Zen Cart Logo
Forums / Addon Payment Modules / Square WebPay support thread.

Square WebPay support thread.

Views: 128,160

Results 261 to 280 of 800
13 Sep 2022, 3:56 PM
#261
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Square WebPay support thread.

Thanks Scott. Already checked the API logs and the only 401 errors were ObtainToken and these were from last week when I was setting the module up originally.

Everything seems to be working perfectly if it wasn't for the user reports. I put the first few down to user error but my gut now tells me there is an issue.

Assume I should still be using API version 2022-02-16?

13 Sep 2022, 10:04 PM
#262
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

Brent:

Thanks Scott. Already checked the API logs and the only 401 errors were ObtainToken and these were from last week when I was setting the module up originally.

Everything seems to be working perfectly if it wasn't for the user reports. I put the first few down to user error but my gut now tells me there is an issue.

Assume I should still be using API version 2022-02-16?

brent,
unfortunately i can not debug based on a gut feeling. if you have any error logs, by all means go ahead and post them.

you can change the constant MODULE_PAYMENT_SQ_WEBPAY_LOGGING to Log Always, and see what happens.

the potential for problems could be before ZC sends any data to square, which should hopefully generate an error log. else if the data gets sent to square then you should see it on the API dashboard on the square web site. if you have log always on, you should see that Square log as well in your logs directory.

and yes that is the correct API version to use.

best.

23 Sep 2022, 4:28 PM
#265
heresy_miniatures avatar

heresy_miniatures

New Zenner

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

Re: Square WebPay support thread.

thanks!

11 Oct 2022, 11:37 PM
#266
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Square WebPay support thread.

Using Ver 1.5.7 ppatch 1, I've tried installing the new square module twice. Neither time did it show up under the payment module on the admin site. Any ideas?

12 Oct 2022, 12:33 AM
#267
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

pazdar:

Using Ver 1.5.7 ppatch 1, I've tried installing the new square module twice. Neither time did it show up under the payment module on the admin site. Any ideas?

i would say you are not installing it properly.

i think all that is needed is a language file and a payment module for a payment module to show up in the admin. they need to be in the right places.

without any log files, i am only venturing a guess. but plenty of store owners were able to get it to show up on the admin with nothing more than the directions that come with the module.

make sure you have not uploaded the for_upload directory.

best.

13 Oct 2022, 12:37 AM
#268
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Square WebPay support thread.

Good evening;

After seeing your email, I erased the payment file under modules, re-uploaded it from the master file for v1.5.7, then re-uploaded the square module. Now it shows up. This time I'm getting "ALERT: Access Token not set:" I do have it set to the correct location. Do I need to change anything in any of the files?

13 Oct 2022, 4:39 AM
#269
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

pazdar:

Good evening;

After seeing your email, I erased the payment file under modules, re-uploaded it from the master file for v1.5.7, then re-uploaded the square module. Now it shows up. This time I'm getting "ALERT: Access Token not set:" I do have it set to the correct location. Do I need to change anything in any of the files?

i have recently reviewed the docs here:

https://docs.zen-cart.com/user/payment/square/

and found them to be VERY helpful with installation and problem solving.

if you go through those docs and still can not get it working, by all means, come back here.

best.

13 Oct 2022, 12:22 PM
#270
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Square WebPay support thread.

Thanks, I went through them, still not working. Here's what I'm seeing:

ALERT: Access Token not set:

  1. Make sure the OAuth Redirect URL in your Square Account "app" is set to

https://www.pazd..........

I've double checked and the handler file is in the main directory

13 Oct 2022, 3:02 PM
#271
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

pazdar:

Thanks, I went through them, still not working. Here's what I'm seeing:

ALERT: Access Token not set:

  1. Make sure the OAuth Redirect URL in your Square Account "app" is set to

https://www.pazd..........

I've double checked and the handler file is in the main directory

have you done this part here:

https://docs.zen-cart.com/user/payment/square/#reinstalling-square-web-payments

your access token is bad...

13 Oct 2022, 4:31 PM
#272
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Square WebPay support thread.

Yes, I get this:

ALERT: Access Token not set:

  1. Make sure the OAuth Redirect URL in your Square Account "app" is set to

https://www.pazdarwinery.com/squareWebPay_handler.php

  1. And then (click on green button)

I do that and I get a blank screen with this address:

https://www.pazdarwinery.com/squareWebPay_handler.php?code=sq0cgp-Sf_MP2A5eoKhtX9W2pZCxg&response_type=code&state=5aa6f6d9b5194be671ea7c252d0771086279e795bb76886ec838c41f13ed7ce4#_=_

13 Oct 2022, 11:28 PM
#273
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

pazdar:

Yes, I get this:

ALERT: Access Token not set:

  1. Make sure the OAuth Redirect URL in your Square Account "app" is set to

https://www.pazdarwinery.com/squareWebPay_handler.php

  1. And then (click on green button)

I do that and I get a blank screen with this address:

https://www.pazdarwinery.com/squareWebPay_handler.php?code=sq0cgp-Sf_MP2A5eoKhtX9W2pZCxg

i'm getting a 500 response code from your site and the squareWebPay_handler. which indicates some sort of server issue.

do you have any logs?

i would also look in the handler for the $verbose = false; and change that to $verbose = true;

14 Oct 2022, 6:40 AM
#274
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square WebPay support thread.

After uploading the files I get the following error in the log files:
PHP Fatal error: Uncaught Error: Class "Square\Environment" not found in MY_PATH/includes/modules/payment/square_webPay.php:105
Stack trace:
#0 /MY_PATH/modules.php(204): square_webPay->__construct()
#1 /: require('/home/tim/zenca...')
#2 {main}
thrown in /MY_PATH/includes/modules/payment/square_webPay.php on line 105

There appears no webpay module in Modules->Payment.

php Version is 8.0
Zen Cart 1.5.7d

14 Oct 2022, 5:07 PM
#275
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

todoonada:

After uploading the files I get the following error in the log files:
PHP Fatal error: Uncaught Error: Class "Square\Environment" not found in MY_PATH/includes/modules/payment/square_webPay.php:105
Stack trace:
#0 /MY_PATH/modules.php(204): square_webPay->__construct()
#1 /: require('/home/tim/zenca...')
#2 {main}
thrown in /MY_PATH/includes/modules/payment/square_webPay.php on line 105

There appears no webpay module in Modules->Payment.

php Version is 8.0
Zen Cart 1.5.7d

you have not properly uploaded all the files in the zip. specifically the directory here:

/MY_PATH/includes/modules/payment/square_webPay/

there are a number of directories and more files there. those are all required.

14 Oct 2022, 8:14 PM
#276
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Square WebPay support thread.

I tried setting it to "true"

Here is the error report I get:

[14-Oct-2022 14:10:32 America/Boise] SQUARE TOKEN REQUEST - auth code for exchange: sq0cgp-kqtdUqf6zPos4IikZi1WFQ

Array
(
[code] => sq0cgp-kqtdUqf6zPos4IikZi1WFQ
[response_type] => code
[state] => 932ee36d66d8eff178bf665e995eebc55857a15ee927e385822656fe450d2cbd
[main_page] => index
)

[14-Oct-2022 14:10:32 America/Boise] PHP Fatal error: Uncaught Error: Class 'Unirest\Request' not found in /includes/modules/payment/square_webPay/square/square/src/Apis/BaseApi.php:64
Stack trace:
#0 /includes/modules/payment/square_webPay/square/square/src/Apis/OAuthApi.php(22): Square\Apis\BaseApi->__construct(Object(Square\SquareClient), Array, NULL)
#1 /includes/modules/payment/square_webPay/square/square/src/SquareClient.php(327): Square\Apis\OAuthApi->__construct(Object(Square\SquareClient), Array, NULL)
#2 /includes/modules/payment/square_webPay.php(694): Square\SquareClient->getOAuthApi()
#3 /squareWebPay_handler.php(33): square_webPay->exchangeForToken('sq0cgp-kqtdUqf6...')
#4 {main}
thrown in /includes/modules/payment/square_webPay/square/square/src/Apis/BaseApi.php on line 64

[14-Oct-2022 14:10:32 America/Boise] Request URI: /squareWebPay_handler.php?code=sq0cgp-kqtdUqf6zPos4IikZi1WFQ&response_type=code&state=932ee36d66d8eff178bf665e995eebc55857a15ee927e385822656fe450d2cbd, IP address: 69.206.192.57
--> PHP Fatal error: Uncaught Error: Class 'Unirest\Request' not found in /includes/modules/payment/square_webPay/square/square/src/Apis/BaseApi.php:64
Stack trace:
#0 /includes/modules/payment/square_webPay/square/square/src/Apis/OAuthApi.php(22): Square\Apis\BaseApi->__construct(Object(Square\SquareClient), Array, NULL)
#1 /includes/modules/payment/square_webPay/square/square/src/SquareClient.php(327): Square\Apis\OAuthApi->__construct(Object(Square\SquareClient), Array, NULL)
#2 /includes/modules/payment/square_webPay.php(694): Square\SquareClient->getOAuthApi()
#3 /squareWebPay_handler.php(33): square_webPay->exchangeForToken('sq0cgp-kqtdUqf6...')
#4 {main}
thrown in /includes/modules/payment/square_webPay/square/square/src/Apis/BaseApi.php on line 64.

14 Oct 2022, 11:04 PM
#277
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square WebPay support thread.

carlwhat:

you have not properly uploaded all the files in the zip. specifically the directory here:

/MY_PATH/includes/modules/payment/square_webPay/

there are a number of directories and more files there. those are all required.

I uploaded all files, so missing files were not the problem.
I found the reason why I can not see the WebPay module and get aforementioned error:
When I am on PHP-version 8.0.17 I get an error.
Switching to PHP 7.4.28, I do not get an error and the module shows up.

15 Oct 2022, 12:19 AM
#278
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

todoonada:

I uploaded all files, so missing files were not the problem.
I found the reason why I can not see the WebPay module and get aforementioned error:
When I am on PHP-version 8.0.17 I get an error.
Switching to PHP 7.4.28, I do not get an error and the module shows up.

i have an already installed version of square web pay on my development server. if i switch my dev box to run php 8.0.20, i am able to process orders without problem. according to the square docs, the api version i used is good up to square 8.0.

if i click remove and remove the square webPay module, zc removes the module no problem. and it still shows up. i am then able to re-install it.

again, my dev machine is running v157 (latest codebase) and php 8.0.20.

your error above suggests a missing class file. specifically:

includes/modules/payment/square_webPay/square/square/src/Environment.php.

in fact, if i remove that file from my system, i receive the following error:

[14-Oct-2022 17:14:41 America/Los_Angeles] PHP Fatal error:  Uncaught Error: Class "Square\Environment" not found in /var/www/zcdev/includes/modules/payment/square_webPay.php:107
Stack trace:
#0 /var/www/zcdev/admin/modules.php(204): square_webPay->__construct()
#1 /var/www/zcdev/admin/index.php(11): require('...')
#2 {main}
  thrown in /var/www/zcdev/includes/modules/payment/square_webPay.php on line 107

[14-Oct-2022 17:14:41 America/Los_Angeles] Request URI: /admin/index.php?cmd=modules&set=payment, IP address: 192.168.14.74
--> PHP Fatal error: Uncaught Error: Class "Square\Environment" not found in /var/www/zcdev/includes/modules/payment/square_webPay.php:107
Stack trace:
#0 /var/www/zcdev/admin/modules.php(204): square_webPay->__construct()
#1 /var/www/zcdev/admin/index.php(11): require('...')
#2 {main}
  thrown in /var/www/zcdev/includes/modules/payment/square_webPay.php on line 107.

looks pretty similar to your error. in fact, i would say the same.

i am happy that you got it working. but for anyone reading this thread, this module has been tested on php 8.0 and this module works without issue on that version of php.

best.

15 Oct 2022, 12:23 AM
#279
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

@pazdar

on your square dashboard, what version of the api are you using?

you should be on:

API version
2022-02-16

i am not sure if that is your problem, but i would start there.

best.

15 Oct 2022, 12:34 AM
#280
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

pazdar:

--> PHP Fatal error: Uncaught Error: Class 'Unirest\Request' not found in /includes/modules/payment/square_webPay/square/square/src/Apis/BaseApi.php:64

is this file on your server:

includes/modules/payment/square_webPay/apimatic/unirest-php/src/Unirest/Request.php