Skip to content

Commit 527432c

Browse files
authored
Merge pull request #130 from square/release/37.0.0.20240417
Generated PR for Release: 37.0.0.20240417
2 parents be889da + fe606c1 commit 527432c

File tree

13 files changed

+15
-186
lines changed

13 files changed

+15
-186
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# **ATTENTION**
2+
This repository **cannot** accept Pull Requests. If you wish to proceed with opening this PR, please understand that your code **will not** be pulled into this repository. Consider opening an issue which lays out the problem instead. Thank you very much for your efforts and highlighting issues!
3+
4+
Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly.

doc/api/o-auth.md

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -10,82 +10,11 @@ o_auth_api = client.o_auth
1010

1111
## Methods
1212

13-
* [Renew Token](../../doc/api/o-auth.md#renew-token)
1413
* [Revoke Token](../../doc/api/o-auth.md#revoke-token)
1514
* [Obtain Token](../../doc/api/o-auth.md#obtain-token)
1615
* [Retrieve Token Status](../../doc/api/o-auth.md#retrieve-token-status)
1716

1817

19-
# Renew Token
20-
21-
**This endpoint is deprecated.**
22-
23-
`RenewToken` is deprecated. For information about refreshing OAuth access tokens, see
24-
[Migrate from Renew to Refresh OAuth Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).
25-
26-
Renews an OAuth access token before it expires.
27-
28-
OAuth access tokens besides your application's personal access token expire after 30 days.
29-
You can also renew expired tokens within 15 days of their expiration.
30-
You cannot renew an access token that has been expired for more than 15 days.
31-
Instead, the associated user must recomplete the OAuth flow from the beginning.
32-
33-
__Important:__ The `Authorization` header for this endpoint must have the
34-
following format:
35-
36-
```
37-
Authorization: Client APPLICATION_SECRET
38-
```
39-
40-
Replace `APPLICATION_SECRET` with the application secret on the **Credentials**
41-
page in the [Developer Dashboard](https://developer.squareup.com/apps).
42-
43-
:information_source: **Note** This endpoint does not require authentication.
44-
45-
```ruby
46-
def renew_token(client_id:,
47-
body:,
48-
authorization:)
49-
```
50-
51-
## Parameters
52-
53-
| Parameter | Type | Tags | Description |
54-
| --- | --- | --- | --- |
55-
| `client_id` | `String` | Template, Required | Your application ID, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). |
56-
| `body` | [`Renew Token Request Hash`](../../doc/models/renew-token-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
57-
| `authorization` | `String` | Header, Required | Client APPLICATION_SECRET |
58-
59-
## Response Type
60-
61-
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Renew Token Response Hash`](../../doc/models/renew-token-response.md).
62-
63-
## Example Usage
64-
65-
```ruby
66-
client_id = 'client_id8'
67-
68-
body = {
69-
:access_token => 'ACCESS_TOKEN'
70-
}
71-
72-
authorization = 'Client CLIENT_SECRET'
73-
74-
75-
result = o_auth_api.renew_token(
76-
client_id: client_id,
77-
body: body,
78-
authorization: authorization
79-
)
80-
81-
if result.success?
82-
puts result.data
83-
elsif result.error?
84-
warn result.errors
85-
end
86-
```
87-
88-
8918
# Revoke Token
9019

9120
Revokes an access token generated with the OAuth flow.

doc/client.md

Lines changed: 2 additions & 2 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-
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2024-03-20'` |
8+
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2024-04-17'` |
99
| `custom_url` | `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
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
@@ -25,7 +25,7 @@ The API client can be initialized as follows:
2525

2626
```ruby
2727
client = Square::Client.new(
28-
square_version: '2024-03-20',
28+
square_version: '2024-04-17',
2929
bearer_auth_credentials: BearerAuthCredentials.new(
3030
access_token: 'AccessToken'
3131
),

doc/models/catalog-custom-attribute-definition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ to store any sensitive information (personally identifiable information, card de
1919
| `name` | `String` | Required | The name of this definition for API and seller-facing UI purposes.<br>The name must be unique within the (merchant, application) pair. Required.<br>May not be empty and may not exceed 255 characters. Can be modified after creation.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` |
2020
| `description` | `String` | Optional | Seller-oriented description of the meaning of this Custom Attribute,<br>any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.<br>**Constraints**: *Maximum Length*: `255` |
2121
| `source_application` | [`Source Application Hash`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. |
22-
| `allowed_object_types` | [`Array<String (Catalog Object Type)>`](../../doc/models/catalog-object-type.md) | Required | The set of `CatalogObject` types that this custom atttribute may be applied to.<br>Currently, only `ITEM`, `ITEM_VARIATION`, and `MODIFIER` are allowed. At least one type must be included.<br>See [CatalogObjectType](#type-catalogobjecttype) for possible values |
22+
| `allowed_object_types` | [`Array<String (Catalog Object Type)>`](../../doc/models/catalog-object-type.md) | Required | The set of `CatalogObject` types that this custom atttribute may be applied to.<br>Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included.<br>See [CatalogObjectType](#type-catalogobjecttype) for possible values |
2323
| `seller_visibility` | [`String (Catalog Custom Attribute Definition Seller Visibility)`](../../doc/models/catalog-custom-attribute-definition-seller-visibility.md) | Optional | Defines the visibility of a custom attribute to sellers in Square<br>client applications, Square APIs or in Square UIs (including Square Point<br>of Sale applications and Square Dashboard). |
2424
| `app_visibility` | [`String (Catalog Custom Attribute Definition App Visibility)`](../../doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their<br>creating application. |
2525
| `string_config` | [`Catalog Custom Attribute Definition String Config Hash`](../../doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. |

doc/models/order-line-item-tax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contributes to the order subtotal.
2020
| `catalog_version` | `Integer` | Optional | The version of the catalog object that this tax references. |
2121
| `name` | `String` | Optional | The tax's name.<br>**Constraints**: *Maximum Length*: `255` |
2222
| `type` | [`String (Order Line Item Tax Type)`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. |
23-
| `percentage` | `String` | Optional | The percentage of the tax, as a string representation of a decimal<br>number. For example, a value of `"7.25"` corresponds to a percentage of<br>7.25%.<br><br>Either `percentage` or `amount_money` should be set, but not both.<br>**Constraints**: *Maximum Length*: `10` |
23+
| `percentage` | `String` | Optional | The percentage of the tax, as a string representation of a decimal<br>number. For example, a value of `"7.25"` corresponds to a percentage of<br>7.25%.<br>**Constraints**: *Maximum Length*: `10` |
2424
| `metadata` | `Hash[String, String]` | Optional | Application-defined data attached to this tax. Metadata fields are intended<br>to store descriptive references or associations with an entity in another system or store brief<br>information about the object. Square does not process this field; it only stores and returns it<br>in relevant API calls. Do not use metadata to store any sensitive information (such as personally<br>identifiable information or card details).<br><br>Keys written by applications must be 60 characters or less and must be in the character set<br>`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed<br>with a namespace, separated from the key with a ':' character.<br><br>Values have a maximum length of 255 characters.<br><br>An application can have up to 10 entries per metadata field.<br><br>Entries written by applications are private and can only be read or modified by the same<br>application.<br><br>For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). |
2525
| `applied_money` | [`Money Hash`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
2626
| `scope` | [`String (Order Line Item Tax Scope)`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. |

doc/models/order.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ itemization data.
3333
| `tenders` | [`Array<Tender Hash>`](../../doc/models/tender.md) | Optional | The tenders that were used to pay for the order. |
3434
| `refunds` | [`Array<Refund Hash>`](../../doc/models/refund.md) | Optional | The refunds that are part of this order. |
3535
| `metadata` | `Hash[String, String]` | Optional | Application-defined data attached to this order. Metadata fields are intended<br>to store descriptive references or associations with an entity in another system or store brief<br>information about the object. Square does not process this field; it only stores and returns it<br>in relevant API calls. Do not use metadata to store any sensitive information (such as personally<br>identifiable information or card details).<br><br>Keys written by applications must be 60 characters or less and must be in the character set<br>`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed<br>with a namespace, separated from the key with a ':' character.<br><br>Values have a maximum length of 255 characters.<br><br>An application can have up to 10 entries per metadata field.<br><br>Entries written by applications are private and can only be read or modified by the same<br>application.<br><br>For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). |
36-
| `created_at` | `String` | Optional | The timestamp for when the order was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). |
37-
| `updated_at` | `String` | Optional | The timestamp for when the order was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). |
36+
| `created_at` | `String` | Optional | The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). |
37+
| `updated_at` | `String` | Optional | The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). |
3838
| `closed_at` | `String` | Optional | The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example "2016-09-04T23:59:33.123Z"). |
3939
| `state` | [`String (Order State)`](../../doc/models/order-state.md) | Optional | The state of the order. |
4040
| `version` | `Integer` | Optional | The version number, which is incremented each time an update is committed to the order.<br>Orders not created through the API do not include a version number and<br>therefore cannot be updated.<br><br>[Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders). |

doc/models/renew-token-request.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

doc/models/renew-token-response.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

lib/square/api/base_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class BaseApi
55
attr_accessor :config, :http_call_back
66

77
def self.user_agent
8-
'Square-Ruby-SDK/36.1.0.20240320 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
8+
'Square-Ruby-SDK/37.0.0.20240417 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
99
end
1010

1111
def self.user_agent_parameters

lib/square/api/o_auth_api.rb

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
11
module Square
22
# OAuthApi
33
class OAuthApi < BaseApi
4-
# `RenewToken` is deprecated. For information about refreshing OAuth access
5-
# tokens, see
6-
# [Migrate from Renew to Refresh OAuth
7-
# Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-t
8-
# okens).
9-
# Renews an OAuth access token before it expires.
10-
# OAuth access tokens besides your application's personal access token
11-
# expire after 30 days.
12-
# You can also renew expired tokens within 15 days of their expiration.
13-
# You cannot renew an access token that has been expired for more than 15
14-
# days.
15-
# Instead, the associated user must recomplete the OAuth flow from the
16-
# beginning.
17-
# __Important:__ The `Authorization` header for this endpoint must have the
18-
# following format:
19-
# ```
20-
# Authorization: Client APPLICATION_SECRET
21-
# ```
22-
# Replace `APPLICATION_SECRET` with the application secret on the
23-
# **Credentials**
24-
# page in the [Developer Dashboard](https://developer.squareup.com/apps).
25-
# @param [String] client_id Required parameter: Your application ID, which
26-
# is available on the **OAuth** page in the [Developer
27-
# Dashboard](https://developer.squareup.com/apps).
28-
# @param [RenewTokenRequest] body Required parameter: An object containing
29-
# the fields to POST for the request. See the corresponding object
30-
# definition for field details.
31-
# @param [String] authorization Required parameter: Client
32-
# APPLICATION_SECRET
33-
# @return [RenewTokenResponse Hash] response from the API call
34-
def renew_token(client_id:,
35-
body:,
36-
authorization:)
37-
warn 'Endpoint renew_token in OAuthApi is deprecated'
38-
new_api_call_builder
39-
.request(new_request_builder(HttpMethodEnum::POST,
40-
'/oauth2/clients/{client_id}/access-token/renew',
41-
'default')
42-
.template_param(new_parameter(client_id, key: 'client_id')
43-
.should_encode(true))
44-
.header_param(new_parameter('application/json', key: 'Content-Type'))
45-
.body_param(new_parameter(body))
46-
.header_param(new_parameter(authorization, key: 'Authorization'))
47-
.header_param(new_parameter('application/json', key: 'accept'))
48-
.body_serializer(proc do |param| param.to_json unless param.nil? end))
49-
.response(new_response_handler
50-
.deserializer(APIHelper.method(:json_deserialize))
51-
.is_api_response(true)
52-
.convertor(ApiResponse.method(:create)))
53-
.execute
54-
end
55-
564
# Revokes an access token generated with the OAuth flow.
575
# If an account has more than one OAuth access token for your application,
586
# this

0 commit comments

Comments
 (0)