square.rb 5.0.0.20200226 → 5.1.0.20200325

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: 4db64adc1deef73ef00086f17ac38e54e342472456ebc04cee8b64e691c5ea3a
4
- data.tar.gz: bd4ee35fcc7bc37b6a37d7f071b6e9bce6091088879bbf1c9a4b3b6d67de3553
3
+ metadata.gz: 138fb32372ec1f9f3d7fad1888d2cd713e65f177fe4efbf0e22927ef22840c08
4
+ data.tar.gz: 1a801b869c9216881f41ae33c70867f0918c3cd11c63e23d29449593b20da41a
5
5
  SHA512:
6
- metadata.gz: 9bc48e30881676a19e52933b16fd57d02bb990fcafd282969f010412d31b8296c2511288cb478cb545f418959e8206847d31d53127fc6311f14ebc731ad0a3a9
7
- data.tar.gz: 2f6af98a925f9304a1e7c833c3a637bea22329099cba3cf09656cd92bada279c7f8cf3f0d14c08faba2026f6ef777a5dbb1a119477107f6d7b7f403b795f2635
6
+ metadata.gz: 2a20b19c6ded28b7263ebe2410891f7673fcaa2d1a07f1b06cdb2fecca07e3c7246c19df7e6f6c5e22209df84ad33555ce867dc3044f1cb0958330e2e6a619c1
7
+ data.tar.gz: 7f340885a07aba8355b416b6ceca057ee9115ca2fcfade634c5ccee74be5c92faf1c03980dba6bf3284bce08ed31fcba5e9bcf960c41cb2e1f2d3efdcdd1cb8f
@@ -8,8 +8,8 @@ module Square
8
8
  @http_call_back = http_call_back
9
9
 
10
10
  @global_headers = {
11
- 'user-agent' => 'Square-Ruby-SDK/5.0.0.20200226',
12
- 'Square-Version' => '2020-02-26'
11
+ 'user-agent' => 'Square-Ruby-SDK/5.1.0.20200325',
12
+ 'Square-Version' => '2020-03-25'
13
13
  }
14
14
  end
15
15
 
@@ -127,7 +127,7 @@ module Square
127
127
  # In this case, you can
128
128
  # direct Square to cancel the payment using this endpoint. In the request,
129
129
  # you provide the same
130
- # idempotency key that you provided in your CreatePayment request you want
130
+ # idempotency key that you provided in your CreatePayment request you want
131
131
  # to cancel. After
132
132
  # cancelling the payment, you can submit your CreatePayment request again.
133
133
  # Note that if no payment with the specified idempotency key is found, no
@@ -246,8 +246,12 @@ module Square
246
246
  # elayed-payments).
247
247
  # @param [String] payment_id Required parameter: Unique ID identifying the
248
248
  # payment to be completed.
249
+ # @param [Object] body Required parameter: An object containing the fields
250
+ # to POST for the request. See the corresponding object definition for
251
+ # field details.
249
252
  # @return [CompletePaymentResponse Hash] response from the API call
250
- def complete_payment(payment_id:)
253
+ def complete_payment(payment_id:,
254
+ body:)
251
255
  # Prepare query url.
252
256
  _query_builder = config.get_base_uri
253
257
  _query_builder << '/v2/payments/{payment_id}/complete'
@@ -259,13 +263,15 @@ module Square
259
263
 
260
264
  # Prepare headers.
261
265
  _headers = {
262
- 'accept' => 'application/json'
266
+ 'accept' => 'application/json',
267
+ 'content-type' => 'application/json; charset=utf-8'
263
268
  }
264
269
 
265
270
  # Prepare and execute HttpRequest.
266
271
  _request = config.http_client.post(
267
272
  _query_url,
268
- headers: _headers
273
+ headers: _headers,
274
+ parameters: body.to_json
269
275
  )
270
276
  OAuth2.apply(config, _request)
271
277
  _response = execute_request(_request)
data/lib/square/client.rb CHANGED
@@ -4,11 +4,11 @@ module Square
4
4
  attr_reader :config
5
5
 
6
6
  def sdk_version
7
- '5.0.0.20200226'
7
+ '5.1.0.20200325'
8
8
  end
9
9
 
10
10
  def square_version
11
- '2020-02-26'
11
+ '2020-03-25'
12
12
  end
13
13
 
14
14
  # Access to mobile_authorization controller.
@@ -36,7 +36,7 @@ module Square
36
36
  @backoff_factor = backoff_factor
37
37
 
38
38
  # Current API environment
39
- @environment = environment
39
+ @environment = String(environment)
40
40
 
41
41
  # OAuth 2.0 Access Token
42
42
  @access_token = access_token
@@ -73,21 +73,21 @@ module Square
73
73
  end
74
74
 
75
75
  # All the environments the SDK can run in.
76
- @environments = {
76
+ ENVIRONMENTS = {
77
77
  'production' => {
78
78
  'default' => 'https://connect.squareup.com'
79
79
  },
80
80
  'sandbox' => {
81
81
  'default' => 'https://connect.squareupsandbox.com'
82
82
  }
83
- }
83
+ }.freeze
84
84
 
85
85
  # Generates the appropriate base URI for the environment and the server.
86
86
  # @param [Configuration::Server] The server enum for which the base URI is
87
87
  # required.
88
88
  # @return [String] The base URI.
89
89
  def get_base_uri(server = 'default')
90
- self.class.environments[environment][server].clone
90
+ ENVIRONMENTS[environment][server].clone
91
91
  end
92
92
  end
93
93
  end
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: 5.0.0.20200226
4
+ version: 5.1.0.20200325
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: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging