Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
...
I did not try your suggested solution yet, because I do not like to change anything while not knowing the reason. ...
it is hard for me to help you find a solution if you do not try the solutions i have already provided.
the error is coming from a call to json_encode. that method will return false if it can not properly encode the data provided to it. which most likely means that the data is not utf8 encoded.
i agree that i would be reluctant to implement a solution until i can accurately reproduce a problem; but given the frequency of your issue, i am not really sure what the downside is.
best.
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
it is hard for me to help you find a solution if you do not try the solutions i have already provided.
the error is coming from a call to json_encode. that method will return false if it can not properly encode the data provided to it. which most likely means that the data is not utf8 encoded.
i agree that i would be reluctant to implement a solution until i can accurately reproduce a problem; but given the frequency of your issue, i am not really sure what the downside is.
best.
The error is not very frequent. It happens from time to time.
The downside is that I do not want to potentially increase errors by changing code without knowing what causes the error.
What does the question mark do in
Code:
serialize($value): ?string
?
It does not solve the UTF8 error (if it is one).
I know you already mentioned that you think the <br /> tag is not the problem. I changed the tag -before I read your comment- to a hyphen.
Re: Square WebPay support thread.
I suspect that I know the answer to this but I will ask anyway...will this Square module work with zen 1.5.4?
Thanks
Rich
Re: Square WebPay support thread.
Quote:
Originally Posted by
rstar23
I suspect that I know the answer to this but I will ask anyway...will this Square module work with zen 1.5.4?
Thanks
Rich
no.
apologies.
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
more information is always better. i will try and take a look at this and see if i can reproduce it.
best.
Hello carlwhat,
I could not reproduce the error. I made some observations while checking the "Whos online" page of the shop.
I saw a customer checking out and it stayed awfully long at the squareWebPay_handler.php file. I expected another error of the same kind I described before, but after 20 seconds the file switched to checkout_success and there was no error and the order was successful.
A few days later I saw the same again, but even after 15 minutes, the file was still squareWebPay_handler.php. After this the customer was not visible on the "Whos online" page, because after 15 mins of inactivity, they are removed from the list. There was no error file in the log folder for this transaction and no successful order.
I checked the encoding of customer's data and the item he wanted to order, but could not find anything strange.
So I think that the error might come from people trying to reload the page or clicking the browser's back button, when it takes too long to show the checkout_success page and only a white page is displayed.
Re: Square WebPay support thread.
158
PHP 8.1
bootstrap clone
OPC
Code:
[13-Feb-2023 15:20:02 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 471.642.591.531, Language id 1#0 /includes/modules/payment/square_webPay/square/square/src/Models/Location.php(12): zen_debug_error_handler()
#1 /laravel/vendor/composer/ClassLoader.php(571): include('/home/haremark/...')
#2 /laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /includes/modules/payment/square_webPay.php(795): Composer\Autoload\ClassLoader->loadClass()
#4 /includes/modules/pages/checkout_payment/jscript_square_webPay.php(36): square_webPay->getLocationDetails()
#5 /includes/modules/pages/checkout_one/jscript_square_webPay.php(22): require('/home/frammer/...')
#6 /includes/templates/boot_clone/common/html_header.php(224): require('/home/frammer/...')
#7 /index.php(42): require('/home/frammer/...')
--> PHP Deprecated: Return type of Square\Models\Location::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /includes/modules/payment/square_webPay/square/square/src/Models/Location.php on line 807.
Should line 807 go from
Code:
public function jsonSerialize(bool $asArrayWhenEmpty = false)
to
Code:
#[\ReturnTypeWillChange]
public function jsonSerialize(bool $asArrayWhenEmpty = false)
or
Code:
public function jsonSerialize(bool $asArrayWhenEmpty = false):mixed
none of the above?
Re: Square WebPay support thread.
on the downloads page:
-- The square SDK has NOT changed (17.2.0.20220216), and only supports up to php 8.0.
Re: Square WebPay support thread.
Other than logs complaining about deprecation, it works.
Just FYI
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
more information is always better. i will try and take a look at this and see if i can reproduce it.
best.
Since I can not reproduce the error, I can only hope to see the error live on the "Whos online" list of active customers.
I just had another customer who was stuck at squareWebPay_handler.php for 30s.
It seems he went then back to checkout_confirmation and then was able to finish the credit card transaction. No error in the logs.
I think something is wrong on Square's or Square Japan's side.
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
Since I can not reproduce the error, I can only hope to see the error live on the "Whos online" list of active customers.
I just had another customer who was stuck at squareWebPay_handler.php for 30s.
It seems he went then back to checkout_confirmation and then was able to finish the credit card transaction. No error in the logs.
I think something is wrong on Square's or Square Japan's side.
i would have to run some more transactions. i am not sure why a customer would be stuck at the handler for 30s.
remind me of your setup with regards to OAuth renewal? specifically do you have an automated job set up like in the docs?
if you do not have a cronjob set up, i would set that up. if you do already have it set up, set $verbose to true, to see the results of it.
and how many orders paid by square are you getting each week?