Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Class 'SquareClient' not found #3

Closed
Swapnilchavan18 opened this issue Jun 14, 2020 · 6 comments
Closed

Uncaught Error: Class 'SquareClient' not found #3

Swapnilchavan18 opened this issue Jun 14, 2020 · 6 comments

Comments

@Swapnilchavan18
Copy link

Swapnilchavan18 commented Jun 14, 2020

I started on working with new php sdk and it gives me an error. I checked code inside sdk and there is no class 'SquareClient', but other classes(LocationsApi,Environment) are found. What I am doing wrong? Is this sdk production ready?

require_once "square_sdk/vendor/autoload.php";
use Square\SquareClient;
$sq_client = new SquareClient([
	'accessToken' => $square_access_token,
	'environment' => Environment::SANDBOX,
]);
@StephenJosey
Copy link

The class definitely exists: https://github.com/square/square-php-sdk/blob/master/src/SquareClient.php. When I install via composer, it finds the SquareClient successfully. Are you saying in your repo you downloaded, you do not see this file (SquareClient.php)?

@sseaman
Copy link
Collaborator

sseaman commented Jul 8, 2020

Closing due to lack of response. Please feel free to open again if you would like to continue the conversation.

@sseaman sseaman closed this as completed Jul 8, 2020
@Swapnilchavan18
Copy link
Author

Error was with php 7.0. It works perfectly with php 7.4.

@itsmemanoj
Copy link

@Swapnilchavan18 what about 7.2?
i am having the same issue.

@Swapnilchavan18
Copy link
Author

I directly migrated from 7.0 to 7.4 , but as readme says minimum requirement of PHP 7.1+, so php 7.2 should be ok. Are you using with composer?

@itsmemanoj
Copy link

itsmemanoj commented Aug 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants