Skip to content

Commit c8721b0

Browse files
author
autobot
committed
Generated PR for Release: 18.0.0.20220420
1 parent 1ed93aa commit c8721b0

File tree

220 files changed

+6229
-1637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+6229
-1637
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "square/square",
33
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
4-
"version": "17.3.0.20220316",
4+
"version": "18.0.0.20220420",
55
"type": "library",
66
"keywords": [
77
"Square",
@@ -22,7 +22,7 @@
2222
"ext-curl": "*",
2323
"ext-json": "*",
2424
"ext-mbstring": "*",
25-
"apimatic/unirest-php": "^2.2.1",
25+
"apimatic/unirest-php": "^2.2.2",
2626
"apimatic/jsonmapper": "^3.0.0"
2727
},
2828
"require-dev": {

doc/apis/catalog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ $body = new Models\BatchRetrieveCatalogObjectsRequest(
105105
);
106106
$body->setIncludeRelatedObjects(true);
107107
$body->setCatalogVersion(118);
108+
$body->setIncludeDeletedObjects(false);
108109

109110
$apiResponse = $catalogApi->batchRetrieveCatalogObjects($body);
110111

doc/apis/locations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ if ($apiResponse->isSuccess()) {
5050

5151
Creates a [location](https://developer.squareup.com/docs/locations-api).
5252
Creating new locations allows for separate configuration of receipt layouts, item prices,
53-
and sales reports. Developers can use locations to separate sales activity via applications
53+
and sales reports. Developers can use locations to separate sales activity through applications
5454
that integrate with Square from sales activity elsewhere in a seller's account.
55-
Locations created programmatically with the Locations API will last forever and
56-
are visible to the seller for their own management, so ensure that
55+
Locations created programmatically with the Locations API last forever and
56+
are visible to the seller for their own management. Therefore, ensure that
5757
each location has a sensible and unique name.
5858

5959
```php

doc/apis/orders.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ $body_order_lineItems_1_modifiers[0]->setUid('uid1');
116116
$body_order_lineItems_1_modifiers[0]->setCatalogObjectId('CHQX7Y4KY6N5KINJKZCFURPZ');
117117
$body_order_lineItems_1_modifiers[0]->setCatalogVersion(69);
118118
$body_order_lineItems_1_modifiers[0]->setName('name1');
119-
$body_order_lineItems_1_modifiers[0]->setBasePriceMoney(new Models\Money);
120-
$body_order_lineItems_1_modifiers[0]->getBasePriceMoney()->setAmount(53);
121-
$body_order_lineItems_1_modifiers[0]->getBasePriceMoney()->setCurrency(Models\Currency::TTD);
119+
$body_order_lineItems_1_modifiers[0]->setQuantity('quantity7');
122120
$body_order_lineItems[1]->setModifiers($body_order_lineItems_1_modifiers);
123121

124122
$body_order_lineItems_1_appliedDiscounts = [];
@@ -672,7 +670,7 @@ To be used with `PayOrder`, a payment must:
672670
- Reference the order by specifying the `order_id` when [creating the payment](../../doc/apis/payments.md#create-payment).
673671
Any approved payments that reference the same `order_id` not specified in the
674672
`payment_ids` is canceled.
675-
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture).
673+
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture).
676674
Using a delayed capture payment with `PayOrder` completes the approved payment.
677675

678676
```php

doc/apis/payouts.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Payouts
2+
3+
```php
4+
$payoutsApi = $client->getPayoutsApi();
5+
```
6+
7+
## Class Name
8+
9+
`PayoutsApi`
10+
11+
## Methods
12+
13+
* [List Payouts](../../doc/apis/payouts.md#list-payouts)
14+
* [Get Payout](../../doc/apis/payouts.md#get-payout)
15+
* [List Payout Entries](../../doc/apis/payouts.md#list-payout-entries)
16+
17+
18+
# List Payouts
19+
20+
Retrieves a list of all payouts for the default location.
21+
You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
22+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
23+
24+
```php
25+
function listPayouts(
26+
?string $locationId = null,
27+
?string $status = null,
28+
?string $beginTime = null,
29+
?string $endTime = null,
30+
?string $sortOrder = null,
31+
?string $cursor = null,
32+
?int $limit = null
33+
): ApiResponse
34+
```
35+
36+
## Parameters
37+
38+
| Parameter | Type | Tags | Description |
39+
| --- | --- | --- | --- |
40+
| `locationId` | `?string` | Query, Optional | The ID of the location for which to list the payouts.<br>By default, payouts are returned for the default (main) location associated with the seller. |
41+
| `status` | [`?string (PayoutStatus)`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. |
42+
| `beginTime` | `?string` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.<br>Inclusive. Default: The current time minus one year. |
43+
| `endTime` | `?string` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.<br>Default: The current time. |
44+
| `sortOrder` | [`?string (SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. |
45+
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
46+
| `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<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |
47+
48+
## Response Type
49+
50+
[`ListPayoutsResponse`](../../doc/models/list-payouts-response.md)
51+
52+
## Example Usage
53+
54+
```php
55+
$locationId = 'location_id4';
56+
$status = Models\PayoutStatus::PAID;
57+
$beginTime = 'begin_time2';
58+
$endTime = 'end_time2';
59+
$sortOrder = Models\SortOrder::DESC;
60+
$cursor = 'cursor6';
61+
$limit = 172;
62+
63+
$apiResponse = $payoutsApi->listPayouts($locationId, $status, $beginTime, $endTime, $sortOrder, $cursor, $limit);
64+
65+
if ($apiResponse->isSuccess()) {
66+
$listPayoutsResponse = $apiResponse->getResult();
67+
} else {
68+
$errors = $apiResponse->getErrors();
69+
}
70+
71+
// Get more response info...
72+
// $statusCode = $apiResponse->getStatusCode();
73+
// $headers = $apiResponse->getHeaders();
74+
```
75+
76+
77+
# Get Payout
78+
79+
Retrieves details of a specific payout identified by a payout ID.
80+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
81+
82+
```php
83+
function getPayout(string $payoutId): ApiResponse
84+
```
85+
86+
## Parameters
87+
88+
| Parameter | Type | Tags | Description |
89+
| --- | --- | --- | --- |
90+
| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. |
91+
92+
## Response Type
93+
94+
[`GetPayoutResponse`](../../doc/models/get-payout-response.md)
95+
96+
## Example Usage
97+
98+
```php
99+
$payoutId = 'payout_id6';
100+
101+
$apiResponse = $payoutsApi->getPayout($payoutId);
102+
103+
if ($apiResponse->isSuccess()) {
104+
$getPayoutResponse = $apiResponse->getResult();
105+
} else {
106+
$errors = $apiResponse->getErrors();
107+
}
108+
109+
// Get more response info...
110+
// $statusCode = $apiResponse->getStatusCode();
111+
// $headers = $apiResponse->getHeaders();
112+
```
113+
114+
115+
# List Payout Entries
116+
117+
Retrieves a list of all payout entries for a specific payout.
118+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
119+
120+
```php
121+
function listPayoutEntries(
122+
string $payoutId,
123+
?string $sortOrder = null,
124+
?string $cursor = null,
125+
?int $limit = null
126+
): ApiResponse
127+
```
128+
129+
## Parameters
130+
131+
| Parameter | Type | Tags | Description |
132+
| --- | --- | --- | --- |
133+
| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. |
134+
| `sortOrder` | [`?string (SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. |
135+
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
136+
| `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<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |
137+
138+
## Response Type
139+
140+
[`ListPayoutEntriesResponse`](../../doc/models/list-payout-entries-response.md)
141+
142+
## Example Usage
143+
144+
```php
145+
$payoutId = 'payout_id6';
146+
$sortOrder = Models\SortOrder::DESC;
147+
$cursor = 'cursor6';
148+
$limit = 172;
149+
150+
$apiResponse = $payoutsApi->listPayoutEntries($payoutId, $sortOrder, $cursor, $limit);
151+
152+
if ($apiResponse->isSuccess()) {
153+
$listPayoutEntriesResponse = $apiResponse->getResult();
154+
} else {
155+
$errors = $apiResponse->getErrors();
156+
}
157+
158+
// Get more response info...
159+
// $statusCode = $apiResponse->getStatusCode();
160+
// $headers = $apiResponse->getHeaders();
161+
```
162+

doc/apis/subscriptions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ if ($apiResponse->isSuccess()) {
314314
# List Subscription Events
315315

316316
Lists all events for a specific subscription.
317-
In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned.
318317

319318
```php
320319
function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null, ?int $limit = null): ApiResponse

doc/apis/terminal.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ $body_checkout_deviceOptions = new Models\DeviceCheckoutOptions(
5151
$body_checkout_deviceOptions_deviceId
5252
);
5353
$body_checkout_deviceOptions->setSkipReceiptScreen(false);
54+
$body_checkout_deviceOptions->setCollectSignature(false);
5455
$body_checkout_deviceOptions->setTipSettings(new Models\TipSettings);
5556
$body_checkout_deviceOptions->getTipSettings()->setAllowTipping(false);
5657
$body_checkout_deviceOptions->getTipSettings()->setSeparateTipScreen(false);
@@ -87,7 +88,7 @@ if ($apiResponse->isSuccess()) {
8788

8889
# Search Terminal Checkouts
8990

90-
Retrieves a filtered list of Terminal checkout requests created by the account making the request.
91+
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.
9192

9293
```php
9394
function searchTerminalCheckouts(SearchTerminalCheckoutsRequest $body): ApiResponse
@@ -135,7 +136,7 @@ if ($apiResponse->isSuccess()) {
135136

136137
# Get Terminal Checkout
137138

138-
Retrieves a Terminal checkout request by `checkout_id`.
139+
Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days.
139140

140141
```php
141142
function getTerminalCheckout(string $checkoutId): ApiResponse
@@ -209,7 +210,7 @@ if ($apiResponse->isSuccess()) {
209210

210211
# Create Terminal Refund
211212

212-
Creates a request to refund an Interac payment completed on a Square Terminal.
213+
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](../../doc/apis/refunds.md).
213214

214215
```php
215216
function createTerminalRefund(CreateTerminalRefundRequest $body): ApiResponse
@@ -236,15 +237,19 @@ $body_refund_paymentId = '5O5OvgkcNUhl7JBuINflcjKqUzXZY';
236237
$body_refund_amountMoney = new Models\Money;
237238
$body_refund_amountMoney->setAmount(111);
238239
$body_refund_amountMoney->setCurrency(Models\Currency::CAD);
240+
$body_refund_reason = 'Returning items';
241+
$body_refund_deviceId = 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291';
239242
$body->setRefund(new Models\TerminalRefund(
240243
$body_refund_paymentId,
241-
$body_refund_amountMoney
244+
$body_refund_amountMoney,
245+
$body_refund_reason,
246+
$body_refund_deviceId
242247
));
243248
$body->getRefund()->setId('id4');
244249
$body->getRefund()->setRefundId('refund_id8');
245250
$body->getRefund()->setOrderId('order_id8');
246-
$body->getRefund()->setReason('Returning items');
247-
$body->getRefund()->setDeviceId('f72dfb8e-4d65-4e56-aade-ec3fb8d33291');
251+
$body->getRefund()->setDeadlineDuration('deadline_duration6');
252+
$body->getRefund()->setStatus('status6');
248253

249254
$apiResponse = $terminalApi->createTerminalRefund($body);
250255

@@ -262,7 +267,7 @@ if ($apiResponse->isSuccess()) {
262267

263268
# Search Terminal Refunds
264269

265-
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
270+
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
266271

267272
```php
268273
function searchTerminalRefunds(SearchTerminalRefundsRequest $body): ApiResponse
@@ -310,7 +315,7 @@ if ($apiResponse->isSuccess()) {
310315

311316
# Get Terminal Refund
312317

313-
Retrieves an Interac Terminal refund object by ID.
318+
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
314319

315320
```php
316321
function getTerminalRefund(string $terminalRefundId): ApiResponse

doc/client.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-03-16'` |
8+
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-04-20'` |
99
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
@@ -27,7 +27,7 @@ The API client can be initialized as follows:
2727
$client = new Square\SquareClient([
2828
// Set authentication parameters
2929
'accessToken' => 'AccessToken',
30-
'squareVersion' => '2022-03-16',
30+
'squareVersion' => '2022-04-20',
3131

3232
// Set the environment
3333
'environment' => 'production',
@@ -54,7 +54,7 @@ require_once "vendor/autoload.php";
5454

5555
$client = new Square\SquareClient([
5656
'accessToken' => 'AccessToken',
57-
'squareVersion' => '2022-03-16',
57+
'squareVersion' => '2022-04-20',
5858
]);
5959

6060
$locationsApi = $client->getLocationsApi();
@@ -107,6 +107,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold
107107
| getMerchantsApi() | Gets MerchantsApi |
108108
| getOrdersApi() | Gets OrdersApi |
109109
| getPaymentsApi() | Gets PaymentsApi |
110+
| getPayoutsApi() | Gets PayoutsApi |
110111
| getRefundsApi() | Gets RefundsApi |
111112
| getSitesApi() | Gets SitesApi |
112113
| getSnippetsApi() | Gets SnippetsApi |

doc/models/activity-type.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# Activity Type
3+
4+
## Enumeration
5+
6+
`ActivityType`
7+
8+
## Fields
9+
10+
| Name | Description |
11+
| --- | --- |
12+
| `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. |
13+
| `APP_FEE_REFUND` | A refund for an application fee on a payment. |
14+
| `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. |
15+
| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account.<br>These are, generally, proportional to the seller's sales. |
16+
| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance.<br>These are, generally, proportional to the seller's refunds. |
17+
| `CHARGE` | A credit card payment capture. |
18+
| `DEPOSIT_FEE` | Any fees involved with deposits such as instant deposits. |
19+
| `DISPUTE` | The balance change due to a dispute event. |
20+
| `ESCHEATMENT` | An escheatment entry for remittance. |
21+
| `FEE` | The Square processing fee. |
22+
| `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller<br>referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).<br>This entry represents a credit to the seller for the purposes of free processing. |
23+
| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. |
24+
| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance. Initial, in the sense that it<br>causes the creation of the other activity types, such as hold and refund. |
25+
| `MONEY_TRANSFER` | The balance change from a money transfer. |
26+
| `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. |
27+
| `OPEN_DISPUTE` | The balance change for a chargeback that has been filed. |
28+
| `OTHER` | Any other type that does not belong in the rest of the types. |
29+
| `OTHER_ADJUSTMENT` | Any other type of adjustment that does not fall under existing types. |
30+
| `PAID_SERVICE_FEE` | A fee paid to a third-party merchant. |
31+
| `PAID_SERVICE_FEE_REFUND` | A fee paid to a third-party merchant. |
32+
| `REDEMPTION_CODE` | Repayment for a redemption code. |
33+
| `REFUND` | A refund for an existing card payment. |
34+
| `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. |
35+
| `RESERVE_HOLD` | Fees paid for funding risk reserve. |
36+
| `RESERVE_RELEASE` | Fees released from risk reserve. |
37+
| `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the<br>settlement of the original entry failed. |
38+
| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are, generally,<br>proportional to the merchant's sales but can be issued for other reasons related to the MCA. |
39+
| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are, generally,<br>proportional to the merchant's refunds but can be issued for other reasons related to the MCA. |
40+
| `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. |
41+
| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that has been refunded. |
42+
| `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. |
43+
| `TAX_ON_FEE` | The tax paid on fee amounts. |
44+
| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. |
45+
| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. |
46+

doc/models/batch-retrieve-catalog-objects-request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| `objectIds` | `string[]` | Required | The IDs of the CatalogObjects to be retrieved. | getObjectIds(): array | setObjectIds(array objectIds): void |
1313
| `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false` | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void |
1414
| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical versions of objects. The specified version value is matched against<br>the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will<br>be from the current version of the catalog. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void |
15+
| `includeDeletedObjects` | `?bool` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. | getIncludeDeletedObjects(): ?bool | setIncludeDeletedObjects(?bool includeDeletedObjects): void |
1516

1617
## Example (as JSON)
1718

0 commit comments

Comments
 (0)