Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 4ab7c39

Browse files
Merge pull request #142 from square/jessdelacruzsantos/UpdateMigrationGuide
Update readme.md
2 parents 14f47f3 + da16edc commit 4ab7c39

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

README.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
![Square logo]
2-
3-
# Square Connect PHP SDK - RETIRED
1+
# Square Connect PHP SDK - RETIRED replaced by [square/square-php-sdk](https://github.com/square/square-php-sdk)
42

53
---
64

@@ -38,7 +36,6 @@ The old Connect SDK documentation is available under the
3836
Follow the instructions below to migrate your apps from the deprecated
3937
`square/connect` sdk to the new library.
4038

41-
### Option 1: With composer.json
4239
You need to update your app to use the Square PHP SDK instead of the Connect PHP SDK
4340
The Square PHP SDK uses the `square/square` identifier.
4441

@@ -52,24 +49,10 @@ $ php composer.phar require square/square
5249
```
5350
"require": {
5451
...
55-
"square/square": "*",
52+
"square/square": "^5.0.0",
5653
...
5754
}
5855
```
59-
60-
### Option 2: From GitHub
61-
Clone the Square PHP SDK repository or download the zip into your project folder and
62-
then update the following line in your code from
63-
64-
```php
65-
require('connect-php-sdk/autoload.php');
66-
```
67-
to:
68-
69-
```php
70-
require('square-php-sdk/autoload.php');
71-
```
72-
7356
### Update your code
7457

7558
1. Change all instances of `use SquareConnect\...` to `use Square\...`.
@@ -103,14 +86,13 @@ Square SDK
10386
```php
10487
require 'vendor/autoload.php';
10588

106-
use Square\Client;
107-
108-
$access_token = 'YOUR_ACCESS_TOKEN';
89+
use Square\SquareClient;
90+
use Square\Environment;
10991

11092
// Initialize the Square client.
11193
$api_client = new SquareClient([
112-
'accessToken' => $access_token,
113-
'environment' => 'sandbox'
94+
'accessToken' => "YOUR_ACCESS_TOKEN",
95+
'environment' => Environment::SANDBOX
11496
]); // In production, the environment arg is 'production'
11597
```
11698

@@ -162,6 +144,14 @@ try {
162144
Now consider equivalent code using the new `square/square` library:
163145

164146
```php
147+
require 'vendor/autoload.php';
148+
149+
use Square\Environment;
150+
use Square\Exceptions\ApiException;
151+
use Square\SquareClient;
152+
use Square\Models\CreatePaymentRequest;
153+
use Square\Models\Money;
154+
165155
$payments_api = $api_client->getPaymentsApi();
166156

167157
$money = new Money();
@@ -200,6 +190,5 @@ Please join us in our [Square developer community] if you have any questions!
200190

201191

202192
[//]: # "Link anchor definitions"
203-
[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
204193
[Square PHP SDK]: https://github.com/square/square-php-sdk
205194
[Square developer community]: https://squ.re/slack

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "square/connect",
33
"version": "3.20200528.1",
4-
"description": "PHP client library for the Square Connect v2 API",
4+
"description": "This Package is deprecated, it is replaced by https://packagist.org/packages/square/square.",
55
"keywords": [
66
"swagger",
77
"php",

0 commit comments

Comments
 (0)