square.rb 5.2.0.20200422 → 6.1.0.20200722
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +315 -285
- data/lib/square.rb +3 -0
- data/lib/square/api/base_api.rb +2 -2
- data/lib/square/api/catalog_api.rb +76 -57
- data/lib/square/api/customer_groups_api.rb +1 -1
- data/lib/square/api/customer_segments_api.rb +2 -7
- data/lib/square/api/customers_api.rb +18 -5
- data/lib/square/api/disputes_api.rb +1 -11
- data/lib/square/api/inventory_api.rb +2 -2
- data/lib/square/api/invoices_api.rb +358 -0
- data/lib/square/api/locations_api.rb +7 -2
- data/lib/square/api/loyalty_api.rb +543 -0
- data/lib/square/api/merchants_api.rb +2 -1
- data/lib/square/api/orders_api.rb +32 -0
- data/lib/square/api/payments_api.rb +3 -9
- data/lib/square/api/refunds_api.rb +3 -2
- data/lib/square/api/team_api.rb +326 -0
- data/lib/square/api/transactions_api.rb +0 -71
- data/lib/square/api/v1_employees_api.rb +3 -76
- data/lib/square/api/v1_items_api.rb +0 -360
- data/lib/square/api/v1_locations_api.rb +0 -18
- data/lib/square/api/v1_transactions_api.rb +1 -19
- data/lib/square/client.rb +23 -4
- data/lib/square/configuration.rb +12 -4
- metadata +6 -3
@@ -6,15 +6,6 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Get the general information for a business.
|
9
|
-
# ---
|
10
|
-
# - __Deprecation date__: 2019-11-20
|
11
|
-
# - [__Retirement
|
12
|
-
# date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#dep
|
13
|
-
# recated): 2020-11-18
|
14
|
-
# - [Migration
|
15
|
-
# guide](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-locat
|
16
|
-
# ions)
|
17
|
-
# ---
|
18
9
|
# @return [V1Merchant Hash] response from the API call
|
19
10
|
def retrieve_business
|
20
11
|
warn 'Endpoint retrieve_business in V1LocationsApi is deprecated'
|
@@ -44,15 +35,6 @@ module Square
|
|
44
35
|
|
45
36
|
# Provides details for all business locations associated with a Square
|
46
37
|
# account, including the Square-assigned object ID for the location.
|
47
|
-
# ---
|
48
|
-
# - __Deprecation date__: 2019-11-20
|
49
|
-
# - [__Retirement
|
50
|
-
# date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#dep
|
51
|
-
# recated): 2020-11-18
|
52
|
-
# - [Migration
|
53
|
-
# guide](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-locat
|
54
|
-
# ions)
|
55
|
-
# ---
|
56
38
|
# @return [List of V1Merchant Hash] response from the API call
|
57
39
|
def list_locations
|
58
40
|
warn 'Endpoint list_locations in V1LocationsApi is deprecated'
|
@@ -8,15 +8,6 @@ module Square
|
|
8
8
|
# Provides non-confidential details for all of a location's associated bank
|
9
9
|
# accounts. This endpoint does not provide full bank account numbers, and
|
10
10
|
# there is no way to obtain a full bank account number with the Connect API.
|
11
|
-
# ---
|
12
|
-
# - __Deprecation date__: 2020-02-26
|
13
|
-
# - [__Retirement
|
14
|
-
# date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycl
|
15
|
-
# e#deprecated): 2021-02-26
|
16
|
-
# - [Migration
|
17
|
-
# guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-
|
18
|
-
# bankaccounts)
|
19
|
-
# ---
|
20
11
|
# @param [String] location_id Required parameter: The ID of the location to
|
21
12
|
# list bank accounts for.
|
22
13
|
# @return [List of V1BankAccount Hash] response from the API call
|
@@ -53,15 +44,6 @@ module Square
|
|
53
44
|
# Provides non-confidential details for a merchant's associated bank
|
54
45
|
# account. This endpoint does not provide full bank account numbers, and
|
55
46
|
# there is no way to obtain a full bank account number with the Connect API.
|
56
|
-
# ---
|
57
|
-
# - __Deprecation date__: 2020-02-26
|
58
|
-
# - [__Retirement
|
59
|
-
# date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycl
|
60
|
-
# e#deprecated): 2021-02-26
|
61
|
-
# - [Migration
|
62
|
-
# guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-
|
63
|
-
# bankaccounts)
|
64
|
-
# ---
|
65
47
|
# @param [String] location_id Required parameter: The ID of the bank
|
66
48
|
# account's associated location.
|
67
49
|
# @param [String] bank_account_id Required parameter: The bank account's
|
@@ -272,7 +254,7 @@ module Square
|
|
272
254
|
end_time: nil,
|
273
255
|
limit: nil,
|
274
256
|
batch_token: nil,
|
275
|
-
include_partial:
|
257
|
+
include_partial: false)
|
276
258
|
# Prepare query url.
|
277
259
|
_query_builder = config.get_base_uri
|
278
260
|
_query_builder << '/v1/{location_id}/payments'
|
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
|
-
'
|
7
|
+
'6.1.0.20200722'
|
8
8
|
end
|
9
9
|
|
10
10
|
def square_version
|
11
|
-
|
11
|
+
config.square_version
|
12
12
|
end
|
13
13
|
|
14
14
|
# Access to mobile_authorization controller.
|
@@ -113,6 +113,12 @@ module Square
|
|
113
113
|
@inventory ||= InventoryApi.new config
|
114
114
|
end
|
115
115
|
|
116
|
+
# Access to invoices controller.
|
117
|
+
# @return [InvoicesApi] Returns the controller instance.
|
118
|
+
def invoices
|
119
|
+
@invoices ||= InvoicesApi.new config
|
120
|
+
end
|
121
|
+
|
116
122
|
# Access to labor controller.
|
117
123
|
# @return [LaborApi] Returns the controller instance.
|
118
124
|
def labor
|
@@ -149,6 +155,12 @@ module Square
|
|
149
155
|
@transactions ||= TransactionsApi.new config
|
150
156
|
end
|
151
157
|
|
158
|
+
# Access to loyalty controller.
|
159
|
+
# @return [LoyaltyApi] Returns the controller instance.
|
160
|
+
def loyalty
|
161
|
+
@loyalty ||= LoyaltyApi.new config
|
162
|
+
end
|
163
|
+
|
152
164
|
# Access to merchants controller.
|
153
165
|
# @return [MerchantsApi] Returns the controller instance.
|
154
166
|
def merchants
|
@@ -167,6 +179,12 @@ module Square
|
|
167
179
|
@refunds ||= RefundsApi.new config
|
168
180
|
end
|
169
181
|
|
182
|
+
# Access to team controller.
|
183
|
+
# @return [TeamApi] Returns the controller instance.
|
184
|
+
def team
|
185
|
+
@team ||= TeamApi.new config
|
186
|
+
end
|
187
|
+
|
170
188
|
# Access to terminal controller.
|
171
189
|
# @return [TerminalApi] Returns the controller instance.
|
172
190
|
def terminal
|
@@ -175,13 +193,14 @@ module Square
|
|
175
193
|
|
176
194
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
177
195
|
backoff_factor: 1, environment: 'production',
|
178
|
-
access_token: 'TODO: Replace',
|
179
|
-
config: nil)
|
196
|
+
square_version: '2020-07-22', access_token: 'TODO: Replace',
|
197
|
+
additional_headers: {}, config: nil)
|
180
198
|
@config = if config.nil?
|
181
199
|
Configuration.new(timeout: timeout, max_retries: max_retries,
|
182
200
|
retry_interval: retry_interval,
|
183
201
|
backoff_factor: backoff_factor,
|
184
202
|
environment: environment,
|
203
|
+
square_version: square_version,
|
185
204
|
access_token: access_token,
|
186
205
|
additional_headers: additional_headers)
|
187
206
|
else
|
data/lib/square/configuration.rb
CHANGED
@@ -9,6 +9,7 @@ module Square
|
|
9
9
|
attr_reader :retry_interval
|
10
10
|
attr_reader :backoff_factor
|
11
11
|
attr_reader :environment
|
12
|
+
attr_reader :square_version
|
12
13
|
attr_reader :access_token
|
13
14
|
|
14
15
|
def additional_headers
|
@@ -21,7 +22,8 @@ module Square
|
|
21
22
|
|
22
23
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
23
24
|
backoff_factor: 1, environment: 'production',
|
24
|
-
access_token: 'TODO: Replace',
|
25
|
+
square_version: '2020-07-22', access_token: 'TODO: Replace',
|
26
|
+
additional_headers: {})
|
25
27
|
# The value to use for connection timeout
|
26
28
|
@timeout = timeout
|
27
29
|
|
@@ -38,6 +40,9 @@ module Square
|
|
38
40
|
# Current API environment
|
39
41
|
@environment = String(environment)
|
40
42
|
|
43
|
+
# Square Connect API versions
|
44
|
+
@square_version = square_version
|
45
|
+
|
41
46
|
# OAuth 2.0 Access Token
|
42
47
|
@access_token = access_token
|
43
48
|
|
@@ -49,20 +54,23 @@ module Square
|
|
49
54
|
end
|
50
55
|
|
51
56
|
def clone_with(timeout: nil, max_retries: nil, retry_interval: nil,
|
52
|
-
backoff_factor: nil, environment: nil,
|
53
|
-
additional_headers: nil)
|
57
|
+
backoff_factor: nil, environment: nil, square_version: nil,
|
58
|
+
access_token: nil, additional_headers: nil)
|
54
59
|
timeout ||= self.timeout
|
55
60
|
max_retries ||= self.max_retries
|
56
61
|
retry_interval ||= self.retry_interval
|
57
62
|
backoff_factor ||= self.backoff_factor
|
58
63
|
environment ||= self.environment
|
64
|
+
square_version ||= self.square_version
|
59
65
|
access_token ||= self.access_token
|
60
66
|
additional_headers ||= self.additional_headers
|
61
67
|
|
62
68
|
Configuration.new(timeout: timeout, max_retries: max_retries,
|
63
69
|
retry_interval: retry_interval,
|
64
70
|
backoff_factor: backoff_factor,
|
65
|
-
environment: environment,
|
71
|
+
environment: environment,
|
72
|
+
square_version: square_version,
|
73
|
+
access_token: access_token,
|
66
74
|
additional_headers: additional_headers)
|
67
75
|
end
|
68
76
|
|
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:
|
4
|
+
version: 6.1.0.20200722
|
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-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -131,8 +131,10 @@ files:
|
|
131
131
|
- lib/square/api/disputes_api.rb
|
132
132
|
- lib/square/api/employees_api.rb
|
133
133
|
- lib/square/api/inventory_api.rb
|
134
|
+
- lib/square/api/invoices_api.rb
|
134
135
|
- lib/square/api/labor_api.rb
|
135
136
|
- lib/square/api/locations_api.rb
|
137
|
+
- lib/square/api/loyalty_api.rb
|
136
138
|
- lib/square/api/merchants_api.rb
|
137
139
|
- lib/square/api/mobile_authorization_api.rb
|
138
140
|
- lib/square/api/o_auth_api.rb
|
@@ -140,6 +142,7 @@ files:
|
|
140
142
|
- lib/square/api/payments_api.rb
|
141
143
|
- lib/square/api/refunds_api.rb
|
142
144
|
- lib/square/api/reporting_api.rb
|
145
|
+
- lib/square/api/team_api.rb
|
143
146
|
- lib/square/api/terminal_api.rb
|
144
147
|
- lib/square/api/transactions_api.rb
|
145
148
|
- lib/square/api/v1_employees_api.rb
|
@@ -190,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
193
|
- !ruby/object:Gem::Version
|
191
194
|
version: '0'
|
192
195
|
requirements: []
|
193
|
-
rubygems_version: 3.0.
|
196
|
+
rubygems_version: 3.0.8
|
194
197
|
signing_key:
|
195
198
|
specification_version: 4
|
196
199
|
summary: square
|