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

Square WebPay support thread.

Views: 128,153

Results 221 to 240 of 800
19 Jul 2022, 12:32 AM
#221
carlwhat avatar

carlwhat

zennedOut

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

Square WebPay support thread.

carlwhat:

...

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.

....

dbltoe:

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


please reread my instructions above.

**no change is necessary to the latest released version of OPC.**

this file should run without problem as testing has been done:

<https://github.com/lat9/one_page_checkout/blob/v2.4.2/includes/modules/pages/checkout_one/jquery.checkout_one.js>

its minimized version should work as well (i am not a fan of minimized versions, especially when code is sporadically spewing errors):

<https://github.com/lat9/one_page_checkout/blob/v2.4.2/includes/modules/pages/checkout_one/jquery.checkout_one.min.js>

i have seen you reporting issues with OPC.  again, this problem is an OPC problem, not a square_webPay  (SWP) problem.

OPC (with comments) has over 1000 lines of javascript.    SWP (with comments) has under 200 lines of javascript.

no one using the standard checkout reports problems with SWP.  with OPC, there are a few...

but again, i am reasonably confident that I have found the root of this problem, and that it has been addressed in the OPC code.

i am not 100% confident that you are running the latest version of said code.  and especially given that you have modified it which should no longer be needed.
19 Jul 2022, 4:17 AM
#222
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.

As you may recall, I was part of that troubleshooting.

And, just for clarification, most of today's reputable FTP programs, when told to overwrite, will do just that.

Again, both OPC and WebPay are loaded with their current GitHub versions.

19 Jul 2022, 4:28 AM
#223
barco57 avatar

barco57

Totally Zenned

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

Re: Square WebPay support thread.

dbltoe:

And, just for clarification, most of today's reputable FTP programs, when told to overwrite, will do just that.
Good to know...:smartalec:

20 Jul 2022, 2:50 PM
#224
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

carlwhat:

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.

Does this correct the problem with the radio button?

I have upgraded OPC and I am still getting the same issue

21 Jul 2022, 8:46 PM
#225
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

I have just had this email through from Square:

Hi there,

We wanted to inform you that the SqPaymentForm JavaScript library retirement has been extended to 2022-10-31 and its functionality will be shut off after this date. Additionally new applications will not be allowed to use SqPaymentForm from 2022-07-21.

SqPaymentForm has been deprecated since 2021-05-13 and replaced by Web Payments SDK. We encourage you to migrate as soon as possible by following this step-by-step migration guide.

Check out the Web Payments SDK documentation and technical reference to get started today.

If you have any questions, drop us a note in our Developer Forums.

Thank you,

The Square Developer Team


This means that the old Square Module should work until 31st October 2022. So it gives the developers of Square WebPay and OPC time to correct any bugs between the functionality of the two modules from either side of the fence. Hopefully this means there can be a little less stress around the timescales of getting bugs resolved, and we will then get a NEW Square WebPay Module that works happily across the standard Zen Cart Checkout AND One Page Checkout.

21 Jul 2022, 9:57 PM
#226
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

Nick1973:

I have just had this email through from Square:

Hi there,

We wanted to inform you that the SqPaymentForm JavaScript library retirement has been extended to 2022-10-31 and its functionality will be shut off after this date. Additionally new applications will not be allowed to use SqPaymentForm from 2022-07-21.

SqPaymentForm has been deprecated since 2021-05-13 and replaced by Web Payments SDK. We encourage you to migrate as soon as possible by following this step-by-step migration guide.

Check out the Web Payments SDK documentation and technical reference to get started today.

If you have any questions, drop us a note in our Developer Forums.

Thank you,

The Square Developer Team


This means that the old Square Module should work until 31st October 2022. So it gives the developers of Square WebPay and OPC time to correct any bugs between the functionality of the two modules from either side of the fence. Hopefully this means there can be a little less stress around the timescales of getting bugs resolved, and we will then get a NEW Square WebPay Module that works happily across the standard Zen Cart Checkout AND One Page Checkout.

I will add, I am still having token problems with the latest Square WebPay and OPC despite trying the various downloads from GitHub and from Modules. I have tried all the various fixes which are supposed to work, but unfortunately don't or they don't appear to. If there is fix for the radio button issue, I do not have it and have not been able to find it. This issue arises when a customer enters their Credit Card Details before selecting the Credit Card Radio Button at the checkout. The payment is not taken and it results in a 'TOKEN' error. However, it only happens when using One Page Checkout, and NOT the standard Zen Cart Checkout. This is why I have now resorted back to the OLD Square Module, until BOTH modules have this fixed.

22 Jul 2022, 7:16 AM
#227
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square WebPay support thread.

Nick1973:

I will add, I am still having token problems with the latest Square WebPay and OPC despite trying the various downloads from GitHub and from Modules. I have tried all the various fixes which are supposed to work, but unfortunately don't or they don't appear to. If there is fix for the radio button issue, I do not have it and have not been able to find it. This issue arises when a customer enters their Credit Card Details before selecting the Credit Card Radio Button at the checkout. The payment is not taken and it results in a 'TOKEN' error. However, it only happens when using One Page Checkout, and NOT the standard Zen Cart Checkout. This is why I have now resorted back to the OLD Square Module, until BOTH modules have this fixed.

This is probably of no help to you but further to the debugging I carried out on Github I have double-checked the fix that was provided with the customer interaction you describe above.

ZC v1.5.7d
OPC v2.4.1
PayPal EC
Square WebPay v1.0.1

Using the revised version of jquery.checkout_one.js as outlined in this Github issue (this revised file is now in OPC v2.4.2), I continue to **not **get the 'TOKEN' error.

I have yet to upgrade my live site to OPC v2.4.2 (other than the revised .js file), once I do I will obviously check again and report if the issue raises it's ugly head again.

22 Jul 2022, 8:22 AM
#228
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

simon1066:

This is probably of no help to you but further to the debugging I carried out on Github I have double-checked the fix that was provided with the customer interaction you describe above.

ZC v1.5.7d
OPC v2.4.1
PayPal EC
Square WebPay v1.0.1

Using the revised version of jquery.checkout_one.js as outlined in this Github issue (this revised file is now in OPC v2.4.2), I continue to **not **get the 'TOKEN' error.

I have yet to upgrade my live site to OPC v2.4.2 (other than the revised .js file), once I do I will obviously check again and report if the issue raises it's ugly head again.

Ok I will obviously hang on until I delete OPC and SquareWebPay to try again. Are you using Bootstrap?

22 Jul 2022, 8:29 AM
#229
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square WebPay support thread.

Nick1973:

Ok I will obviously hang on until I delete OPC and SquareWebPay to try again. Are you using Bootstrap?

I am not using a Bootstrap template. I guess if you are concerned about that then switching to a Classic termplate might help.

22 Jul 2022, 8:59 AM
#230
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

simon1066:

I am not using a Bootstrap template. I guess if you are concerned about that then switching to a Classic termplate might help.

Not an option really due to all the work involved in recreating the whole thing from scratch. I'd lose alot of optimisation work and it would literally screw my business even further.

22 Jul 2022, 11:37 AM
#231
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square WebPay support thread.

Nick1973:

Not an option really due to all the work involved in recreating the whole thing from scratch. I'd lose alot of optimisation work and it would literally screw my business even further.

I guess I was thinking that switching templates temporarily might help establish if it's your template that's causing the issue - presumably it's ZCA Bootstrap Template for One-Page Checkout. I don't know enough about that template to know if it might be a thing.

26 Jul 2022, 1:13 PM
#232
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Square WebPay support thread.

simon1066:

I guess I was thinking that switching templates temporarily might help establish if it's your template that's causing the issue - presumably it's ZCA Bootstrap Template for One-Page Checkout. I don't know enough about that template to know if it might be a thing.

I have a client that is using Responsive Classic and he is also getting the issue when OPC is enabled.

30 Jul 2022, 6:39 PM
#233
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Location:
Sparta, TN
Posts:
166
Plugin Contributions:
0

Re: Square WebPay support thread.

Zen Cart 1.5.7d
Database Patch Level: 1.5.7b
Clone A Template: Responsive clone
Sitemap XML v4.0
PayPal Express Checkout (Debug)
Square WebPay 1.0.0

I got a debug log:

[26-Jul-2022 11:03:06 America/Chicago] PHP Notice: missing token result: {"main_page":"checkout_confirmation","securityToken":"75f23328f7c105dabb0dd6620335df67","action":"submit","payment":"square_webPay","comments":"","x":"42","y":"18"} in /includes/modules/payment/square_webPay.php on line 234

I logged into my Square account and realized maybe I forgot to renew my token because there was a notice that my API version was two (2) behind. Changed API version to latest and replaced token.

Today I got a debug log:

[30-Jul-2022 07:10:14 America/Chicago] Request URI: /VDSstore/ADMIN/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: 152.97.210.26
#1  square_webPay->getLocationsPulldownArray() called at [/home/vinyld6/public_html/VDSstore/includes/modules/payment/square_webPay.php:1405]
#2  zen_cfg_pull_down_squareWebPay_locations() called at [/home/vinyld6/public_html/VDSstore/ADMIN/modules.php(335) : eval()'d code:1]
#3  eval() called at [/home/vinyld6/public_html/VDSstore/ADMIN/modules.php:335]
#4  require(/home/vinyld6/public_html/VDSstore/ADMIN/modules.php) called at [/home/vinyld6/public_html/VDSstore/ADMIN/index.php:11]
--> PHP Warning: Invalid argument supplied for foreach() in /home/vinyld6/public_html/VDSstore/includes/modules/payment/square_webPay.php on line 794.

I also received a square alert:

Jul-30-2022 04:15:44
Error Dump: [UNAUTHORIZED]: The `Authorization` http header of your request was incorrect or expired. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is a valid access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__ ....

Most of my sales are paid via PayPal. I have been renewing my Square token manually every 10 days via my Square account. It worked 07/03/2022 just a few orders ago. It seems there something else I need to be doing to get square payments to come through with the new API version, like setting the headers.

I'm just not sure how or where to do this. Can someone offer me a little guidance where I can find the header to change the API version? Should I go back to my previous API version through Square? Could I have just forgotten to checkbox the "Change my webhook endpoints to use this API version" while in Square? When done, what would be the recommended way to check that all is working?

TIA

31 Jul 2022, 10:34 PM
#235
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

VDecalS:

Today I got a debug log:

[30-Jul-2022 07:10:14 America/Chicago] Request URI: /VDSstore/ADMIN/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: 152.97.210.26
#1 square_webPay->getLocationsPulldownArray() called at [/home/vinyld6/public_html/VDSstore/includes/modules/payment/square_webPay.php:1405]
#2 zen_cfg_pull_down_squareWebPay_locations() called at [/home/vinyld6/public_html/VDSstore/ADMIN/modules.php(335) : eval()'d code:1]
#3 eval() called at [/home/vinyld6/public_html/VDSstore/ADMIN/modules.php:335]
#4 require(/home/vinyld6/public_html/VDSstore/ADMIN/modules.php) called at [/home/vinyld6/public_html/VDSstore/ADMIN/index.php:11]
--> PHP Warning: Invalid argument supplied for foreach() in /home/vinyld6/public_html/VDSstore/includes/modules/payment/square_webPay.php on line 794.


hi @VDecalS,
from what i remember you have a sessions issue that prevents the automatic renewal of the OAuth token.  that issue was well documented here:

<https://www.zen-cart.com/showthread.php?228750-Square-WebPay-support-thread&p=1388439&highlight=SESSION#:~:text=standard%203%20page,is%20unexpected%20behavior>.

so i am not sure if that part of your equation was eventually resolved.  because of that problem, you have to manually renew your OAuth token; as we changed your handler (if my memory serves me correctly).

in addition, looking at this log file, you have quoted, foreach and line 794 is version 1.0.0.  i would update to 1.0.1, with the exception of the handler file.

i think @swguy's solution is a bit of a hack; but if it works, i think it is fine for now.

i have plans to do some refactoring and updating of the module, and specifically with the handling of production v sandbox environments as well as the renewal of the tokens.  unfortunately i'm currently a little strapped for time and perhaps a bit un-motivated.  but we will see....

glad you were able to get it working!
1 Aug 2022, 1:54 PM
#236
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Location:
Sparta, TN
Posts:
166
Plugin Contributions:
0

Re: Square WebPay support thread.

Hi carlwhat,

I've gotten a new order with cc payment, so everything is working now. Manually renewing my OAuth token is working for me. Updating the API version was simple enough. Updating/replacing the OAuth secret to match the new API version just skipped my train of thinking. This make complete sense to me now that I've experienced the result.

Thanks for the query. :hug:

1 Aug 2022, 3:59 PM
#237
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 @swguy's solution is a bit of a hack; but if it works, i think it is fine for now.

@dbltoe and @carlwhat:

If there's an easier way, please write it up so I can add it to the documentation.

1 Aug 2022, 5:57 PM
#238
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Location:
Sparta, TN
Posts:
166
Plugin Contributions:
0

Re: Square WebPay support thread.

Hi Scott,

I didn't see it as a hack.

I think the only clarification to the instructions: https://docs.zen-cart.com//user/payment/square_errors/
would be a step 5: Save

Everything after that is only necessary if you get the blank screen. Perhaps that portion of the remaining instructions should be boxed or indented or ?. Though I didn't have a problem understanding the instructions, others might.

Your post helped me get to an understanding of the process. - Thanks!

1 Aug 2022, 7:07 PM
#239
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.

swguy:

@dbltoe and @carlwhat:

If there's an easier way, please write it up so I can add it to the documentation.
As I stated on GitHub, I have no knowledge of the process with WebPay as I have not had a token expire. We did ours different under the original Square but I am not privy to any of the steps for WebPay.

2 Aug 2022, 12:42 AM
#240
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

carlwhat:

i think @swguy's solution is a bit of a hack; but if it works, i think it is fine for now.

i have plans to do some refactoring and updating of the module, and specifically with the handling of production v sandbox environments as well as the renewal of the tokens. unfortunately i'm currently a little strapped for time and perhaps a bit un-motivated. but we will see....

hi @swguy,
i have looked at what you wrote up and i think it is fine. when i initially read it, i thought one was removing files and then re-uploading them.

the bigger issue to me is a more elegant way of handling this situation with the code. which is why i think a refactor may be in order...

but i think (and appreciate) you documenting this situation and the way to address it. and in further examining it, i think it covers the situation well. in addition, the term, hack, was poorly chosen on my part.

hopefully, i will get some time and make this situation a little cleaner. again, i was initially following the old square module code, as opposed to re-thinking about, perhaps a better way to handle the renewals of the OAuth.

i will now add that to my async wiki....

best.