Download the PHP
package square/connect without Composer
On this page you can find all versions of the php package
square/connect. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
The Square Connect PHP SDK is retired (EOL) as of 2020-06-10 and will no longer
receive bug fixes or product updates. To continue receiving API and SDK
improvements, please follow the instructions below to migrate to the new
Square PHP SDK.
The old Connect SDK documentation is available under the
/docs folder.
Migrate to the Square PHP SDK
Update your code
Example code migration
Ask the Community
Migrate to the Square PHP SDK
Follow the instructions below to migrate your apps from the deprecated
square/connect sdk to the new library.
You need to update your app to use the Square PHP SDK instead of the Connect PHP SDK
The Square PHP SDK uses the square/square identifier.
On the command line, run:
-or-
Update your composer.json:
Update your code
Change all instances of use SquareConnect\... to use Square\....
Replace SquareConnect models with the new Square equivalents
Update client instantiation to follow the method outlined below.
Update code for accessing response data to follow the method outlined below.
Check $apiResponse->isSuccess() or $apiResponse->isError() to determine if the call was a success.
To simplify your code, we also recommend that you use method chaining to access
APIs instead of explicitly instantiating multiple clients.
Client instantiation
Connect SDK
Square SDK
Example code migration
As a specific example, consider the following code for creating a new payment
from the following nonce:
With the deprecated square/connect library, this is how you instantiate a client
for the Payments API, format the request, and call the endpoint:
Now consider equivalent code using the new square/square library:
Requiresphp Version
>=5.3.3 ext-curl Version
* ext-json Version
* ext-mbstring Version
*
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package square/connect contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.