-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
i would have to run some more transactions. i am not sure why a customer would be stuck at the handler for 30s.
Another one was stuck for 15 mins until he disappeared from the Whos online-list.
Quote:
Originally Posted by
carlwhat
remind me of your setup with regards to OAuth renewal? specifically do you have
an automated job set up like in the docs?
if you do not have a cronjob set up, i would set that up. if you do already have it set up, set $verbose to true, to see the results of it.
I do not have a cronjob setup. My understanding is that a cronjob is only necessary if very few payments (meaning several days of inactivity) are made by Square. The error also happened when another person ordered successfully one hour before.
Quote:
Originally Posted by
carlwhat
and how many orders paid by square are you getting each week?
By Square around 30.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
Another one was stuck for 15 mins until he disappeared from the Whos online-list.
I do not have a cronjob setup. My understanding is that a cronjob is only necessary if very few payments (meaning several days of inactivity) are made by Square. The error also happened when another person ordered successfully one hour before.
By Square around 30.
i would setup the cron job. and then keep on monitoring.
i think the holdup on the handler is due to a renew of the OAuth. if the cronjob automatically renews it, then the customer will not be waiting on it.
i am not sure that is your answer. but it is DEFINITELY worth a shot.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
i would setup the cron job. and then keep on monitoring.
i think the holdup on the handler is due to a renew of the OAuth. if the cronjob automatically renews it, then the customer will not be waiting on it.
i am not sure that is your answer. but it is DEFINITELY worth a shot.
best.
OK, I set it up. Let's see what happens.
Thank you for your advice.
-
Re: Square WebPay support thread.
Maybe this is a known issue but I didn't find it when I searched. I'm running 1.5.7c and if I make a test order and get to the payment page and do not put anything in the credit card/exp/zip and just click continue on the cart I get:
"We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN"
I am just trying to recreate what a customer will eventually do and then email me. LoL. Seems like it should have a different error for blank fields or do a check somewhere.
Has anyone modified the code to address this?
Thanks!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
spyderrobotics
Maybe this is a known issue but I didn't find it when I searched. I'm running 1.5.7c and if I make a test order and get to the payment page and do not put anything in the credit card/exp/zip and just click continue on the cart I get:
"We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN"
I am just trying to recreate what a customer will eventually do and then email me. LoL. Seems like it should have a different error for blank fields or do a check somewhere.
Has anyone modified the code to address this?
Thanks!
are you using one page checkout? if so, what version.
do you have this key in your version of OPC:
Key: CHECKOUT_ONE_PAYMENT_METHODS_THAT_SUBMIT
and if so, what is it set to.
if you do not have that key, you need to upgrade your version of OPC.
-
Re: Square WebPay support thread.
Thanks for the response. I am not using OPC.
-
Re: Square WebPay support thread.
More info:
Just found this. So if I have the paypal module enabled it works and flags it. However, if the square webpay module is the only payment module then it has the error.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
spyderrobotics
More info:
Just found this. So if I have the paypal module enabled it works and flags it. However, if the square webpay module is the only payment module then it has the error.
i am not able to reproduce this on my test system.
-
Re: Square WebPay support thread.
Thanks for looking into it. I am not sure where to go from here. Maybe I can change the error message to just tell the customer to check that the fields are not blank. If you wanted to check it out my site is spyderrobotics.com
I have paypal turned off at the moment so it can recreate the error. You can make a fake account and try the checkout.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
spyderrobotics
Thanks for looking into it. I am not sure where to go from here. Maybe I can change the error message to just tell the customer to check that the fields are not blank. If you wanted to check it out my site is spyderrobotics.com
I have paypal turned off at the moment so it can recreate the error. You can make a fake account and try the checkout.
if a customer tries to hit continue without entering any credit card data, one certainly gets that error message.
that is reproducible on my test system.
perhaps, it may be of value to change that error message. i will give it some thought...
best.
-
Re: Square WebPay support thread.
-
1 Attachment(s)
Re: Square WebPay support thread.
Quote:
Originally Posted by
spyderrobotics
Thanks for looking into it. I am not sure where to go from here. Maybe I can change the error message to just tell the customer to check that the fields are not blank. If you wanted to check it out my site is spyderrobotics.com
I have paypal turned off at the moment so it can recreate the error. You can make a fake account and try the checkout.
I get the same error with PayPal turned off:
"We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN"
If PayPal is turned ON and credit card is checked, but not entered, I get a friendly reminder to enter credit card number before proceeding to page 3 of checkout.
Friendly reminder is much nicer than error on store end.
Attachment 20215
Code:
[16-Feb-2023 14:23:08 America/Chicago] 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.
ok, a few changes coming.
for those of you who use square as the only payment method, and want to prevent the funny message, the cool kids way is here:
this file here:
includes/modules/pages/checkout_payment/jscript_square_webPay.php
Code:
//line 39 was:
if (document.querySelector('#pmt-square_webPay').checked) {
//change it to:
if ((document.querySelector('#pmt-square_webPay').checked) || (document.querySelector('#pmt-square_webPay').getAttribute('type') == 'hidden')) {
also, with that change, i do not think we will ever get here, but in:
includes/modules/payment/square_webPay.php
line 266, should be changed to something like:
PHP Code:
$messageStack->add_session('checkout_payment', 'uh... looks like you did not input a credit card number!', 'error');
these changes will be incorporated into a new release.
thank you to those who support me.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
ok, a few changes coming.
for those of you who use square as the only payment method, and want to prevent the funny message, the cool kids way is here:
this file here:
includes/modules/pages/checkout_payment/jscript_square_webPay.php
Code:
//line 39 was:
if (document.querySelector('#pmt-square_webPay').checked) {
//change it to:
if ((document.querySelector('#pmt-square_webPay').checked) || (document.querySelector('#pmt-square_webPay').getAttribute('type') == 'hidden')) {
also, with that change, i do not think we will ever get here, but in:
includes/modules/payment/square_webPay.php
line 266, should be changed to something like:
PHP Code:
$messageStack->add_session('checkout_payment', 'uh... looks like you did not input a credit card number!', 'error');
these changes will be incorporated into a new release.
thank you to those who support me.
Thanks carlwhat.
square_webPay-master from 7/26/2022. My code line was actually line 179 instead of 39, and there's an extra space before { on the example (which made finding it weird), but it works now!
I didn't change the messageStack, because I couldn't determine which line needed changing, but agree we probably won't get there.
:smile:
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
VDecalS
Thanks carlwhat.
square_webPay-master from 7/26/2022. My code line was actually line 179 instead of 39, and there's an extra space before { on the example (which made finding it weird), but it works now!
I didn't change the messageStack, because I couldn't determine which line needed changing, but agree we probably won't get there.
:smile:
my apologies. it was late, and i was looking at the wrong file for the line number.
it is ~around line 180, and according to my code, line 185 on v1.0.3.
thanks for confirming the fix.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
i would setup the cron job. and then keep on monitoring.
i think the holdup on the handler is due to a renew of the OAuth. if the cronjob automatically renews it, then the customer will not be waiting on it.
i am not sure that is your answer. but it is DEFINITELY worth a shot.
best.
The cronjob was no success. I just had someone get stuck several times at squareWebPay_handler.php again. The squareWebPay_handler.php displayed "not expired" because I had verbose set to true. The order finally came through, but of course I do not know why.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
The cronjob was no success. I just had someone get stuck several times at squareWebPay_handler.php again. The squareWebPay_handler.php displayed "not expired" because I had verbose set to true. The order finally came through, but of course I do not know why.
of course, i do not know why either.
that said, here is my new working theory... this has nothing to do with square.... or at least nothing to do with the handler...
the handler comes back with "not expired". in looking at that part of the code, if that is the return, getting to that return should not take any time at all. or at least nothing associated with the kind of delays that you seeing. "not expired" means we looked at the OAuth, and it is fine, and lets go back to our normal scheduled programming. now whether square itself is having an issue in communicating within japan, i can not say.
what your user is waiting for is up for anyone's guess. the fact that you are looking at who's online, and a user is stuck at the handler, is not definitive evidence that the handler is what is causing the problem. the only thing that tells me is that who's online is reporting that the last place i have seen this customer is at the handler. i have not dug deep into that code, but again, i do not have completer confidence that is where the last point is.
have you tried contacting the user after this experience to see what their experience is?
given that this situation is only happening for you, i find it hard to imagine that it is my code that is causing this problem. no one else is having these issues. might you have some sort of order conversion tracking on your website? something else may entirely be holding this order up... or not...
i appreciate you reporting this issue, but i am now not sure what your expectation is from me or from anyone on the zen-cart boards.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
of course, i do not know why either.
that said, here is my new working theory... this has nothing to do with square.... or at least nothing to do with the handler...
the handler comes back with "not expired". in looking at that part of the code, if that is the return, getting to that return should not take any time at all. or at least nothing associated with the kind of delays that you seeing. "not expired" means we looked at the OAuth, and it is fine, and lets go back to our normal scheduled programming. now whether square itself is having an issue in communicating within japan, i can not say.
what your user is waiting for is up for anyone's guess. the fact that you are looking at who's online, and a user is stuck at the handler, is not definitive evidence that the handler is what is causing the problem. the only thing that tells me is that who's online is reporting that the last place i have seen this customer is at the handler. i have not dug deep into that code, but again, i do not have completer confidence that is where the last point is.
have you tried contacting the user after this experience to see what their experience is?
given that this situation is only happening for you, i find it hard to imagine that it is my code that is causing this problem. no one else is having these issues. might you have some sort of order conversion tracking on your website? something else may entirely be holding this order up... or not...
i appreciate you reporting this issue, but i am now not sure what your expectation is from me or from anyone on the zen-cart boards.
I do not contact the customer, because it makes no good impression to let them know they are followed in their activities in the shop (I know big players are doing much creepier stuff, but you get the point). Also I would have to explain why I can not find the error myself and it just seems too much hassle to bother the customer with.
I thought about a slow Square server, too. However I had customers who tried to checkout hours later and still had the same error. So a slow server seems not to be the reason.
I don't think the error is connected to your code. Since you are very familiar how Square functions, my initial thought was, that you might have an idea what the problem might be.
-
Re: Square WebPay support thread.
While setting this up for a client, ran into a few bugs that I did manage to fix. 2 seem to be related to an error condition that shouldn't happen (but somehow managed to make it happen) and the third is related to said situation. All are in the same file `includes/modules/payment/square_webPay.php`
in `admin_notification` around line 530 change to :
Code:
$transaction = is_array($records) ? $records[0] : $records;
in `lookupOrderDetails` there are two instances of calling `return new Models\Order;` that will fail as it expects a Location ID. One around line 897 and the other around 915. Both should be changed to the following:
Code:
$location = $this->getLocationDetails();
return new Models\Order($location->getId());
-
Re: Square WebPay support thread.
zen cart 1.5.8
square web pay 1.0.4
bootstrap 3.5.2
I have an issue where the terms and conditions do not need to be ticked for an order to go through. I think it is connected to JavaScript and using preventDefault method. I believe that this means that required fields are not checked when the form is submitted. I have resolved the issue by adding the following to includes/modules/pages/checkout_payment/jscript_square_webPay.php
original starting line 157
Code:
var verifyBuyerResult = document.createElement("input");
verifyBuyerResult.setAttribute("type", "hidden");
verifyBuyerResult.setAttribute("name", "verifyBuyerResult");
verifyBuyerResult.setAttribute("value", JSON.stringify(verificationToken));
document.querySelector('[name="checkout_payment"]').appendChild(verifyBuyerResult);
cardButton.disabled = false;
document.forms["checkout_payment"].submit();
new
Code:
var verifyBuyerResult = document.createElement("input");
verifyBuyerResult.setAttribute("type", "hidden");
verifyBuyerResult.setAttribute("name", "verifyBuyerResult");
verifyBuyerResult.setAttribute("value", JSON.stringify(verificationToken));
document.querySelector('[name="checkout_payment"]').appendChild(verifyBuyerResult);
cardButton.disabled = false;
let isFormValid = document.forms["checkout_payment"].checkValidity();
if (isFormValid) {
document.forms["checkout_payment"].submit();
} else {
document.forms["checkout_payment"].reportValidity();
}
Something similar may be required for one page checkout!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
brittainmark
zen cart 1.5.8
square web pay 1.0.4
bootstrap 3.5.2
I have an issue where the terms and conditions do not need to be ticked for an order to go through. I think it is connected to JavaScript and using preventDefault method. I believe that this means that required fields are not checked when the form is submitted. I have resolved the issue by adding the following to includes/modules/pages/checkout_payment/jscript_square_webPay.php
original starting line 157
Code:
var verifyBuyerResult = document.createElement("input");
verifyBuyerResult.setAttribute("type", "hidden");
verifyBuyerResult.setAttribute("name", "verifyBuyerResult");
verifyBuyerResult.setAttribute("value", JSON.stringify(verificationToken));
document.querySelector('[name="checkout_payment"]').appendChild(verifyBuyerResult);
cardButton.disabled = false;
document.forms["checkout_payment"].submit();
new
Code:
var verifyBuyerResult = document.createElement("input");
verifyBuyerResult.setAttribute("type", "hidden");
verifyBuyerResult.setAttribute("name", "verifyBuyerResult");
verifyBuyerResult.setAttribute("value", JSON.stringify(verificationToken));
document.querySelector('[name="checkout_payment"]').appendChild(verifyBuyerResult);
cardButton.disabled = false;
let isFormValid = document.forms["checkout_payment"].checkValidity();
if (isFormValid) {
document.forms["checkout_payment"].submit();
} else {
document.forms["checkout_payment"].reportValidity();
}
Something similar may be required for one page checkout!
this makes sense.
good catch.
best,
-
Re: Square WebPay support thread.
Hello all,
Zen Cart 1.5.8
Using Bootstrap 3.5.3
I am able to verify or accept transactions by going to square.. but I am no longer able to do it through the DETAILS option of an order..
I'm getting this error:
"The configuration of the order's payment module (square_webPay) has changed. No refunds, auths, captures or voids can be done for this order."
My module is Green...
Thanks for any help!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
brian70809
Hello all,
Zen Cart 1.5.8
Using Bootstrap 3.5.3
I am able to verify or accept transactions by going to square.. but I am no longer able to do it through the DETAILS option of an order..
I'm getting this error:
"The configuration of the order's payment module (square_webPay) has changed. No refunds, auths, captures or voids can be done for this order."
My module is Green...
Thanks for any help!
i think you have a token issue.
are you sure you can accept new orders using square webPay?
you are saying you can not do refunds or voids or captures from the admin side. and it looks like the problem is due to an invalid token.
review documentation and this thread for configuring the handler, and ensure that you have a valid token.
best.
-
Re: Square WebPay support thread.
Hello,
Using ZenCart 1.5.6c, MariaDB 10.3.24, PHP 7.3.15 (I do have an upgrade plan to PHP 8.2.x and ZenCart 1.5.8a in the next 3 months)
I've tried to use Square Web Payments and the 1st page of checkout looks good, I am able to enter credit card details, 2nd page passes, and when going to the 3rd page I get a "An error has occured, please refresh the page" error. When I refresh the page, I go back to page 1 of checkout (where I can enter credit card details), with a "nonce already used for a transaction, please obtain a new nonce".
The error log for the initial "an error has occurred" shows this:
Code:
#8 require(/<edited>/Public/html/shop/includes/modules/pages/checkout_process/header_php.php) called at [/<edited>/Public/html/shop/index.php:36]
--> PHP Fatal error: 1364:Field 'transaction_id' doesn't have a default value :: INSERT INTO square_payments (order_id, location_id, payment_id, sq_order, created_at) VALUES ('171', 'Q5...<edited>...MS9', '7BCuB7lE1...<edited>...0hd9HZY', 'yeyuuRe...<edited>...tBdQJZY', now()) ==> (as called by) /<edited>/Public/html/shop/includes/functions/functions_general.php on line 952 <== in /<edited>/Public/html/shop/includes/classes/db/mysql/query_factory.php on line 171.
Do I need to edit the Square code to have some default value for the transaction ID?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
gernot
Hello,
Using ZenCart 1.5.6c, MariaDB 10.3.24, PHP 7.3.15 (I do have an upgrade plan to PHP 8.2.x and ZenCart 1.5.8a in the next 3 months)
I've tried to use Square Web Payments and the 1st page of checkout looks good, I am able to enter credit card details, 2nd page passes, and when going to the 3rd page I get a "An error has occured, please refresh the page" error. When I refresh the page, I go back to page 1 of checkout (where I can enter credit card details), with a "nonce already used for a transaction, please obtain a new nonce".
The error log for the initial "an error has occurred" shows this:
Code:
#8 require(/<edited>/Public/html/shop/includes/modules/pages/checkout_process/header_php.php) called at [/<edited>/Public/html/shop/index.php:36]
--> PHP Fatal error: 1364:Field 'transaction_id' doesn't have a default value :: INSERT INTO square_payments (order_id, location_id, payment_id, sq_order, created_at) VALUES ('171', 'Q5...<edited>...MS9', '7BCuB7lE1...<edited>...0hd9HZY', 'yeyuuRe...<edited>...tBdQJZY', now()) ==> (as called by) /<edited>/Public/html/shop/includes/functions/functions_general.php on line 952 <== in /<edited>/Public/html/shop/includes/classes/db/mysql/query_factory.php on line 171.
Do I need to edit the Square code to have some default value for the transaction ID?
There should have been more to that log than just the final "who did it" that includes the who-called-who-at-what line information. From what you've posted, all I can decipher is that someone called a function in functions_general.php during the checkout_process step.
I'm not sure how much I can help (@carlwhat is on vacation for the next couple of weeks), but I'll try my best if I have sufficient data to muddle my way through!
-
Re: Square WebPay support thread.
My apologies, I mistakenly thought I should par the log down to the last part. Here the full entry:
Code:
[21-May-2023 15:29:33 Asia/Tokyo] Request URI: /shop/index.php?main_page=checkout_process, IP address: 192.168.1.3
#1 trigger_error() called at [/home/hase/Public/html/shop/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/home/hase/Public/html/shop/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/home/hase/Public/html/shop/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/home/hase/Public/html/shop/includes/functions/functions_general.php:952]
#5 zen_db_perform() called at [/home/hase/Public/html/shop/includes/modules/payment/square_webPay.php:512]
#6 square_webPay->after_process() called at [/home/hase/Public/html/shop/includes/classes/payment.php:254]
#7 payment->after_process() called at [/home/hase/Public/html/shop/includes/modules/pages/checkout_process/header_php.php:17]
#8 require(/home/hase/Public/html/shop/includes/modules/pages/checkout_process/header_php.php) called at [/home/hase/Public/html/shop/index.php:36]
--> PHP Fatal error: 1364:Field 'transaction_id' doesn't have a default value :: INSERT INTO square_payments (order_id, location_id, payment_id, sq_order, created_at) VALUES ('171', 'Q5F86K1K1WMS9', '7BCuB7lE1Gz7rsvNayHoyV0hd9HZY', 'yeyuuReM6B3qnxe42yZCTrtBdQJZY', now()) ==> (as called by) /home/hase/Public/html/shop/includes/functions/functions_general.php on line 952 <== in /home/hase/Public/html/shop/includes/classes/db/mysql/query_factory.php on line 171.
-
Re: Square WebPay support thread.
Thanks, @gernot. It'll take me a while (as always), since I don't have any clients who use that payment method, to be able to review the payment method's handling and see why (in this case) the transaction_id was missing.
What version of Square WebPay are you using?
-
Re: Square WebPay support thread.
Hello @lat9,
Thank you very much. I am using v1.0.4 (the current latest). For the (non-Web) Square module I have v1.5 installed, but it is disabled.
I will try to see what I can do on my own, I'm just not sure if the "default transaction ID" is something that should be available and is not being picked up, or whether it is something that needs to be created from inside the plugin.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
gernot
Hello @lat9,
Thank you very much. I am using v1.0.4 (the current latest). For the (non-Web) Square module I have v1.5 installed, but it is disabled.
I will try to see what I can do on my own, I'm just not sure if the "default transaction ID" is something that should be available and is not being picked up, or whether it is something that needs to be created from inside the plugin.
omg! there is documentation in the code! who knew:
PHP Code:
/**
* Check and fix table structure if appropriate
*
* Note: The tender_id and transaction_id fields are no longer populated; but are left behind in older installs for lookup of history
*/
the error that you are no receiving is due to the version of mysql you are running. you need to alter the table to allow null for transaction_id. see here:
https://stackoverflow.com/questions/...-to-allow-null
you can go into phpmyadmin or use mysql via the command line and need to run a command like:
Code:
ALTER TABLE square_payments MODIFY transaction_id null;
or something like that.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
gernot
Hello @lat9,
Thank you very much. I am using v1.0.4 (the current latest). For the (non-Web) Square module I have v1.5 installed, but it is disabled.
I will try to see what I can do on my own, I'm just not sure if the "default transaction ID" is something that should be available and is not being picked up, or whether it is something that needs to be created from inside the plugin.
It would help to see if there are additional PHP Notices being logged at the time of the error. Since you're running zc156c, you can install Report All Errors (https://www.zen-cart.com/downloads.php?do=file&id=1792) and set the storefront setting to IgnoreDups.
P.S. Thanks, @carlwhat, your post came in while I was distracted in my response!
-
Re: Square WebPay support thread.
Hello @carlwhat
Many thanks! I could change the table to accept Null as a valid value with
Code:
ALTER TABLE square_payments MODIFY transaction_id varchar(255);
since varchar(255) by default accepts NULL.
Hello @lat9
Thank you for the recommendation, I will test further and attempt to install this plugin for better debugging.
-
Re: Square WebPay support thread.
When I have this module uploaded to my server it doesn't give me the square_webPay option on the payment module. It then also blocks any of the payment modules to have the side menu open on the page. If I delete or rename the /includes/modules/payment/square_webPay.php file then the other payment modules allow the menus to open. I can't install this module if I can't get the menus to open. I did have the old square payment module installed and it stopped working (can't click on text boxes during checkout). I clicked on remove module so the icon is red now, but I can't get the square_webPay to load. (zencart v1.5.7b, php 5.6)
-
Re: Square WebPay support thread.
Perhaps there's a log file in the /logs folder that would help us understand what's happening?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
swguy
Perhaps there's a log file in the /logs folder that would help us understand what's happening?
unfortunately not
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jwlamb
unfortunately not
according to the very thorough documentation this module requires php 7.4 although it has been tested and worked with php 7.3. see:
https://www.zen-cart.com/downloads.php?do=file&id=2345
php 5.6 is not supported nor will it work.
best.
-
Re: Square WebPay support thread.
I'd like to reduce the empty vertical space below the credit card info entry box and above the next payment method on the checkout_payment page. Using browser web developer tools, I see there is a hidden button with id="card-button" with text "Use Credit Card" that takes up 21.5 px vertically. When I use the Square payment method, I never see this button. Under what conditions does this button become visible and can the vertical space taken up by the button be eliminated when hidden? Can anyone suggest an approach to reduce this empty space?
Thank you!
zc157c, php8.0.2, Square WebPay 1.0.2
-
Re: Square WebPay support thread.
Are you using the standard three-page checkout or something like OPC?
-
Re: Square WebPay support thread.
I'm using the standard 3-page checkout and standard non-responsive template. Updated to 1.0.4 with no change to appearance.
Dave
-
Re: Square WebPay support thread.
Care to give us a look? Use yoursiteDOTcom if you are not ready for the world to see it.
-
Re: Square WebPay support thread.
Sure. "store.febt DOT org".
Dave
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Dave224
I'd like to reduce the empty vertical space below the credit card info entry box and above the next payment method on the checkout_payment page. Using browser web developer tools, I see there is a hidden button with id="card-button" with text "Use Credit Card" that takes up 21.5 px vertically. When I use the Square payment method, I never see this button. Under what conditions does this button become visible and can the vertical space taken up by the button be eliminated when hidden? Can anyone suggest an approach to reduce this empty space?
Thank you!
zc157c, php8.0.2, Square WebPay 1.0.2
I think that this button is redundant in Zen Cart, it's the equivalent of ZC's Confirm/Pay Now/Confirm Order button at the end of step 3. Due to the way the surrounding divs overlap you would only save 17px if you 'removed' it.
In browser dev tools try adding display:none; to the element and you'll see that that hides it fully. I guess you would need to change the 'visibility: hidden;' to 'display:none;' in includes\modules\pages\checkout_payment\jscript_square_webPay.php (try searching it for 'card-button').
For me, it would be more trouble than it's worth given I would be editing a plugins core file.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
simon1066
...In browser dev tools try adding display:none; to the element and you'll see that that hides it fully. I guess you would need to change the 'visibility: hidden;' to 'display:none;' in includes\modules\pages\checkout_payment\jscript_square_webPay.php (try searching it for 'card-button').
For me, it would be more trouble than it's worth given I would be editing a plugins core file.
Of course an easier way might be to just add that display:none to your stylesheet! Try it out.
(Why is it I always go for the complicated way first?)
-
Re: Square WebPay support thread.
Yeah, I thought of both those approaches but was hesitant because I don't know if that button ever gets displayed to the customer and under what conditions it would be displayed. Think I'll wait until dbltoe responds. But thank you!
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Dave224
Yeah, I thought of both those approaches but was hesitant because I don't know if that button ever gets displayed to the customer and under what conditions it would be displayed. Think I'll wait until dbltoe responds. But thank you!
ha ha ha.... oh my that's a good one...
simon's approach is a good one. it was recommended by me to swguy previously, although i could not find it on this thread.
the card-button code is just a place holder for the square javascript to replace. if the customer does see it, then you have a problem, as it is not meant for the customer to see.
best.
-
4 Attachment(s)
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
php 5.6 is not supported nor will it work.
If I switch to 7.3/7.4 or even 8.0/8.1 then the list doesn't fully populate. I'm not sure what setting I'm messing up, but this just isn't working for me.
5.6 without the php file square_webPay.php
Attachment 20306
5.6 with the php file square_webPay.php, note the install box on right disappears. Also note that square webPay is not listed in the list.
Attachment 20307
7.3 and 7.4, list is shortened and Square webPay still not shown
Attachment 20308
8.0 and 8.1, list is almost gone
Attachment 20309
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jwlamb
7.3 and 7.4, list is shortened and Square webPay still not shown
Also to note, if on php 7.3 or higher, then PayPal disappears from the list, currently that is the only payment module that is working.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Dave224
Yeah, I thought of both those approaches but was hesitant because I don't know if that button ever gets displayed to the customer and under what conditions it would be displayed. Think I'll wait until dbltoe responds. But thank you!
That's like waiting on the apprentice to outdo the master:P
I was simply trying to get one of the items the posting tips asks for in these instances, a URL for the site in question.
I will add from the accessibility standpoint that display:none and visibility:hidden often have to have a little different manipulation to meet accessibility AND HTML standards. While hidden removes both the image and any reference in a screen reader, hidden does not "eat up" the space used by the item.
Also, looking at the site, you need a lot of work to get the site into current things like a responsive template. But that should be in a different thread.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jwlamb
If I switch to 7.3/7.4 or even 8.0/8.1 then the list doesn't fully populate. I'm not sure what setting I'm messing up, but this just isn't working for me.
5.6 without the php file square_webPay.php
Attachment 20306
5.6 with the php file square_webPay.php, note the install box on right disappears. Also note that square webPay is not listed in the list.
Attachment 20307
7.3 and 7.4, list is shortened and Square webPay still not shown
Attachment 20308
8.0 and 8.1, list is almost gone
Attachment 20309
square webpay requires…. whatever i said above. php 7.4.
i would remove square webpay and try to run your site as it currently exists to run under 7.4. i do not see that in your post. i think 1 of your other payment modules is choking. and you can see that by removing square webpay and trying to run php 7.4.
in addition you said you are not getting any log files. that’s a problem. your screenshots clearly indicate fatal errors and properly configured systems should have log files.
i would talk to your hosting company to find out why you are not seeing those log files and to track them down. withou log files troubleshooting is very difficult and again what you are posting clearly indicates problems for which log files should be generated.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
I think 1 of your other payment modules is choking
Not sure which one, but I deleted all of them except PayPal, Square (old version), and Square webPay. It works now on 7.4. :frusty:
-
Re: Square WebPay support thread.
Hi, firstly thank you Carl for creating this (and to all the others on here who give their time generously, it is appreciated by amateurs like me!). I assist a friend with his site, I set it up around ten years ago and we have done a couple of upgrades so are now on the lovely ZC1.5.8a on PHP8.1 and mySQL5.7
So, i have installed the latest download of Square WebPay (1.04), now incase it helps anyone else Square seem to have updated how you get the API side setup, incase it helps anyone else, it is now slightly hidden, you have to go in to Developer ("Sqaure Developer"), if you don't have any existing app integrations this is tricky to find (unless i am just a bit thick :)
On the Dashboard menu onthe left, look for Settings at the bottom, then App Integrations. This will be empty apart from some featured apps and a big blue button to Visit app Marketplace, choose this, but then on the new page in the menu at the top choose the "More" drop down menu then choose "Square Developer".
* Regard this as an addition to Point 3 of the great notes found here! https://docs.zen-cart.com/user/payment/square/
Now, those notes make reference to Version 1.0.1 of Square Web Payments requires API Version 2022-02-16, so my first question is, "Is this still true for version 1.0.4 of the SquareWebPay module? Or should I just leave it on the latest which it defaults to? (which is 16 versions ahead so this seems unlikely).
Second question (sorry!) in the help files it makes reference to a change made in version 1.02 to cope with ZC website that are in a subfolder (ours is). It mentions properly defining in the config file the "DIR_WS_HTTPS_CATALOGUE constant", now we haven't, we haven't needed to so far, the notes in those files seem to suggest it will be autodetected so ours say:
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
Now there is a problem with the install as SquareWebPay is not showing up in the Admin - Modules sections and none of the others have the usual options to install/edit (and were all fine dyas ago!) so there is an issue with what i have done. I have checked and all the files are uploaded to the correct folders.
Is is down to this missing folder definition? To test this I made the change in both files (configure.php in both admin and store) - but only those two lines and it broke the site! the edits were:
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3');
(the store is in a folder called JPV3) - i have now changed it back and its working fine. Now i believe these are added to the https info and so maybe i just needed to reissue/renew the SSL cert? Not sure...
I did turn on admin logging and saw this in a log file:
PHP Fatal error: Uncaught Error: Class "Square\Environment" not found in /homepages/7/d456783090/htdocs/JPV3/includes/modules/payment/square_webPay.php:107
Does that help anyone point me in the right direction?
Any and all help greatly appreciated as I was hoping this would be plug and play but it hasnt been smooth so far :(
Thanks, George
-
Re: Square WebPay support thread.
Quote:
Now, those notes make reference to Version 1.0.1 of Square Web Payments requires API Version 2022-02-16, so my first question is, "Is this still true for version 1.0.4 of the SquareWebPay module? Or should I just leave it on the latest which it defaults to? (which is 16 versions ahead so this seems unlikely).
Square is constantly updating the API and, one of the newer could affect the way WebPay works. Stick with the suggested API until told different. Subscribe to this thread to make sure you receive any updates.
Code:
the edits were:
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3');
It appears you have a missing / in the HTTPS setting. It should be
Code:
the edits were:
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
Also, this is where it would help to see the entire config file (with sensitive info eliminated) but, do so in a different thread as it's off topic for WebPay.
Open the new thread, answer all the posting tips and let us know how the internet is "told" to go to your subfoder.
-
1 Attachment(s)
Re: Square WebPay support thread.
Hi thanks dbltoe for the help. I have left the API version on the one instructed. I retried with the update to the config files but it still goes wrong. In the help files it mentions properly defining in the config file the "DIR_WS_HTTPS_CATALOGUE constant", now we haven't, so
I made the change in both files (configure.php in both admin and store) - but only those two lines and it broke the site! the edits were:
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
(the store is in a folder called JPV3) - i have now changed it back and its working fine. Now i believe these are added to the https info and so maybe i just needed to reissue/renew the SSL cert? It broke the storefront not the admin side. The storefront wound up looking like this:
Attachment 20317
Any further help would be greatly appreciated. I know you mentioned starting this again in a new new thread but this does still relate to webpay as that won't show up in Admin and everything was/is fine in other respects and its the webpay specific instructions saying to do this. Thanks, George
-
Re: Square WebPay support thread.
Sorry, it doesn't relate in that WebPay would work if your settings were correct. It may take a few back and forths to get all corect and that shouldn't be done here.
Please open another thread and provide copies of your two config files with admin folder, database user/password/name blanked out using the # abovve.
-
Re: Square WebPay support thread.
Note also that the constant "DIR_WS_HTTPS_CATALOGUE" doesn't exist - it's "DIR_WS_HTTPS_CATALOG"
-
Re: Square WebPay support thread.
Having a weird one.
Have been using the squrewebpay add on since Calrwhat first released it. I recently upgraded to 1.0.4 and have been seeing a few of these in my logs folder debugs
"should not get here. check that you have the latest jscript_square_webpay file and that you are not having javascript errors in the console."
The thing is, many payments with square are going through just fine, yet the odd customer says the payment form won't load to enter their card details. I can have 10 or 20 square payments in a row without issue, and then this will happen to a random customer. Is this something to do with the setup of the customers browsers/ad blockers/cookies, or is it something on my site which I can fix?
Zen Cart 1.5.6c running on php 7.3.33
Any help much appreciated.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
johnjlarge
Having a weird one.
Have been using the squrewebpay add on since Calrwhat first released it. I recently upgraded to 1.0.4 and have been seeing a few of these in my logs folder debugs
"should not get here. check that you have the latest jscript_square_webpay file and that you are not having javascript errors in the console."
The thing is, many payments with square are going through just fine, yet the odd customer says the payment form won't load to enter their card details. I can have 10 or 20 square payments in a row without issue, and then this will happen to a random customer. Is this something to do with the setup of the customers browsers/ad blockers/cookies, or is it something on my site which I can fix?
Zen Cart 1.5.6c running on php 7.3.33
Any help much appreciated.
some other javascript code is hick-jacking your submit your submit form button.
are you using OPC?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
some other javascript code is hick-jacking your submit your submit form button.
are you using OPC?
No, just using the standard zen cart payflow of checkout_shipping, checkout_payment and checkout_confirmation. It works for most customers, but for some this error throws. I can put through as many test payments & live payments using all sorts of different browsers & I can't replicate it. With some customers, no matter how many times they try, the payment form just won't load.
-
Re: Square WebPay support thread.
Just thinking out loud, is it possible an ad blocker or privacy extension is blocking the javascript from loading via https://web.squarecdn.com/v1/square.js and then the subsequent https://web.squarecdn.com/v1/square.js which is loaded via the square.js file? If that was the case, would the error be the same? The only reason I ask is that I’ve had it from two school teachers of late, both of whom couldn't load the payment form. If an extension or IT network policy blocked the loading of those third party .js files, would the error/outcome be the same?
If that's the case, perhaps serving those JS files locally would be better, or showing an error on screen if those resources are blocked. Asking general users/customers what browser extensions, versions & network policies they are running is pretty futile as they generally don't know. But I am seeing this more & more, which may suggest it's in a blocklist or privacy extension of some sort as a false positive.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
johnjlarge
Just thinking out loud, is it possible an ad blocker or privacy extension is blocking the javascript from loading via
https://web.squarecdn.com/v1/square.js and then the subsequent
https://web.squarecdn.com/v1/square.js which is loaded via the square.js file? If that was the case, would the error be the same? The only reason I ask is that I’ve had it from two school teachers of late, both of whom couldn't load the payment form. If an extension or IT network policy blocked the loading of those third party .js files, would the error/outcome be the same?
If that's the case, perhaps serving those JS files locally would be better, or showing an error on screen if those resources are blocked. Asking general users/customers what browser extensions, versions & network policies they are running is pretty futile as they generally don't know. But I am seeing this more & more, which may suggest it's in a blocklist or privacy extension of some sort as a false positive.
if that file was blocked, you would never see the entry of the credit card fields. if you are seeing the credit card number entry form, then the square js has loaded correctly.
what is your website address?
-
Re: Square WebPay support thread.
Website is www.koolbadges.co.uk
One of the teachers who emailed me said just that
"Hello, we are trying to place an order online but there seems to be a problem with the website as when we click on the option to pay by debit or credit card, it doesn't do anything. Can you please contact us about this?"
And another just this morning said
"I am trying to purchase these five badges but your website won’t allow me to enter my credit card??"
However, the payment form did load for others who have checked out perfectly fine via square .
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
johnjlarge
Website is
www.koolbadges.co.uk
One of the teachers who emailed me said just that
"Hello, we are trying to place an order online but there seems to be a problem with the website as when we click on the option to pay by debit or credit card, it doesn't do anything. Can you please contact us about this?"
And another just this morning said
"I am trying to purchase these five badges but your website won’t allow me to enter my credit card??"
However, the payment form did load for others who have checked out perfectly fine via square .
john,
i am not sure what your expectations are. your payment form works fine for some, it fails for others.
we know for the majority of ZC users out there, it seems to work fine.
i'm trying to help you with 1 problem, and now you are asking for help on numerous different problems.
with regards to your customers who are complaining, i would suggest asking them to try another browser.
as i stated above, if they can not enter credit card details, the square form is not loading, which indicates maybe they are blocking square, or maybe they are using a seriously outdated browser. i can not say...
with regards to your original problem, again, something could be hijacking the form. on the last page of the checkout process, we have already gone to square and in the background, we have added info to the form that looks like:
Code:
<form name="checkout_confirmation" action="https://www.koolbadges.co.uk/index.php?main_page=checkout_process" method="post" id="checkout_confirmation" onsubmit="submitonce();">
<input type="hidden" name="securityToken" value="4e5411c4bb0336a967fcc9d1d96c9aec">
<input type="hidden" name="square_webPay_tokenResult" value="{"details":{"card":{"brand":"VISA","expMonth":12,"expYear":2025,"last4":"1111"},"method":"Card","billing":{"postalCode":"90049"}},"status":"OK","token":"cnon:CBASEKCaBgKk1twdirP2EfAkazo"}">
<input type="hidden" name="square_webPay_verifyBuyerResult" value="{"token":"verf:CBASEPzcicdUPU2pHz-8PtKfSvc","userChallenged":false}">
<div class="buttonRow forward">
<input class="cssButton submit_button button button_confirm_order" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" onmouseout="this.className='cssButton submit_button button button_confirm_order'" type="submit" value="Confirm Order" name="btn_submit_x" id="btn_submit">
</div>
</form>
this is missing from the confirmation form. that is what i believe to be your original error.
-
Re: Square WebPay support thread.
hi Carl.
Sorry, with regards me saying something may be blocking, that was because I thought it could be causing the error itself. I didn't mean to suggest two separate issues, the blocking suggestion was regarding the payment errors.
Was that code you mentioned that is missing from checkout-confirmation added in a version later than 1.0.1? I ask because I've rolled back the plugin to the 1.0.1 version as it still had the odd error with the card form loading for certain users, it seemed like it errored far less on this website.
I just did a test payment with my card, & I did have the form elements suggested above
Code:
<form name="checkout_confirmation" action="https://www.koolbadges.co.uk/index.php?main_page=checkout_process" method="post" id="checkout_confirmation" onsubmit="submitonce();">
<input type="hidden" name="securityToken" value="9a4f035ac6cede55a14f04ced03bd260" />
<input type="hidden" name="square_webPay_tokenResult" value="{"details":{"card":{"brand":"MASTERCARD","expMonth":12,"expYear":1234,"last4":"1234"},"method":"Card","billing":{"postalCode":"pl123rn"}},"status":"OK","token":"cnon:CBESECVIGit11dEAGJZjovKY1IY"}" />
<input type="hidden" name="square_webPay_verifyBuyerResult" value="{"token":"verf:CBESEJx-0b00JJx1dTg-ry34oKY","userChallenged":false}" />
<div class="buttonRow forward">
<input class="cssButton submit_button button button_confirm_order" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" onmouseout="this.className='cssButton submit_button button button_confirm_order'" type="submit" value="Confirm Order" name="btn_submit_x" id="btn_submit" />
</div>
</form>
-
Re: Square WebPay support thread.
Right.
I'm back on the latest version to rule out any older code issues that have already been corrected.
I can check out just fine using this version also. I do note that the hidden form on checkout_confrimation is present, but instead of quotation marks, I have html quotes " as follows
Code:
<input type="hidden" name="square_webPay_tokenResult" value="{"details":{"card":{"brand":"MASTERCARD",
Does anyone know why I'm seeing it like that in source & could this be causing an issue?
-
1 Attachment(s)
Re: Square WebPay support thread.
Hi John, long shot! Did you check if your customers, who could not pay by credit card, had javascript enabled on their browser? This will cause the button to be displayed and it will not be changed to the credit card entry form.
You could test this by changing includes/modules/payment/square_webPay.php line 248-9 from
Code:
'field' => '<div id="card-container" ></div>
<button id="card-button" type="button">Use Credit Card</button>',
to
Code:
'field' => '<div id="card-container" ></div>
<button id="card-button" type="button">Use Credit Card</button>
<noscript>Javascript is required to pay by credit card</noscript>',
If this is the issue then the customer will see something like
Attachment 20321
-
Re: Square WebPay support thread.
Hi Mark.
I’ve asked, but getting information out of school admin staff or English teachers about their browser is really difficult. I’ve asked for details, but alas they aren't forthcoming other than "its on the school computer" or "i tried on my iPhone"
I'll definitely add that though to let people without JavaScript enabled know they need it to pay.
-
Re: Square WebPay support thread.
Is everyone getting an email from Square saying "You are receiving this message because your application is currently using the RenewToken API, which will be completely retired by April 17, 2024." ?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
swguy
Is everyone getting an email from Square saying "You are receiving this message because your application is currently using the RenewToken API, which will be completely retired by April 17, 2024." ?
we had one
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
swguy
Is everyone getting an email from Square saying "You are receiving this message because your application is currently using the RenewToken API, which will be completely retired by April 17, 2024." ?
the square webpay api makes use of a refresh token, not a renew token.
see:
https://developer.squareup.com/docs/...refresh-tokens
the square payment module certainly may have made use of the renewToken. see:
https://github.com/zencart/zencart/b....php#L155-L171
getting an email from square.... well who knows why they would send it...
-
Re: Square WebPay support thread.
Mine yesterday reported this error and it uses the CRON. Additionally, there was no nag in the module to re-token.
-
Re: Square WebPay support thread.
@carlwhat
Thanks for the very helpful module. I sent a donation to you via the link in your documentation.
-
Re: Square WebPay support thread.
Question for you. When I checkout I do not see a Zip Code field:
https://screenrec.com/share/qQ6YbdtTmG
When my client does, there is one:
https://screenrec.com/share/FuTLZrUqGv
I've done as a guest and with an account. The site is using OPC.
What is that?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jeking
@carlwhat
Thanks for the very helpful module. I sent a donation to you via the link in your documentation.
:thumbsup:
thank you!
-
Re: Square WebPay support thread.
I think if you look, you have not entered any info in the form while the other has the card number. When you start entering the card number, the first four characters will change the icon to match the card. Completing the card number will reveal the ZIP field.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jeking
i have no control over those fields. square controls all of that.
what logic they use to determine which fields they need in order to successfully a charge a card is not something that has really interested me. but they do things differently based on where you are located, various risk factors, etc.
in memory serves me correctly, i believe in europe they ask for an additional field as well. part of the anti-fraud movement.
but for the most part anything within the square box is controlled by them and not by me.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
dbltoe
I think if you look, you have not entered any info in the form while the other has the card number. When you start entering the card number, the first four characters will change the icon to match the card. Completing the card number will reveal the ZIP field.
Yep, I just figured that out. All good, thanks.
-
Re: Square WebPay support thread.
I keep getting this error in my log. Transactions go through and work, but before every transaction this comes up.
Quote:
Error Dump: [service.not_authorized]: Not Authorized
Sent to Square: Square\Models\ObtainTokenRequest Object
(
[clientId:Square\Models\ObtainTokenRequest:private] =>xxxxxxxxxxxxxxxxxxxxxxxxx
There is more to the log, but I think this is telling you whats happening? The log has my Handshake info, so I left it out.
Appreciate your app.
Thanks!
-
Re: Square WebPay support thread.
More to my error
Quote:
Error when calling OAuthApi->obtainToken: {} in /var/www/vhosts/gulfstatessupply.com/Store/includes/modules/payment/square_webPay.php on line 782
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
brian70809
I keep getting this error in my log. Transactions go through and work, but before every transaction this comes up.
There is more to the log, but I think this is telling you whats happening? The log has my Handshake info, so I left it out.
Appreciate your app.
Thanks!
without seeing more of the error log (including line numbers), it is hard to tell what is going on.
i do not need to see your client_id or application secret.
the obtainTokenRequest looks to only happen in 1 place. not sure why you would still be able to process transactions if your oaouth has expired.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
brian70809
More to my error
what version are you running?
have you tried to refresh the token from the admin console?
i would also look to set up the handler to refresh the token via a cronjob. i think how to do that is somewhere in the docs.
best.
-
Re: Square WebPay support thread.
I have version 1.0.1 of Web Pay running successfully on Zen Cart 1.5.7d.
I have set up a test environment with Zen Cart 1.5.8 and Web Pay 1.0.4. A new application for testing has been set up in Square. It is running in sandbox mode. I can not get the Web Pay module to change from yellow to green and show the the cc payment option in the shop.
Two things are different to the running version:
1: When I click Edit on the test version, there is nothing to select in the drop down box of "Location ID". But it shows a value when I am not in Edit mode. The value is different to the value in the shop which is live.
2: The new fields of "Live Merchant Token", "Square Token TTL" and "Square Refresh Token" are all empty.
I have no idea what is wrong or missing
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
I have version 1.0.1 of Web Pay running successfully on Zen Cart 1.5.7d.
I have set up a test environment with Zen Cart 1.5.8 and Web Pay 1.0.4. A new application for testing has been set up in Square. It is running in sandbox mode. I can not get the Web Pay module to change from yellow to green and show the the cc payment option in the shop.
Two things are different to the running version:
1: When I click Edit on the test version, there is nothing to select in the drop down box of "Location ID". But it shows a value when I am not in Edit mode. The value is different to the value in the shop which is live.
2: The new fields of "Live Merchant Token", "Square Token TTL" and "Square Refresh Token" are all empty.
I have no idea what is wrong or missing
OK, I found what the problem was. I made the Square connection for the test shop directly in sandbox mode.
To make sandbox mode work in my test environment, I changed from sandbox mode to production mode, put the new Application ID and Application Secret into Zen Cart. Activated Square. Green button near the module. Then I changed to sandbox mode again on the Square page, copied Application ID and Application Secret for the sandbox mode to Zen Cart and now I have a green button near the module and it says "sandbox mode".
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
todoonada
OK, I found what the problem was. I made the Square connection for the test shop directly in sandbox mode.
To make sandbox mode work in my test environment, I changed from sandbox mode to production mode, put the new Application ID and Application Secret into Zen Cart. Activated Square. Green button near the module. Then I changed to sandbox mode again on the Square page, copied Application ID and Application Secret for the sandbox mode to Zen Cart and now I have a green button near the module and it says "sandbox mode".
glad you got it figured out.
-
Re: Square WebPay support thread.
Square is reporting some issues right now. You can monitor the service status here: https://www.issquareup.com/
-
Re: Square WebPay support thread.
I'm seeing this on a client site.
--> PHP Deprecated: Creation of dynamic property square_webPay::$oauthClient is deprecated in /home/calendars/public_html/store/includes/modules/payment/square_webPay.php on line 128.
Plugin version: 1.0.4
PHP 8.2.9
Zen Cart 1.5.8a
Is there a fix I missed?
Should we roll back to an earlier PHP version?
-
Re: Square WebPay support thread.
Anybody know what this means?
Error Dump: [FORBIDDEN]: Cannot fetch orders for a different merchant.
Sent to Square: SquareModelsBatchRetrieveOrdersRequest Object
(
[locationId:SquareModelsBatchRetrieveOrdersRequest:private] =>
[orderIds:SquareModelsBatchRetrieveOrdersRequest:private] => Array
(
[0] => olNTbRVBlZFnRVHCOpPq3R787kLZY
)
)
-
Re: Square WebPay support thread.
Fields Missing
When you get to the point of entering the credit card number, expiration etc, the fields are not there.
We verified the URL, Application Code and Application Secret from the production tab on the Square Developer site and re-uploaded the module, but no go.
Also when in the Gui Admin Modules squarewebpay edit, the drop down to choose Location is not being a drop down. Can not choose location.
test.fantasycostume.com
Zen 1.5.7d
Php 7.4
SQL - 8.0.34-cll-lve
No error logs
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jeking
I'm seeing this on a client site.
--> PHP Deprecated: Creation of dynamic property square_webPay::$oauthClient is deprecated in /home/calendars/public_html/store/includes/modules/payment/square_webPay.php on line 128.
Plugin version: 1.0.4
PHP 8.2.9
Zen Cart 1.5.8a
Is there a fix I missed?
Should we roll back to an earlier PHP version?
hi jim,
v 1.0.4 makes use of square SDK version: 17.2.0.20220216. This SDK requires php 7.4 - php 8.0.
the error you are seeing is from php 8.2.
you may be able to run with php 8.1; but i have not tested it.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
Nick1973
Anybody know what this means?
Error Dump: [FORBIDDEN]: Cannot fetch orders for a different merchant.
Sent to Square: SquareModelsBatchRetrieveOrdersRequest Object
(
[locationId:SquareModelsBatchRetrieveOrdersRequest:private] =>
[orderIds:SquareModelsBatchRetrieveOrdersRequest:private] => Array
(
[0] => olNTbRVBlZFnRVHCOpPq3R787kLZY
)
)
without seeing additional info from the logs it is hard to tell.
my guess is that some of the constants between the old square and the new square_webPay are mixed up.
the error seems pretty clear. you are trying to retrieve order information from a different merchant id. hence my guess.
but rather tough to say, and i'm pretty sure that method, lookupOrderDetails, works. else i would think i would see a lot more people with this error.
best.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
masterrusty
Fields Missing When you get to the point of entering the credit card number, expiration etc, the fields are not there.
We verified the URL, Application Code and Application Secret from the production tab on the Square Developer site and re-uploaded the module, but no go.
Also when in the Gui Admin Modules squarewebpay edit, the drop down to choose Location is not being a drop down. Can not choose location.
test.fantasycostume.com
Zen 1.5.7d
Php 7.4
SQL - 8.0.34-cll-lve
No error logs
you need to have a location set up in the square developer dashboard. without a location in that pulldown nothing will work.
you can enable logging, by changing the debug value to log always and post the contents from there when you go in from the admin. i think it should log something there.
but my guess is that you have not properly set up a location in your square dashboard. which is why it is not showing up as a pulldown.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
hi jim,
v 1.0.4 makes use of square SDK version: 17.2.0.20220216. This SDK requires php 7.4 - php 8.0.
the error you are seeing is from php 8.2.
you may be able to run with php 8.1; but i have not tested it.
best.
Carl,
Thanks for the explanation. 8.1 also resulted in errors, in the log not on the website, so I reverted to PHP 8.0.
Any plans to update to a newer SDK?
Thanks,
Jim
-
2 Attachment(s)
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
you need to have a location set up in the square developer dashboard. without a location in that pulldown nothing will work.
you can enable logging, by changing the debug value to log always and post the contents from there when you go in from the admin. i think it should log something there.
but my guess is that you have not properly set up a location in your square dashboard. which is why it is not showing up as a pulldown.
I have locations in Square Developer. But no drop down in gui.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jeking
Carl,
Thanks for the explanation. 8.1 also resulted in errors, in the log not on the website, so I reverted to PHP 8.0.
Any plans to update to a newer SDK?
Thanks,
Jim
not at this time...
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
masterrusty
I have locations in Square Developer. But no drop down in gui.
are you in sandbox mode or live mode?
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
carlwhat
are you in sandbox mode or live mode?
Yes in live mode.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
masterrusty
Yes in live mode.
i don't know what to tell you. you seem to have a very rudimentary error that indicates a problem with either your credentials or your oauth token.
i would double check all of that information as well as the instructions on the docs for doing the install. mind you the problem is not with the code (no need to re-upload files), but something is wrong with your settings. or your square admin daashboard.
in your store root you can create a file called test.php with the following information:
PHP Code:
<?php
require('includes/application_top.php');
include_once DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/square_webPay.php';
include_once DIR_FS_CATALOG . DIR_WS_LANGUAGES . 'english/modules/payment/square_webPay.php';
$test = new square_webPay();
$pulldown = $test->getLocationsPulldownArray();
print_r($pulldown);
die(__FILE__ . ':' . __LINE__);
when you go to:
www.mystore.com/test.php
you should see something like:
Array ( [0] => Array ( [id] => Default Test Account:[LKCCSZDNNZ0S6]:USD [text] => Default Test Account: USD ) ) /var/www/zcdev/test.php:21
if the Array is empty, you have done something wrong.
best.
-
Re: Square WebPay support thread.
Hallos,
Should I make a new square app for each zencart site i use the square web pay module on ? Or is one enough and I just share the Api key ? thanks so much again for all that you guys do.
-
Re: Square WebPay support thread.
Quote:
Originally Posted by
jasonshanks
Should I make a new square app for each zencart site i use the square web pay module on ?
Yes.
one app integration for each URL as you will need specific URLs for Square to know where to answer/porcess each sale.
-
Re: Square WebPay support thread.
-
Re: Square WebPay support thread.
Do you suggest deleting the old square module then?
-
Re: Square WebPay support thread.
If you had used the oold method to accept payment, you can use the Moduless >> Payment to remove the installation but leave the files. That way, your older transactions can still be viewed.