Skip to content

Commit

Permalink
Merge pull request #125 from square/release/34.1.0.20231213
Browse files Browse the repository at this point in the history
Generated PR for Release: 34.1.0.20231213
  • Loading branch information
jguze authored Dec 12, 2023
2 parents 7e3dec8 + e48380e commit a52e282
Show file tree
Hide file tree
Showing 49 changed files with 1,724 additions and 69 deletions.
21 changes: 17 additions & 4 deletions doc/api/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ body = {
:present_at_all_locations => true,
:item_data => {
:name => 'Tea',
:category_id => '#Beverages',
:tax_ids => [
'#SalesTax'
],
Expand All @@ -187,6 +186,11 @@ body = {
}
}
],
:categories => [
{
:id => '#Beverages'
}
],
:description_html => '<p><strong>Hot</strong> Leaf Juice</p>'
}
},
Expand All @@ -196,7 +200,6 @@ body = {
:present_at_all_locations => true,
:item_data => {
:name => 'Coffee',
:category_id => '#Beverages',
:tax_ids => [
'#SalesTax'
],
Expand Down Expand Up @@ -230,6 +233,11 @@ body = {
}
}
],
:categories => [
{
:id => '#Beverages'
}
],
:description_html => '<p>Hot <em>Bean Juice</em></p>'
}
},
Expand Down Expand Up @@ -566,7 +574,8 @@ any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it.
```ruby
def retrieve_catalog_object(object_id:,
include_related_objects: false,
catalog_version: nil)
catalog_version: nil,
include_category_path_to_root: false)
```

## Parameters
Expand All @@ -576,6 +585,7 @@ def retrieve_catalog_object(object_id:,
| `object_id` | `String` | Template, Required | The object ID of any type of catalog objects to be retrieved. |
| `include_related_objects` | `TrueClass \| FalseClass` | Query, 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`<br>**Default**: `false` |
| `catalog_version` | `Integer` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will<br>be from the current version of the catalog. |
| `include_category_path_to_root` | `TrueClass \| FalseClass` | Query, Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned<br>in the response payload.<br>**Default**: `false` |

## Response Type

Expand All @@ -588,10 +598,13 @@ object_id = 'object_id8'

include_related_objects = false

include_category_path_to_root = false


result = catalog_api.retrieve_catalog_object(
object_id: object_id,
include_related_objects: include_related_objects
include_related_objects: include_related_objects,
include_category_path_to_root: include_category_path_to_root
)

if result.success?
Expand Down
142 changes: 142 additions & 0 deletions doc/api/checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ checkout_api = client.checkout
## Methods

* [Create Checkout](../../doc/api/checkout.md#create-checkout)
* [Retrieve Location Settings](../../doc/api/checkout.md#retrieve-location-settings)
* [Update Location Settings](../../doc/api/checkout.md#update-location-settings)
* [Retrieve Merchant Settings](../../doc/api/checkout.md#retrieve-merchant-settings)
* [Update Merchant Settings](../../doc/api/checkout.md#update-merchant-settings)
* [List Payment Links](../../doc/api/checkout.md#list-payment-links)
* [Create Payment Link](../../doc/api/checkout.md#create-payment-link)
* [Delete Payment Link](../../doc/api/checkout.md#delete-payment-link)
Expand Down Expand Up @@ -155,6 +159,144 @@ end
```


# Retrieve Location Settings

Retrieves the location-level settings for a Square-hosted checkout page.

```ruby
def retrieve_location_settings(location_id:)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `location_id` | `String` | Template, Required | The ID of the location for which to retrieve settings. |

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Settings Response Hash`](../../doc/models/retrieve-location-settings-response.md).

## Example Usage

```ruby
location_id = 'location_id4'


result = checkout_api.retrieve_location_settings(location_id: location_id)

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```


# Update Location Settings

Updates the location-level settings for a Square-hosted checkout page.

```ruby
def update_location_settings(location_id:,
body:)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `location_id` | `String` | Template, Required | The ID of the location for which to retrieve settings. |
| `body` | [`Update Location Settings Request Hash`](../../doc/models/update-location-settings-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Location Settings Response Hash`](../../doc/models/update-location-settings-response.md).

## Example Usage

```ruby
location_id = 'location_id4'

body = {
:location_settings => {}
}


result = checkout_api.update_location_settings(
location_id: location_id,
body: body
)

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```


# Retrieve Merchant Settings

Retrieves the merchant-level settings for a Square-hosted checkout page.

```ruby
def retrieve_merchant_settings
```

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Merchant Settings Response Hash`](../../doc/models/retrieve-merchant-settings-response.md).

## Example Usage

```ruby
result = checkout_api.retrieve_merchant_settings

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```


# Update Merchant Settings

Updates the merchant-level settings for a Square-hosted checkout page.

```ruby
def update_merchant_settings(body:)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `body` | [`Update Merchant Settings Request Hash`](../../doc/models/update-merchant-settings-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Merchant Settings Response Hash`](../../doc/models/update-merchant-settings-response.md).

## Example Usage

```ruby
body = {
:merchant_settings => {}
}


result = checkout_api.update_merchant_settings(body: body)

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```


# List Payment Links

Lists all payment links.
Expand Down
72 changes: 71 additions & 1 deletion doc/api/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ terminal_api = client.terminal
* [Search Terminal Checkouts](../../doc/api/terminal.md#search-terminal-checkouts)
* [Get Terminal Checkout](../../doc/api/terminal.md#get-terminal-checkout)
* [Cancel Terminal Checkout](../../doc/api/terminal.md#cancel-terminal-checkout)
* [Dismiss Terminal Checkout](../../doc/api/terminal.md#dismiss-terminal-checkout)
* [Create Terminal Refund](../../doc/api/terminal.md#create-terminal-refund)
* [Search Terminal Refunds](../../doc/api/terminal.md#search-terminal-refunds)
* [Get Terminal Refund](../../doc/api/terminal.md#get-terminal-refund)
* [Cancel Terminal Refund](../../doc/api/terminal.md#cancel-terminal-refund)
* [Dismiss Terminal Refund](../../doc/api/terminal.md#dismiss-terminal-refund)


# Create Terminal Action
Expand Down Expand Up @@ -198,7 +200,7 @@ def dismiss_terminal_action(action_id:)

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `action_id` | `String` | Template, Required | Unique ID for the `TerminalAction` associated with the waiting dialog to be dismissed. |
| `action_id` | `String` | Template, Required | Unique ID for the `TerminalAction` associated with the action to be dismissed. |

## Response Type

Expand Down Expand Up @@ -377,6 +379,40 @@ end
```


# Dismiss Terminal Checkout

Dismisses a Terminal checkout request if the status and type of the request permits it.

```ruby
def dismiss_terminal_checkout(checkout_id:)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `checkout_id` | `String` | Template, Required | Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. |

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Dismiss Terminal Checkout Response Hash`](../../doc/models/dismiss-terminal-checkout-response.md).

## Example Usage

```ruby
checkout_id = 'checkout_id8'


result = terminal_api.dismiss_terminal_checkout(checkout_id: checkout_id)

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```


# Create Terminal Refund

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/api/refunds.md).
Expand Down Expand Up @@ -530,3 +566,37 @@ elsif result.error?
end
```


# Dismiss Terminal Refund

Dismisses a Terminal refund request if the status and type of the request permits it.

```ruby
def dismiss_terminal_refund(terminal_refund_id:)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `terminal_refund_id` | `String` | Template, Required | Unique ID for the `TerminalRefund` associated with the refund to be dismissed. |

## Response Type

This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Dismiss Terminal Refund Response Hash`](../../doc/models/dismiss-terminal-refund-response.md).

## Example Usage

```ruby
terminal_refund_id = 'terminal_refund_id0'


result = terminal_api.dismiss_terminal_refund(terminal_refund_id: terminal_refund_id)

if result.success?
puts result.data
elsif result.error?
warn result.errors
end
```

4 changes: 2 additions & 2 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 |
| --- | --- | --- |
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2023-11-15'` |
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2023-12-13'` |
| `custom_url` | `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`** |
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
Expand All @@ -25,7 +25,7 @@ The API client can be initialized as follows:

```ruby
client = Square::Client.new(
square_version: '2023-11-15',
square_version: '2023-12-13',
access_token: 'AccessToken',
environment: 'production',
custom_url: 'https://connect.squareup.com'
Expand Down
4 changes: 3 additions & 1 deletion doc/models/batch-retrieve-catalog-objects-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| `include_related_objects` | `TrueClass \| FalseClass` | 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` |
| `catalog_version` | `Integer` | 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. |
| `include_deleted_objects` | `TrueClass \| FalseClass` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. |
| `include_category_path_to_root` | `TrueClass \| FalseClass` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned<br>in the response payload. |

## Example (as JSON)

Expand All @@ -24,7 +25,8 @@
"AA27W3M2GGTF3H6AVPNB77CK"
],
"catalog_version": 190,
"include_deleted_objects": false
"include_deleted_objects": false,
"include_category_path_to_root": false
}
```

14 changes: 12 additions & 2 deletions doc/models/batch-retrieve-catalog-objects-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
"id": "W62UWFY35CWMYGVWK6TWJDNI",
"is_deleted": false,
"item_data": {
"category_id": "BJNQCF2FJ6S6UIDT65ABHLRX",
"categories": [
{
"id": "BJNQCF2FJ6S6UIDT65ABHLRX",
"ordinal": 0
}
],
"description": "Hot Leaf Juice",
"name": "Tea",
"tax_ids": [
Expand Down Expand Up @@ -88,7 +93,12 @@
"id": "AA27W3M2GGTF3H6AVPNB77CK",
"is_deleted": false,
"item_data": {
"category_id": "BJNQCF2FJ6S6UIDT65ABHLRX",
"categories": [
{
"id": "BJNQCF2FJ6S6UIDT65ABHLRX",
"ordinal": 0
}
],
"description": "Hot Bean Juice",
"name": "Coffee",
"tax_ids": [
Expand Down
Loading

0 comments on commit a52e282

Please sign in to comment.