hi brian,
square is not really developer friendly. here you have a person asking for some help, and you want to know if they are using the official zencart square implementation? have you investigated that link? zen-cart 1.5.4 was released in 2014 and is no longer supported. the current zen-cart version is 1.5.8. php 5.6 was EOL 12/2018. and yet that is what square has on their official zen-cart integration? on the link you have provided?
what you have listed there is the integration based on the SqPaymentForm library; which square retired 10/2022.
the new official
zen-cart square integration is based on the square web payments sdk. and i developed it as courtesy to the zen-cart community. the plugin is listed here.
and it is officially
listed in the docs here.
despite supporting all of the zen-cart community that relies on this plugin, square refuses to even grant me an affiliate link to allow me to continue development of the module, and the zen-cart community financial support is minimal at best.
considering the amount of financial transactions processed through square using code developed by me, and supported by me, why do you think that is?
with regards to the problem experienced here by todoonada, i have already done some troubleshooting on it. and frankly, i do not understand your question:
“Do they know what’s being returned as a boolean instead of a string?”
what does that mean? a boolean is being returned. probably false
. the real question is why is a boolean being returned? the version that he is running has a json_encode call on line 113. and what is being submitted there are the complete order details as an array (from what i remember). and json_encode will return false if it can not properly encode the array. which most likely means some of the data submitted by the store owner was not properly utf8 encoded.
unfortunately todoonada can not provide all of the input array that is causing the error, which makes fixing it pure guess work. i would say that it is squares’ responsibility for catching any errors on failures with json_encode, but for all i know a more current version of your sdk does that. without financial support from the zen-cart community or from square, it makes keeping up with all of the latest sdks another charity project that i am less inclined to do.
does that make any sense?
best.