Okay, I found a bug in the 1.0 beta. It is in includes\modules\payments\square.php line 664:
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:$oauthApi = new SquareConnect\Api\OAuthApi($this->_sqConfig);
So this is the error that is being thrown by this bug. This is the problem I have been experiencing: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; }
I believe I fixed it by modifying line 664 to: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
Code:$oauthApi = new SquareConnect\Api\OAuthApi($this->_apiConnection);


Reply With Quote
