Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
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:
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.
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.
Thank you.
includes/modules/payment/square_webPay/square/square/src/Environment.php is there, size is 236B.
I also tested on my local testing Apache with PHP 8.0.15. Same error:
Code:
PHP Fatal error: Uncaught Error: Class "Square\Environment" not found in /home/tim/zencartNewSisa/zencart1.5.6/includes/modules/payment/square_webPay.php:105
The module does not show up and the box on the right side of the payment modules list is missing.
PS: I do not have anything running yet. I just uploaded the files and checked if I can see the module.
PPS: I also checked with PHP 8.1. Get the same error.
Re: Square WebPay support thread.
includes/modules/payment/square_webPay.php line 846 creates the error log:
[15-Oct-2022 12:28:29 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Square\Models\Order::__construct(), 0 passed in /home/cust/public_html/shop/includes/modules/payment/square_webPay.php on line 846 and exactly 1 expected in /home/cust/public_html/shop/includes/modules/payment/square_webPay/square/square/src/Models/Order.php:172
Perhaps instead of
return new Models\Order;
it should be
return null;
(This can happen in abnormal situations where the creation of all parts of the error didn't complete successfully.)
Re: Square WebPay support thread.
We installed this mod yesterday and had everything working and weren't experiencing any issues. Today we are seeing a lot of slowness / delay with the credit card fields populating and often times, the complete component doesn't load with the zip code field missing. I've linked some screenshots … just curious if anyone has run into this or has any ideas?
Image of credit card input after some delay - https://drive.google.com/file/d/16EU...ew?usp=sharing
Image of screen while it loads .. almost takes 10 seconds or more sometimes - https://drive.google.com/file/d/1DuD...ew?usp=sharing
Re: Square WebPay support thread.
Hello carlwhat,
about thePHP Fatal error: Uncaught Error: Class "Square\Environment" not found in /home/tim/zencartNewSisa/zencart1.5.7/includes/modules/payment/square_webPay.php:105
error:
When I uploaded the files for WebPay, I was already on PHP 8.0. I switched the version of PHP several times (8.0 to 7.4 and back and forth). Then I saw that the error message changed while on PHP 8.0. It was
Use of undefined constant MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE - assumed 'MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE'
now. The WebPay module still did not show up in the payment modules.
I then applied the code you gave here https://www.zen-cart.com/showthread....47#post1388847
and the module showed up under PHP 8.0.
I got exactly the same files/code running on my local server. On my local server I run PHP 8 and I can not change between PHP 8 and 7. The module still is not showing up on my local server. No files missing. Same files like on my live server.
Now it looks like uploading the files under PHP 8 caused the problem. Uploading the files under PHP 7 and the upgrading to PHP 8 worked (after applying your changed code).
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
Hello carlwhat,
about thePHP Fatal error: Uncaught Error: Class "Square\Environment" not found in /home/tim/zencartNewSisa/zencart1.5.7/includes/modules/payment/square_webPay.php:105
error:
When I uploaded the files for WebPay, I was already on PHP 8.0. I switched the version of PHP several times (8.0 to 7.4 and back and forth). Then I saw that the error message changed while on PHP 8.0. It was
Use of undefined constant MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE - assumed 'MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE'
now. The WebPay module still did not show up in the payment modules.
I then applied the code you gave here
https://www.zen-cart.com/showthread....47#post1388847
and the module showed up under PHP 8.0.
I got exactly the same files/code running on my local server. On my local server I run PHP 8 and I can not change between PHP 8 and 7. The module still is not showing up on my local server. No files missing. Same files like on my live server.
Now it looks like uploading the files under PHP 8 caused the problem. Uploading the files under PHP 7 and the upgrading to PHP 8 worked (after applying your changed code).
- glad you got it figured out.
- you seem like a smart guy. i know you can figure out other things associated with the module and any problems you may encounter.
- my apologies that i have not uploaded a new version of this software. i do have those changes in my latest version. i just have a number of other things on my plate that need to get done prior to doing any updates.
- please note that the current version will NOT work with php 8.2.
- it will also NOT work with php 8.1.
best.
Re: Square WebPay support thread.
Thank you, I'm running 1.0.1 according to module on my admin site. I was missing apimoto file which I could swear I had loaded previously. I reloaded that file, ran a dummy order and it appears to have worked.
Re: Square WebPay support thread.
Quote:
Originally Posted by
pazdar
Thank you, I'm running 1.0.1 according to module on my admin site. I was missing apimoto file which I could swear I had loaded previously. I reloaded that file, ran a dummy order and it appears to have worked.
:thumbsup:
Re: Square WebPay support thread.
I have a question about the language displayed. I translated the file square_webPay.php, but in the shop it still displays English in the input fields for "Card Number" and "MM/YY". I would like to translate those and the hints below ("Enter card number", etc), but do not know where I can do that.
File is of course uploaded and all files are in the correct folders.
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
File is of course uploaded and all files are in the correct folders.
:laugh::laugh:
of course they are....
that information you are seeing is coming from square using javascript. there is no translation possible from the ZC side.
it does seem like one could set the locale.
that would need to get done here:
includes/modules/pages/checkout_payment/jscript_square_webPay.php
unfortunately, i do not have the time to explore that at this moment. other projects await...
perhaps some other adventurous soul from this board might find out how to that and graciously post the results back.
best.
Re: Square WebPay support thread.
Thanks for your quick answer. I feared I would not have direct influence by changing any language file.
I tried changing the browser language and OS language, but it was still in English.
I will look into the link and file you gave me.