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