Forums / Addon Payment Modules / Square WebPay support thread.

Square WebPay support thread.

Views: 129,451

Results 121 to 140 of 803
26 May 2022, 8:32 PM
#121
dbltoe avatar

dbltoe

Totally Zenned

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

Square WebPay support thread.

dbltoe:

One customer (with latest WebPay and OPC) is experiencing random Missing Token Reports. With nearly seventy successful transactions since this log file, there have only been five of these logs reported.

I cannot find a commonality among them. topkayakerDOTcom

20-May-2022 21:50:40 UTC] 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 234

It just does not make sense.

From the store owner> My first attempt (Citi) I got this error message:
> We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN
> I changed to another card (Cap1) and was successful, **Order No. #####**.
> I then tried the first card (Citi) again and was successful, **Order No. #####**.
> I did Not clear my cache or use the F5 key. It is not my habit to do so. I only do that if I have no other option and must get a transaction to process.
>  
> Shortly thereafter I called (shop customer) to place the order **for him online from my computer** at the office. The Error message below was displayed:
> Your transaction failed due to an error: [GENERIC_DECLINE] Authorization error: 'GENERIC_DECLINE'
> Yes, we went over all the card and address info VERY carefully, almost but not quite to the point where I was challenging his competency.
> He called back after talking to his bank. The bank said that the many transactions were approved by the “bank” but declined by the store. I assume store to be Square (fraud protection) and/or WEBSITE.
Any thoughts greatly appreciated

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

26 May 2022, 10:23 PM
#122
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Square WebPay support thread.

More information on the subject.

Made sure I was the only one processing an order and monitored from cart addition to completed charge with the chrome console.

The error log created was ```
[26-May-2022 21:54:53 UTC] 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 234


Yet, the successful transaction was made one second later.

[Attachment no longer available]

So, if I am getting this result correctly, we have situations where the bank okays and ZC doesn't AND (in this case) the process worked despite the missing token.:dontgetit

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

27 May 2022, 3:14 AM
#123
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

dbltoe:

More information on the subject.

Made sure I was the only one processing an order and monitored from cart addition to completed charge with the chrome console.

The error log created was ```
[26-May-2022 21:54:53 UTC] 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 234

> 
> Yet, the successful transaction was made one second later.
> 
> [Attachment no longer available]
> 
> So, if I am getting this result correctly, we have situations where the bank okays and ZC doesn't AND (in this case) the process worked despite the missing token.:dontgetit

i have been to said site and everything operated correctly as far as square looks.

the error message indicates that the payment form was submitted, but the response from square was not on the form.  any time you see line 234 in v1.0.1, that means the post of the form to your ZC server does NOT have any response from square.

it does NOT mean you submitted a transaction, although you may/probably/most definitely (pick one) might have.  looking at your square dashboard will tell you if you have.  the error message means that if there was a response, it was not on the form and therefore ZC can not do anything with it because it does not know anything about it.

this is the essence of the problem with OPC that was resolved with the changes made (and implemented on said site) with regards to OPC.

if you are getting the error and then everything works properly a second later, you are most likely having a javascript problem.  2 event listeners are submitting the same form one after the other would be 1 guess.

you are having other javascript errors on said site, which may cascade down to your problem.  but in my latest review, everything looked fine to me.  and the response from square was on the form.  and i got an appropriate error:

Your transaction failed due to an error: [PAN_FAILURE] Authorization error: 'PAN_FAILURE'

that error comes from square.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

27 May 2022, 9:54 PM
#124
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Square WebPay support thread.

Unfortunately, I have no access to the Square Dashboard.

I've sepent the day trying to find any javascipt error elsewhere. And, I had done that transaction in down for maintenance with only my IP as allowed.

Watched the console through the whole process with no problems noted yet got the token notice one second before the success notice.

I suspected older mods like Products with Attributes Stocck and Numinix Product Fields but can't find any evidence that they are the culprits.

If you have any advice as to where else I might look, it would be greatly appreciated.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 May 2022, 2:08 AM
#125
out1 avatar

out1

New Zenner

Join Date:
Nov 2020
Posts:
5
Plugin Contributions:
0

Re: Square WebPay support thread.

I believe I fixed the apostrophe error where the credit card form would not load when a users name or address contained the apostrophe character.

I edited the file jscript_square_webPay.php inside the in includes/modules/pages/checkout_payment folder.

lines 88 to 103

        async function verifyBuyer(payments, token) {
            const verificationDetails = {
                amount: '<?= zen_round($order->info['total'], 2); ?>',
                billingContact: {
                    addressLines: ["<?= $order->billing['street_address']; ?>", "<?= $order->billing['suburb']; ?>"],
                    familyName: "<?= $order->billing['lastname']; ?>",
                    givenName: "<?= $order->billing['firstname']; ?>",
                    email: "<?= $order->customer['email_address']; ?>",
                    country: "<?= $order->billing['country']['iso_code_2']; ?>",
                    phone: '<?= $order->customer['telephone']; ?>',
                    state: "<?= $order->billing['state']; ?>",
                    city: "<?= $order->billing['city']; ?>",
                },
                currencyCode: '<?= $order->info['currency']; ?>',
                intent: 'CHARGE',
            };

it worked for me but please verify this is the correct fix. thanks!

29 May 2022, 3:27 AM
#126
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

out1:

I believe I fixed the apostrophe error where the credit card form would not load when a users name or address contained the apostrophe character.

I edited the file jscript_square_webPay.php inside the in includes/modules/pages/checkout_payment folder.

lines 88 to 103

    async function verifyBuyer(payments, token) {
        const verificationDetails = {
            amount: '<?= zen_round($order->info['total'], 2); ?>',
            billingContact: {
                addressLines: ["<?= $order->billing['street_address']; ?>", "<?= $order->billing['suburb']; ?>"],
                familyName: "<?= $order->billing['lastname']; ?>",
                givenName: "<?= $order->billing['firstname']; ?>",
                email: "<?= $order->customer['email_address']; ?>",
                country: "<?= $order->billing['country']['iso_code_2']; ?>",
                phone: '<?= $order->customer['telephone']; ?>',
                state: "<?= $order->billing['state']; ?>",
                city: "<?= $order->billing['city']; ?>",
            },
            currencyCode: '<?= $order->info['currency']; ?>',
            intent: 'CHARGE',
        };
> 
> 
> it worked for me but please verify this is the correct fix. thanks!

have u downloaded the latest version 1.0.1? it was made available last week and addressed this problem by making use of the php addslashes function. 

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

29 May 2022, 10:26 AM
#127
swguy avatar

swguy

Administrator

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

Re: Square WebPay support thread.

Square WebPay install instructions available in the Zen Cart docs:

https://docs.zen-cart.com/user/payment/square/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

30 May 2022, 3:33 AM
#128
out1 avatar

out1

New Zenner

Join Date:
Nov 2020
Posts:
5
Plugin Contributions:
0

Re: Square WebPay support thread.

carlwhat:

have u downloaded the latest version 1.0.1? it was made available last week and addressed this problem by making use of the php addslashes function.

best.

Thank you I will check the updated version, I had version 1.0 from May 21.

31 May 2022, 4:51 AM
#129
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Square WebPay support thread.

out1:

Thank you I will check the updated version, I had version 1.0 from May 21.

I know this is a simple update, but are there update instructions available?

31 May 2022, 5:44 AM
#130
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

royaldave:

I know this is a simple update, but are there update instructions available?

sorry no. i should have included something.

it’s a simple file replacement. but nothing in the sdk has changed.

you can copy all of the files without the need to copy the directory:

for_upload/includes/modules/payment/square_webPay

hope that helps!

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

31 May 2022, 7:31 PM
#131
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Square WebPay support thread.

Those of you who were already using Square prior to carlwhat's update to WebPay may want to check your ADMIN >> Customers >> Orders for orders made in late March or earlier that have square under the Payment/Shipping header versus square_webPay.

We (myzencarthostDOTcom) updated several of our customers while some did 1.0.0 and 1.0.1 on their own. Both groups have shown cases where the Payment/Shipping was not changed to square_webPay on orders made with the old square.

If you are using WebPay and the Payment/Shipping shows square, you will not be able to access the full details for the order. IOW, you will not see anything AFTER the payment method. A partial blank screen with no log created and no way to see comments on the order.

NOTE: Some sites with Edit Orders are able to access the data with that mod. Still, the fix needs to be made.

Somehow, the upgrades did not modify the orders table in the database for any existing square orders. Specifically, the payment_module_code field. Some sites had a DB prefix and others did not so, I don't think that's the problem.

There's a quick fix if you find this happening. Go to ADMIN >> Tools >> Install SQL Patcches (it shows up as SQL Query Executor on the page).

Please read the instructions on that page that are in RED.

Enter the following code.

UPDATE orders
SET payment_module_code = 'square_webPay'
WHERE payment_module_code = 'square';

Then click on send.

You'll be good to go

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

31 May 2022, 7:48 PM
#132
brittainmark avatar

brittainmark

Totally Zenned

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

Re: Square WebPay support thread.

dbltoe:

Those of you who were already using Square prior to carlwhat's update to WebPay may want to check your ADMIN >> Customers >> Orders for orders made in late March or earlier that have square under the Payment/Shipping header versus square_webPay.

We (myzencarthostDOTcom) updated several of our customers while some did 1.0.0 and 1.0.1 on their own. Both groups have shown cases where the Payment/Shipping was not changed to square_webPay on orders made with the old square.

If you are using WebPay and the Payment/Shipping shows square, you will not be able to access the full details for the order. IOW, you will not see anything AFTER the payment method. A partial blank screen with no log created and no way to see comments on the order.

NOTE: Some sites with Edit Orders are able to access the data with that mod. Still, the fix needs to be made.

Somehow, the upgrades did not modify the orders table in the database for any existing square orders. Specifically, the payment_module_code field. Some sites had a DB prefix and others did not so, I don't think that's the problem.

There's a quick fix if you find this happening. Go to ADMIN >> Tools >> Install SQL Patcches (it shows up as SQL Query Executor on the page).

Please read the instructions on that page that are in RED.

Enter the following code.

UPDATE orders
SET payment_module_code = 'square_webPay'
WHERE payment_module_code = 'square';

> 
> Then click on send.
> 
> You'll be good to go

Thanks for this. I did have a prefix, and they were not changed. I have run the code and all good now. Thanks again

Mark Brittain
http:\innerlightcrystals.co.uk\sales\

31 May 2022, 7:58 PM
#133
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

this is a big that i noticed and documented with regards to the original square module. not square_webPay.

by running that sql statement you are not losing visibility into how that order was originally charged. if you are ok with that, great. but it is NOT how i would do it. nor is it what i would recommend doing.

i would look into changing the square code as opposed to changing all of one’s data.

do at your own peril.

“to err is human… but to really mess things up you need a computer…. and to mess things up royally you need sql…”

old shakesperean saying.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

31 May 2022, 9:19 PM
#134
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Square WebPay support thread.

I'm experiencing the same happening, partial blank page after payment on order details page, but I'm getting this in the logs:
**
PHP Warning: require(/includes/modules/payment/square_support/square_admin_notification.php): failed to open stream: No such file or directory in /includes/modules/payment/square_webPay.php on line 505.

[31-May-2022 17:01:24 America/Detroit] PHP Fatal error: require(): Failed opening required '/includes/modules/payment/square_support/square_admin_notification.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /includes/modules/payment/square_webPay.php on line 505**

I ran the update above (post #131) but error log continues (updated to webPay over the weekend).

Doing a search I found includes/modules/payment/square_webPay.php has this line of code in it require(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/square_support/square_admin_notification.php');

Checking the square_webPay folder doesn't contain anything remotely similar to this file in it. Should I modify the file by deleting the line/commenting it or is there another line that should replace it?

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

31 May 2022, 9:30 PM
#135
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

that file is part of the base v157 zc install. you should track that file down and upload it to your server.

do not modify the code.

best

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

1 Jun 2022, 4:20 PM
#136
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Square WebPay support thread.

carlwhat:

that file is part of the base v157 zc install. you should track that file down and upload it to your server.

do not modify the code.

best

Thanks. Yeah, that file is on the deprecated Square plugin which according to the Square WebPay instructions should be removed. Makes no sense to have a plugin that won't work installed so another one could work, unless I'm missing something? :dontgetit

Perhaps an update to the Square WebPay is in order to include that or any other files needed for this new version to work :wink:

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

1 Jun 2022, 4:31 PM
#137
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

mvstudio:

Thanks. Yeah, that file is on the deprecated Square plugin which according to the Square WebPay instructions should be removed. Makes no sense to have a plugin that won't work installed so another one could work, unless I'm missing something? :dontgetit

Perhaps an update to the Square WebPay is in order to include that or any other files needed for this new version to work :wink:

do not confuse zc v158 (unreleased) with v157 code.

my module is for v157 code. and you have deleted a file from said code base.

see also:

https://github.com/zencart/zencart/pull/4818#issuecomment-1138002673

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

1 Jun 2022, 5:12 PM
#138
swguy avatar

swguy

Administrator

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

Re: Square WebPay support thread.

Yeah, that file is on the deprecated Square plugin which according to the Square WebPay instructions should be removed.

Please don't do this.

Just leave these files be. Appropriate removals will be done when you upgrade to 1.5.8.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

1 Jun 2022, 5:28 PM
#139
simon1066 avatar

simon1066

Totally Zenned

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

Re: Square WebPay support thread.

mvstudio:

Thanks. Yeah, that file is on the deprecated Square plugin which according to the Square WebPay instructions should be removed. Makes no sense to have a plugin that won't work installed so another one could work, unless I'm missing something? :dontgetit

Perhaps an update to the Square WebPay is in order to include that or any other files needed for this new version to work :wink:

When it says 'remove' that means clicking 'Remove Module' in Admin > Modules > Payment : Square

Simon

1 Jun 2022, 6:37 PM
#140
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Square WebPay support thread.

All the files were placed back as they were in the original installation 1.5.7.

Just an observation that removing something implies taking away or out, rather than turning it off. That's where this error of mine came from.

As far as I remember ZC has always had this constant that when one plugin is "removed", the files for that plugin can be safely deleted from the server, until now as far as I can tell. That's why I assumed I was doing the right thing by "removing the deprecated Square plugin" as there was no need for it. Nowhere in any of the files anywhere it stated I shouldn't have done so. Maybe a note in the read-me would help others not make the same error I made(?). Just a suggestion to avoid future mishaps.

Honest mistake on my part. Didn't mean to cause any trouble nor offend anyone. All is well and everything works as it should.

Thanks for the help! I really appreciate it :smile:

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com