Skip to content

Commit

Permalink
Merge pull request #85 from square/release/19.1.0.20220616
Browse files Browse the repository at this point in the history
Generated PR for Release: 19.1.0.20220616
  • Loading branch information
Wolfgang Schuster authored Jun 16, 2022
2 parents 7852d8a + ecf3cc7 commit 4996849
Show file tree
Hide file tree
Showing 105 changed files with 1,257 additions and 368 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

For general API and SDK changelogs, see [Square APIs and SDKs Release Notes](https://developer.squareup.com/docs/changelog/connect).

## Version 19.0.1.20220512 (2022-05-12)
- Fixed [Op Cache can break response types](https://github.com/square/square-php-sdk/issues/80)

## Version 17.3.0.20220316 (2022-03-16)
### Added

Expand Down
4 changes: 2 additions & 2 deletions 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": "19.0.1.20220512",
"version": "19.1.0.20220616",
"type": "library",
"keywords": [
"Square",
Expand All @@ -23,7 +23,7 @@
"ext-json": "*",
"ext-mbstring": "*",
"apimatic/unirest-php": "^2.2.2",
"apimatic/jsonmapper": "^3.0.1"
"apimatic/jsonmapper": "^3.0.3"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
Expand Down
2 changes: 1 addition & 1 deletion doc/apis/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function listCatalog(?string $cursor = null, ?string $types = null, ?int $catalo
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `cursor` | `?string` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.<br>The page size is currently set to be 100.<br>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
| `types` | `?string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.<br><br>The valid values are defined in the [CatalogObjectType](../../doc/models/catalog-object-type.md) enum, for example,<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.<br><br>If this is unspecified, the operation returns objects of all the top level types at the version<br>of the Square API used to make the request. Object types that are nested onto other object types<br>are not included in the defaults.<br><br>At the current API version the default object types are:<br>ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION,<br>SERVICE_CHARGE, PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,<br>SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. |
| `types` | `?string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.<br><br>The valid values are defined in the [CatalogObjectType](../../doc/models/catalog-object-type.md) enum, for example,<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.<br><br>If this is unspecified, the operation returns objects of all the top level types at the version<br>of the Square API used to make the request. Object types that are nested onto other object types<br>are not included in the defaults.<br><br>At the current API version the default object types are:<br>ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,<br>PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,<br>SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. |
| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical<br>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. |

## Response Type
Expand Down
2 changes: 1 addition & 1 deletion doc/apis/gift-cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $giftCardsApi = $client->getGiftCardsApi();
# List Gift Cards

Lists all gift cards. You can specify optional filters to retrieve
a subset of the gift cards.
a subset of the gift cards. Results are sorted by `created_at` in ascending order.

```php
function listGiftCards(
Expand Down
6 changes: 4 additions & 2 deletions doc/apis/loyalty.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ if ($apiResponse->isSuccess()) {

# Accumulate Loyalty Points

Adds points to a loyalty account.
Adds points earned from the base loyalty program to a loyalty account.

- If you are using the Orders API to manage orders, you only provide the `order_id`.
The endpoint reads the order to compute points to add to the buyer's account.
Expand All @@ -171,6 +171,8 @@ Adds points to a loyalty account.
[CalculateLoyaltyPoints](../../doc/apis/loyalty.md#calculate-loyalty-points) to compute the points
that you provide to this endpoint.

This endpoint excludes additional points earned from loyalty promotions.

```php
function accumulateLoyaltyPoints(string $accountId, AccumulateLoyaltyPointsRequest $body): ApiResponse
```
Expand Down Expand Up @@ -392,7 +394,7 @@ if ($apiResponse->isSuccess()) {

# Calculate Loyalty Points

Calculates the points a purchase earns.
Calculates the points a purchase earns from the base loyalty program.

- If you are using the Orders API to manage orders, you provide the `order_id` in the request. The
endpoint calculates the points by reading the order.
Expand Down
3 changes: 1 addition & 2 deletions doc/apis/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ $terminalApi = $client->getTerminalApi();

# Create Terminal Action

Creates a Terminal action request and sends it to the specified device to take a payment
for the requested amount.
Creates a Terminal action request and sends it to the specified device.

```php
function createTerminalAction(CreateTerminalActionRequest $body): ApiResponse
Expand Down
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-05-12'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-06-16'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
Expand All @@ -27,7 +27,7 @@ The API client can be initialized as follows:
$client = new Square\SquareClient([
// Set authentication parameters
'accessToken' => 'AccessToken',
'squareVersion' => '2022-05-12',
'squareVersion' => '2022-06-16',

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

$client = new Square\SquareClient([
'accessToken' => 'AccessToken',
'squareVersion' => '2022-05-12',
'squareVersion' => '2022-06-16',
]);

$locationsApi = $client->getLocationsApi();
Expand Down
8 changes: 4 additions & 4 deletions doc/models/appointment-segment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Defines an appointment segment of a booking.
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `durationMinutes` | `?int` | Optional | The time span in minutes of an appointment segment.<br>**Constraints**: `<= 1500` | getDurationMinutes(): ?int | setDurationMinutes(?int durationMinutes): void |
| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](../../doc/models/catalog-item-variation.md) object representing the service booked in this segment.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void |
| `serviceVariationId` | `?string` | Optional | The ID of the [CatalogItemVariation](../../doc/models/catalog-item-variation.md) object representing the service booked in this segment.<br>**Constraints**: *Maximum Length*: `36` | getServiceVariationId(): ?string | setServiceVariationId(?string serviceVariationId): void |
| `teamMemberId` | `string` | Required | The ID of the [TeamMember](../../doc/models/team-member.md) object representing the team member booked in this segment.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32` | getTeamMemberId(): string | setTeamMemberId(string teamMemberId): void |
| `serviceVariationVersion` | `int` | Required | The current version of the item variation representing the service booked in this segment. | getServiceVariationVersion(): int | setServiceVariationVersion(int serviceVariationVersion): void |
| `serviceVariationVersion` | `?int` | Optional | The current version of the item variation representing the service booked in this segment. | getServiceVariationVersion(): ?int | setServiceVariationVersion(?int serviceVariationVersion): void |
| `intermissionMinutes` | `?int` | Optional | Time between the end of this segment and the beginning of the subsequent segment. | getIntermissionMinutes(): ?int | setIntermissionMinutes(?int intermissionMinutes): void |
| `anyTeamMember` | `?bool` | Optional | Whether the customer accepts any team member, instead of a specific one, to serve this segment. | getAnyTeamMember(): ?bool | setAnyTeamMember(?bool anyTeamMember): void |
| `resourceIds` | `?(string[])` | Optional | The IDs of the seller-accessible resources used for this appointment segment. | getResourceIds(): ?array | setResourceIds(?array resourceIds): void |
Expand All @@ -24,9 +24,9 @@ Defines an appointment segment of a booking.
```json
{
"duration_minutes": null,
"service_variation_id": "service_variation_id6",
"service_variation_id": null,
"team_member_id": "team_member_id0",
"service_variation_version": 56,
"service_variation_version": null,
"intermission_minutes": null,
"any_team_member": null,
"resource_ids": null
Expand Down
5 changes: 3 additions & 2 deletions doc/models/batch-retrieve-inventory-changes-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
| `locationIds` | `?(string[])` | Optional | The filter to return results by `Location` ID.<br>The filter is only applicable when set. The default value is null. | getLocationIds(): ?array | setLocationIds(?array locationIds): void |
| `types` | [`?(string[]) (InventoryChangeType)`](../../doc/models/inventory-change-type.md) | Optional | The filter to return results by `InventoryChangeType` values other than `TRANSFER`.<br>The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. | getTypes(): ?array | setTypes(?array types): void |
| `states` | [`?(string[]) (InventoryState)`](../../doc/models/inventory-state.md) | Optional | The filter to return `ADJUSTMENT` query results by<br>`InventoryState`. This filter is only applied when set.<br>The default value is null. | getStates(): ?array | setStates(?array states): void |
| `updatedAfter` | `?string` | Optional | The filter to return results with their `calculated_at` value <br>after the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedAfter(): ?string | setUpdatedAfter(?string updatedAfter): void |
| `updatedBefore` | `?string` | Optional | The filter to return results with their `created_at` or `calculated_at` value <br>strictly before the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedBefore(): ?string | setUpdatedBefore(?string updatedBefore): void |
| `updatedAfter` | `?string` | Optional | The filter to return results with their `calculated_at` value<br>after the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedAfter(): ?string | setUpdatedAfter(?string updatedAfter): void |
| `updatedBefore` | `?string` | Optional | The filter to return results with their `created_at` or `calculated_at` value<br>strictly before the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedBefore(): ?string | setUpdatedBefore(?string updatedBefore): void |
| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void |
| `limit` | `?int` | Optional | **Constraints**: `>= 1`, `<= 1000` | getLimit(): ?int | setLimit(?int limit): void |

## Example (as JSON)

Expand Down
1 change: 1 addition & 0 deletions doc/models/batch-retrieve-inventory-counts-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| `updatedAfter` | `?string` | Optional | The filter to return results with their `calculated_at` value<br>after the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedAfter(): ?string | setUpdatedAfter(?string updatedAfter): void |
| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void |
| `states` | [`?(string[]) (InventoryState)`](../../doc/models/inventory-state.md) | Optional | The filter to return results by `InventoryState`. The filter is only applicable when set.<br>Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`.<br>The default is null. | getStates(): ?array | setStates(?array states): void |
| `limit` | `?int` | Optional | **Constraints**: `>= 1`, `<= 1000` | getLimit(): ?int | setLimit(?int limit): void |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/calculate-loyalty-points-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ a specified purchase.
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void |
| `points` | `?int` | Optional | The points that the buyer can earn from a specified purchase. | getPoints(): ?int | setPoints(?int points): void |
| `points` | `?int` | Optional | The points that the buyer can earn from a specified purchase.<br>This value does not include additional points earned from a loyalty promotion. | getPoints(): ?int | setPoints(?int points): void |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/cancel-terminal-action-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void |
| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | - | getAction(): ?TerminalAction | setAction(?TerminalAction action): void |
| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void |

## Example (as JSON)

Expand Down
17 changes: 17 additions & 0 deletions doc/models/card-co-brand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Card Co Brand

Indicates the brand for a co-branded card.

## Enumeration

`CardCoBrand`

## Fields

| Name |
| --- |
| `UNKNOWN` |
| `AFTERPAY` |
| `CLEARPAY` |

4 changes: 3 additions & 1 deletion doc/models/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ details are determined by the payment token generated by Web Payments SDK.
| `prepaidType` | [`?string (CardPrepaidType)`](../../doc/models/card-prepaid-type.md) | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. | getPrepaidType(): ?string | setPrepaidType(?string prepaidType): void |
| `bin` | `?string` | Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API<br>returns this field.<br>**Constraints**: *Maximum Length*: `6` | getBin(): ?string | setBin(?string bin): void |
| `version` | `?int` | Optional | Current version number of the card. Increments with each card update. Requests to update an<br>existing Card object will be rejected unless the version in the request matches the current<br>version for the Card. | getVersion(): ?int | setVersion(?int version): void |
| `cardCoBrand` | [`?string (CardCoBrand)`](../../doc/models/card-co-brand.md) | Optional | Indicates the brand for a co-branded card. | getCardCoBrand(): ?string | setCardCoBrand(?string cardCoBrand): void |

## Example (as JSON)

Expand All @@ -48,7 +49,8 @@ details are determined by the payment token generated by Web Payments SDK.
"card_type": null,
"prepaid_type": null,
"bin": null,
"version": null
"version": null,
"card_co_brand": null
}
```

10 changes: 2 additions & 8 deletions doc/models/catalog-subscription-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@ Describes a subscription plan. For more information, see
"uid": null,
"cadence": "EVERY_FOUR_MONTHS",
"periods": null,
"recurring_price_money": {
"amount": null,
"currency": null
},
"recurring_price_money": null,
"ordinal": null
},
{
"uid": null,
"cadence": "QUARTERLY",
"periods": null,
"recurring_price_money": {
"amount": null,
"currency": null
},
"recurring_price_money": null,
"ordinal": null
}
]
Expand Down
2 changes: 1 addition & 1 deletion doc/models/create-gift-card-activity-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A request to create a gift card activity.
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `idempotencyKey` | `string` | Required | A unique string that identifies the `CreateGiftCardActivity` request.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void |
| `giftCardActivity` | [`GiftCardActivity`](../../doc/models/gift-card-activity.md) | Required | Represents an action performed on a gift card that affects its state or balance. | getGiftCardActivity(): GiftCardActivity | setGiftCardActivity(GiftCardActivity giftCardActivity): void |
| `giftCardActivity` | [`GiftCardActivity`](../../doc/models/gift-card-activity.md) | Required | Represents an action performed on a [gift card](../../doc/models/gift-card.md) that affects its state or balance.<br>A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity<br>includes a `redeem_activity_details` field that contains information about the redemption. | getGiftCardActivity(): GiftCardActivity | setGiftCardActivity(GiftCardActivity giftCardActivity): void |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/create-gift-card-activity-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The response might contain a set of `Error` objects if the request resulted in e
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void |
| `giftCardActivity` | [`?GiftCardActivity`](../../doc/models/gift-card-activity.md) | Optional | Represents an action performed on a gift card that affects its state or balance. | getGiftCardActivity(): ?GiftCardActivity | setGiftCardActivity(?GiftCardActivity giftCardActivity): void |
| `giftCardActivity` | [`?GiftCardActivity`](../../doc/models/gift-card-activity.md) | Optional | Represents an action performed on a [gift card](../../doc/models/gift-card.md) that affects its state or balance.<br>A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity<br>includes a `redeem_activity_details` field that contains information about the redemption. | getGiftCardActivity(): ?GiftCardActivity | setGiftCardActivity(?GiftCardActivity giftCardActivity): void |

## Example (as JSON)

Expand Down
Loading

0 comments on commit 4996849

Please sign in to comment.