Originally Posted by
DrByte
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.
Bookmarks