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 +4 -4
- data/lib/square/api/base_api.rb +2 -2
- data/lib/square/api/payments_api.rb +10 -4
- data/lib/square/client.rb +2 -2
- data/lib/square/configuration.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 138fb32372ec1f9f3d7fad1888d2cd713e65f177fe4efbf0e22927ef22840c08
|
4
|
+
data.tar.gz: 1a801b869c9216881f41ae33c70867f0918c3cd11c63e23d29449593b20da41a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a20b19c6ded28b7263ebe2410891f7673fcaa2d1a07f1b06cdb2fecca07e3c7246c19df7e6f6c5e22209df84ad33555ce867dc3044f1cb0958330e2e6a619c1
|
7
|
+
data.tar.gz: 7f340885a07aba8355b416b6ceca057ee9115ca2fcfade634c5ccee74be5c92faf1c03980dba6bf3284bce08ed31fcba5e9bcf960c41cb2e1f2d3efdcdd1cb8f
|
data/lib/square/api/base_api.rb
CHANGED
@@ -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.
|
12
|
-
'Square-Version' => '2020-
|
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
data/lib/square/configuration.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|