Results 1 to 10 of 821

Hybrid View

  1. #1
    Join Date
    Jan 2018
    Location
    Toronto, Canada
    Posts
    19
    Plugin Contributions
    0

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Quote Originally Posted by DrByte View Post
    Since you've changed $verbose to true, what happens when you visit your_store.com/square_handler.php via your browser? It should tell you the status of the token.

    I wonder if you have the wrong path. How is this "task" command different from the one you have for the currency cron?
    Thank you DrByte.
    Status of the token shows not expired and it's logic since there have been transactions during the day. However the actual token in Square Dashboard (APPS) has not changed after the cron job.

    I include screen of scheduled tasks. Currency Update has the same parameters except for the location of executable php.
    Thank you again.
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Yes, the actual token won't change unless Square issues an exchange for it, either because they've decided it's time to rotate it, or because it's expired. Since it hasn't expired (which doesn't happen unless unused for 30 days), it's unsurprising that there's no observable change.

    It shouldn't be giving any error though. When there's nothing to renew, it exits with status code of 0, meaning no error.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2018
    Location
    Toronto, Canada
    Posts
    19
    Plugin Contributions
    0

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Quote Originally Posted by DrByte View Post
    Yes, the actual token won't change unless Square issues an exchange for it, either because they've decided it's time to rotate it, or because it's expired. Since it hasn't expired (which doesn't happen unless unused for 30 days), it's unsurprising that there's no observable change.

    It shouldn't be giving any error though. When there's nothing to renew, it exits with status code of 0, meaning no error.
    I changed the Schedule Task in Plesk from Run a Command to Fetch a URL and now no error.
    Thank you DrByte

  4. #4
    Join Date
    Mar 2006
    Location
    San Francisco, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Zen Cart v1.5.5f
    Site was upgraded about a month ago from v1.5.4 to 1.5.5f
    We had our ISP do the upgrade and they set up a test site so assume it was an official upgrade procedure.
    We use plug-ins Cross-Sell (X-Sell), Image Handler, Flexible Footer Menu, Wishlist, Westminister theme.
    Our problem is payment-related to the Square 0.94 plug-in. We also have Check/Money Order, PayPal Express Checkout enabled (green). Authorize.net (AIM) and COD options are yellow; all others in Payment Module are red.
    PHP Version 5.6.37 ; mysqlnd 5.0.11-dev - 20120503 - $Id:
    Everything was working as expected until we needed a new Access Token for our Square account about a month after the upgrade. We have updated these tokens in the past with no problems prior to the recent upgrade. We successfully replaced our Personal Access Token in our Square account (and received confirmation of that within Square), copied the new token into our Zen Cart Square payment module, and updated the module. However, we are still getting the following error via e-mail with every customer who tries to place an order paying via credit card:

    Results Received back from Square: Array
    (
    [401] => [HTTP/1.1 401 Unauthorized] {"errors":[{"category":"AUTHENTICATION_ERROR","code":"ACCESS_TOKEN_REVOKED","detail":"Th e provided OAuth access token has been revoked."}]}
    )


    We have spoken with Square and they said the problem must be in the Zen Cart module because we are able to manually input orders successfully via the virtual terminal within our Square account. We have contacted our ISP about this and received this response:

    "There has been no update to server recently. However, we have found that shopping cart does shift to HTTPS upon checkout, so that may be a factor.

    "We have checked the six possible conditions listed under "Problems with OAuth Token Generation" at - https://www.zen-cart.com/content.php...Cart&styleid=3.

    "None of these conditions are valid in this case.The files concerned have not been modified in months, and there is no .htredirect that is forcing redirects.

    "As per the HTTP and HTTPS logs for holymtn.com for "square_handler.php", which Square accesses to complete transactions. In the past 2 weeks, there have been zero attempts to access this file from the outside. This suggests that either the plugin is misconfigured, or there is another error preventing Square from accessing the URL.

    "At this point I think that Square should be contacted, as I have not found anything server-side that is generating errors."

    We have replaced the access tokens three times but there has been no change in results.

    We have read through the FAQs and searched for an answer in the forum area but without success. Can you please help? Here's our URL:

    https://www.holymtn.com/catalog

    Thank you in advance for any light you can shed on this.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Your store does NOT use your "Personal Access Token", so resetting that won't fix anything for your store.

    The Oauth token referred to by the "ACCESS_TOKEN_REVOKED" message is NOT your "personal access token". it's a token that you can't see or set anywhere by hand. That token is generated by requesting it using the AppID/Secret from your account's OAuth settings after you enter those settings into your store.

    The "ACCESS_TOKEN_REVOKED" message means that the token you've entered is no longer valid. More specifically, it's been forcefully deactivated/revoked on Square's end. (And I'm guessing that's probably because it's still referring to the old token that expired and then ran out past the grace-period for renewal.)

    I'm sad that the Square rep didn't go further and make sure they were actually receiving requests for your AppID on their end. Their tech team could explain the token failure in more detail if they followed it through.

    At this point I think there are 2 factors to consider:

    1. Have you created more than one "app" in your Square account? You only need ONE.
    Most merchants won't have more than one such "app", so this may be a non-issue. But if you have multiple, be sure you understand why you've done that, and be sure you're grabbing the AppID/Secret (and setting the OAuth Return URL) for the right one when configuring your ZC module in your store.

    2. Let's do a reset:
    a. in your ZC Admin, go to your Square module, and click Remove, and confirm it. This should also reset any old negotiated tokens so there should be no "revoked" response anymore.
    b. Then click Install to re-add it. You will need to re-configure it from scratch again by entering your AppID and Secret from your Square "app". (explained in the "Configure the Square Module in your store Admin" of https://www.zen-cart.com/content.php...quare-Payments ) and clicking the green Access Token button so that it negotiates a new Oauth token for you.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Mar 2006
    Location
    San Francisco, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Thank you so much, DrByte! That was it -- due to the e-mail error codes we received we were substituting our personal access token for the OAuth application secret and wondering why were weren't seeing the green button to authorize the app. Thank you for highlighting that difference for us. Once we reinstalled the app and tested it, everything is now working perfectly again. Much gratitude to you -- we really appreciate your quick answer, insight and direction!

  7. #7
    Join Date
    Jul 2013
    Location
    Brisbane, Australia
    Posts
    39
    Plugin Contributions
    0

    Default Re: Square Payment Module for Zen Cart [Support Thread]

    Hi. I was hoping someone could please help with an error re the cron job to automatically handle token refreshes.

    Cron job installed via cPanel on server:
    php /home/my_username/public_html/square_handler.php
    Error Log:
    [12-Sep-2018 12:05:02 Australia/Brisbane] PHP Fatal error: Uncaught Error: Class 'square' not found in /home/my_username/public_html/square_handler.php:19
    Stack trace:
    #0 {main}
    thrown in /home/my_username/public_html/square_handler.php on line 19
    Email returned:
    Status: 500 Internal Server Error
    X-Powered-By: PHP/7.0.31
    Access-Control-Allow-Origin: *
    Set-Cookie: cookie_test=please_accept_for_session; expires=Fri, 12-Oct-2018 02:05:02 GMT; Max-Age=2592000; path=/; domain=recoveredheritage.com.au
    Set-Cookie: zcrm_ac08606c3ae64282ac69e5945c47bda5=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=recoveredheritage.com.au
    Content-Type: text/html; charset=utf-8
    My situation:
    Square v0.94 installed successfully and all looks OK in Admin
    ZC1.5.5e (modified with plugins)
    Website: recoveredheritage.com.au. Still under development (maintenance mode currently on but the error persists even when its off).

    Line 19 of that file states
    $square = new square;
    . I tried re-uploading all the SQUARE plugin files in case I missed one in the classes directory somehow - but error persists. As yet, I haven't been able to find a solution or the problem discussed in either the zencart or general community. Can anyone point me in the right direction to resolve this please?

    Thanks.

 

 

Similar Threads

  1. WordPress® for Zen Cart® (wp4zen) [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 109
    Last Post: 1 Dec 2024, 01:36 PM
  2. Bambora/Beanstream Payment Module Support Thread
    By swguy in forum Addon Payment Modules
    Replies: 127
    Last Post: 26 Mar 2021, 04:13 PM
  3. v154 Support Thread: AddToAny for Zen Cart (The Universal Sharing Platform)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 8 Apr 2019, 02:39 PM
  4. Layaway Payment Module Support Thread
    By Danielle in forum Addon Payment Modules
    Replies: 0
    Last Post: 21 Nov 2006, 06:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg