Results 1 to 10 of 821

Threaded View

  1. #11
    Join Date
    Mar 2016
    Location
    Norcatur, Kansas, USA
    Posts
    80
    Plugin Contributions
    3

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

    Okay, I found a bug in the 1.0 beta. It is in includes\modules\payments\square.php line 664:

    Code:
            $oauthApi = new SquareConnect\Api\OAuthApi($this->_sqConfig);
    The OAuthApi class initializes NOT with SquareConfiguration, but rather with ApiClient. See lines 34-45 of includes\classes\vendors\square\connect\lib\Api\OAuthApi.php:

    Code:
        /**
         * Constructor
         * @param \SquareConnect\ApiClient|null $apiClient The api client to use
         */
        function __construct($apiClient = null)
        {
            if ($apiClient == null) {
                $apiClient = new ApiClient();
                $apiClient->getConfig()->setHost('https://connect.squareup.com');
            }
      
            $this->apiClient = $apiClient;
        }
    So this is the error that is being thrown by this bug. This is the problem I have been experiencing:

    Code:
    [15-Mar-2020 20:47:11 America/Chicago] PHP Fatal error:  Uncaught Error: Call to undefined method SquareConnect\Configuration::callApi() in C:\wamp\www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php:134
    Stack trace:
    #0 C:\wamp\www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php(78): SquareConnect\Api\OAuthApi->obtainTokenWithHttpInfo(Object(SquareConnect\Model\ObtainTokenRequest))
    #1 C:\wamp\www\store\includes\modules\payment\square.php(676): SquareConnect\Api\OAuthApi->obtainToken(Object(SquareConnect\Model\ObtainTokenRequest))
    #2 C:\wamp\www\store\includes\modules\payment\square.php(541): square->renewOAuthToken()
    #3 C:\wamp\www\store\includes\modules\payment\square.php(476): square->token_refresh_check()
    #4 C:\wamp\www\store\includes\modules\payment\square.php(718): square->getAccessToken()
    #5 C:\wamp\www\store\includes\modules\payment\square.php(733): square->getLocationsList()
    #6 C:\wamp\www\store\includes\modules\payment\square.php(1264): square->getLocationsPulldownArray()
    #7 C:\wamp\www\store\wEn-nImda4eman\modules.php(307) : eval()'d code(1): zen_cfg_pull_down_square_locations('', 'MODULE_PAYMENT_...')
    #8 C:\wamp\www\store\wEn-nImda4eman\modules.php(307): eval()
    #9 {main}
      thrown in C:\wamp\www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php on line 134
    I believe I fixed it by modifying line 664 to:

    Code:
            $oauthApi = new SquareConnect\Api\OAuthApi($this->_apiConnection);
    Last edited by Fjolsvith; 16 Mar 2020 at 03:31 AM.

 

 

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