Re: Square WebPay support thread.
carlwhat - I'm getting Square Alert error:
Code:
Jun-18-2022 02:53:15
=================================
Error Dump: [ACCESS_TOKEN_EXPIRED]: The provided OAuth access token has expired. You must renew the access token via the Renew Access Token endpoint.
Sent to Square: SquareModelsCreatePaymentRequest Object
(
[sourceId:SquareModelsCreatePaymentRequest:private] => cnon:LETTERNUMBERCODE
[idempotencyKey:SquareModelsCreatePaymentRequest:private] => LETTERNUMBERCODE
[amountMoney:SquareModelsCreatePaymentRequest:private] => SquareModelsMoney Object
(
[amount:SquareModelsMoney:private] => ####
[currency:SquareModelsMoney:private] => USD
)
[tipMoney:SquareModelsCreatePaymentRequest:private] =>
[appFeeMoney:SquareModelsCreatePaymentRequest:private] =>
[delayDuration:SquareModelsCreatePaymentRequest:private] =>
[autocomplete:SquareModelsCreatePaymentRequest:private] =>
[orderId:SquareModelsCreatePaymentRequest:private] =>
[customerId:SquareModelsCreatePaymentRequest:private] =>
[locationId:SquareModelsCreatePaymentRequest:private] => LV7VYYRF6PYHC
[teamMemberId:SquareModelsCreatePaymentRequest:private] =>
[referenceId:SquareModelsCreatePaymentRequest:private] =>
[verificationToken:SquareModelsCreatePaymentRequest:private] => verf:LETTERNUMBERCODE
[acceptPartialAuthorization:SquareModelsCreatePaymentRequest:private] =>
[buyerEmailAddress:SquareModelsCreatePaymentRequest:private] => EMAIL######################
[billingAddress:SquareModelsCreatePaymentRequest:private] => SquareModelsAddress Object
(
[addressLine1:SquareModelsAddress:private] =>
[addressLine2:SquareModelsAddress:private] =>
[addressLine3:SquareModelsAddress:private] =>
[locality:SquareModelsAddress:private] =>
[sublocality:SquareModelsAddress:private] =>
[administrativeDistrictLevel1:SquareModelsAddress:private] =>
[postalCode:SquareModelsAddress:private] =>
[country:SquareModelsAddress:private] =>
)
[shippingAddress:SquareModelsCreatePaymentRequest:private] => SquareModelsAddress Object
(
[addressLine1:SquareModelsAddress:private] =>
[addressLine2:SquareModelsAddress:private] =>
[addressLine3:SquareModelsAddress:private] =>
[locality:SquareModelsAddress:private] =>
[sublocality:SquareModelsAddress:private] =>
[administrativeDistrictLevel1:SquareModelsAddress:private] =>
[postalCode:SquareModelsAddress:private] =>
[country:SquareModelsAddress:private] =>
)
[note:SquareModelsCreatePaymentRequest:private] => CUSTOMER_ORDER_INFORMATION Vinyl Decal Superstore
[statementDescriptionIdentifier:SquareModelsCreatePaymentRequest:private] =>
[cashDetails:SquareModelsCreatePaymentRequest:private] =>
[externalDetails:SquareModelsCreatePaymentRequest:private] =>
)
Also a debug log:
Code:
[18-Jun-2022 15:00:30 America/Chicago] Request URI: /VDSstore/ADMINFOLDER/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: 152.97.210.26
#1 square_webPay->getLocationsPulldownArray() called at [/includes/modules/payment/square_webPay.php:1405]
#2 zen_cfg_pull_down_squareWebPay_locations() called at [/ADMINFOLDER/modules.php(335) : eval()'d code:1]
#3 eval() called at [/ADMINFOLDER/modules.php:335]
#4 require(/ADMINFOLDER/modules.php) called at [/ADMINFOLDER/index.php:11]
--> PHP Warning: Invalid argument supplied for foreach() in /includes/modules/payment/square_webPay.php on line 794.
From our correspondence "the squareWebPay_handler.php renews the token". For some reason, my file is not renewing the token.
I've gone to my square account and "replaced" the token manually. Is there more I need to do for this to work next time?
Thank you.
Re: Square WebPay support thread.
hi @VdecalS,
i would take a re-look at my email to you on 5/18. i made a change to your squareWebPay_handler.php. that change is why your token never gets renewed.
you could change it to the live version of the handler, but then we potentially run back into the problem of getting those "Whoops..." timeout errors.
again, you are the only run reporting that timeout issue which suggests to me the issue is with your code base or potentially a server configuration.
a potential solution would be to to create a cronjob to automatically renew your token (which should be documented somewhere around here), but we would have to use the live version of the handler for that. it's not a big deal, but it is a bit of an administration issue as you would have a modified version of the handler file different from everyone else (which in fact you already do).
you can see about setting up a cronjob here:
https://www.zen-cart.com/content.php...ection%20above.
i hope that helps.
best.
1 Attachment(s)
Re: Square WebPay support thread.
The cron settings will need to be reviewed with your host for accuracy as there are differrent methods depending on the server, wheether or not you are using cPanel (or Similar), and OS version.
For a litespeed server, the latest linux, and cPanel myzencarthost.com uses:
Attachment 20036
Re: Square WebPay support thread.
Also, as a quick stop gap till the cron is working, customers have reported that simply entering your_site.com/squareWebPay_handler.php will reset things IF you see a blank screen returned.
A "This site can't be reached" being returned indicates non-completion generally due to the OAuth Production Redirect URL being incorrect at your Square account.
Re: Square WebPay support thread.
Have just installed Square WebPay and the Production API version for WebPay in Square dev website obviously defaults to the latest version (2022-06-16 as of today), I suspect that this should be rolled back to the API version that Square WebPay v1.01 was designed for i.e. 2022-02-16, is that so?
Re: Square WebPay support thread.
Quote:
Originally Posted by
simon1066
Have just installed Square WebPay and the Production API version for WebPay in Square dev website obviously defaults to the latest version (2022-06-16 as of today), I suspect that this should be rolled back to the API version that Square WebPay v1.01 was designed for i.e. 2022-02-16, is that so?
yes. that is correct.
Re: Square WebPay support thread.
Just wondering.
Since the updates to the API version have not touched the Web Payments SDK since, the original 2022-02-16, isn't it safe to go to the latest?
Or should we (those of us owners/developers out there) be watching the Payments API changes?
Several of our (myzencarthost) customers are using the latest with none of the problems being reported elsewhere (e.g. tokens, redirect URL, line 239 errors, etc.).
No problems have been reported from upgrading the API version on the old Square mod. Even with one using the API version after 2022-02-16.
Chart for this is at https://developer.squareup.com/docs/changelog/connect.
Re: Square WebPay support thread.
Square setup (on Square DEV APP) set up, with PRODUCTION APPLICATION ID, SECRET and ACCESS TOKEN generated and the codes copied to notepad. Redirect URL set to point to https://mywebsite.co.uk/squareWebPay_handler.php
Install webpay module on website, and insert all the PRODUCTION codes.
But... I am getting: Square WebPay (Access Token needed) in red at the top (just above the EDIT button)
I have tried several things, including uninstalling and reinstalling the module and going through the above, but am still getting "Square WebPay (Access Token needed)"
Any ideas?
Re: Square WebPay support thread.
JMO
You might be on a test/development site that Square is not "seeing" as https://mywebsite.co.uk/squareWebPay_handler.php
Re: Square WebPay support thread.
Quote:
Originally Posted by
dbltoe
It's a live site.
(BTW - I have other sites using "old" square system about to be deprecated by square so I built this new site on all the latest ZC software and plugins).
Idea is to get this NEW site functioning properly with all payment modules configured.
New site is tagfactory . co . uk
I can post the error log if this helps...