Skip to content

Commit

Permalink
Merge pull request #94 from square/release/22.0.0.20220921
Browse files Browse the repository at this point in the history
  • Loading branch information
joanc-sq authored Sep 21, 2022
2 parents eff2315 + d82b2ea commit 76b5cc2
Show file tree
Hide file tree
Showing 43 changed files with 218 additions and 207 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders.

* [Requirements](#requirements)
* [Installation](#installation)
* [Quickstart](#quickstart)
* [Usage](#usage)
* [Tests](#tests)
* [SDK Reference](#sdk-reference)
* [Deprecated APIs](#deprecated-apis)


## Requirements

Use of the Square PHP SDK requires:
Expand Down Expand Up @@ -123,16 +132,18 @@ All environment variables:
* [Sites]
* [Snippets]

### Authorization APIs
### Authorization
* [Mobile Authorization]
* [OAuth]

### Deprecated APIs
* [Employees]
* [V1 Employees]
* [V1 Transactions]
* [V1 Items]
* [Transactions]
## Deprecated APIs

The following Square APIs are [deprecated](https://developer.squareup.com/docs/build-basics/api-lifecycle):

* [Employees] - replaced by the [Team] API. For more information, see [Migrate from the Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees).

* [Transactions] - replaced by the [Orders] and [Payments] APIs. For more information, see [Migrate from the Transactions API](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api).


[//]: # "Link anchor definitions"
[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
Expand All @@ -153,7 +164,6 @@ All environment variables:
[Checkout]: doc/apis/checkout.md
[Catalog]: doc/apis/catalog.md
[Customers]: doc/apis/customers.md
[Employees]: doc/apis/employees.md
[Inventory]: doc/apis/inventory.md
[Labor]: doc/apis/labor.md
[Loyalty]: doc/apis/loyalty.md
Expand All @@ -167,14 +177,12 @@ All environment variables:
[Subscriptions]: doc/apis/subscriptions.md
[Mobile Authorization]: doc/apis/mobile-authorization.md
[OAuth]: doc/apis/o-auth.md
[V1 Employees]: doc/apis/v1-employees.md
[V1 Transactions]: doc/apis/v1-transactions.md
[V1 Items]: doc/apis/v1-items.md
[Team]: doc/apis/team.md
[Transactions]: doc/apis/transactions.md
[Sites]: doc/apis/sites.md
[Snippets]: doc/apis/snippets.md
[Cards]: doc/api/cards.md
[Payouts]: doc/api/payouts.md
[Gift Cards]: doc/api/gift-cards.md
[Gift Card Activities]: doc/api/gift-card-activities.md
[Employees]: doc/apis/employees.md
[Transactions]: doc/apis/transactions.md
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "square/square",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"version": "21.1.0.20220823",
"version": "22.0.0.20220921",
"type": "library",
"keywords": [
"Square",
Expand Down
6 changes: 4 additions & 2 deletions doc/apis/apple-pay.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ an Apple Pay enabled domain.
This endpoint provides an easy way for platform developers to bulk activate
Apple Pay on the Web with Square for merchants using their platform.

To learn more about Web Apple Pay, see
[Add the Apple Pay on the Web Button](https://developer.squareup.com/docs/payment-form/add-digital-wallets/apple-pay).
Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022.
You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate).

To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).

```php
function registerDomain(RegisterDomainRequest $body): ApiResponse
Expand Down
1 change: 1 addition & 0 deletions doc/apis/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ $body_invoice_customFields[1]->setPlacement(Models\InvoiceCustomFieldPlacement::
$body_invoice->setCustomFields($body_invoice_customFields);

$body_invoice->setSaleOrServiceDate('2030-01-24');
$body_invoice->setStorePaymentMethodEnabled(false);
$body = new Models\CreateInvoiceRequest(
$body_invoice
);
Expand Down
3 changes: 2 additions & 1 deletion doc/apis/loyalty.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ Adds points earned from a purchase to a [loyalty account](../../doc/models/loyal
- If you are not using the Orders API to manage orders, provide `points` with the number of points to add.
You must first perform a client-side computation of the points earned from the loyalty program and
loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](../../doc/apis/loyalty.md#calculate-loyalty-points)
to compute the points earned from the loyalty program (but not points earned from a loyalty promotion).
to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see
[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).

```php
function accumulateLoyaltyPoints(string $accountId, AccumulateLoyaltyPointsRequest $body): ApiResponse
Expand Down
72 changes: 36 additions & 36 deletions doc/apis/v1-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ $v1TransactionsApi = $client->getV1TransactionsApi();

## Methods

* [List Orders](../../doc/apis/v1-transactions.md#list-orders)
* [Retrieve Order](../../doc/apis/v1-transactions.md#retrieve-order)
* [Update Order](../../doc/apis/v1-transactions.md#update-order)
* [List Payments](../../doc/apis/v1-transactions.md#list-payments)
* [Retrieve Payment](../../doc/apis/v1-transactions.md#retrieve-payment)
* [List Refunds](../../doc/apis/v1-transactions.md#list-refunds)
* [Create Refund](../../doc/apis/v1-transactions.md#create-refund)
* [List Settlements](../../doc/apis/v1-transactions.md#list-settlements)
* [Retrieve Settlement](../../doc/apis/v1-transactions.md#retrieve-settlement)
* [V1 List Orders](../../doc/apis/v1-transactions.md#v1-list-orders)
* [V1 Retrieve Order](../../doc/apis/v1-transactions.md#v1-retrieve-order)
* [V1 Update Order](../../doc/apis/v1-transactions.md#v1-update-order)
* [V1 List Payments](../../doc/apis/v1-transactions.md#v1-list-payments)
* [V1 Retrieve Payment](../../doc/apis/v1-transactions.md#v1-retrieve-payment)
* [V1 List Refunds](../../doc/apis/v1-transactions.md#v1-list-refunds)
* [V1 Create Refund](../../doc/apis/v1-transactions.md#v1-create-refund)
* [V1 List Settlements](../../doc/apis/v1-transactions.md#v1-list-settlements)
* [V1 Retrieve Settlement](../../doc/apis/v1-transactions.md#v1-retrieve-settlement)


# List Orders
# V1 List Orders

**This endpoint is deprecated.**

Provides summary information for a merchant's online store orders.

```php
function listOrders(
function v1ListOrders(
string $locationId,
?string $order = null,
?int $limit = null,
Expand All @@ -54,7 +54,7 @@ function listOrders(
```php
$locationId = 'location_id4';

$apiResponse = $v1TransactionsApi->listOrders($locationId);
$apiResponse = $v1TransactionsApi->v1ListOrders($locationId);

if ($apiResponse->isSuccess()) {
$v1Order = $apiResponse->getResult();
Expand All @@ -68,14 +68,14 @@ if ($apiResponse->isSuccess()) {
```


# Retrieve Order
# V1 Retrieve Order

**This endpoint is deprecated.**

Provides comprehensive information for a single online store order, including the order's history.

```php
function retrieveOrder(string $locationId, string $orderId): ApiResponse
function v1RetrieveOrder(string $locationId, string $orderId): ApiResponse
```

## Parameters
Expand All @@ -95,7 +95,7 @@ function retrieveOrder(string $locationId, string $orderId): ApiResponse
$locationId = 'location_id4';
$orderId = 'order_id6';

$apiResponse = $v1TransactionsApi->retrieveOrder($locationId, $orderId);
$apiResponse = $v1TransactionsApi->v1RetrieveOrder($locationId, $orderId);

if ($apiResponse->isSuccess()) {
$v1Order = $apiResponse->getResult();
Expand All @@ -109,14 +109,14 @@ if ($apiResponse->isSuccess()) {
```


# Update Order
# V1 Update Order

**This endpoint is deprecated.**

Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:

```php
function updateOrder(string $locationId, string $orderId, V1UpdateOrderRequest $body): ApiResponse
function v1UpdateOrder(string $locationId, string $orderId, V1UpdateOrderRequest $body): ApiResponse
```

## Parameters
Expand All @@ -141,7 +141,7 @@ $body = new Models\V1UpdateOrderRequest(
$body_action
);

$apiResponse = $v1TransactionsApi->updateOrder($locationId, $orderId, $body);
$apiResponse = $v1TransactionsApi->v1UpdateOrder($locationId, $orderId, $body);

if ($apiResponse->isSuccess()) {
$v1Order = $apiResponse->getResult();
Expand All @@ -155,7 +155,7 @@ if ($apiResponse->isSuccess()) {
```


# List Payments
# V1 List Payments

**This endpoint is deprecated.**

Expand All @@ -172,7 +172,7 @@ list an offline payment chronologically between online payments that
were seen in a previous request.

```php
function listPayments(
function v1ListPayments(
string $locationId,
?string $order = null,
?string $beginTime = null,
Expand Down Expand Up @@ -205,7 +205,7 @@ function listPayments(
$locationId = 'location_id4';
$includePartial = false;

$apiResponse = $v1TransactionsApi->listPayments($locationId, null, null, null, null, null, $includePartial);
$apiResponse = $v1TransactionsApi->v1ListPayments($locationId, null, null, null, null, null, $includePartial);

if ($apiResponse->isSuccess()) {
$v1Payment = $apiResponse->getResult();
Expand All @@ -219,14 +219,14 @@ if ($apiResponse->isSuccess()) {
```


# Retrieve Payment
# V1 Retrieve Payment

**This endpoint is deprecated.**

Provides comprehensive information for a single payment.

```php
function retrievePayment(string $locationId, string $paymentId): ApiResponse
function v1RetrievePayment(string $locationId, string $paymentId): ApiResponse
```

## Parameters
Expand All @@ -246,7 +246,7 @@ function retrievePayment(string $locationId, string $paymentId): ApiResponse
$locationId = 'location_id4';
$paymentId = 'payment_id0';

$apiResponse = $v1TransactionsApi->retrievePayment($locationId, $paymentId);
$apiResponse = $v1TransactionsApi->v1RetrievePayment($locationId, $paymentId);

if ($apiResponse->isSuccess()) {
$v1Payment = $apiResponse->getResult();
Expand All @@ -260,14 +260,14 @@ if ($apiResponse->isSuccess()) {
```


# List Refunds
# V1 List Refunds

**This endpoint is deprecated.**

Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length.

```php
function listRefunds(
function v1ListRefunds(
string $locationId,
?string $order = null,
?string $beginTime = null,
Expand Down Expand Up @@ -297,7 +297,7 @@ function listRefunds(
```php
$locationId = 'location_id4';

$apiResponse = $v1TransactionsApi->listRefunds($locationId);
$apiResponse = $v1TransactionsApi->v1ListRefunds($locationId);

if ($apiResponse->isSuccess()) {
$v1Refund = $apiResponse->getResult();
Expand All @@ -311,7 +311,7 @@ if ($apiResponse->isSuccess()) {
```


# Create Refund
# V1 Create Refund

**This endpoint is deprecated.**

Expand All @@ -329,7 +329,7 @@ purposes, you can create fake cash payments in Square Point of Sale and
refund them.

```php
function createRefund(string $locationId, V1CreateRefundRequest $body): ApiResponse
function v1CreateRefund(string $locationId, V1CreateRefundRequest $body): ApiResponse
```

## Parameters
Expand All @@ -356,7 +356,7 @@ $body = new Models\V1CreateRefundRequest(
$body_reason
);

$apiResponse = $v1TransactionsApi->createRefund($locationId, $body);
$apiResponse = $v1TransactionsApi->v1CreateRefund($locationId, $body);

if ($apiResponse->isSuccess()) {
$v1Refund = $apiResponse->getResult();
Expand All @@ -370,7 +370,7 @@ if ($apiResponse->isSuccess()) {
```


# List Settlements
# V1 List Settlements

**This endpoint is deprecated.**

Expand All @@ -382,7 +382,7 @@ ranges cannot exceed one year in length.
information.

```php
function listSettlements(
function v1ListSettlements(
string $locationId,
?string $order = null,
?string $beginTime = null,
Expand Down Expand Up @@ -414,7 +414,7 @@ function listSettlements(
```php
$locationId = 'location_id4';

$apiResponse = $v1TransactionsApi->listSettlements($locationId);
$apiResponse = $v1TransactionsApi->v1ListSettlements($locationId);

if ($apiResponse->isSuccess()) {
$v1Settlement = $apiResponse->getResult();
Expand All @@ -428,7 +428,7 @@ if ($apiResponse->isSuccess()) {
```


# Retrieve Settlement
# V1 Retrieve Settlement

**This endpoint is deprecated.**

Expand All @@ -451,7 +451,7 @@ a bank account within 3 business days, but in exceptional cases it may
take longer.

```php
function retrieveSettlement(string $locationId, string $settlementId): ApiResponse
function v1RetrieveSettlement(string $locationId, string $settlementId): ApiResponse
```

## Parameters
Expand All @@ -471,7 +471,7 @@ function retrieveSettlement(string $locationId, string $settlementId): ApiRespon
$locationId = 'location_id4';
$settlementId = 'settlement_id0';

$apiResponse = $v1TransactionsApi->retrieveSettlement($locationId, $settlementId);
$apiResponse = $v1TransactionsApi->v1RetrieveSettlement($locationId, $settlementId);

if ($apiResponse->isSuccess()) {
$v1Settlement = $apiResponse->getResult();
Expand Down
2 changes: 1 addition & 1 deletion doc/apis/webhook-subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function listWebhookSubscriptions(
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for your original query.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
| `includeDisabled` | `?bool` | Query, Optional | Includes disabled [Subscription](../../doc/models/webhook-subscription.md)s.<br>By default, all enabled [Subscription](../../doc/models/webhook-subscription.md)s are returned.<br>**Default**: `false` |
| `sortOrder` | [`?string (SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the [Subscription](../../doc/models/webhook-subscription.md) was created with the specified order.<br>This field defaults to ASC. |
| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is greater<br>than 100, it is ignored and the default value is used instead.<br><br>Default: 100 |
| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value.<br><br>Default: 100 |

## Response Type

Expand Down
Loading

0 comments on commit 76b5cc2

Please sign in to comment.