Zen Cart Logo
Forums / Addon Payment Modules / Square WebPay support thread.

Square WebPay support thread.

Views: 128,153

Results 201 to 220 of 800
11 Jul 2022, 5:12 PM
#201
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Square WebPay support thread.

carlwhat:

how do you know i'm not already doing that? ...

That's good to hear - the customers in question are not exactly tech savvy and couldn't report on their experience.
I'm not positive what $error->getCode() is going to return - can we look for this particular message and say something like "try another card?"

11 Jul 2022, 5:33 PM
#202
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Square WebPay support thread.

one other detail when the url to the square handler is output, it no longer contains https according to this server. Can I assume this was the first problem? I checked square to make sure I had entered it with https and I did for sure.

I deleted and uploaded the mod again - looks like there was a problem with the upload before but now more sure of all files.

New error:
[11-Jul-2022 12:27:31 America/Chicago] PHP Fatal error: Uncaught Error: Class 'Square\Apis\OAuthApi' not found in /includes/modules/payment/square_webPay/square/square/src/SquareClient.php:327
Stack trace:
#0 /includes/modules/payment/square_webPay.php(699): Square\SquareClient->getOAuthApi()
#1 /squareWebPay_handler.php(33): square_webPay->exchangeForToken('sq0cgp-yqknT5yc...')
#2 {main}
thrown in /includes/modules/payment/square_webPay/square/square/src/SquareClient.php on line 327

[11-Jul-2022 12:27:31 America/Chicago] Request URI: /squareWebPay_handler.php?code=sq0cgp-yqknT5ycT7STIC6TiIdI7g&response_type=code&state=365182f3272e192f5b9fee7f9f0c33430, IP address: 76.179.90.49
--> PHP Fatal error: Uncaught Error: Class 'Square\Apis\OAuthApi' not found in /includes/modules/payment/square_webPay/square/square/src/SquareClient.php:327
Stack trace:
#0 /includes/modules/payment/square_webPay.php(699): Square\SquareClient->getOAuthApi()
#1 /squareWebPay_handler.php(33): square_webPay->exchangeForToken('sq0cgp-yqknT5yc...')
#2 {main}
thrown in /includes/modules/payment/square_webPay/square/square/src/SquareClient.php on line 327.

11 Jul 2022, 5:40 PM
#203
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

swguy:

That's good to hear - the customers in question are not exactly tech savvy and couldn't report on their experience.
I'm not positive what $error->getCode() is going to return - can we look for this particular message and say something like "try another card?"

can you please email the full log that you are getting?

i'm not really into giving generic error messages when we should have the exact detail of what went wrong.

that said, it is entirely possible that i am not providing that detailed message and that getCode and getDetail is not what i expect it to be.

i certainly am willing to add some notifiers so that you can override the message that goes to the messageStack is that works for you.

11 Jul 2022, 5:40 PM
#204
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Square WebPay support thread.

swguy:

@carlwhat is maintaining the Square plugin; please don't post information about your fork - it's disrespectful and confusing to new people.
I will immediately delete such posts.

so should I go back and delete/overwrite again with the original plugin file? I downloaded that fork.

11 Jul 2022, 7:41 PM
#205
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

delia:

so should I go back and delete/overwrite again with the original plugin file? I downloaded that fork.

delia,
i would re-download it either from the plugins here. or from the source which is here:

https://github.com/proseLA/square_webPay/releases/tag/v1.0.1

i would review the data here:

https://docs.zen-cart.com/user/payment/square/#upgrading-to-square-web-payments-from-square-payments-form

at some point i plan on redoing this handshake with the OAuth token. which is what the handler does. i personally find it problematic as well... i tried modeling it after the original square module, and now i am not really liking it. i had to get a new OAuth token myself the other day, and it took me forever! i think mostly because of the production v sandbox environment.

unfortunately i can not provide much help. but the idea that you have missing classes suggests to me you have not uploaded all of the code. on my install it finds it finds those classes no problem.

perhaps someone else can chime on getting the OAuth token.

best.

11 Jul 2022, 7:47 PM
#206
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

swguy:

That's good to hear - the customers in question are not exactly tech savvy and couldn't report on their experience.
I'm not positive what $error->getCode() is going to return - can we look for this particular message and say something like "try another card?"

ok, i have simulated a few errors. the details provided on this page:

https://developer.squareup.com/reference/square/enums/ErrorCode

are not available in the response.

in addition, it seems that the getDetail provides all of the information in the getCode method. so having both of those in the message could look confusing.

i will look into providing a config option so that a generic message could be chosen rather the specific message as opposed to doing a notifier. and then you can have a choice. hope that works for you.

when an error comes up here is what one can present back to the customer:

https://www.dropbox.com/s/vrh971v5ui8twaf/square_error_methods.png?dl=0

best.

12 Jul 2022, 8:54 PM
#207
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Square WebPay support thread.

whatever went wrong - I now have it working fine. That was the craziest crap I've ever run into. working between 2 different ftp programs and 2 different OS and weirdness and more weirdness. I'm thinking some caching was the issue somewhere.....

12 Jul 2022, 9:07 PM
#208
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

When this happens:

Your transaction failed due to an error: (access token expired) The provided OAuth access token has expired. You must renew the access token via the Renew Access Toke via the Renew Access Token Endpoint.

Can you detect it and email the store owner?

12 Jul 2022, 9:08 PM
#209
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

delia:

whatever went wrong - I now have it working fine. That was the craziest crap I've ever run into. working between 2 different ftp programs and 2 different OS and weirdness and more weirdness. I'm thinking some caching was the issue somewhere.....

:thumbsup:

12 Jul 2022, 9:08 PM
#210
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

swguy:

When this happens:

Your transaction failed due to an error: (access token expired) The provided OAuth access token has expired. You must renew the access token via the Renew Access Toke via the Renew Access Token Endpoint.

Can you detect it and email the store owner?

you are very demanding....

12 Jul 2022, 10:37 PM
#211
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

Yikes.

[12-Jul-2022 17:30:21 America/Chicago] PHP Fatal error: Uncaught TypeError: Argument 1 passed to square_webPay::saveAccessToken() must be an instance of Square\Models\ObtainTokenResponse, array given, called in /home/ccs/public_html/zen/includes/modules/payment/square_webPay.php on line 732 and defined in /home/ccs/public_html/zen/includes/modules/payment/square_webPay.php:644

Can't even see Webpay in the sidebar.

12 Jul 2022, 10:45 PM
#212
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

Resolution:

Edit URL in browser address bar to end in

action=delete

Then you can remove the module and add again.

13 Jul 2022, 11:43 AM
#213
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

I think the root cause was that I said disable the old OAuth secret right away (instead of waiting 24 hours as is done by default). So it may be best not to do that.

14 Jul 2022, 10:05 AM
#214
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

Re: Square WebPay support thread.

Not an issue, just an uncaught error for information. I think either my serves DNS was down or the square website was down. Log file below.

[13-Jul-2022 00:01:19 UTC] PHP Notice: Exception when calling OAuthApi->obtainToken: Could not resolve host: connect.squareup.com in /includes/modules/payment/square_webPay.php on line 733
[13-Jul-2022 00:01:19 UTC] PHP Fatal error: Uncaught Exception: Error Processing Request: Token renewal failed! in /includes/modules/payment/square_webPay.php:734
Stack trace:
#0 /includes/modules/payment/square_webPay.php(592): square_webPay->renewOAuthToken()
#1 /squareWebPay_handler.php(45): square_webPay->token_refresh_check()
#2 {main}
thrown in /includes/modules/payment/square_webPay.php on line 734

[13-Jul-2022 00:01:19 UTC] Request URI: , IP address: .
--> PHP Fatal error: Uncaught Exception: Error Processing Request: Token renewal failed! in /includes/modules/payment/square_webPay.php:734
Stack trace:
#0 /includes/modules/payment/square_webPay.php(592): square_webPay->renewOAuthToken()
#1 /squareWebPay_handler.php(45): square_webPay->token_refresh_check()
#2 {main}
thrown in /includes/modules/payment/square_webPay.php on line 734.

The token had not expired, I just have a cron job to renew it. I just went into admin>payments>squarewebpay and edited settings and updated with out making any changes. This renewed the access token.

14 Jul 2022, 2:02 PM
#215
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

brittainmark:

Not an issue, just an uncaught error for information. I think either my serves DNS was down or the square website was down. Log file below.

[13-Jul-2022 00:01:19 UTC] PHP Notice: Exception when calling OAuthApi->obtainToken: Could not resolve host: connect.squareup.com in /includes/modules/payment/square_webPay.php on line 733
[13-Jul-2022 00:01:19 UTC] PHP Fatal error: Uncaught Exception: Error Processing Request: Token renewal failed! in /includes/modules/payment/square_webPay.php:734
Stack trace:
#0 /includes/modules/payment/square_webPay.php(592): square_webPay->renewOAuthToken()
#1 /squareWebPay_handler.php(45): square_webPay->token_refresh_check()
#2 {main}
thrown in /includes/modules/payment/square_webPay.php on line 734

[13-Jul-2022 00:01:19 UTC] Request URI: , IP address: .
--> PHP Fatal error: Uncaught Exception: Error Processing Request: Token renewal failed! in /includes/modules/payment/square_webPay.php:734
Stack trace:
#0 /includes/modules/payment/square_webPay.php(592): square_webPay->renewOAuthToken()
#1 /squareWebPay_handler.php(45): square_webPay->token_refresh_check()
#2 {main}
thrown in /includes/modules/payment/square_webPay.php on line 734.

The token had not expired, I just have a cron job to renew it. I just went into admin>payments>squarewebpay and edited settings and updated with out making any changes. This renewed the access token.

i'm guessing your DNS was down.

perhaps i do not need to throw the exception. current code is:

            } catch (Exception $e) {
                trigger_error('Exception when calling OAuthApi->obtainToken: ' . $e->getMessage());
                throw new Exception('Error Processing Request: Token renewal failed!', 1);
            }

i will think and play around a bit.

thanks for the report!

15 Jul 2022, 2:03 AM
#216
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

for those of you who have helped me with debugging problems, i want to express my thanks.

for those of you who attempted to brow beat me into submission, i say bugger off!

if you do not know which group you are in, feel free to DM me.

for those of you still having problems with OPC and square_webPay, i want to refer you to this post, and specifically this github issue which will be corrected in the soon to be released version of OPC.

no change is necessary for square_webPay to play nice with OPC.

individuals who i privately contacted about testing, please change this file:

https://github.com/lat9/one_page_checkout/blob/master/includes/modules/pages/checkout_one/jquery.checkout_one.js

and it's minimized version:

https://github.com/lat9/one_page_checkout/blob/master/includes/modules/pages/checkout_one/jquery.checkout_one.min.js

to the released version; once released.

while your testing confirmed all of my debugging, keeping everyone on the released version of OPC is better for support in the long run.

other cleanup of square_webPay (including better handling of the OAuth handshake) may happen in the future. development does not happen without support.

best.

15 Jul 2022, 11:55 AM
#217
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

if you do not know which group you are in, feel free to DM me.

So old school. Clearly you should build a Wiki or something so an asynchronous determination can be made.

15 Jul 2022, 7:05 PM
#218
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

Re: Square WebPay support thread.

I am aware of which group I am in...

15 Jul 2022, 10:40 PM
#219
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square WebPay support thread.

Yeah but, I'm in all three. :cheers:

18 Jul 2022, 10:19 PM
#220
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square WebPay support thread.

1.5.7d PHP 7.4.3

Site is running the latest Github versions of WebPay and OPC.

Single files previously changed in OPC were overwritten as instructed.

This has shown up three times during a time span when 47 successful WebPay captures were made.```
[18-Jul-2022 10:22:43 America/New_York] PHP Notice: missing token result: check if card button is disabled on dev console using: document.getElementById('card-button'); else look for javascript error in console. in /includes/modules/payment/square_webPay.php on line 239