-
Square Payment Module for Zen Cart [Support Thread]
I'm pleased to announce today the release of the new Square Payments module for Zen Cart
You can download the plugin from https://www.zen-cart.com/downloads.php?do=file&id=156
And you can read setup instructions at https://www.zen-cart.com/content.php...s-for-Zen-Cart or from the README in the plugin zip file.
The module currently requires Zen Cart v1.5.5 or v1.5.4
And the module is compatible with PHP 7.2, 7.1, 7.0, 5.6, 5.5, 5.4
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks a lot, I have been hoping for this for a long time, Square Is a great processor and the setup was pretty straight forward. No real issues other than after:
Configure the Square Module in your store Admin
Step 4 - "Click Here to Login and Authorize Your Account."
I needed to Refresh the Payment Module page to proceed
Tested just fine without any errors and the refund process worked.
Thanks again, nice job..:clap:
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
UncleBobOfLargo
Thanks a lot, I have been hoping for this for a long time, Square Is a great processor and the setup was pretty straight forward. No real issues other than after:
Configure the Square Module in your store Admin
Step 4 - "Click Here to Login and Authorize Your Account."
I needed to Refresh the Payment Module page to proceed
Tested just fine without any errors and the refund process worked.
Thanks again, nice job..:clap:
Glad that it worked for you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Update:
If you are changing domain name make sure you change your OAuth Return URL in your SqaureUp Account.
Login into your account with SqaureUp > Apps > My Apps upper right corner > Click on the OAuth.
Wade Morris
-
Re: Square Payment Module for Zen Cart [Support Thread]
Super excited to use this app - Ive hit one little snag that I cant seem to make sense of.
I keep getting red text that says (Access Token needed) - I go through the steps in OAuth, I get a page that says something to the effect of "Token Added, please close this page" but then nothing changes.
Help?
Thanks!
-
Re: Square Payment Module for Zen Cart [Support Thread]
Did you try refreshing your browser?
Sometimes that message doesn't disappear right away, but refreshing your Admin Payment Modules page will see the message disappear, and things will be ready to go.
If it doesn't go, then the OAuth Redirect URL set in your Square account might not be correct.
-
Re: Square Payment Module for Zen Cart [Support Thread]
In earlier testing, there were times when you had to click on the update button or hit enter to see the result.
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
I have installed square payments module.
In the checkout process step2 even though i entered working credit card details it was showing the error message like
" We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE"
Due to this i was not able move forward for the payment.
Even I enabled default theme, still same error.
I even tried disabling all other payment module(Paypal and CEOn manual card) still same error.
There is JS conflict browser console.
We haven't done any changes to default checkout flow.
Please see the attached screenshot.Attachment 17186
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Arukuti
" We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE"
There is JS conflict browser console.
You must resolve the javascript errors in your template before the module will work.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
You must resolve the javascript errors in your template before the module will work.
Sorry for typo, there are no JS errors in console.
-
Re: Square Payment Module for Zen Cart [Support Thread]
The Square module requires that you install all the files in the prescribed folders as per the documentation. If you don't, then the javascript which interacts with the Square servers can't obtain the token/nonce code that is used for processing a payment. When the token/nonce cannot be obtained, the SQ-NONCE-FAILURE error appears.
The javascript hooks into form elements built-in to the standard Zen Cart checkout flow, so those must be present in your template in order for it to work.
Additionally, your OAuth setup must also be completed as per the setup instructions in the documentation.
I just did a fresh setup of Zen Cart v1.5.5e on a brand new site, added the Square module and followed the instructions step by step. The first attempt at payment was successful.
https://www.zen-cart.com/content.php...quare-Payments
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello, I've uploaded this module using FileZilla and followed all outlined steps. I continue to see the (Access Token needed) message in red. I've hit the update button at the top, pressed enter, refreshed the page, kicked my cat, drank a class of milk and did a hula dance but nothing seems to have worked. Are there any certain permissions that I need to maker sure are set on the files I've uploaded? I've gone folder to folder to make sure all files have uploaded and this files sizes match what's on my local drive. I've also deleted and remade apps on the Square Dev site to see if that was a problem.
When I click the green button it brings up a new window asking me to log into my account. When I put in my credentials it shows a loading icon over the login button for several seconds followed by a black page with black text in the upper left... this page closes so fast I'm not sure what the text says.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I have a client using Zen Cart 1.5.5e and the Square Payments Module 0.81. She needs to renew /refresh the OAuth token. She has tried all the suggestions in this thread (creating a new app, confirming the return URL, etc.) but the payment method is still not available. She indicates the refresh token link is "missing".
Any suggestions?
Thanks in advance!
-
Re: Square Payment Module for Zen Cart [Support Thread]
When the module in your store Admin says "(Access Token needed)", it's because the OAuth token has NOT been successfully obtained from Square.
For the OAuth token to be obtained, the following (as documented in the installation instructions) must be in place:
a) square_handler.php must be on your server. It should be in the same directory as ipn_main_handler.php already exists.
b) the correct URL pointing to square_handler.php on your site must be entered into your Square's account OAuth Redirect URL setting.
c) click on the button to initiate the process of requesting a token. This will open a browser window to Square, and if you're not already logged in there, will ask for credentials.
d) After Square verifies the supplied credentials, it will show an almost-blank page with a small redirection message, before the window closes automatically.
e) Within 0-5 seconds after that almost-blank window closes, Square should have automatically sent a message to the OAuth Redirect URL (your square_handler.php file), which will read and validate Square's response, and update the token in your store. This happens automatically, and 99% of the time happens in less than 1 second.
f) Now refreshing your Zen Cart Admin screen will show that the "Get Token" button has disappeared, as well as the "(Access Token needed)" message.
The module is now fully functional.
Common causes of problems with this:
a) didn't upload square_handler.php
b) put square_handler.php into the wrong directory. It belongs in the "root" of your store's folders. For reference, "ipn_main_handler.php" also exists in this directory.)
c) didn't put the OAuth Redirect URL into Square's settings, or mistyped it.
Less common, but possible causes:
a) you've got URL-rewriting rules set up in .htaccess or nginx, which are disallowing square_handler.php to be reached, probably because you're redirecting those requests to some other URL/file. Fix: allow square_handler.php to accessed directly. You could clone any rules for ipn_main_handler.php for square_handler.php, as a starting point.
b) you're running on a test site using a fake/unreachable URL, according to Square's servers. Fix by using a real live website.
c) you're running behind a firewall that's got aggressive restrictions on which files are allowed to be accessed. This is simple. Just tell the firewall to allow normal port 443 access to square_handler.php .... just like any other file on a website should be able to do. Nothing special here.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you.
Response from my client:
I do get the screen that says token has been updated when I'm redirected to square and put in my credentials. But zencart then goes green and the "needs token disappears but it doesn't become a payment method.
Any other suggestions?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbair
I have a client using Zen Cart 1.5.5e and the Square Payments Module 0.81. She needs to renew /refresh the OAuth token. She has tried all the suggestions in this thread (creating a new app, confirming the return URL, etc.) but the payment method is still not available. She indicates the refresh token link is "missing".
Any suggestions?
Thanks in advance!
Quote:
Originally Posted by
dbair
Thank you.
Response from my client:
I do get the screen that says token has been updated when I'm redirected to square and put in my credentials. But zencart then goes green and the "needs token disappears but it doesn't become a payment method.
Any other suggestions?
By "it doesn't become a payment method", I'm assuming they're trying to say "it shows in the Admin, but during checkout Square is not offered"?
Reasons for a payment module to not show during checkout (none of them are specific to Square):
- A Payment Zone restriction has been set, and the address being used for checkout isn't in that zone. Set Payment Zone to --none-- in the module, to remove all restrictions
- Another plugin is interfering with the default checkout process, and a billing country/state haven't been specified.
- Strange/unusual alterations to checkout templates. This is rare, but does happen, depending on who customizes them.
You haven't listed:
- what template is in use
- all the plugins on the site
- which other payment modules are enabled
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you for your response.
Yes, it does not become a payment method.
Other Payment module is PayPal Express.
Template is Responsive Classic.
The only plugin installed after zen cart was installed is ckeditor.
Quote:
Originally Posted by
DrByte
By "it doesn't become a payment method", I'm assuming they're trying to say "it shows in the Admin, but during checkout Square is not offered"?
Reasons for a payment module to not show during checkout (none of them are specific to Square):
- A Payment Zone restriction has been set, and the address being used for checkout isn't in that zone. Set Payment Zone to --none-- in the module, to remove all restrictions
- Another plugin is interfering with the default checkout process, and a billing country/state haven't been specified.
- Strange/unusual alterations to checkout templates. This is rare, but does happen, depending on who customizes them.
You haven't listed:
- what template is in use
- all the plugins on the site
- which other payment modules are enabled
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you again.
It was the location code.
Fixed now.
Quote:
Originally Posted by
DrByte
By "it doesn't become a payment method", I'm assuming they're trying to say "it shows in the Admin, but during checkout Square is not offered"?
Reasons for a payment module to not show during checkout (none of them are specific to Square):
- A Payment Zone restriction has been set, and the address being used for checkout isn't in that zone. Set Payment Zone to --none-- in the module, to remove all restrictions
- Another plugin is interfering with the default checkout process, and a billing country/state haven't been specified.
- Strange/unusual alterations to checkout templates. This is rare, but does happen, depending on who customizes them.
You haven't listed:
- what template is in use
- all the plugins on the site
- which other payment modules are enabled
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbair
Thank you again.
It was the location code.
Fixed now.
Thanks for reporting back.
The Location ID is normally automatically set to the first available location. But if you're using multiple locations, or have somehow tricked the system into storing a wrong location value, then there will be errors during checkout. Choosing one from the dropdown will resolve that.
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
Hi Dr. Byte,
1st problem I have is extractions of the file from the .zip I kept getting a Path too long error, which I tried skipping but it was a lot of files. Then I used filezilla to upload my extracted files and I can not find the square module anywhere even after refreshing. My assumption is all of the files are missing so I need to try this a different way. Any suggestions?
Attachment 17206
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
Nevermind! I had to extract to my desktop and upload the files before moving it to folder in which I usually save my templates. I managed to upload all of the files, and the module still is not showing up in the list.
Attachment 17207
-
Re: Square Payment Module for Zen Cart [Support Thread]
After the 1st failures I have tried again. I uploaded my back up copy of the store and started fresh at 1st I could install and make changes to the payment modules with no issues. After following the installation directions for Square Payment Module, I can no longer see any installation or make changes to the payment modules and the Square module is not listed as in the image in the previous post. I now have 4 new debug logs which I don't understand:
[07-Aug-2017 23:34:16 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:20 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:23 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
[07-Aug-2017 23:34:50 America/Detroit] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/sammirah/public_html/webstore/includes/languages/english/modules/payment/square.php on line 34
My assumption is I need to change a [ to a ) somewhere on line 34 in the square.php file but I don't want to mess anything else up, if that is not what it means. Please advise.
-
Re: Square Payment Module for Zen Cart [Support Thread]
@sammirah, what version of PHP are you using? I see from your screenshot you're using Zen Cart v1.5.5, which is great.
The Square module is designed for PHP 5.4 or newer, and Zen Cart v1.5.4 or newer.
The message you've quoted suggests that you're using an older version of PHP that doesn't recognize the square-bracket short-array syntax added in PHP 5.4 in 2012.
Perhaps you can ask your hosting company to switch you to PHP 5.6 instead?
-
Re: Square Payment Module for Zen Cart [Support Thread]
It says that I am using PHP version 5.6.30 but I think I make need to add it to the .htaccess file because the current one has AddHandler application/x-httpd-php53 .php listed when there was a problem with another plugin
-
Re: Square Payment Module for Zen Cart [Support Thread]
Yippe Ki Yay! That worked. I added a line AddHandler application/x-httpd-php56 .php to the .htaccess file in the store directory and it works just fine and I can see the square module. Thanks Dr. Byte:cool:
-
Re: Square Payment Module for Zen Cart [Support Thread]
Nevermind, I got it fixed. I had to remove the module then re-installed it.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Just noticed this on one of our customers.
Code:
PHP Fatal error: Square Payment Module token expired on 2017-07-21T02:46:56Z. Payment module has been disabled. Please login to Admin and re-authorize the module. in /home/********/public_html/includes/modules/payment/square.php on line 528
This occurred less than 48 hours after a sale and also occurred on a test site at the same time.
One is 1.5.4 with PHP 5.4 and the other is 1.5.5e with PHP 5.6.
Has Square set some time limit between orders, an annual reset date, ....? If so, can we set a heads up call/text/email?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quick fix: go back into the Admin, to the Square module settings, and get a new token manually.
The module is supposed to auto-renew if the token is more than 3 weeks old.
It tests for need for auto-renew on every transaction, and you can also set up a cron job to do it too.
But, I saw this same thing happen on another site ... so am investigating.
Update: 3 sites. Grrr ... something's amuck, that "was" working before. Will post further once a resolution is found.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
Code:
PHP Fatal error: Square Payment Module token expired on zzzzzzzzz. Payment module has been disabled. Please login to Admin and re-authorize the module.
There was a bug in the token-refresh code. The module has been updated. Install v0.90 to prevent the problem from happening again.
Download latest: Square Payments for Zen Cart
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quick fix got me the same result as my previous post without the gibberish.
But, just overwrote with the updated 0.90 files and am back up and working again.
THANX Doc:clap:
-
Re: Square Payment Module for Zen Cart [Support Thread]
Got a square question?
I need to ether turn it off or feed it something when $_SESSION['free_virtual'] or freecharger is activated.
ZC1.5.5e
PHP7.1
One-Page Checkout v1.4.0
Square Payment v0.90
COWAA v1.0
and many modified
Free and Virtual checkout with COWAA is only using name and email address for a free download.. one-page template is modified so only name, email, payment and cart is displayed, all other is bypassed.
It works as expected with COD, COP, Money-order/check and PayPal standard active and shows as freecharger. If I turn Square on then the page errors and the button fails to submit.
Error from WebConsol is:
Code:
Error: SqPaymentForm element with id `square_cc-number` not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform paymentform:1:5997
[6]</n.prototype.buildIframeController https://js.squareup.com/v2/paymentform:1:5997
[6]</n.prototype.buildIframeControllers https://js.squareup.com/v2/paymentform:1:5839
[6]</n.prototype.build https://js.squareup.com/v2/paymentform:1:5640
[8]</n.prototype.build https://js.squareup.com/v2/paymentform:1:14150
bound self-hosted:913:17
setFormSubmitButton, payment-module: freecharger
Showing "confirm"
Setting orderConfirmed (0), submitter (null)
jQuery version: 3.2.1
I'm thinking now it has more to do when freecharger is active..
This is the error I get with a logged in user.
Code:
setFormSubmitButton, payment-module: freecharger index.php:210:13
Showing "confirm" index.php:210:13
Setting orderConfirmed (0), submitter (null) index.php:210:13
jQuery version: 3.2.1 index.php:210:13
Error: SqPaymentForm element with id `square_cc-number` not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform paymentform:1:5997
[6]</n.prototype.buildIframeController https://js.squareup.com/v2/paymentform:1:5997
[6]</n.prototype.buildIframeControllers https://js.squareup.com/v2/paymentform:1:5839
[6]</n.prototype.build https://js.squareup.com/v2/paymentform:1:5640
[8]</n.prototype.build https://js.squareup.com/v2/paymentform:1:14150
bound
The only thing I haven't tried is to drop jQuery back to 1.12!
with square turned off, not removed, this is what WebConsol has and submit works.
Code:
setFormSubmitButton, payment-module: freecharger index.php:210:13
Showing "confirm" index.php:210:13
Setting orderConfirmed (0), submitter (null) index.php:210:13
jQuery version: 3.2.1 index.php:210:13
No error logs show up ether. The more I play with this, the more its looking like something is going on when Freecharger is active and Square is on.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Is it only an issue when COWAA is in play?
On my end, with Square and FreeCharger, checkout works fine, without COWAA or OPC.
So, I suspect something to do with the HTML changes (different elements on the page, perhaps some unclosed HTML tags, or improperly nested form elements) that you've done when customizing your site. I don't think it has anything to do with the Square module's code or javascript.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I assume the Square sign-up link on https://www.zen-cart.com/content.php...s-for-Zen-Cart is an affiliate link. If it is do you happen to have one for the UK. That link gives no choice on the country that can be selected - only United States.
(If I go to their site without your token then I can choose my country).
Wanted to check so ZC can get the commission.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
simon1066
I assume the Square sign-up link on
https://www.zen-cart.com/content.php...s-for-Zen-Cart is an affiliate link. If it is do you happen to have one for the UK. That link gives no choice on the country that can be selected - only United States.
(If I go to their site without your token then I can choose my country).
Wanted to check so ZC can get the commission.
Based on a signup I helped someone else with, I *think* if you "first" visit thru the referral link, it'll drop the necessary cookie, and if on the same page you just change the URL to remove the code so that it lets you choose your country, it'll still give the credit.
My UK contact with more specific instructions, is currently on holiday. Go ahead with the signup.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Tiny change to the readme instructions for Compatibility With Various Zen Cart Plugins
Code:
For One-Page Checkout to work, you must copy the jscript_square.php file from /includes/modules/checkout_payment/ into the /includes/modules/pages/checkout_one folder.
should be
Code:
For One-Page Checkout to work, you must copy the jscript_square.php file from /includes/modules/pages/checkout_payment/ into the /includes/modules/pages/checkout_one folder.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks. Will include the correction in the next release.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Based on a signup I helped someone else with, I *think* if you "first" visit thru the referral link, it'll drop the necessary cookie, and if on the same page you just change the URL to remove the code so that it lets you choose your country, it'll still give the credit.
My UK contact with more specific instructions, is currently on holiday. Go ahead with the signup.
That's great, I'll try that.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I am newbie to ZC. I have Square Payments for Zen Cart - Version: 0.82 installed. Do I follow the directions for newer version as if it was the first time I installed it?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Yes. Essentially just replace the files with the new ones.
-
Re: Square Payment Module for Zen Cart [Support Thread]
A smooth step for me was to remove the payment method in the admin first. Seemed to hang without doing that.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
A smooth step for me was to remove the payment method in the admin first. Seemed to hang without doing that.
Do I remove it or just enable it? Thanks for input I am not sure what I am doing.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Actually, it should say Install or Edit/Remove.
If not yet installed, overwrite it all and then install. If it has an option to remove, do that then overwrite.
-
Re: Square Payment Module for Zen Cart [Support Thread]
okay I removed the square module and followed the steps adding the different pages to the directories. It shows processing in ZC admin. When I test it, it gives me a "communication error" when I submit it. Do I need to delete the app in square and create a new one? Any ideas?
Thanks,
Maxine
-
Re: Square Payment Module for Zen Cart [Support Thread]
I went in Square and it had the option to redo the secret answer, did that. Updated that in ZC admin. Do I need to upload all the files in the upload folder(I have .082 version on server) too or just the ones on the install list? Still get communication error.
Thanks
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
Actually, it should say Install or Edit/Remove.
If not yet installed, overwrite it all and then install. If it has an option to remove, do that then overwrite.
The second sentence could have been better in it's explanation.
You have the mod on your site.
In the Admin >> Modules >> Payment menu, click the circled I next to Square.
If it shows the install button, do nothing.
If it shows two buttons -- edit and remove -- click on remove and follow the instructions.
Obtain a fresh copy of the latest Square Mod
Use an FTP program to upload the fresh copy - Overwrite all files so you don't miss anything.
Go back to Admin >> Modules >> Payment and click the circled I next to Square.
Click on Install and follow the directions.
Remember most attempts at creating a shortcut actually take you miles out of your way.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thank you, DrByte!
P.S. I just send you something.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I just installed this plugin and this may be a dumb question but how do I retreive the whole credit card number?
I did a test order on our site and I just get the last 8 numbers in the Admin panel with the order.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Maynards
I just installed this plugin and this may be a dumb question but how do I retreive the whole credit card number?
I did a test order on our site and I just get the last 8 numbers in the Admin panel with the order.
The idea is that *you* never get to see the entire card number, and that you stop processing cards manually at all. Square is an online processing service, and *they* are the only ones who ever see the card data, and they process it immediately. That way your store doesn't have to account for specialized very expensive security for secure card handling.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Does this plugin automatically process the card without me processing manually like I had to with the Ceon Payment module?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
The idea is that *you* never get to see the entire card number, and that you stop processing cards manually at all. Square is an online processing service, and *they* are the only ones who ever see the card data, and they process it immediately. That way your store doesn't have to account for specialized very expensive security for secure card handling.
Look like you beat me to my answer.
So it looks like I just bought something from my website and I should see the payment on my credit card.
-
Re: Square Payment Module for Zen Cart [Support Thread]
This is such a great plugin. I can't believe how easy it was for me to add it to my site with my limited knowledge of how payment plugins work. Extremely handier than my old processing way.
-
1 Attachment(s)
Re: Square Payment Module for Zen Cart [Support Thread]
I'm getting this error:
"We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE"
It's installed in the proper folders, and token is set up, but I can't figure out this error. It might be Java Script errors from my template that was explained on page 1 and 2, but I'm unsure where to start looking.Attachment 17293
-
Re: Square Payment Module for Zen Cart [Support Thread]
Yes, those javascript errors will prevent the page's javascript from operating properly, including the payment portion.
It looks like all the javascript-validation logic on your page has been altered to inject a bunch of button and aria and other code which also uses double-quotes that are conflicting with the double-quotes used to display validation messages. You've probably injected all this extra HTML into your language files.
ie:
Code:
alert("<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>This form has already been submitted. Please press OK and wait for this process to be completed.");
-
Re: Square Payment Module for Zen Cart [Support Thread]
The template I've been using is the Shopfast zencart theme for 1.5.4
I guess they programmed it pretty crapily -_-
-
Re: Square Payment Module for Zen Cart [Support Thread]
Anyone had a go with the addition of Apple Pay? https://medium.com/square-corner-blo...s-1f85cb6fe433
It appears that the two javascript files used are combined into jscript_square.php file. My attempt at adding the required info resulted in messing up the form.
I changed jscript_square.php to
Code:
<?php/**
* Javascript to prep functionality for Square payment module
*
* @package square
* @copyright Copyright 2003-2017 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Author: Chris Brown <[email protected]> New in v1.5.6 $
*/
if (!defined(MODULE_PAYMENT_SQUARE_STATUS) || MODULE_PAYMENT_SQUARE_STATUS != 'True' || (!defined('MODULE_PAYMENT_SQUARE_APPLICATION_ID') || MODULE_PAYMENT_SQUARE_ACCESS_TOKEN == '')) {
return false;
}
?>
<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
<script type="text/javascript">
var cardNonce;
var paymentForm = new SqPaymentForm({
//
locationId: locationId
//
applicationId: '<?php echo MODULE_PAYMENT_SQUARE_APPLICATION_ID; ?>',
inputClass: 'paymentInput',
inputStyles: [
{
fontSize: '14px',
padding: '7px 12px',
backgroundColor: "white"
}
],
cardNumber: {
elementId: 'square_cc-number',
placeholder: '•••• •••• •••• ••••'
},
cvv: {
elementId: 'square_cc-cvv',
placeholder: 'CVV'
},
expirationDate: {
elementId: 'square_cc-expires',
placeholder: 'MM/YY'
},
postalCode: {
elementId: 'square_cc-postcode',
placeholder: '11111'
},
callbacks: {
cardNonceResponseReceived: function (errors, nonce, cardData) {
if (errors) {
console.error("Encountered errors:");
var error_html = ""
errors.forEach(function (error) {
console.error(' ' + error.message);
error_html += "<li> " + error.message + " </li>";
});
document.getElementById('card-errors').innerHTML = '<ul>' + error_html + '</ul>';
$('#paymentSubmitButton').disabled = false;
} else {
// success
$('#paymentSubmitButton').disabled = true;
$("#card-errors").empty()
document.getElementById('card-nonce').value = nonce;
document.getElementById('card-type').value = cardData.card_brand;
document.getElementById('card-four').value = cardData.last_4;
document.getElementById('card-exp').value = ('0'+cardData.exp_month.toString()).substr(-2) + cardData.exp_year.toString().substr(-2);
document.getElementsByName('checkout_payment')[0].submit();
}
},
unsupportedBrowserDetected: function () {
document.getElementById('card-errors').innerHTML = '<p class="error alert">This browser is not supported for Square Payments. Please contact us to let us know! Meanwhile, please pay using an alternate method; or shop using a different browser such as FireFox or Chrome.</p>';
paymentForm.destroy();
},
inputEventReceived: function (inputEvent) {
switch (inputEvent.eventType) {
case 'focusClassAdded':
methodSelect('pmt-square');
break;
case 'cardBrandChanged':
document.getElementById('sq-card-brand').innerHTML = inputEvent.cardBrand;
break;
}
},
methodsSupported: function (methods) {
if (methods.applePay === true) {
// Show apple pay button
var element = document.getElementById('sq-apple-pay');
element.style.display = 'inline-block';
}
}
paymentFormLoaded: function () {
paymentForm.setPostalCode('<?php echo $order->billing['postcode']; ?>');
}
}
});
createPaymentRequest: function () {
return {
requestShippingAddress: true,
currencyCode: "USD",
countryCode: "US",
total: {
label: "{{ MERCHANT NAME }}",
amount: "100.00",
pending: false,
},
lineItems: [
{
label: "Subtotal",
amount: "80.00",
pending: false,
},
{
label: "Shipping",
amount: "0.00",
pending: true,
},
{
label: "Tax",
amount: "10.00",
pending: false,
}
]
};
};
// ...
$(function () {
$.ajaxSetup({
headers: {"X-CSRFToken": "<?php echo $_SESSION['securityToken']; ?>"}
});
$('form[name="checkout_payment"]').submit(function(e) {
if($('#pmt-square').is(':checked') || this['payment'].value == 'square' || document.getElementById('pmt-square').checked == true) {
e.preventDefault();
paymentForm.requestCardNonce();
}
});
});
</script>
<style>
.paymentInput {display:inline;font-size:1em;margin:0 0.1em 10px 0;height:35px;padding-left:5px;width:50%;}
.paymentInput {background-color: white;border:3px solid #ccc;}
.paymentInput--error {color: red; border-color: red;}
</style>
Done this way, the form is not properly set with input blocks and preset Zip.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I would have thought that someone would be interested in adding the ability to accept apple pay to this mod.
:(
-
Re: Square Payment Module for Zen Cart [Support Thread]
Very excited to try this module. However, I'm getting stuck at the very beginning. The instructions in the plug-in say:
- Click to create a New Application for your Zen Cart store to access. Give it a name, such as "Webstore", and click Create at the bottom of the page.
Maybe I'm dense but I can't find anywhere in my Square account under "apps" where I can create a "New Application." Any clues for this are greatly appreciated. Will also check in Square's help too but since these directions came from ZenCart, I thought I'd start here.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
earmsby
Very excited to try this module. However, I'm getting stuck at the very beginning. The instructions in the plug-in say:
- Click to create a New Application for your Zen Cart store to access. Give it a name, such as "Webstore", and click Create at the bottom of the page.
Maybe I'm dense but I can't find anywhere in my Square account under "apps" where I can create a "New Application." Any clues for this are greatly appreciated. Will also check in Square's help too but since these directions came from ZenCart, I thought I'd start here.
Earmsby,
1. Login to your Squareup account.
2. On your left click on apps.
3. You should see "My Apps"
4. There you should able to find a button "Create New Application".
More info at Square Payment Module
-
Re: Square Payment Module for Zen Cart [Support Thread]
They apparently don't use legacy links at Square. You might try logging in and then going to https://connect.squareup.com/apps. That should show any apps you have going and the link for creating an app.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
wmorris
Earmsby,
1. Login to your Squareup account.
2. On your left click on apps.
3. You should see "My Apps"
4. There you should able to find a button "Create New Application".
This is what I was doing, but I just noticed the small difference in the link on the Square payment module page. It wasn't my regular Square/apps page but the subdomain of "connect" made the difference. There was probably some other way to get to this directly in the Square account but actually following the direction carefully was all I needed in this case. :P
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
wmorris
Earmsby,
1. Login to your Squareup account.
2. On your left click on apps.
3. You should see "My Apps"
4. There you should able to find a button "Create New Application".
Unfortunately, if you already have an app, there is no button for creating a new one. Hence the direction to log in to https://connect.squareup.com/apps after logging in to square
-
Re: Square Payment Module for Zen Cart [Support Thread]
Has anyone tried to get an existing Square account qualified for the promotional 2.7% rate?
I have received 2 replies offering technical support and nothing related to account setup.
I have also received one Phishing email pretending to be Square.
All since transmitting a single email to ----------
-
Re: Square Payment Module for Zen Cart [Support Thread]
The correct email address is: partnersupport@squareup.com
My contact at Square has confirmed that there's been a lot of response to this offer ... so I know it's functional.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks DrByte
I copy/pasted the address in the original email. Sorry, in the post I was typing from memory.
I'll try again.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
The correct email address is: partnersupport@squareup.com
My contact at Square has confirmed that there's been a lot of response to this offer ... so I know it's functional.
I contacted them a few day's ago with no response. I sent another email earlier today.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Maynards
I contacted them a few day's ago with no response. I sent another email earlier today.
I had to do two emails, but I'm in so it is working for existing accounts.
Thanks DrByte
-
Re: Square Payment Module for Zen Cart [Support Thread]
Apparently Square only works for customer orders paid for and shipped in the US and Canada. This is what the Square support person is telling me. Does anyone have different information?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
earmsby
Apparently Square only works for customer orders paid for and shipped in the US and Canada. This is what the Square support person is telling me. Does anyone have different information?
https://squareup.com/help/us/en/article/5085-accepted-cards
Their website indicates different.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Interesting. The customer service rep told me, "... customers can use international credit cards to make purchases through a Square merchant’s Online Store, but the order must be placed in the U.S. and shipped to a U.S. address."
I was not aware that the ZenCart payment module sends the shipping address with the payment info, but maybe it does? Have others been able to process payments to customers with shipping addresses outside the US?
I did write back to try to clarify where they consider the order to have been "placed" - at my location in the US or at the location where the customer is typing into a browser screen. Seems unclear to me.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Server: Geekhost.ca running Linux 2.6.32-642.6 on HTTP Server: Apache
PHP v5.6.32 and MySQL: 5.5.5-10
Zen Cart v1.5.4
Plugins:
Simple Blue Responsive v1.0
CKEditor v3.7s
Edit Orders v4.1.4
Sitemap XML v 3.6
Google Merchant Center Feeder 1.14.5
Graphical Sales Report v1.11
Sales Report v3.2.0
USPS 2017-09-16
Square Payments Module 0.90
I get: We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE.
I tryed turning on and off my working FirstData/Linkpoint/YourPay API.
I've upgraded my PayPal from Standard to Express and tryed it on and off.
I've replaced the Application ID and the Application Secret
I notice that the Location ID is a dropdown in ZC and NOT changeable. It defaults to the "Name" under the Locations tab at connect.squareup.com and not the acual Location ID.
Are any of the above plugins been known for being the problem?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Might want to check at https://www.zen-cart.com/content.php...s-for-Zen-Cart.
Scroll down to Support, Common Errors.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Guessing it's a javascript error in your payment page.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Zen Cart 1.5.5e - Database Patch Level: 1.5.5
with Simple Blue Responsive v1.0 template and CKEditor plugin and I still get:
"We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE."
What else could I be doing wrong?
-
Re: Square Payment Module for Zen Cart [Support Thread]
FIXED!
Somewhere in Simple Blue Responsive v1.0 Template
Crap! Now I gotta rebuild a new template :(
-
Re: Square Payment Module for Zen Cart [Support Thread]
Amature tearing his hair out here.
I'm trying to get this working at www.skahfeestudios.com, and it's been throwing SQ-NONCE-FAILURE.
I've switched template back to classic and still getting the error. When I enter credit card information and click submit, console is showing:
Code:
ReferenceError: check_form is not defined index.php:197:19
Clicking through to the line of code brings me to:
Code:
function doCollectsCardDataOnsite()
{
var str = $('form[name="checkout_payment"]').serializeArray();
zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
data: str
}).done(function( response ) {
$('#checkoutPayment').hide();
$('#navBreadCrumb').html(response.breadCrumbHtml);
$('#checkoutPayment').before(response.confirmationHtml);
$(document).attr('title', response.pageTitle);
});
}
$(document).ready(function(){
$('form[name="checkout_payment"]').submit(function() {
$('.paymentSubmit').attr('disabled', true);
formPassed = check_form();
I'm assuming this is tied to my failed attempts to implement One Page Checkout and Fast Easy Checkout (not at the same time). I guess I didn't revert a file back to its state prior to that failure. Any tips for me on how to track down the problem? Really hoping to get this working without a wipe and rebuild.
Thanks,
Scott
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
earmsby
Apparently Square only works for customer orders paid for and shipped in the US and Canada. This is what the Square support person is telling me. Does anyone have different information?
Quote:
Originally Posted by
RixStix
Quote:
Originally Posted by
earmsby
Interesting. The customer service rep told me, "... customers can use international credit cards to make purchases through a Square merchant’s Online Store, but the order must be placed in the U.S. and shipped to a U.S. address."
I was not aware that the ZenCart payment module sends the shipping address with the payment info, but maybe it does? Have others been able to process payments to customers with shipping addresses outside the US?
I did write back to try to clarify where they consider the order to have been "placed" - at my location in the US or at the location where the customer is typing into a browser screen. Seems unclear to me.
@earmsby, I asked Square to clarify this situation. Turns out the answer you were given was not fully correct. It was accurate if you were using the "Square Online Store" (which is a mini store within your Square account, to sell your items .... not your Zen Cart store), but inaccurate for your Zen Cart store since the Zen Cart integration uses Square's "E-commerce API" ... which does indeed accept international credit cards. ie: it'll accept all Visa/MasterCard/Amex/Discover/JCB cards, regardless of country, as long as it passes standard fraud-detection rules.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
HenryGale
Amature tearing his hair out here.
I'm trying to get this working at
www.skahfeestudios.com, and it's been throwing SQ-NONCE-FAILURE.
I've switched template back to classic and still getting the error. When I enter credit card information and click submit, console is showing:
Code:
ReferenceError: check_form is not defined index.php:197:19
Clicking through to the line of code brings me to:
Code:
function doCollectsCardDataOnsite()
{
var str = $('form[name="checkout_payment"]').serializeArray();
zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
data: str
}).done(function( response ) {
$('#checkoutPayment').hide();
$('#navBreadCrumb').html(response.breadCrumbHtml);
$('#checkoutPayment').before(response.confirmationHtml);
$(document).attr('title', response.pageTitle);
});
}
$(document).ready(function(){
$('form[name="checkout_payment"]').submit(function() {
$('.paymentSubmit').attr('disabled', true);
formPassed = check_form();
I'm assuming this is tied to my failed attempts to implement One Page Checkout and Fast Easy Checkout (not at the same time). I guess I didn't revert a file back to its state prior to that failure. Any tips for me on how to track down the problem? Really hoping to get this working without a wipe and rebuild.
Thanks,
Scott
I'd investigate all changes you've made to:
- /includes/modules/payment/checkout_payment -- all files
- /includes/modules/payment/checkout_confirmation -- all files
- /includes/modules/payment/checkout (this directory was added by FEC, so should be gone if you removed FEC)
- /includes/templates/EACH_OF_THE_TEMPLATES/jscript -- all files, make sure only the files still needed are present, and match your ZC version
- /includes/templates/EACH_OF_THE_TEMPLATES/templates/tpl_checkout_payment_default.php
- /includes/templates/EACH_OF_THE_TEMPLATES/templates/tpl_checkout_confirmation_default.php
One of the best ways to identify possible culprits is to get 2 directories on your PC: one containing all your server's Zen Cart files, and one containing a fresh uncustomized copy of original Zen Cart files for that version of Zen Cart .... and then run a text-file-compare program to compare and identify all differences between the files, both in-file-alterations, and added/deleted files. Good tools for this are Beyond Compare by Scooter Software, and Araxis Merge, or the free WinMerge (see http://www.zen-cart.com/wiki/index.php/Useful_Tools )
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
AquaticAddiction
Super excited to use this app - Ive hit one little snag that I cant seem to make sense of.
I keep getting red text that says (Access Token needed) - I go through the steps in OAuth, I get a page that says something to the effect of "Token Added, please close this page" but then nothing changes.
Help?
Thanks!
Was this ever answered?
I've uploaded all the files to the right locations on my server, created an app in my Square account, set the redirect URL to my domain, but I still have the red warning "(Access Token Needed)" in my Zen Cart Admin / Modules / Payment.
When I click on the "Click here to login and Authorize your account" button, I'm taken to the Square site where I log in. Then the page refreshes and I'm at my domain.
When I try to edit the module, there is nothing in the Location dropdown. How do I get something to appear here?
No matter how often I refresh my Admin page, the warning never goes away, and Square isn't one of the options listed for checkout.
Please help!
J.M. Snyder
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
jmsnyder23
I've uploaded all the files to the right locations on my server, created an app in my Square account, set the redirect URL to my domain, but I still have the red warning "(Access Token Needed)" in my Zen Cart Admin / Modules / Payment.
When I click on the "Click here to login and Authorize your account" button, I'm taken to the Square site where I log in. Then the page refreshes and I'm at my domain.
When I try to edit the module, there is nothing in the Location dropdown. How do I get something to appear here?
No matter how often I refresh my Admin page, the warning never goes away, and Square isn't one of the options listed for checkout.
Please help!
J.M. Snyder
Here's how it works:
- You put the correct URL into the OAuth setting in your Square account.
- In your store Admin, you fill in your account credentials (App ID and App Secret, especially)
- In your store Admin you see the Token button for Authorizing your account, and click it
- This takes you to the Square website where you approve the issuing of a token (it may ask you to login to Square if you weren't already)
- In the background it sends a small message to the OAuth URL
- If the incoming message to the OAuth URL is valid (and if the URL is correct, and not blocked by any .htaccess redirects or SEO-URL intercepts), then the issued token will be saved to your store and the module activated properly.
- Upon (manual) reload or re-visit of the Payment Modules page in your Admin, the Token button and error message will disappear from the Square module, and the module will show up on the storefront side, ready to take payments. Also, clicking the Edit button on the Square module will now show a list of Locations in the Locations Dropdown.
What can go wrong, thus preventing tokens from being issued properly?
- incompatible PHP version (You didn't mention your PHP version)
- files in wrong directories, or files missed from upload
- wrong URL entered into Square OAuth screen
- .htaccess URL rewrites blocking access to the square-handler URL
- plugins interfering with normal operation, including URL-rewriters, or so-called "SEO URLs"
Also, you didn't mention your Zen Cart version.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Okay, I figured it out :)
For those who may encounter the same problem, make sure your Redirect URL includes /square_handler.php. This information is NOT included in the instructions on the Square website, which were the ones I was following (it IS in the Zen Cart instructions).
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
jmsnyder23
Okay, I figured it out :)
For those who may encounter the same problem, make sure your Redirect URL includes /square_handler.php. This information is NOT included in the instructions on the Square website, which were the ones I was following (it IS in the Zen Cart instructions).
Thanks for posting back.
I note that the correct Redirect URL is also displayed in your Zen Cart Admin's Square page, near the Token Authorize button.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi:
I need some help trying to use the Square payments with my Zen Cart store.
I am a Canadian, but my website sells in both Canadian and U.S. dollars. I kept the U.S. currency as the default since most of my goods come from the U.S. and are sold to me in U.S. dollars.
I set up the Square Payments last week and it seemed to be working fine.
When the sale goes though in U.S. dollars the admin order edit screen is correct and everything is fine. Square reads that amount and the payment is correct.
Yesterday, I had a sale in Canadian funds. When that happens the admin order edit screen is wrong. It always has been. (the amount is converted to U.S. dollars in the display). The printed invoice is correct, but the edit order screen is not.
Square is taking that edit orders screen amount as the actual payment amount, which is incorrect.
Has anyone else had this happen? Is there a way to get the edit orders screen to be correct in Canadian currency? Is there a way to have Square payments get the correct amount when this happens?
My website is https://poolcuesexpress.com. I am running version 1.5.4.
Any help would be appreciated.
Dave H.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hmmm, the last time I did an alternate-currency sale using this module it did the exchange correctly for me.
You may already have this correct, but I must ask: What exchange rates do you have set for CAD vs USD in your Admin?
-
Re: Square Payment Module for Zen Cart [Support Thread]
Dr. Byte
I have U.S. default set at 1.000 and Canadian set at 1.2999
Dave H
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello everyone.
I've tried implementing ApplePay to the Square payment as per the instructions on the blog post https://medium.com/square-corner-blo...s-1f85cb6fe433 and the instructions found here https://docs.connect.squareup.com/pa...-apple-pay-web with no success.
Can someone please provide some guidance?
Thank you.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi:
Can someone offer any guidance on where I should look to correct this.
I have the Square payment module turned off for right now, but I would like to get it working.
Dave
-
Re: Square Payment Module for Zen Cart [Support Thread]
We are experiencing problems with Square and One Page Checkout (OPC) See thread starting at https://www.zen-cart.com/showthread....67#post1338767
Further investigation shows that Square Payment is somehow inserting itself into the OPC proccess when a new customer selects Pay Pal Express. We were getting
Code:
paymentform:1 Uncaught Error: SqPaymentForm element with id `square_cc-number` not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform
at s.buildIframeController (paymentform:1)
at s.buildIframeControllers (paymentform:1)
at s.build (paymentform:1)
at s.build (paymentform:1)
s.buildIframeController @ paymentform:1
s.buildIframeControllers @ paymentform:1
s.build @ paymentform:1
s.build @ paymentform:1
And, we still got the error without OPC using PayPal and the standard, three-page checkout.
PayPal brings the customer back to OPC and Square is looking for the cc number.
When PayPal brings the customer back to Step 2 of 3 in the standard checkout, the Square error is also there BUT, it disappears when the customer goes to Step 3 of 3. Once on Step 3 of 3, PayPal will confirm even with Square turned on as the error disappears between steps 2 and 3.
The system goes through all steps including registering the New Customer, emailing info, order shows up, etc.
Again, ALL failed testing is done as never before customer, using PayPal from Split-Page Login.
Conversely, when a logged-in user orders an item and clicks on Checkout (OPC ON - Square ON), the OPC is shown with the options for a CC or PayPal Express. Choosing PayPal Express and clicking Confirm takes the logged-in user to PayPal and completes the order on return. It does not return to OPC to give the user the option to confirm but, goes immediately to completion.
Synopsis:
We were wondering why some PayPal orders were coming in and we were getting emails that PayPal would not allow others to check out. Current trials result in:
1. Customer NOT logged in and NOT a previous customer with both Square and OPC enabled
* Places item in cart
* Selects Check Out
* Arrives a split-login
* Selects PayPal Express
* Browser opens PayPal
* Customer selects method of payment and pays
* Browser returns to site with "uncaught Error" from Square
* Customer is unable to complete the transaction as the Confirm Order Button does nothing
2. Returning Customer Or Newly Registered Customer, logged in with both Square and OPC enabled.
* Places item in cart
* Selects Check Out
* Arrives at OPC with options for Square, PayPal, or Money Order
* Selects PayPal Express
* Browser opens PayPal
* Customer selects method of payment and pays
* Browser returns to site and completes the transaction without requiring any further action from the Customer
We are still not certain whether Square or OPC is the culprit but, one of them is "sticking it's nose in where it doesn't belong."
Still uncertain as to whether Square is incorrectly looking for a cc_number or OPC is incorrecly looking for the cc_number from Square upon the Customer's return from PayPal.
Turning OPC off allows all customers to complete the process so, we have disabled OPC for now and hope a resolution is forthcoming.
Any information needed will be gladly provided.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi again. I posted this sort of request above, but got no answer, so I'm posting it again (thank you and sorry!)
Code:
I've tried implementing ApplePay to the Square payment as per the instructions on the blog post https://medium.com/square-corner-blo...s-1f85cb6fe433 and the instructions found here https://docs.connect.squareup.com/pa...-apple-pay-web with no success.
Can someone please provide some guidance?
Thank you.
Also would it be possible to have customers insert the name on the card along side the rest of the information? As it is right now, the plugin isn't asking for the name on the card, and we have strict policies in this regard. Before anyone asks, we've been burned before (ex-wife buying with ex-husbands CC) and of course bank sided with CC owner, needless to say we lost both the money and the merchandise, so if possible would like to prevent this sort of issue in the future.
Thank you!! =)
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
top hatt
Hi:
I need some help trying to use the Square payments with my Zen Cart store.
I am a Canadian, but my website sells in both Canadian and U.S. dollars. I kept the U.S. currency as the default since most of my goods come from the U.S. and are sold to me in U.S. dollars.
I set up the Square Payments last week and it seemed to be working fine.
When the sale goes though in U.S. dollars the admin order edit screen is correct and everything is fine. Square reads that amount and the payment is correct.
Yesterday, I had a sale in Canadian funds. When that happens the admin order edit screen is wrong. It always has been. (the amount is converted to U.S. dollars in the display). The printed invoice is correct, but the edit order screen is not.
Square is taking that edit orders screen amount as the actual payment amount, which is incorrect.
Has anyone else had this happen? Is there a way to get the edit orders screen to be correct in Canadian currency? Is there a way to have Square payments get the correct amount when this happens?
My website is
https://poolcuesexpress.com. I am running version 1.5.4.
Any help would be appreciated.
Dave H.
Quote:
Originally Posted by
DrByte
Hmmm, the last time I did an alternate-currency sale using this module it did the exchange correctly for me.
You may already have this correct, but I must ask: What exchange rates do you have set for CAD vs USD in your Admin?
Quote:
Originally Posted by
top hatt
Dr. Byte
I have U.S. default set at 1.000 and Canadian set at 1.2999
Dave H
Haven't checked if the issue remains in ZC 1.5.5 yet, but unrelated to Square. Looking over the purchase history from a ZC 1.5.3 site, came across the same scenario. Purchase made in foreign currency (store set for USD as default, purchase made with €. On the standard invoice slip, all amounts shown in € with proper units and values. On invoice, the sub-total and total reflect $ as converted using the then current conversion rate. Ie. The price of the item was $30.00, no taxes, the price was shown correctly for the product as paid for in € on the product line and correctly in $ for sub-total and total, but it seems unusual to not all be in one currency. When I changed the in store currency conversion for € (drastic change from something like 0.98xxxx to 0.5) there was no change in the display of price on the standard edit screen for the order.
Again, I don't think the issue is in Square or any particular payment module as the payment described above was through paypal and that it instead is some factor of display/calculation associated with the edit screen/orders code.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I've determined that there is an interoperability issue when Square, PayPal Express Checkout (shortcut) and One-Page Checkout are all enabled for a site. See https://www.zen-cart.com/showthread....37#post1339137 One-Page Checkout posting for details.
The update for the Square payment method requires change to the plugin's /includes/modules/pages/checkout_payment/jscript_square.php as follows:
Code:
if ($payment_modules->in_special_checkout() || !defined(MODULE_PAYMENT_SQUARE_STATUS) || MODULE_PAYMENT_SQUARE_STATUS != 'True' || (!defined('MODULE_PAYMENT_SQUARE_APPLICATION_ID') || MODULE_PAYMENT_SQUARE_ACCESS_TOKEN == '')) {
return false;
}
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hi:
I agree with you that it does not seem to be an issue with Square making the admin/customers/orders/edit screen incorrect.
When the sale goes though in U.S. dollars the admin/customers/orders/edit screen is correct and everything is fine.
When I have a sale in Canadian funds the admin/customers/orders/edit screen is wrong.
The product description line with pricing is correct in Canadian dollars.
The Subtotal line is incorrect. The price is displayed converted to U.S. dollars.
The shipping cost line is incorrect. The price is displayed converted to U.S. dollars.
The sales tax line is incorrect. The price is displayed converted to U.S. dollars.
The Grand Total amount is incorrect. The price is displayed converted to U.S. dollars.
Square is taking the Grand Total amount from the admin/customers/order/edit order screen as the amount to pay in Canadian dollars, since the purchase was made in Canadian dollars.
This is off by the difference in the conversion rate between USD and CDN.
Is there a way to either correct the admin/customers/orders/edit screen or get Square to take the payment amount from the admin/customers/orders/invoice screen. The invoice screen is correct.
Dave
-
Re: Square Payment Module for Zen Cart [Support Thread]
A few days ago I did some testing with this on a store configured with USD as primary currency.
When I placed an order as a customer using CAD currency, the Admin displays all amounts in CAD as calculated at the time the order was placed.
In the Square data (gray box) Square reports that it charged a certain USD equivalent on the specified day.
The rest of the Admin order details page shows everything in CAD, since that's what got stored in the database when the order was placed.
I don't think Square is causing any issues here at all.
Are you saying you wish that the Admin forced all prices back to your primary USD amount, instead of displaying what the customer purchased it as? I think that's a bigger challenge ... again, a separate discussion from Square, as I think the same behavior happens regardless which payment module is in use.
https://cl.ly/3V0O3U0q0Z0O/[d2d757be...0SquarePay.png
-
Re: Square Payment Module for Zen Cart [Support Thread]
Dr. Byte:
I am using Zen Cart version 1.5.4.
On my install the admin/customers/orders/edit screen has always been wonky.
When the sale goes though in U.S. dollars the admin/customers/orders/edit screen is correct and everything is fine.
When I have a sale in Canadian funds the admin/customers/orders/edit screen is incorrect.
The product description line with pricing is correct in Canadian dollars.
The Subtotal line is incorrect. The price is displayed converted to U.S. dollars.
The shipping cost line is incorrect. The price is displayed converted to U.S. dollars.
The sales tax line is incorrect. The price is displayed converted to U.S. dollars.
The Grand Total amount is incorrect. The price is displayed converted to U.S. dollars.
I believe Square took the grand total amount for payment, but treated it as if it was Canadian funds. This made the payment incorrect by the amount of the currency conversion.
After posting my problem on the Square Payment Module forum, I reevaluated what had happened and thought that fixing my admin/customers/orders/edit screen may be a better approach to the problem.
I posted my issue about the admin/customers/orders/edit screen on the Managing Customers and Orders forum and mc12345678 helped me change the code for the admin/orders.php file which resolved the issue. The admin/customers/orders/edit screen now is correct in either USD or CDN.
I have not had time to retest the Square module yet to confirm that this change has corrected the issue. I will try to do that today.
Thank you for taking the time to help me. I will report back when I have retested the Square payments.
Dave H.
-
Re: Square Payment Module for Zen Cart [Support Thread]
If I may again weigh in on the discussion and somewhat importantly the terminology.
The statement that the amount is "wrong" perhaps comes from the equivalent display of a currency symbol between US and CAD (would suggest adding an identifier to each if both currencies are going to be used within the same store by way of the currencies portion of the admin). Reason being, the amounts are not incorrect as displayed, they are mis-understood.
As to how they are displayed differently or mixed within a purchase, a similar "issue" was seen using a different payment processor where the payment processor setup allowed the currency to be collected and remain in the "alternate" or selected currency. Ie. A payment made in Canadian dollars (CAD) would be "stored" to remain in CAD unless requested to be converted to another currency. The same was possible for whatever currency was accepted by the payment processor and as handled by the account holder. This allows the store to "dictate" the conversion rate, but collect and keep the funds in the paid for currency. At a later time the funds could be converted by the payment processor or used as provided to perform a transaction.
Now I just looked at the setup options available in the 0.90 version of this module within ZC, but that side of the payment module does not offer settings like described above of "choosing" which currency in which to collect and store the money provided by a customer.
That said though, when using PayPal express where the currency selection was chosen to be the selected currency, then the mixed content of currencies on the order's edit screen had been seen (ultimately prompting a change in payment acceptance to Only {the currency primary to the store} as there has not been a need to maintain funds in alternate currencies).
As DrByte has run at least one test condition of a purchase in a currency that was not the primary currency of the store and the display of information about the order is consistent throughout the order's edit screen, I am not sure that the problem described can even be made visible with this payment gateway perhaps unless somehow multiple accounts are able to be active selected by the location of the purchaser and the data reported back to the store in a "mixed" state which is then captured/displayed as identified. Remember the "currency" was chosen by the location of the individual not necessarily by changing the selected currency. The test purchase above shows FL tax being applied in a CAD purchase which itself seems a little odd, but possible based on setup and testing within the store. Regardless I don't know the complete configuration of either of those two stores to necessarily cause the explained result. I do know that I have seen the condition described and was able to track down the difference in code that permitted the difference in display. I believe though that the difference in display (again now that have seen the image provided by DrByte I would suggest changing something about the currency indicator to improve clarity when two or more currencies sharing the same symbol are used in a single store) is important to be provided somewhere on the page (note the example provided by DrByte still shows both the "paid for" currency as well as the converted to currency with what appears to be a conversion rate determined primarily by square although would say that there is a bit of a mix of square and ZC involved which perhaps is not fully captured in square.)
Anyways the thread where a code modification was provided was here: https://www.zen-cart.com/showthread....-Orders-Screen
As described I don't necessarily think that the modification is the right thing for everyone and don't really see a problem with the potential different display provided there is some understanding (preferably visual) of what is being shown.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I've had this payment module running nicely now for a month or two. Definitely prefer it over PayPal that I was using previously. However, I'm wondering if there is a way to modify the module to send the customer/cardholder name to Square. All the payments come through as "Unknown Name" in the square dashboard. It would be very handy to have the customer's name or the cardholder name for bookkeeping purposes in Square. I'm curious as to whether the module is already supposed to do this and it's just not working in my installation of it or whether this is functionality that could be added. I'm willing to tinker if I knew where to start.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I believe that's something you need to take up with the folks at Square.
They would never process a card without the cardholder's name so, they must have it. If it doesn't show up in your Square report, it's probably because their system is not coded to do it.
-
Re: Square Payment Module for Zen Cart [Support Thread]
I believe it's a security/data protection thing. I have a Square and an iZettle account and the latter also omits customers names.
-
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
earmsby
I've had this payment module running nicely now for a month or two. Definitely prefer it over PayPal that I was using previously. However, I'm wondering if there is a way to modify the module to send the customer/cardholder name to Square. All the payments come through as "Unknown Name" in the square dashboard. It would be very handy to have the customer's name or the cardholder name for bookkeeping purposes in Square. I'm curious as to whether the module is already supposed to do this and it's just not working in my installation of it or whether this is functionality that could be added. I'm willing to tinker if I knew where to start.
Not sure if it'll make a difference, but you could add the first_name parameter to accompany the last_name parameter here: https://github.com/zencart/zencart/b...quare.php#L288
-
Re: Square Payment Module for Zen Cart [Support Thread]
Hello everyone.
We received an order today. The client paid by CC through Square which generated this weird email.
PHP Code:
Jan-09-2018 12:41:20
=================================
Error Dump: stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[category] => PAYMENT_METHOD_ERROR
[code] => CARD_DECLINED
[detail] => Card declined.
)
)
)
Transaction ID assigned:
Sent to Square: Array
(
[idempotency_key] => XXXXXXXXXX
[card_nonce] => XXXXXXXXXXXXXXXX
[amount_money] => Array
(
[amount] => 91800
[currency] => USD
)
[delay_capture] => 1
[reference_id] => XXXXXXXXXXXXXXXXXX
[note] => By Valenti Organics
[customer_id] => 12
[buyer_email_address] => XXXXXXXXXXXXXXXX
[billing_address] => Array
(
[address_line] => XXXXXXXXXXXXXXXX
[address_line_2] =>
[locality] => ##########
[administrative_district_level_1] => ##########
[postal_code] => 00000
[country] => AE
[last_name] => salim
[organization] =>
)
[shipping_address] => Array
(
[address_line] => XXXXXXXXXXXXXXXXX
[address_line_2] =>
[locality] => ##########
[administrative_district_level_1] => ##########
[postal_code] => 00000
[country] => AE
[last_name] => salim
[organization] =>
)
)
Results Received back from Square: Array (
[402] => [HTTP/1.1 402 Payment Required] {"errors":[{"category":"PAYMENT_METHOD_ERROR","code":"CARD_DECLINED","detail":"Card declined."}]}
)
The amount in US $862.05 yet the amount in the email is wrong.
The order seems to have gone through just fine by the way.
Any ideas why this email was generated??
-
Re: Square Payment Module for Zen Cart [Support Thread]
That error occurred when the customer attempted a payment which was declined, exactly as the message says.
You said that an order came through later, so most likely the customer chose a different credit card to complete their purchase.