-
Re: Square WebPay support thread.
Quote:
Originally Posted by
lat9
Since the site is running https-all-the-time, your site's root .htaccess file should 'support' that. Make a backup copy and add the following clauses close to the top of the file to 'force' the access to https://vinyldecalsuperstore.com/{whatever} when the access is made as
vinyldecalsuperstore.com/VDSstore/{whatever}
http://vinyldecalsuperstore.com/{whatever}
http://www.vinyldecalsuperstore.com/{whatever}
https://www.vinyldecalsuperstore.com/{whatever}
Code:
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTP_HOST} ^www\.vinyldecalsuperstore\.com$ [NC]
RewriteRule (.*) https://vinyldecalsuperstore.com/$1 [R=301,L]
I've got a bunch of this stuff in my .htaccess folder right now, including a domain that points to my primary vinyldecalsuperstore.com
Code:
RewriteCond %{HTTP_HOST} ^vdsdecal\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.vdsdecal\.com$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/" [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^vinyldecalsuperstore\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.vinyldecalsuperstore\.com$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/VDSstore\/" [R=301,L]
RewriteBase /
# Rewrites all URLS without VDSstore in them
RewriteCond %{REQUEST_URI} !^/VDSstore/
# Rewrites all URLS [Replace "example" with the actual domain, without the TLD (.com, .net, .biz, etc)]
RewriteCond %{HTTP_HOST} ^(www\.)?vinyldecalsuperstore\.
# Rewrite all those to insert /folder
RewriteRule ^(.*)$ /VDSstore/$1 [L]
Is there a particular order I should have all this and if so, where should I insert the code you gave me?
Thank you so very much!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
VDecalS
I've got a bunch of this stuff in my .htaccess folder right now, including a domain that points to my primary vinyldecalsuperstore.com
Code:
RewriteCond %{HTTP_HOST} ^vdsdecal\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.vdsdecal\.com$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/" [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^vinyldecalsuperstore\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.vinyldecalsuperstore\.com$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "https\:\/\/vinyldecalsuperstore\.com\/VDSstore\/" [R=301,L]
RewriteBase /
# Rewrites all URLS without VDSstore in them
RewriteCond %{REQUEST_URI} !^/VDSstore/
# Rewrites all URLS [Replace "example" with the actual domain, without the TLD (.com, .net, .biz, etc)]
RewriteCond %{HTTP_HOST} ^(www\.)?vinyldecalsuperstore\.
# Rewrite all those to insert /folder
RewriteRule ^(.*)$ /VDSstore/$1 [L]
Is there a particular order I should have all this and if so, where should I insert the code you gave me?
Thank you so very much!
you are having a token problem!
https://vinyldecalsuperstore.com/VDS...ay_handler.php
is returning a 417. fix that, and then lets see what happens.
i think there is info on this thread on it. but let us know if you need help with it.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
That's probably it. My Square Developer OAuth page says I have 8 Active tokens. Only I don't know how to even view them! :bangin:
-
Re: Square WebPay support thread.
In Square Developer: I've replaced my token, and replaced my OAuth Application Secret. So now I'm up to 9 active tokens.
then;
In my Zen-Cart I removed the Square WebPay Module, then Installed it with the new OAuth Application Secret and tried to Authorize with the green bar and still get the Debug logs as stated in #94
I'm feeling beaten down. Walking away from this for a bit before trying the restore from backup. I still have PayPal for now.
Thanks all.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
VDecalS
In Square Developer: I've replaced my token, and replaced my OAuth Application Secret. So now I'm up to 9 active tokens.
then;
In my Zen-Cart I removed the Square WebPay Module, then Installed it with the new OAuth Application Secret and tried to Authorize with the green bar and still get the Debug logs as stated in #94
I'm feeling beaten down. Walking away from this for a bit before trying the restore from backup. I still have PayPal for now.
Thanks all.
but we are so close....
again, the problem is here:
https://vinyldecalsuperstore.com/VDS...ay_handler.php
this is returning a 417. in a fully functioning implementation, it should return a 200.
on this line:
https://github.com/proseLA/square_we...andler.php#L22
set that to true, ie:
PHP Code:
$verbose = true;
then, click on the link above, and lets see what the error message is.
just that, and we should have some good info to go on.
also, are we not getting any logs? we should have some logs if the token is not refreshed properly.
best.
-
Re: Square WebPay support thread.
Perhaps these instructions will help.
Solely put together by me and not a sanctioned part of the mod.
https://myzencarthost.com/index.php?...ay-Module.html
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
VDecalS
In Square Developer: I've replaced my token, and replaced my OAuth Application Secret. So now I'm up to 9 active tokens.
then;
In my Zen-Cart I removed the Square WebPay Module, then Installed it with the new OAuth Application Secret and tried to Authorize with the green bar and still get the Debug logs as stated in #94
I'm feeling beaten down. Walking away from this for a bit before trying the restore from backup. I still have PayPal for now.
Thanks all.
ok, we were going down the wrong track. this problem is solved.
admin -> configuration -> sessions -> recreate session.
this value was set to true. setting it to false has fixed the time out error.
i will have to explore a bit as to what that config value does and why it does not destroy the session in paypal, but it destroys it in square.
best.
-
Re: Square WebPay support thread.
carlWHAT? called the savior by the chief bottle washer... AND ME!:bow:
cake sent via PayPal:hug:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
VDecalS
carlWHAT? called the savior by the chief bottle washer... AND ME!:bow:
cake sent via PayPal:hug:
:thumbsup:
thank you.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
ok, we were going down the wrong track. this problem is solved.
admin -> configuration -> sessions -> recreate session.
this value was set to true. setting it to false has fixed the time out error.
i will have to explore a bit as to what that config value does and why it does not destroy the session in paypal, but it destroys it in square.
best.
ok, this worked for a hot minute, but now it is not.
i have some more information, in case someone would like to chime in... which would be appreciated.
standard 3 page checkout. on chrome, one gets to the checkout confirmation page. at the end of the tpl_checkout_confirmation_default.php script, the session looks intact. HOWEVER, after the page is completely rendered, the session is destroyed. this is confirmed by clicking on the my account link (without clicking on the order confirmation submit button), and it directs one to a login page, which is unexpected behavior.
interestingly enough, this behavior does NOT happen on firefox. the expected process happens, and there is no destruction of the session.
apparently this behavior does NOT happen with paypal express checkout on firefox or on chrome (ie it works).
session settings can be seen here:
https://www.dropbox.com/s/8tk970t6c2...06-12.png?dl=0
if anyone has any ideas, i am listening.
thanks in advance.
-
Re: Square WebPay support thread.
Dear CarlWhat?,
As advised, I have removed the old Square module php files by following the hierarchy of your Square WebPay module.
I'm no longer seeing the "old" Square module in my Admin/Payments.
There is no more getting booted out on Chrome, Edge, or Firefox!
Removing the old Square module (php files) is the step that messed me up the most, because I thought the "Remove Module" in Admin/Payments would do the trick.
Thank you so much for your hands-on help, patience, guidance and explanations. I've learned so much from you with this.
I'm in awe of the many contributors of Zen-Cart and appreciate what excellent help I am able to get from the forum community.
nbl to carlWhat? et al
-
Re: Square WebPay [VOICE_FAILURE]
Maybe not all is well. I've gotten no payments through Square WebPay, but this morning I received this "Square Alert"
Code:
May-21-2022 09:07:49
=================================
Error Dump: [VOICE_FAILURE]: Authorization error: 'VOICE_FAILURE'
Sent to Square: SquareModelsCreatePaymentRequest Object
(
[sourceId:SquareModelsCreatePaymentRequest:private] => cnon:*private letter-number*
[idempotencyKey:SquareModelsCreatePaymentRequest:private] => *private letter-number*
[amountMoney:SquareModelsCreatePaymentRequest:private] => SquareModelsMoney Object
(
[amount:SquareModelsMoney:private] => *order total numbers*
[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] => *private*
[teamMemberId:SquareModelsCreatePaymentRequest:private] =>
[referenceId:SquareModelsCreatePaymentRequest:private] =>
[verificationToken:SquareModelsCreatePaymentRequest:private] => verf:*letter/number*
[acceptPartialAuthorization:SquareModelsCreatePaymentRequest:private] =>
[buyerEmailAddress:SquareModelsCreatePaymentRequest:private] => *customer 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 name*; Ordered:(1) *my product*; Deliver To: *customer address and phone number in Canada* Vinyl Decal Superstore
[statementDescriptionIdentifier:SquareModelsCreatePaymentRequest:private] =>
[cashDetails:SquareModelsCreatePaymentRequest:private] =>
[externalDetails:SquareModelsCreatePaymentRequest:private] =>
)
I'm hoping that it is just the customer's card requirement as stated on Square's reference to ErrorCodes
Code:
VOICE_FAILURE
The card issuer declined the request because the issuer requires voice authorization from the cardholder.
Has anyone else had this problem? Perhaps this is an addition requirement because it's a Canadian purchase from USA location?
Thanks for your input!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
ChuckPhillips
ZC 1.56c, PHP 7.4,
If the customer has an apostrophe in their name (like Andre') or address (like River Fall's Place), the CC form will not load. Does not appear that was an issue with the old plugin.
Removing the apostrophe will allow checkout.
1.57a with php 7.4 and this is a minor problem for me as well. A fix would be great.
Thanks!
-
Re: Square WebPay [VOICE_FAILURE]
ALL IS WELL. The customer switched credit cards (or fixed input) and sale went through.
On a related note, while removing the old Square module (php files), I went too far and also deleted the folder
includes\modules\payment\square_support
I was getting a partial white page, but was able to figure out the problem by reading the DEBUG log.
Thank you all
-
Re: Square WebPay support thread.
I'm preparing to upgrade Square to WebPay (and OPC) and am catching up with the various posts in this thread and wanted to confirm the following,
Quote:
Originally Posted by
VDecalS
As advised, I have removed the old Square module php files by following the hierarchy of your Square WebPay module.
I assume we do remove the existing Square plugin by uninstalling it within Admin and removing all of its files? The above post mentions following the hierachy of WebPay, I've not seen this or the removal of files suggested before, perhaps it was in a PM. (I note that WebPay makes use of the existing Square database table, so we would leave that alone)
Quote:
Originally Posted by
VDecalS
.... while removing the old Square module (php files), I went too far and also deleted the folder
includes\modules\payment\square_support
If following the hierarchy of WebPay I assume we do leave this in place.
To sum up - the existing Square plugin should be uninstalled from within Admin and all of its files should be removed with the exception of the square_support folder.
(I don't think a hierarchical removal of the old plugin is strictly correct, if we follow that premise then that would leave the \includes\classes\vendors\square folder behind - which I believe is no longer needed. Perhaps I misunderstand 'hierarchy').
-
Re: Square WebPay support thread.
Actually, doing anything other than clicking on Remove Module in the admin is not recommended.
If you remove files from the current Square installation, you will have problems reviewing sales made with Square when you click on Details.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
simon1066
I'm preparing to upgrade Square to WebPay (and OPC) and am catching up with the various posts in this thread and wanted to confirm the following,
I assume we do remove the existing Square plugin by uninstalling it within Admin and removing all of its files? The above post mentions following the hierachy of WebPay, I've not seen this or the removal of files suggested before, perhaps it was in a PM. (I note that WebPay makes use of the existing Square database table, so we would leave that alone)
The installation docs state "If you want to use Square WebPay module, please remove the Square Module". I uninstalled within the Admin, but hadn't deleted the php files which resulted in Square WebPay breaking.
You are correct that the php removal was suggested in a PM. I followed only the Square WebPay hierarchy in removing php files, without touching the database table.
Quote:
Originally Posted by
simon1066
If following the hierarchy of WebPay I assume we do leave this in place.
To sum up - the existing Square plugin should be uninstalled from within Admin and all of its files should be removed with the exception of the square_support folder.
(I don't think a hierarchical removal of the old plugin is strictly correct, if we follow that premise then that would leave the \includes\classes\vendors\square folder behind - which I believe is no longer needed. Perhaps I misunderstand 'hierarchy').
I had to re-load the square_support folder in order to eliminate partial white screen on the "Order Details" pages.
I did leave the \includes\classes\vendors\square folder in my store as I did not see this in the new WebPay hierarchy. I've not seen any issues by leaving this folder in, but I've only had the one sale since my repair.
Can someone else illuminate on leaving or removing folder \includes\classes\vendors\square?
-
Re: Square WebPay support thread.
There's a difference between Remove and Uninstall. Using the Remove Module option is all that is needed.
Who knows for sure what file(s) may be needed at some time by Square to process/review an order. Don't uninstall. Just Remove.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
dbltoe
There's a difference between Remove and Uninstall. Using the Remove Module option is all that is needed.
Who knows for sure what file(s) may be needed at some time by Square to process/review an order. Don't uninstall. Just Remove.
I had assumed that the removal of php files was to solve the issue in this post.
-
Re: Square WebPay support thread.
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
Code:
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
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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
Code:
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
Quote:
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
-
1 Attachment(s)
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
Code:
[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 20012
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
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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
Code:
[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 20012
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.
-
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.
-
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
PHP Code:
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!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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
PHP Code:
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.
-
Re: Square WebPay support thread.
Square WebPay install instructions available in the Zen Cart docs:
https://docs.zen-cart.com/user/payment/square/
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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!
-
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.
Code:
UPDATE orders
SET payment_module_code = 'square_webPay'
WHERE payment_module_code = 'square';
Then click on send.
You'll be good to go
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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.
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
-
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.
-
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?
-
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
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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/p...ent-1138002673
-
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.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
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
-
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:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
mvstudio
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:
i can only speak for myself, and i did not take any offense.
with regards to removal of plugins, you are correct. but square is NOT a plugin. it is part of the base ZC install. square_webPay is a plugin.
if you think the documentation at docs.zen-cart.com is wrong (or could be clarified), i would suggest you download hugo and fix them. i'm sure the next user would be most appreciative (as well as @swguy).
best.
-
Re: Square WebPay support thread.
The help file has been updated to warn against deleting old Square implementation files.
https://docs.zen-cart.com/user/payment/square/
-
Re: Square WebPay support thread.
Hi guys. I just tried adding this plugin. I am using v1.5.7c and PHP 8.0.
After uploading all the files, when I go to turn on the module and turn off the older Square module, the new one isn't showing. The page is breaking where the new module should be showing. My error log shows this:
PHP Fatal error: Uncaught Error: Undefined constant "MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE" in .../store/includes/modules/payment/square_webPay.php:106
If I switch to PHP 7.4, the module shows.
I realise most people in this thread are using PHP 7.4, and therefore won't have this issue or maybe see it as a big deal, but I have everything else on my site working fine with PHP 8, so it would be nice to keep PHP 8 on, if this happens to be a quick easy fix. Any ideas?
-
Re: Square WebPay support thread.
I don't know if the same is true for your admin but, with the errors found on your home page, you may find that basic errors are creating problems for you.
Code:
<!--<div id="navMain"> |
|
<ul class="back"> |
|
<li></a></li> |
|
<li><a href=""></a></li> |
|
<li><a href=""></a></li> |
|
<li class="last"><a href=""></a></li> |
|
<li><a href=""></a></li> |
|
<li class="last"><a href=""></a></li> |
|
|
|
<li> |
|
<a class="navCartContentsIndicator" href=""><i class="fa fa-shopping-cart" title="Shopping Cart"></i> |
|
</a> |
|
</li> |
|
<li class="last"><a href=""></a></li> |
|
</ul> |
|
<div id="navMainSearch" class="forward"> |
|
</div> |
|
</div> |
|
</div> |
|
<!--eof navigation display--> |
|
|
|
|
|
<!--bof header google ad display--> |
|
<!--eof header google ad display--> |
|
|
|
<!--bof branding display--> |
|
|
|
<!--bof-wstephens edit--> |
|
<!--<div id="logoWrapper" class="group onerow-fluid navbar-dark bg-dark"> |
|
<div id="logo"> |
|
<img id="bannerPic" src="https://www.20thcenturyglass.com/images/main/20th-century-glass-headbanner2018.jpg" alt="20th Century Glass" border="0" /> |
|
</div> |
|
</div> |
|
<!--eof-wstephens edit--> |
|
|
|
<!--<div id="logoWrapper" class="group onerow-fluid"> |
|
<div id="logo"> <div id="taglineWrapper"> |
|
<div id="tagline"></div> |
|
<div id="bannerTwo" class="banners"></div> |
|
</div> |
|
</div> |
|
</div> |
You have several issues in items that may be on every page in your site. I've highlighted four instances of <!--. Between 1 to 2 and 3 to 4 there should be an ending -->
Fixing basic CSS and HTML errors might make things run smoother
-
Re: Square WebPay support thread.
> PHP Fatal error: Uncaught Error: Undefined constant "MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE" in .../store/includes/modules/payment/square_webPay.php:106
Right above line 105 add
if (null === $this->sort_order) return;
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
dbltoe
I don't know if the same is true for your admin but, with the errors found on your home page, you may find that basic errors are creating problems for you.
...
Fixing basic CSS and HTML errors might make things run smoother
noting that none of these fixes has absolutely anything to do with problem being reported. nor anything to do with square_webPay.
please do NOT hijack this thread.
Quote:
Originally Posted by
swguy
> PHP Fatal error: Uncaught Error: Undefined constant "MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE" in .../store/includes/modules/payment/square_webPay.php:106
Right above line 105 add
if (null === $this->sort_order) return;
@swguy, i am NOT a fan of this solution for so many reasons. lets start with this:
https://www.php-fig.org/psr/psr-12/#51-if-elseif-else
and then continue with what happens in the admin with the affiliate link? as well as other details?
i will post some new code shortly.
best.
-
Re: Square WebPay support thread.
This is the standard mechanism that modules use to avoid logs from undefined variables in recent versions of PHP. Compare any other payment module and you'll see this pattern.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
swguy
This is the standard mechanism that modules use to avoid logs from undefined variables in recent versions of PHP. Compare any other payment module and you'll see this pattern.
i have no idea what standard mechanism means. and just because it was done that way does not make it right.
i would suggest spending more time testing prior to posting code. your early return completely changes how square is presented to the store owner prior to install. and either we want our code to conform to PSR or we do not. i prefer my code to conform to said standards as i am a fan of the PHP Standards Recommendation (PSR).
back to the problem at hand; here is the fix for said code. changes start at line 105.
PHP Code:
// from:
$environment = Environment::PRODUCTION;
if (MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE === 'Sandbox') {
$environment = Environment::SANDBOX;
}
$this->client = new SquareClient([
'accessToken' => MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN,
'environment' => $environment,
]);
// to:
$environment = Environment::PRODUCTION;
if (defined('MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE') && MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE === 'Sandbox') {
$environment = Environment::SANDBOX;
}
$this->token= '';
if (defined('MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN')) {
$this->token = MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN;
}
$this->client = new SquareClient([
'accessToken' => $this->token,
'environment' => $environment,
]);
@WayneStephens please let me know if that works for you.
also, noting that these errors exist and are logged in php 7.4; in php 8.0, they are now fatal errors.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
@WayneStephens please let me know if that works for you.
That fixed it, thanks! And no other errors coming up so far while testing. :smile:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
WayneStephens
That fixed it, thanks! And no other errors coming up so far while testing. :smile:
:thumbsup:
-
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...
-
Re: Square WebPay support thread.
So... I uninstalled the WEBPAY module.
Installed the ZC Square for ZC1.5.7 (Pre webpay)
Configured all the access tokens and secret code... and
... This module is working.
I can proceed with this in the meantime.
Question: Should I remove all the files and run an uninstall SQL for this 1.5.7 module, before going the webpay route?
-
Re: Square WebPay support thread.
Hi,
Is there a fix for this.
I have just upgraded my cart.
157d
bootstrap template
OPC
Square Webpay
SitemapXML
PHP 7.4
Everything is working fine, regular orders 50% Square Webpay versus Paypal and no error logs until yesterday, when a purchasing customer emailed me to say they get the following message.
So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN.
I told them to try again, but again the message above came up and again they where unable to complete their transaction.
The error logs show the following.
[26-Jun-2022 15:40:02 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 /home/sweetmomentsuk1/public_html/includes/modules/payment/square_webPay.php on line 234.
I don't seem to be getting any conflicts when viewing the browser console while running test transactions.
It's the first time i have had this since I upgraded on the 11th June (many successful WepPay transactions).
It just seems completely random looking at previous posts.
The latest OPC accomadates Square WebPay to work smoothly when the confirm order button is selected.
Should I try upgrading my API version from 2022-02-16 (Webpay was developed using this) to the latest.
www.sweetmomentsuk.co.uk
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
Hi,
Is there a fix for this.
I have just upgraded my cart.
157d
bootstrap template
OPC
Square Webpay
SitemapXML
PHP 7.4
Everything is working fine, regular orders 50% Square Webpay versus Paypal and no error logs until yesterday, when a purchasing customer emailed me to say they get the following message.
So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN.
I told them to try again, but again the message above came up and again they where unable to complete their transaction.
The error logs show the following.
[26-Jun-2022 15:40:02 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 /home/sweetmomentsuk1/public_html/includes/modules/payment/square_webPay.php on line 234.
I don't seem to be getting any conflicts when viewing the browser console while running test transactions.
It's the first time i have had this since I upgraded on the 11th June (many successful WepPay transactions).
It just seems completely random looking at previous posts.
The latest OPC accomadates Square WebPay to work smoothly when the confirm order button is selected.
Should I try upgrading my API version from
2022-02-16 (Webpay was developed using this) to the latest.
www.sweetmomentsuk.co.uk
i think you need to manually run the handler to renew your token. which i did. when i tried to buy something, i am definitely getting a response back from square, which you can see here:
https://www.dropbox.com/s/olpefpckug...ments.png?dl=0
one can manually renew the OAuth by going here:
https://www.sweetmomentsuk.co.uk/squ...ay_handler.php
best.
-
Re: Square WebPay support thread.
Still can find no rhyme or reason for the 239 error (in the current GitHub version)
Since the 20th of June, the site has had 273 successful payments with WebPay.
Still, during the same period,
Code:
[27-Jun-2022 21:03:42 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 239
reared its ugly head only 15 times and I have not been able to catch anything in the consol.
:frusty:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
schoolboy
So... I uninstalled the WEBPAY module.
Installed the ZC Square for ZC1.5.7 (Pre webpay)
Configured all the access tokens and secret code... and
... This module is working.
I can proceed with this in the meantime.
Question: Should I remove all the files and run an uninstall SQL for this 1.5.7 module, before going the webpay route?
All I can think of is, and I'm not sure if you've already tried this, install Webpay on a site where the old Square plugin is installed and working.
If it does install successfully then just remove the old plugin from within admin and don't delete anything related to the old Square plugin (files or dbase).
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
simon1066
All I can think of is, and I'm not sure if you've already tried this, install Webpay on a site where the old Square plugin is installed and working.
If it does install successfully then just remove the old plugin from within admin and don't delete anything related to the old Square plugin (files or dbase).
I used these instructions: https://docs.zen-cart.com/user/payment/square/
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
Thanks Carl,
I might even set up a Cron job to automate this procedure, as I have a head like a sieve with extra large holes, and I will never remember to do this.
Kind regards
Vic :thumbsup:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
schoolboy
So... I uninstalled the WEBPAY module.
Installed the ZC Square for ZC1.5.7 (Pre webpay)
Configured all the access tokens and secret code... and
... This module is working.
I can proceed with this in the meantime.
Question: Should I remove all the files and run an uninstall SQL for this 1.5.7 module, before going the webpay route?
there is no need to run an uninstall SQL for the original module.
i would follow the instructions here:
https://docs.zen-cart.com/user/payment/square/
the removal, aka uninstall sql for the original module, is the last item on the list. and really not per se necessary. see:
https://docs.zen-cart.com/user/payme...click%20Remove.
i would get the webPay working prior to removing any of the original square config values.
best.
-
Re: Square WebPay support thread.
We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN
I have been trying to find why sometimes a customer gets the error above when trying to make a payment with Webpay. This is what I have found.
I have Square and Paypal as the payment options for my site. When a customer logs into their store account and goes to the OPC screen they have the two payment options with the corresponding radio buttons (neither is selected at this time).
The normal procedure would be to select the payment method (Square Webpay) by selecting the radio button then entering the card details, then Confirm Order. This seems to produce a positive checkout without errors.
However if the customer was to get to the OPC page and enter their card details directly into the Square payment fields, the radio button then becomes highlighted after a couple of digits are entered and the card type is recognized. But when the confirm order button is selected to checkout, the SQ-MISSING-TOKEN error shows up.
It's the same situation if a customer selects Paypal first then stupidly starts entering their card data into the Square fields, Square then becomes highlighted but invariably shows SQ-MISSING-TOKEN error.
So it looks to me if you positively select the radio button for the Square Payments first, then enter card details a checkout without SQ-MISSING-TOKEN error will occur. and you don't get the following error log.
[04-Jul-2022 21:43:05 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 /home/sweetmomentsuk1/public_html/includes/modules/payment/square_webPay.php on line 234.
If this is the case and because we have to think like a customer (not always perfect in the nicest possible way), it might help if the moment the Webpay card fields are selected, the payment option is actually selected at that point along with the radio button.
To me (and I am just a store owner who muddles through) it's a little strange. I am sure the previous standard Square module used to select square the moment you touched the input fields.
Sorry to waffle. Just some thoughts, please take a look if you wish. I have lost a couple of customers recently because of this.
https://www.sweetmomentsuk.co.uk
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
...
However if the customer was to get to the OPC page and enter their card details directly into the Square payment fields, the radio button then becomes highlighted after a couple of digits are entered and the card type is recognized. But when the confirm order button is selected to checkout, the SQ-MISSING-TOKEN error shows up.
It's the same situation if a customer selects Paypal first then stupidly starts entering their card data into the Square fields, Square then becomes highlighted but invariably shows SQ-MISSING-TOKEN error.
So it looks to me if you positively select the radio button for the Square Payments first, then enter card details a checkout without SQ-MISSING-TOKEN error will occur. and you don't get the following error log.
hi vic,
i wish these situations were the case. i am not able to reproduce it on your site. i am only able to fix what i can reproduce.
allow me to explain a little bit about this process: it is a 2-step process; the first step sends the credit card data to square, it returns a token. square_webPay takes this token, adds it onto the html form on the OPC page, and then submits the whole form to your zen-cart installation. at that point, ZC has control, and then ZC submits that token to square.
if for whatever reason that token does NOT make it onto the html form, you see the error that you are getting.
with regards to the 2 situations you mention above, i have a couple of videos. a GENERIC DECLINE is coming back from square. the SQ-MISSING-TOKEN error is an error from square_webPay as we are not submitting anything to square as we do not have the result from the first step of the process:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
https://www.dropbox.com/s/6mc9y5gvf3...20PM.webm?dl=0
Quote:
Originally Posted by
Valencia
...
If this is the case and because we have to think like a customer (not always perfect in the nicest possible way), it might help if the moment the Webpay card fields are selected, the payment option is actually selected at that point along with the radio button.
To me (and I am just a store owner who muddles through) it's a little strange. I am sure the previous standard Square module used to select square the moment you touched the input fields.
you are correct here. the previous module selected the radio button the moment you touched the input fields. the webPay module selects the radio button after the first input, and NOT when a field gets focused.
unfortunately that is impossible to change due to the architecture of the new square infrastructure. it was something that i remember looking at rather closely. but again this is not the problem as one can see from my videos.
that said, i DO appreciate the troubleshooting with the specific keystrokes that you think are causing the problem. if we are able to reproduce it, we can then fix it.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN
I have been trying to find why sometimes a customer gets the error above when trying to make a payment with Webpay. This is what I have found.
I have Square and Paypal as the payment options for my site. When a customer logs into their store account and goes to the OPC screen they have the two payment options with the corresponding radio buttons (neither is selected at this time).
The normal procedure would be to select the payment method (Square Webpay) by selecting the radio button then entering the card details, then Confirm Order. This seems to produce a positive checkout without errors.
However if the customer was to get to the OPC page and enter their card details directly into the Square payment fields, the radio button then becomes highlighted after a couple of digits are entered and the card type is recognized. But when the confirm order button is selected to checkout, the SQ-MISSING-TOKEN error shows up.
It's the same situation if a customer selects Paypal first then stupidly starts entering their card data into the Square fields, Square then becomes highlighted but invariably shows SQ-MISSING-TOKEN error.
So it looks to me if you positively select the radio button for the Square Payments first, then enter card details a checkout without SQ-MISSING-TOKEN error will occur. and you don't get the following error log.
[04-Jul-2022 21:43:05 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 /home/sweetmomentsuk1/public_html/includes/modules/payment/square_webPay.php on line 234.
If this is the case and because we have to think like a customer (not always perfect in the nicest possible way), it might help if the moment the Webpay card fields are selected, the payment option is actually selected at that point along with the radio button.
To me (and I am just a store owner who muddles through) it's a little strange. I am sure the previous standard Square module used to select square the moment you touched the input fields.
Sorry to waffle. Just some thoughts, please take a look if you wish. I have lost a couple of customers recently because of this.
https://www.sweetmomentsuk.co.uk
This only happens with OPC, not the standard checkout. And I have to agree, it's a bit odd that it throws up that error on OPC and not on the standard checkout. The standard checkout takes the payment without errors. If I was a customer with no I.T. knowledge, and could only just understand how to enter my credit card details, once I saw the payment method radio button was highlighted for square web pay when I started entering my card details and without clicking the radio button, I would expect it to process the payment. So the minute I saw the error (you are reporting, and now I am as well), I would walk away and go to the next store that sold similar products because I would feel frustrated and just think that the shopping cart I was trying to buy from had a problem.
This might also explain why my sales have gone down since installing the latest OPC, along with the latest Square Web Pay Module. It is a bug really and it needs fixing somehow. I understand other people on here may say otherwise, but think of it from the customers point of view. They will be stuck there, with a mouse, clicking and clicking and clicking with frustration that they can't pay in their minds. Customers often don't follow instructions well, and just do before they read. Unfortunately, I don't have the knowledge to fix it with OPC, however for the time being, until there is some sort of answer to this problem I will be switching OPC off.
I also see it from the other side, it is frustrating from a developers point of view when something like this is exposed. So I do thank carlwhat for his development on the square web pay module as I know he has put alot of time into this. But it does seem to me that it still doesn't play well with OPC for some reason, despite the time that has gone into developing it. And frustratingly I am not sure what the answer would be to this issue, so I can't help :-(
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
hi vic,
i wish these situations were the case. i am not able to reproduce it on your site. i am only able to fix what i can reproduce.
allow me to explain a little bit about this process: it is a 2-step process; the first step sends the credit card data to square, it returns a token. square_webPay takes this token, adds it onto the html form on the OPC page, and then submits the whole form to your zen-cart installation. at that point, ZC has control, and then ZC submits that token to square.
if for whatever reason that token does NOT make it onto the html form, you see the error that you are getting.
with regards to the 2 situations you mention above, i have a couple of videos. a GENERIC DECLINE is coming back from square. the SQ-MISSING-TOKEN error is an error from square_webPay as we are not submitting anything to square as we do not have the result from the first step of the process:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
https://www.dropbox.com/s/6mc9y5gvf3...20PM.webm?dl=0
you are correct here. the previous module selected the radio button the moment you touched the input fields. the webPay module selects the radio button after the first input, and NOT when a field gets focused.
unfortunately that is impossible to change due to the architecture of the new square infrastructure. it was something that i remember looking at rather closely. but again this is not the problem as one can see from my videos.
that said, i DO appreciate the troubleshooting with the specific keystrokes that you think are causing the problem. if we are able to reproduce it, we can then fix it.
best.
Hi Carl,
Thanks for the video showing the two scenarios, testing out my concerns.
I went through the exact same two scenarios as yourself earlier today, without touching the Square radio button first, and I get SQ-MISSING-TOKEN each time. (I even used the same card data).
If I then immediately entered the card details again without touching anything else, (the Square radio button is already highlighted at this stage)
when I selected Confirm Order I would get the please wait symbol then GENERIC DECLINE, so potentially all good!
The only way I could make sure the system produced a potential successful procedure and show GENERIC DECLINE was to make sure I had selected the Square radio button before entering the card details, and then this was successful repeatedly.
I then decided to try different browsers (Edge and Chrome) as I mainly use Firefox, but the same results persisted.
I am slightly perplexed now and thinking the only thing different between your testing and mine is the location.
Somehow I will have to force (tell my customers nicely) to make sure they select the Square Payments radio button before entering their card details ( There will be customers that read instructions and customers that don't, and they are the ones that will get an SQ-MISSING-TOKEN).
The ideal situation would be that the radio button gets selected in unison with selecting the data entry fields but I understand you have already mentioned the complexities of trying to do this.
This rather testing problem aside, Webpay is awesome.
Vic
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
Hi Carl,
Thanks for the video showing the two scenarios, testing out my concerns.
I went through the exact same two scenarios as yourself earlier today, without touching the Square radio button first, and I get SQ-MISSING-TOKEN each time. (I even used the same card data).
If I then immediately entered the card details again without touching anything else, (the Square radio button is already highlighted at this stage)
when I selected Confirm Order I would get the please wait symbol then GENERIC DECLINE, so potentially all good!
The only way I could make sure the system produced a potential successful procedure and show GENERIC DECLINE was to make sure I had selected the Square radio button before entering the card details, and then this was successful repeatedly.
I then decided to try different browsers (Edge and Chrome) as I mainly use Firefox, but the same results persisted.
I am slightly perplexed now and thinking the only thing different between your testing and mine is the location.
Somehow I will have to force (tell my customers nicely) to make sure they select the Square Payments radio button before entering their card details ( There will be customers that read instructions and customers that don't, and they are the ones that will get an SQ-MISSING-TOKEN).
The ideal situation would be that the radio button gets selected in unison with selecting the data entry fields but I understand you have already mentioned the complexities of trying to do this.
This rather testing problem aside, Webpay is awesome.
Vic
Agreed Vic, if I do the same on the standard checkout (enter card details without checking the radio button) it takes the payment. On OPC it doesn't. This is a problem, as like you say, some will click it, some won't. Some will read instructions, some won't. It is a real shame I am having to revert to the standard checkout as a solution until this issue is fixed.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
Hi Carl,
Thanks for the video showing the two scenarios, testing out my concerns.
I went through the exact same two scenarios as yourself earlier today, without touching the Square radio button first, and I get SQ-MISSING-TOKEN each time. (I even used the same card data).
If I then immediately entered the card details again without touching anything else, (the Square radio button is already highlighted at this stage)
when I selected Confirm Order I would get the please wait symbol then GENERIC DECLINE, so potentially all good!
The only way I could make sure the system produced a potential successful procedure and show GENERIC DECLINE was to make sure I had selected the Square radio button before entering the card details, and then this was successful repeatedly.
I then decided to try different browsers (Edge and Chrome) as I mainly use Firefox, but the same results persisted.
I am slightly perplexed now and thinking the only thing different between your testing and mine is the location.
Somehow I will have to force (tell my customers nicely) to make sure they select the Square Payments radio button before entering their card details ( There will be customers that read instructions and customers that don't, and they are the ones that will get an SQ-MISSING-TOKEN).
The ideal situation would be that the radio button gets selected in unison with selecting the data entry fields but I understand you have already mentioned the complexities of trying to do this.
This rather testing problem aside, Webpay is awesome.
Vic
The minute I turned OPC OFF, an order came through. It kind of confirms it. Since installing both of these modules around mid June, I have had hardly any orders :-(
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
The minute I turned OPC OFF, an order came through. It kind of confirms it. Since installing both of these modules around mid June, I have had hardly any orders :-(
Hi Nick,
I find as long as the Square radio button is checked before entering card details the whole thing works, no errors. The moment a customer just goes straight for the card input fields first without pre-selecting the radio button the SQ-MISSING-TOKEN message pops up which can scare the customer.
I have had customers that understand when I reply to their emails and they go for the Paypal option I suggest, and I have had customers that just drop their cart and I never hear from again.
If there was some way of automatically selecting the Square option when the card input fields where picked it would stop the customer making errors.
And yes Carl What is just amazing to have brought this module to where it is considering the time pressure of the old Square Modules retirement.
Hope something gets sorted going forward as Square is just the business, i have their hardware in my physical store as well!
Vic :smile:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
Hi Nick,
I find as long as the Square radio button is checked before entering card details the whole thing works, no errors. The moment a customer just goes straight for the card input fields first without pre-selecting the radio button the SQ-MISSING-TOKEN message pops up which can scare the customer.
I have had customers that understand when I reply to their emails and they go for the Paypal option I suggest, and I have had customers that just drop their cart and I never hear from again.
If there was some way of automatically selecting the Square option when the card input fields where picked it would stop the customer making errors.
And yes Carl What is just amazing to have brought this module to where it is considering the time pressure of the old Square Modules retirement.
Hope something gets sorted going forward as Square is just the business, i have their hardware in my physical store as well!
Vic :smile:
It seems to be a problem between the module and OPC though as the minute you turn OPC off the problem disappears on the standard checkout. Like you, I prefer square as a solution for card payments these days. It is so easy to use.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
It seems to be a problem between the module and OPC though as the minute you turn OPC off the problem disappears on the standard checkout. Like you, I prefer square as a solution for card payments these days. It is so easy to use.
Yup, just tried turning off OPC and hey presto everything goes through smoothly, I don't even need to select Square, I just input the card data right away and hey presto no more SQ-MISSING-TOKEN.
I really like OPC and Square.:(
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
The moment a customer just goes straight for the card input fields first without pre-selecting the radio button the SQ-MISSING-TOKEN message pops up which can scare the customer....
vic,
again, without bring able to reproduce the problem, it is hard for me to fix it...
i do not agree that the pre-selection of the radio problem addresses the problem, but i have been wrong before.
if you think the message scares the customer, that one is an easy fix....
go to:
includes/languages/english/modules/payment/square_webPay.php
and change:
PHP Code:
// from:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN');
// to:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'Hi, please remember to select square PRIOR to entering your credit card data. Thanks again!');
feel free to change the text to whatever you think is appropriate.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
vic,
again, without bring able to reproduce the problem, it is hard for me to fix it...
i do not agree that the pre-selection of the radio problem addresses the problem, but i have been wrong before.
if you think the message scares the customer, that one is an easy fix....
go to:
includes/languages/english/modules/payment/square_webPay.php
and change:
PHP Code:
// from:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN');
// to:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'Hi, please remember to select square PRIOR to entering your credit card data. Thanks again!');
feel free to change the text to whatever you think is appropriate.
best.
Thank,s Carl
That will help restore confidence. I shall be modifying it tomorrow.
By the way I have just found out that turning off the OPC module allows Webpay to work without having to select the radio button first.
Just tried it now on my test cart, and everything works perfectly. And my test cart is just a duplicate of my live site in a different directory.
Vic :smile:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
vic,
again, without bring able to reproduce the problem, it is hard for me to fix it...
i do not agree that the pre-selection of the radio problem addresses the problem, but i have been wrong before.
if you think the message scares the customer, that one is an easy fix....
go to:
includes/languages/english/modules/payment/square_webPay.php
and change:
PHP Code:
// from:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN');
// to:
define('MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION', 'Hi, please remember to select square PRIOR to entering your credit card data. Thanks again!');
feel free to change the text to whatever you think is appropriate.
best.
It isn't so much the pre-selection, as it does actually pre-select the minute you start typing in the credit card number.
If the customer clicks the radio button, and then enters their card details, the payment is taken absolutely fine.
If they start typing their card details and DON'T select the radio button, and the radio button pre-selects automatically, and then they try to 'confirm order' after they have entered their credit/debit card details, it is then that the error occurs.
Trust me, I have lost orders through this, and I know I have, so I know that it is the issue.
It's easy to replicate if you try it.
I don't think changing the text will make any difference in all honesty. Customers don't always read what is in front of them, and just expect it to work. We are talking people not so computer literate as ourselves here. There is a difference.
It works on the standard checkout, so really it should be the same on OPC.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
...
Trust me, I have lost orders through this, and I know I have, so I know that it is the issue.
It's easy to replicate if you try it.
nick,
try and play along. i have tried it. numerous times. on your site and on vic's site. did you read the above post:
https://tinyurl.com/2probynf
did you watch the video, i posted:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
i have a suggestion for you. why don't you do a screencast similar to what i did, showing the exact sequence where an order goes through using your keystrokes. and then one where it does not.
trust me, there is nothing more that i want to do than to solve this problem. but unless i can replicate it, i can not solve it.
finally with regards to this comment:
It works on the standard checkout, so really it should be the same on OPC.
the only thing i can say is you really have no idea what is going on in OPC and the amount of javascript code that plugin does.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
nick,
try and play along.
i have tried it. numerous times. on your site and on vic's site. did you read the above post:
https://tinyurl.com/2probynf
did you watch the video, i posted:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
i have a suggestion for you. why don't you do a screencast similar to what i did, showing the exact sequence where an order goes through using your keystrokes. and then one where it does not.
trust me, there is nothing more that i want to do than to solve this problem. but unless i can replicate it, i can not solve it.
finally with regards to this comment:
It works on the standard checkout, so really it should be the same on OPC.
the only thing i can say is you really have no idea what is going on in OPC and the amount of javascript code that plugin does.
carlwhat, I am playing along and this is why I am also reporting the issue :-)
Ok Screencast - will do one then so you can see the issue. I guess from our points of view we could be reading things differently from one another after all so not an issue.
'the only thing i can say is you really have no idea what is going on in OPC and the amount of javascript code that plugin does' - I do know the amount of Javascript that is used by OPC, so I am fully aware it will be a minefield to work with.
Like I said before carlwhat, I am extremely grateful for your hard work on this, and I think Vic is from what I read as well. There are probably others that think the same.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
nick,
try and play along.
i have tried it. numerous times. on your site and on vic's site. did you read the above post:
https://tinyurl.com/2probynf
did you watch the video, i posted:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
i have a suggestion for you. why don't you do a screencast similar to what i did, showing the exact sequence where an order goes through using your keystrokes. and then one where it does not.
trust me, there is nothing more that i want to do than to solve this problem. but unless i can replicate it, i can not solve it.
finally with regards to this comment:
It works on the standard checkout, so really it should be the same on OPC.
the only thing i can say is you really have no idea what is going on in OPC and the amount of javascript code that plugin does.
Ok I have had a look at your screencast videos.
Firstly, I understand why the Paypal method would fail, so that is fine because the customer has selected the wrong payment method and then tried to enter details into the square fields. You would expect that to fail!
That is this video:
https://www.dropbox.com/s/6mc9y5gvf3...20PM.webm?dl=0
-----------------------------------------------
Now, this video actually highlights the problem:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
So, a suggestion. To stop this from happening, are you able to force the customer to select the radio button before they can enter their details?
You could disable the SQUARE text entry fields, or even hide them until customers click on the SQUARE radio button. And if customers click the Paypal radio button, the text fields on the square element either remain disabled or hidden from view.
At the side of the SQUARE radio button in BOLD text, or even BOLD RED TEXT, you could have some text saying 'If you wish to pay by credit or debit card, please select this payment method. NOTE: You will be able to enter your payment details once this radio button is checked' - then once the radio button is clicked, the text fields either get enabled OR if hidden, they appear on screen.
At the side of the PAYPAL radio button you could have some text saying 'If you wish to pay by PAYPAL, please select this payment method' - then the SQUARE text fields either remain disabled or hidden from view and the customer can pay by paypal without a problem.
And if the customer happens to try and click confirm order, before they have selected either, it throws up a message something like 'You forgot to select a payment method, please try again'.
This is just an idea by the way! I am trying to help with a suggestion!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
Ok I have had a look at your screencast videos.
Firstly, I understand why the Paypal method would fail, so that is fine because the customer has selected the wrong payment method and then tried to enter details into the square fields. You would expect that to fail!
That is this video:
https://www.dropbox.com/s/6mc9y5gvf3...20PM.webm?dl=0
-----------------------------------------------
Now, this video actually highlights the problem:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
So, a suggestion. To stop this from happening, are you able to force the customer to select the radio button before they can enter their details?
You could disable the SQUARE text entry fields, or even hide them until customers click on the SQUARE radio button. And if customers click the Paypal radio button, the text fields on the square element either remain disabled or hidden from view.
At the side of the SQUARE radio button in BOLD text, or even BOLD RED TEXT, you could have some text saying 'If you wish to pay by credit or debit card, please select this payment method. NOTE: You will be able to enter your payment details once this radio button is checked' - then once the radio button is clicked, the text fields either get enabled OR if hidden, they appear on screen.
At the side of the PAYPAL radio button you could have some text saying 'If you wish to pay by PAYPAL, please select this payment method' - then the SQUARE text fields either remain disabled or hidden from view and the customer can pay by paypal without a problem.
And if the customer happens to try and click confirm order, before they have selected either, it throws up a message something like 'You forgot to select a payment method, please try again'.
This is just an idea by the way! I am trying to help with a suggestion!
Right I am going to try a couple of things. Firstly I am going to run one of my carts with OPC switched off for a day.
Then I am going to run the cart for a day with OPC on, and put some text next to the Square Radio Button saying 'If you wish to pay by credit or debit card, please select this payment method. NOTE: Please ensure you click the radio button before entering your card details, otherwise your transaction will fail' - stating the obvious!
And against the Paypal radio button - some text saying 'If you wish to pay by PAYPAL, please select this payment method, and then click 'Confirm Order' at the bottom of this page'
I know it may sound rediculous but there are 'some' customers that need instructions, where we may think it is obvious what to do.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
no, nick. you are wrong. that video does NOT highlight the problem. that video shows what YOU think is the problem. and in my testing, doing the exact keystrokes that you talk about, the problem does not manifest itself. that video clearly shows that.
in answer to your above suggestion, that is not possible. again that is inherent in square's implementation.
Quote:
Originally Posted by
Nick1973
This is just an idea by the way! I am trying to help with a suggestion!
Quote:
Originally Posted by
carlwhat
i have a suggestion for you. why don't you do a screencast similar to what i did, showing the exact sequence where an order goes through using your keystrokes. and then one where it does not.
why don't you take the time for my suggestion as opposed to making additional suggestions? perhaps your video would more clearly delineate the steps for this problem to occur.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
no, nick. you are wrong. that video does NOT highlight the problem. that video shows what YOU think is the problem. and in my testing, doing the exact keystrokes that you talk about, the problem does not manifest itself. that video clearly shows that.
in answer to your above suggestion, that is not possible. again that is inherent in square's implementation.
why don't you take the time for my suggestion as opposed to making additional suggestions? perhaps your video would more clearly delineate the steps for this problem to occur.
Well if you think that isn't a problem, then you clearly are blind as it clearly is a problem. I even have clients complaining about this now actually and am having to switch off OPC for them as a result.
'in answer to your above suggestion, that is not possible. again that is inherent in square's implementation.' - well if that is the case, then why does it work with the standard zen cart checkout without those issues but not with OPC? I am struggling here as one works, the other doesn't.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
no, nick. you are wrong. that video does NOT highlight the problem. that video shows what YOU think is the problem. and in my testing, doing the exact keystrokes that you talk about, the problem does not manifest itself. that video clearly shows that.
in answer to your above suggestion, that is not possible. again that is inherent in square's implementation.
why don't you take the time for my suggestion as opposed to making additional suggestions? perhaps your video would more clearly delineate the steps for this problem to occur.
Look your video does clearly show the problem, I am amazed that you can't even see it?
Those strokes are the exact ones that I tried. And also I tried without OPC, the same strokes. Without OPC the payment goes through, with OPC it doesn't.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
no, nick. you are wrong. that video does NOT highlight the problem. that video shows what YOU think is the problem. and in my testing, doing the exact keystrokes that you talk about, the problem does not manifest itself. that video clearly shows that.
in answer to your above suggestion, that is not possible. again that is inherent in square's implementation
why don't you take the time for my suggestion as opposed to making additional suggestions? perhaps your video would more clearly delineate the steps for this problem to occur.
I don't know why but I can't get a screencast at the moment anyway. But in it's simplest terms, try the exact same strokes as in your video on the standard checkout, and you will see the issue. You will see on the standard checkout, payments go through no problem. On OPC, they do not!
Customers complaining that they can't pay through OPC are the one's which decide if there is an issue. If they can't pay, there is an issue. I am going to try sticking instructional text next to each radio button to state the obvious, and I do understand your point in some ways. Clicking the radio button should be common sense. However, customers don't always think with common sense. And those are the people that tell us if they are having problems making payments through the checkout.
The other issue is, even if I put instructional text next to those radio buttons, there will be some that still start entering card details and think it has automatically selected the radio button, and therefore they will still get the error and then click off and go somewhere else to get what they want.
For me at the moment, the standard checkout works better than OPC with Square, which is a great shame as OPC is the better one. Although it has got a bit sluggish to be honest and hangs in a place or two.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
Look your video does clearly show the problem, I am amazed that you can't even see it?
Those strokes are the exact ones that I tried. And also I tried without OPC, the same strokes. Without OPC the payment goes through, with OPC it doesn't.
i would suggest these things:
- review the above post. https://tinyurl.com/2probynf
- post a screencast your self documenting the error.
- review this statement from the above mentioned post:
- with regards to the 2 situations you mention above, i have a couple of videos. a GENERIC DECLINE is coming back from square. the SQ-MISSING-TOKEN error is an error from square_webPay as we are not submitting anything to square as we do not have the result from the first step of the process.
- my screencast clearly shows communication from square. not a missing token.
-
Re: Square WebPay support thread.
Code:
[06-Jul-2022 17:51:21 Europe/London] 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 /home/my_vps/public_html/includes/modules/payment/square_webPay.php on line 234
ZC v1.5.7d
OPC v2.4.1
PayPal EC
Testing Square WebPay on a live site for the first time. Forgive me for not fully following the previous posts regarding this error/notice but to explain simply (I hope):
Checking out as a guest and using Square WebPay as the payment method I enter the CC info and click the Confirm button, the checkout_one page refreshes showing the SQ-MISSING-TOKEN error message with the above PHP notice in the \logs folder. It makes no difference if I first click the Square radio button or go straight to entering CC info.
I have tried renewing the token manually (mywebsite.co.uk/squareWebPay_handler.php) and nothing looks awry, to me, in the browser's console - everything is returning 200 OK.
I am open to any debug suggestions.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
i would suggest these things:
- review the above post. https://tinyurl.com/2probynf
- post a screencast your self documenting the error.
- review this statement from the above mentioned post:
- with regards to the 2 situations you mention above, i have a couple of videos. a GENERIC DECLINE is coming back from square. the SQ-MISSING-TOKEN error is an error from square_webPay as we are not submitting anything to square as we do not have the result from the first step of the process.
- my screencast clearly shows communication from square. not a missing token.
Yep and around in circles we go again lol
Try the same method on the standard checkout and you will clearly see the issue.
I have customers telling me they can't checkout using OPC with Square Webpay because they get the SQ-MISSING-TOKEN error. They don't understand that error as they are not technically minded.
The minute they checkout using the standard zen cart checkout, there isn't an error. It works! Therefore something isn't quite right.
-
1 Attachment(s)
Re: Square WebPay support thread.
Quote:
Originally Posted by
simon1066
Code:
[06-Jul-2022 17:51:21 Europe/London] 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 /home/my_vps/public_html/includes/modules/payment/square_webPay.php on line 234
ZC v1.5.7d
OPC v2.4.1
PayPal EC
Testing Square WebPay on a live site for the first time. Forgive me for not fully following the previous posts regarding this error/notice but to explain simply (I hope):
Checking out as a guest and using Square WebPay as the payment method I enter the CC info and click the Confirm button, the checkout_one page refreshes showing the SQ-MISSING-TOKEN error message with the above PHP notice in the \logs folder. It makes no difference if I first click the Square radio button or go straight to entering CC info.
I have tried renewing the token manually (mywebsite.co.uk/squareWebPay_handler.php) and nothing looks awry, to me, in the browser's console - everything is returning 200 OK.
I am open to any debug suggestions.
Screenshot of the Console:
Edit: removing image I'll repost with my oauth details removed.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
hi vic,
i wish these situations were the case. i am not able to reproduce it on your site. i am only able to fix what i can reproduce.
allow me to explain a little bit about this process: it is a 2-step process; the first step sends the credit card data to square, it returns a token. square_webPay takes this token, adds it onto the html form on the OPC page, and then submits the whole form to your zen-cart installation. at that point, ZC has control, and then ZC submits that token to square.
if for whatever reason that token does NOT make it onto the html form, you see the error that you are getting.
with regards to the 2 situations you mention above, i have a couple of videos. a GENERIC DECLINE is coming back from square. the SQ-MISSING-TOKEN error is an error from square_webPay as we are not submitting anything to square as we do not have the result from the first step of the process:
https://www.dropbox.com/s/i3zc3t5diu...20PM.webm?dl=0
https://www.dropbox.com/s/6mc9y5gvf3...20PM.webm?dl=0
you are correct here. the previous module selected the radio button the moment you touched the input fields. the webPay module selects the radio button after the first input, and NOT when a field gets focused.
unfortunately that is impossible to change due to the architecture of the new square infrastructure. it was something that i remember looking at rather closely. but again this is not the problem as one can see from my videos.
that said, i DO appreciate the troubleshooting with the specific keystrokes that you think are causing the problem. if we are able to reproduce it, we can then fix it.
best.
Hi Carl,
I have posted three videos of the following scenarios that I hope might help. They are from the same live site you tested on and unchanged in any way.
No Radio button selected, card data entered directly. returns SQ_Missing_Token
https://drive.google.com/file/d/16Bi...ew?usp=sharing
Radio Button Selected by user then card data entered returns Generic_Decline
https://drive.google.com/file/d/1mrO...ew?usp=sharing
After getting SQ_Missing_Token card data entered immediately again giving Generic_Decline
https://drive.google.com/file/d/1RpE...ew?usp=sharing
I hope it can be of help to visually see the results.
Also when I turn off OPC and have the standard checkout process, entering the card details directly into the card fields without selecting the radio button, gives the positive result the Generic_Decline.
Hope the results are useful.
Kind regards
Vic :smile:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Valencia
Hi Carl,
I have posted three videos of the following scenarios that I hope might help. They are from the same live site you tested on and unchanged in any way.
No Radio button selected, card data entered directly. returns SQ_Missing_Token
https://drive.google.com/file/d/16Bi...ew?usp=sharing
Radio Button Selected by user then card data entered returns Generic_Decline
https://drive.google.com/file/d/1mrO...ew?usp=sharing
After getting SQ_Missing_Token card data entered immediately again giving Generic_Decline
https://drive.google.com/file/d/1RpE...ew?usp=sharing
I hope it can be of help to visually see the results.
Also when I turn off OPC and have the standard checkout process, entering the card details directly into the card fields without selecting the radio button, gives the positive result the Generic_Decline.
Hope the results are useful.
Kind regards
Vic :smile:
This is what I am getting with OPC:
No Radio button selected, card data entered directly. returns SQ_Missing_Token
https://drive.google.com/file/d/16Bi...ew?usp=sharing
If the radio button is checked before entering the card details, the payment works. If it isn't checked, it doesn't work. Your video highlights the this scenario.
If you do the the same process on the standard checkout, it works perfectly as it should.
-
Re: Square WebPay support thread.
in trying to activate the token this error is being generated:
[11-Jul-2022 08:42:47 America/Chicago] Request URI: /squareWebPay_handler.php?code=sq0cgp-hSqjZnDct9f2STlglgrcSQ&response_type=code&state=7797894d5590c14fe34769c3199a7d85 8dbc1c6646e6b65a1f1589a6bf27439a, IP address: 66.232.98.194
--> PHP Fatal error: Uncaught Error: Class 'Square\Models\ObtainTokenRequest' not found in /includes/modules/payment/square_webPay.php:690
Stack trace:
#0 /squareWebPay_handler.php(33): square_webPay->exchangeForToken('sq0cgp-hSqjZnDc...')
#1 {main}
thrown in /includes/modules/payment/square_webPay.php on line 690.
I checked and made sure all the files were uploaded and the old module removed.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
delia
I checked and made sure all the files were uploaded and the old module removed.
If you actually removed the files from their locations, that can be part of the problem.
The best way is to have all the files on the site but, don't click on install.
If all the old files are on the site, go to the circled i for the old square. If it says Install Module, all is fine. If not, click on Remove Module which actually leaves needed files on the site.
-
Re: Square WebPay support thread.
Getting emails saying
Authorization error: 'VOICE_FAILURE' Sent to Square: SquareModelsCreatePaymentRequest Object ....
Sometimes the charge succeeds on retry; other times the customer has to switch to PayPal or some other payment method.
-
Re: Square WebPay support thread.
I guess what I'm wondering is, if it's possible to deduce that you're in this state and give a message to the customer in the cart.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
swguy
I guess what I'm wondering is, if it's possible to deduce that you're in this state and give a message to the customer in the cart.
how do you know i'm not already doing that?
error messages are already added to the message stack and displayed to the customer. see:
https://github.com/proseLA/square_we....php#L428-L433
line 431.
-
Re: Square WebPay support thread.
@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.