Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
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.
who loves ya. look at the aforementioned file, add the set locale in the proper spot:
PHP Code:
document.addEventListener('DOMContentLoaded', async function () {
if (!window.Square) {
throw new Error('Square.js failed to load properly');
}
const payments = window.Square.payments(appId, locationId);
payments.setLocale('es');
let card;
that worked for me.
what other language codes would work, you would have to further examine the docs.
Re: Square WebPay support thread.
Thanks a lot. I will try it.
I read the link you gave me and it says about setLocale:
If this method is not called explicitly, the user's browser language specified by navigator.language will be used instead.
I use Vivaldi as browser and changed the UI language. Nothing happened. Still English display.I tried Firefox then and after changing the UI language there, the text was displayed in the desired language.
I should have tried another browser before wasting your time. Anyway I will try to force the locale, following your code sample.
Re: Square WebPay support thread.
I can confirm carlwhat's fix for Japanese.
Now the displayed language foe Square payment is Japanese, even if the UI language of the browser is not.
It works on Firefox, but not in Vivaldi. That seems to be a problem of Vivaldi, though.
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
I can confirm carlwhat's fix for Japanese.
Now the displayed language foe Square payment is Japanese, even if the UI language of the browser is not.
It works on Firefox, but not in Vivaldi. That seems to be a problem of Vivaldi, though.
どういたしまして
Re: Square WebPay support thread.
The WebPay module works great.
When I go to old orders which have been paid with the old Square payment module, I can not see what the customers ordered. I get an error
PHP Fatal error: Uncaught Error: Undefined constant "MODULE_PAYMENT_SQUARE_APPLICATION_ID" in /includes/modules/payment/square.php:544
I followed the upgrade instructions here: https://docs.zen-cart.com/user/payment/square/
In those instructions a new application is created for the WebPay module on the Square site. So Application ID and Application Secret are different form the old application used for the old Square module. I guess this is the reason the old orders do not show up.
Now I wonder if I change Application ID and Application Secret in the new WebPay module to the former ID and Secret, the old order will be displayed again.
I just could try it, but I got the shop running and do not want to risk messing everything up.
SO I want to ask if anybody got experience with this.
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
The WebPay module works great.
When I go to old orders which have been paid with the old Square payment module, I can not see what the customers ordered. I get an error
PHP Fatal error: Uncaught Error: Undefined constant "MODULE_PAYMENT_SQUARE_APPLICATION_ID" in /includes/modules/payment/square.php:544
I followed the upgrade instructions here:
https://docs.zen-cart.com/user/payment/square/
In those instructions a new application is created for the WebPay module on the Square site. So Application ID and Application Secret are different form the old application used for the old Square module. I guess this is the reason the old orders do not show up.
Now I wonder if I change Application ID and Application Secret in the new WebPay module to the former ID and Secret, the old order will be displayed again.
I just could try it, but I got the shop running and do not want to risk messing everything up.
SO I want to ask if anybody got experience with this.
Have a look at post 131
It isn't strictly the correct way to do it as it doesn't fix the root cause but does solve the problem (if you don't need to keep track of which module was used to take the payment).
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
The WebPay module works great...
:thumbsup:
Re: Square WebPay support thread.
v1.0.2 has been released to the community, and i wanted to say a few words about it.
- if you are installing square webPay for the first time, this is the version to use.
- if you are currently running v1.0.1 with no errors, then there is NO need to upgrade.
- if you have having errors in your processing, v1.0.2 provides a little better help in troubleshooting.
- if your store is installed in a subfolder, then you should definitely upgrade to v1.0.2.
- if you are looking for a language other than english, then v1.0.2 is definitely the way to go.
allow me to say a few things about some of these issues.
square makes use of two tokens; one is the OAuth token, the other token is for the specific customer transaction and points to the cardholder information on the square servers. if you are having problems with your OAuth token, that means the merchant can not process ANY transactions. if you have problems with the cardholder token, that is for the individual transaction.
if you have followed this thread, you may have noticed that there was a lot of work done to ensure that square plays nice with OPC. that problem was with the cardholder token. if you are running into problems with the handler that problem is with your OAuth token.
in general, cardholder token problems should come up on the console of the browser prior to final submittal to square. once submitted to square, any problems with processing the transaction will result in a message to your customer using the zen-cart message stack.
sporadic problems with cardholder tokens are most likely indicative of javascript problems. these can be quite difficult to troubleshoot.
with v1.0.2, problems with your OAuth token are much easier to troubleshoot. you can turn verbose to true in the squareWebPay_handler.php file, and logs will get generated that should point you to the problem.
with regards to international support; this is all done on the admin side by entering a 2 character locale setting. the download has docs on where to look for that code; however not all browsers provide international support via the locale setting. this is something that is WAY out of my arena for support; however based on some research on my part after a previous request, it seemed like an easy enough addition to the code. i would think that most major browsers have this feature; but again, way out of my arena for support if it does not work on a specific browser.
as always, support for this module is here on the forum.
best.
Re: Square WebPay support thread.
Installed the new 1.0.2 on 1.5.7d with OPC.
Getting
Code:
[30-Oct-2022 13:30:25 America/New_York] PHP Fatal error: Uncaught TypeError: Argument 1 passed to square_webPay::saveAccessToken() must be an instance of Square\Models\ObtainTokenResponse, instance of Square\Http\ApiResponse given, called in /includes/modules/payment/square_webPay.php on line 779 and defined in /includes/modules/payment/square_webPay.php:678
Stack trace:
#0 /includes/modules/payment/square_webPay.php(779): square_webPay->saveAccessToken(Object(Square\Http\ApiResponse))
#1 /includes/modules/payment/square_webPay.php(622): square_webPay->renewOAuthToken()
#2 /squareWebPay_handler.php(45): square_webPay->token_refresh_check(false)
#3 {main}
thrown in /includes/modules/payment/square_webPay.php on line 678
[30-Oct-2022 13:30:25 America/New_York] Request URI: /squareWebPay_handler.php, IP address: 68.##.##.122
--> PHP Fatal error: Uncaught TypeError: Argument 1 passed to square_webPay::saveAccessToken() must be an instance of Square\Models\ObtainTokenResponse, instance of Square\Http\ApiResponse given, called in /includes/modules/payment/square_webPay.php on line 779 and defined in /includes/modules/payment/square_webPay.php:678
Stack trace:
#0 /includes/modules/payment/square_webPay.php(779): square_webPay->saveAccessToken(Object(Square\Http\ApiResponse))
#1 /includes/modules/payment/square_webPay.php(622): square_webPay->renewOAuthToken()
#2 /squareWebPay_handler.php(45): square_webPay->token_refresh_check(false)
#3 {main}
thrown in /includes/modules/payment/square_webPay.php on line 678.
Re: Square WebPay support thread.
Another site with 1.0.2 and OPC gets a token warning when the customer has an autofill in Chrome for the CC and does not press enter on the CC Zip before clicking on the confirm order button.
Looks like we may have to work out a way for OPC to ensure the CC is fully active before the confirm order is clicked. You agree?