square.rb 25.0.0.20221116 → 26.0.0.20221214

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dc4e9fcd63b3813aa4ad5988917a80efbd309ea3b794f430c8b272936337c97
4
- data.tar.gz: 403fdfd4137b70d63cc475967d937ec84022732b3b6a553b31320e700acfa7d9
3
+ metadata.gz: fc2a29582c2a6567415cc4454e30c46ce4bb02db1024c94a408388ccb65d8a22
4
+ data.tar.gz: 98bc7d48e63811198c6cd7382c817e4cd5bc3d56e973446ba3aaaab98b04a888
5
5
  SHA512:
6
- metadata.gz: f4200d28c6187cc9c01c528a01626bf2d5e38288ef66100ad799a0948485af0ca2b5b3ace39d6b84cb3685abe45f2a5298e5e93392b1cb2b396b873a65fb3e73
7
- data.tar.gz: 7e3f21e90b2e4609c48463883c9ec4fa6555d28b6eccc9e71a89879384de1d9635309a5bbe1c0c0e5b7661a2fffa4b6b95b6d1ab2700a6d7d19a2d66f9e7d1f9
6
+ metadata.gz: 986453cdf69a944c572281510704456da9070a8546d52a092ae8e99430927ec70ebd8424b66c39e599e27c58a21858acbdab7dbf69f1a7268dc0bcaf765dbbfa
7
+ data.tar.gz: cfb8510ea05858ce8827689436357a8c98fcd3799b83f2eb188f1355aa1b10c0a848dd4181e518d797b85c704f24bd9976a49085994884644f2ad1e42cebd5a7
@@ -45,7 +45,7 @@ module Square
45
45
  end
46
46
 
47
47
  def get_user_agent
48
- user_agent = 'Square-Ruby-SDK/25.0.0.20221116 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
48
+ user_agent = 'Square-Ruby-SDK/26.0.0.20221214 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
49
49
  user_agent['{engine}'] = RUBY_ENGINE
50
50
  user_agent['{engine-version}'] = RUBY_ENGINE_VERSION
51
51
  user_agent['{os-info}'] = RUBY_PLATFORM
@@ -168,5 +168,52 @@ module Square
168
168
  _response, data: decoded, errors: _errors
169
169
  )
170
170
  end
171
+
172
+ # Returns information about an [OAuth access
173
+ # token](https://developer.squareup.com/docs/build-basics/access-tokens#get-
174
+ # an-oauth-access-token) or an application’s [personal access
175
+ # token](https://developer.squareup.com/docs/build-basics/access-tokens#get-
176
+ # a-personal-access-token).
177
+ # Add the access token to the Authorization header of the request.
178
+ # __Important:__ The `Authorization` header you provide to this endpoint
179
+ # must have the following format:
180
+ # ```
181
+ # Authorization: Bearer ACCESS_TOKEN
182
+ # ```
183
+ # where `ACCESS_TOKEN` is a
184
+ # [valid production authorization
185
+ # credential](https://developer.squareup.com/docs/build-basics/access-tokens
186
+ # ).
187
+ # If the access token is expired or not a valid access token, the endpoint
188
+ # returns an `UNAUTHORIZED` error.
189
+ # @param [String] authorization Required parameter: Client
190
+ # APPLICATION_SECRET
191
+ # @return [RetrieveTokenStatusResponse Hash] response from the API call
192
+ def retrieve_token_status(authorization:)
193
+ # Prepare query url.
194
+ _query_builder = config.get_base_uri
195
+ _query_builder << '/oauth2/token/status'
196
+ _query_url = APIHelper.clean_url _query_builder
197
+
198
+ # Prepare headers.
199
+ _headers = {
200
+ 'accept' => 'application/json',
201
+ 'Authorization' => authorization
202
+ }
203
+
204
+ # Prepare and execute HttpRequest.
205
+ _request = config.http_client.post(
206
+ _query_url,
207
+ headers: _headers
208
+ )
209
+ _response = execute_request(_request)
210
+
211
+ # Return appropriate response type.
212
+ decoded = APIHelper.json_deserialize(_response.raw_body)
213
+ _errors = APIHelper.map_response(decoded, ['errors'])
214
+ ApiResponse.new(
215
+ _response, data: decoded, errors: _errors
216
+ )
217
+ end
171
218
  end
172
219
  end
data/lib/square/client.rb CHANGED
@@ -4,7 +4,7 @@ module Square
4
4
  attr_reader :config
5
5
 
6
6
  def sdk_version
7
- '25.0.0.20221116'
7
+ '26.0.0.20221214'
8
8
  end
9
9
 
10
10
  def square_version
@@ -254,7 +254,7 @@ module Square
254
254
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
255
255
  retry_methods: %i[get put], environment: 'production',
256
256
  custom_url: 'https://connect.squareup.com',
257
- square_version: '2022-11-16', access_token: '',
257
+ square_version: '2022-12-14', access_token: '',
258
258
  user_agent_detail: '', additional_headers: {}, config: nil)
259
259
  @config = if config.nil?
260
260
  Configuration.new(connection: connection, adapter: adapter,
@@ -20,7 +20,7 @@ module Square
20
20
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
21
21
  retry_methods: %i[get put], environment: 'production',
22
22
  custom_url: 'https://connect.squareup.com',
23
- square_version: '2022-11-16', access_token: '',
23
+ square_version: '2022-12-14', access_token: '',
24
24
  user_agent_detail: '', additional_headers: {})
25
25
  # The Faraday connection object passed by the SDK user for making requests
26
26
  @connection = connection
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 25.0.0.20221116
4
+ version: 26.0.0.20221214
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square Developer Platform
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging