have you done this part here:
https://docs.zen-cart.com/user/payme...e-web-payments
your access token is bad...
have you done this part here:
https://docs.zen-cart.com/user/payme...e-web-payments
your access token is bad...
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
2. And then (click on green button)
I do that and I get a blank screen with this address:
https://www.pazdarwinery.com/squareW...1f13ed7ce4#_=_
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
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=932ee36d66d8eff178bf665e995eebc5 5857a15ee927e385822656fe450d2cbd, 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.
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:
looks pretty similar to your error. in fact, i would say the same.Code:[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.
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.
@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.
Bookmarks