Thanks for the support!
Thanks for the support!
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.
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
Last edited by VDecalS; 16 Feb 2023 at 09:34 PM. Reason: include error code
My store - closed 12/05/2023
1.5.7d (upgraded from 1.5.7b), clone a template (cloned Responsive Classic Template), Sitemap XML v4.0, Square WebPay, PayPal Express Checkout, PHP Version: 7.4.29 (Zend: 3.4.0)
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
also, with that change, i do not think we will ever get here, but in: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')) {
includes/modules/payment/square_webPay.php
line 266, should be changed to something like:
these changes will be incorporated into a new release.PHP Code:
$messageStack->add_session('checkout_payment', 'uh... looks like you did not input a credit card number!', 'error');
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.
![]()
My store - closed 12/05/2023
1.5.7d (upgraded from 1.5.7b), clone a template (cloned Responsive Classic Template), Sitemap XML v4.0, Square WebPay, PayPal Express Checkout, PHP Version: 7.4.29 (Zend: 3.4.0)
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.
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 :
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:$transaction = is_array($records) ? $records[0] : $records;
Code:$location = $this->getLocationDetails(); return new Models\Order($location->getId());
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
newCode: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();
Something similar may be required for one page checkout!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(); }
Mark Brittain
http:\\innerlightcrystals.co.uk\sales\
Bookmarks