square.rb 9.1.1.20210317 → 10.0.0.20210421
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/README.md +1 -1
- data/lib/square/api/bank_accounts_api.rb +5 -5
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/bookings_api.rb +3 -5
- data/lib/square/api/cash_drawers_api.rb +2 -2
- data/lib/square/api/catalog_api.rb +32 -36
- data/lib/square/api/customer_groups_api.rb +4 -4
- data/lib/square/api/customer_segments_api.rb +4 -4
- data/lib/square/api/customers_api.rb +45 -24
- data/lib/square/api/devices_api.rb +2 -1
- data/lib/square/api/disputes_api.rb +4 -6
- data/lib/square/api/inventory_api.rb +16 -16
- data/lib/square/api/invoices_api.rb +14 -14
- data/lib/square/api/locations_api.rb +1 -2
- data/lib/square/api/loyalty_api.rb +59 -13
- data/lib/square/api/merchants_api.rb +1 -1
- data/lib/square/api/orders_api.rb +17 -15
- data/lib/square/api/payments_api.rb +4 -1
- data/lib/square/api/refunds_api.rb +4 -1
- data/lib/square/api/subscriptions_api.rb +36 -1
- data/lib/square/api/team_api.rb +10 -10
- data/lib/square/api/transactions_api.rb +29 -18
- data/lib/square/api/v1_employees_api.rb +2 -1
- data/lib/square/client.rb +2 -2
- data/lib/square/configuration.rb +1 -1
- data/test/api/test_locations_api.rb +1 -1
- metadata +2 -2
@@ -6,6 +6,9 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Retrieves a list of payments taken by the account making the request.
|
9
|
+
# Results are eventually consistent, and new payments or changes to payments
|
10
|
+
# might take several
|
11
|
+
# seconds to appear.
|
9
12
|
# The maximum results per page is 100.
|
10
13
|
# @param [String] begin_time Optional parameter: The timestamp for the
|
11
14
|
# beginning of the reporting period, in RFC 3339 format. Inclusive. Default:
|
@@ -88,7 +91,7 @@ module Square
|
|
88
91
|
# Square gift card) or record a payment that the seller received outside of
|
89
92
|
# Square
|
90
93
|
# (cash payment from a buyer or a payment that an external entity
|
91
|
-
#
|
94
|
+
# processed on behalf of the seller).
|
92
95
|
# The endpoint creates a
|
93
96
|
# `Payment` object and returns it in the response.
|
94
97
|
# @param [CreatePaymentRequest] body Required parameter: An object
|
@@ -6,6 +6,9 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Retrieves a list of refunds for the account making the request.
|
9
|
+
# Results are eventually consistent, and new refunds or changes to refunds
|
10
|
+
# might take several
|
11
|
+
# seconds to appear.
|
9
12
|
# The maximum results per page is 100.
|
10
13
|
# @param [String] begin_time Optional parameter: The timestamp for the
|
11
14
|
# beginning of the requested reporting period, in RFC 3339 format. Default:
|
@@ -26,7 +29,7 @@ module Square
|
|
26
29
|
# associated with the seller.
|
27
30
|
# @param [String] status Optional parameter: If provided, only refunds with
|
28
31
|
# the given status are returned. For a list of refund status values, see
|
29
|
-
# [PaymentRefund](
|
32
|
+
# [PaymentRefund]($m/PaymentRefund). Default: If omitted, refunds are
|
30
33
|
# returned regardless of their status.
|
31
34
|
# @param [String] source_type Optional parameter: If provided, only refunds
|
32
35
|
# with the given source type are returned. - `CARD` - List refunds only for
|
@@ -220,7 +220,7 @@ module Square
|
|
220
220
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
221
221
|
# ion).
|
222
222
|
# @param [Integer] limit Optional parameter: The upper limit on the number
|
223
|
-
# of subscription events to return
|
223
|
+
# of subscription events to return in the response. Default: `200`
|
224
224
|
# @return [ListSubscriptionEventsResponse Hash] response from the API call
|
225
225
|
def list_subscription_events(subscription_id:,
|
226
226
|
cursor: nil,
|
@@ -259,5 +259,40 @@ module Square
|
|
259
259
|
_response, data: decoded, errors: _errors
|
260
260
|
)
|
261
261
|
end
|
262
|
+
|
263
|
+
# Resumes a deactivated subscription.
|
264
|
+
# @param [String] subscription_id Required parameter: The ID of the
|
265
|
+
# subscription to resume.
|
266
|
+
# @return [ResumeSubscriptionResponse Hash] response from the API call
|
267
|
+
def resume_subscription(subscription_id:)
|
268
|
+
# Prepare query url.
|
269
|
+
_query_builder = config.get_base_uri
|
270
|
+
_query_builder << '/v2/subscriptions/{subscription_id}/resume'
|
271
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
272
|
+
_query_builder,
|
273
|
+
'subscription_id' => { 'value' => subscription_id, 'encode' => true }
|
274
|
+
)
|
275
|
+
_query_url = APIHelper.clean_url _query_builder
|
276
|
+
|
277
|
+
# Prepare headers.
|
278
|
+
_headers = {
|
279
|
+
'accept' => 'application/json'
|
280
|
+
}
|
281
|
+
|
282
|
+
# Prepare and execute HttpRequest.
|
283
|
+
_request = config.http_client.post(
|
284
|
+
_query_url,
|
285
|
+
headers: _headers
|
286
|
+
)
|
287
|
+
OAuth2.apply(config, _request)
|
288
|
+
_response = execute_request(_request)
|
289
|
+
|
290
|
+
# Return appropriate response type.
|
291
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
292
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
293
|
+
ApiResponse.new(
|
294
|
+
_response, data: decoded, errors: _errors
|
295
|
+
)
|
296
|
+
end
|
262
297
|
end
|
263
298
|
end
|
data/lib/square/api/team_api.rb
CHANGED
@@ -54,8 +54,8 @@ module Square
|
|
54
54
|
# marked as failed, but the body of the response
|
55
55
|
# will contain explicit error information for this particular create.
|
56
56
|
# Learn about [Troubleshooting the Teams
|
57
|
-
# API](https://developer.squareup.com/docs/team/troubleshooting#
|
58
|
-
#
|
57
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-
|
58
|
+
# team-members).
|
59
59
|
# @param [BulkCreateTeamMembersRequest] body Required parameter: An object
|
60
60
|
# containing the fields to POST for the request. See the corresponding
|
61
61
|
# object definition for field details.
|
@@ -97,8 +97,8 @@ module Square
|
|
97
97
|
# marked as failed, but the body of the response
|
98
98
|
# will contain explicit error information for this particular update.
|
99
99
|
# Learn about [Troubleshooting the Teams
|
100
|
-
# API](https://developer.squareup.com/docs/team/troubleshooting#
|
101
|
-
#
|
100
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-
|
101
|
+
# team-members).
|
102
102
|
# @param [BulkUpdateTeamMembersRequest] body Required parameter: An object
|
103
103
|
# containing the fields to POST for the request. See the corresponding
|
104
104
|
# object definition for field details.
|
@@ -171,8 +171,8 @@ module Square
|
|
171
171
|
|
172
172
|
# Retrieve a `TeamMember` object for the given `TeamMember.id`.
|
173
173
|
# Learn about [Troubleshooting the Teams
|
174
|
-
# API](https://developer.squareup.com/docs/team/troubleshooting#
|
175
|
-
# member).
|
174
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-t
|
175
|
+
# eam-member).
|
176
176
|
# @param [String] team_member_id Required parameter: The ID of the team
|
177
177
|
# member to retrieve.
|
178
178
|
# @return [RetrieveTeamMemberResponse Hash] response from the API call
|
@@ -210,8 +210,8 @@ module Square
|
|
210
210
|
# Updates a single `TeamMember` object. The `TeamMember` will be returned on
|
211
211
|
# successful updates.
|
212
212
|
# Learn about [Troubleshooting the Teams
|
213
|
-
# API](https://developer.squareup.com/docs/team/troubleshooting#
|
214
|
-
#
|
213
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#update-a-tea
|
214
|
+
# m-member).
|
215
215
|
# @param [String] team_member_id Required parameter: The ID of the team
|
216
216
|
# member to update.
|
217
217
|
# @param [UpdateTeamMemberRequest] body Required parameter: An object
|
@@ -297,8 +297,8 @@ module Square
|
|
297
297
|
# it fully replaces the `WageSetting` object for the team member.
|
298
298
|
# The `WageSetting` will be returned upon successful update.
|
299
299
|
# Learn about [Troubleshooting the Teams
|
300
|
-
# API](https://developer.squareup.com/docs/team/troubleshooting#
|
301
|
-
#
|
300
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#create-or-up
|
301
|
+
# date-a-wage-setting).
|
302
302
|
# @param [String] team_member_id Required parameter: The ID of the team
|
303
303
|
# member to update the `WageSetting` object for.
|
304
304
|
# @param [UpdateWageSettingRequest] body Required parameter: An object
|
@@ -12,24 +12,29 @@ module Square
|
|
12
12
|
# Point of Sale applications.
|
13
13
|
# Refunds with a `status` of `PENDING` are not currently included in this
|
14
14
|
# endpoint's response.
|
15
|
-
# Max results per
|
15
|
+
# Max results per
|
16
|
+
# [page](https://developer.squareup.com/docs/working-with-apis/pagination):
|
17
|
+
# 50
|
16
18
|
# @param [String] location_id Required parameter: The ID of the location to
|
17
19
|
# list refunds for.
|
18
20
|
# @param [String] begin_time Optional parameter: The beginning of the
|
19
21
|
# requested reporting period, in RFC 3339 format. See [Date
|
20
|
-
# ranges](
|
21
|
-
#
|
22
|
+
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
|
23
|
+
# s) for details on date inclusivity/exclusivity. Default value: The
|
24
|
+
# current time minus one year.
|
22
25
|
# @param [String] end_time Optional parameter: The end of the requested
|
23
|
-
# reporting period, in RFC 3339 format. See [Date
|
24
|
-
#
|
25
|
-
#
|
26
|
+
# reporting period, in RFC 3339 format. See [Date
|
27
|
+
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
|
28
|
+
# s) for details on date inclusivity/exclusivity. Default value: The
|
29
|
+
# current time.
|
26
30
|
# @param [SortOrder] sort_order Optional parameter: The order in which
|
27
31
|
# results are listed in the response (`ASC` for oldest first, `DESC` for
|
28
32
|
# newest first). Default value: `DESC`
|
29
33
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
30
34
|
# a previous call to this endpoint. Provide this to retrieve the next set of
|
31
35
|
# results for your original query. See [Paginating
|
32
|
-
# results](
|
36
|
+
# results](https://developer.squareup.com/docs/working-with-apis/pagination)
|
37
|
+
# for more information.
|
33
38
|
# @return [ListRefundsResponse Hash] response from the API call
|
34
39
|
def list_refunds(location_id:,
|
35
40
|
begin_time: nil,
|
@@ -78,24 +83,29 @@ module Square
|
|
78
83
|
# Transactions include payment information from sales and exchanges and
|
79
84
|
# refund
|
80
85
|
# information from returns and exchanges.
|
81
|
-
# Max results per
|
86
|
+
# Max results per
|
87
|
+
# [page](https://developer.squareup.com/docs/working-with-apis/pagination):
|
88
|
+
# 50
|
82
89
|
# @param [String] location_id Required parameter: The ID of the location to
|
83
90
|
# list transactions for.
|
84
91
|
# @param [String] begin_time Optional parameter: The beginning of the
|
85
92
|
# requested reporting period, in RFC 3339 format. See [Date
|
86
|
-
# ranges](
|
87
|
-
#
|
93
|
+
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
|
94
|
+
# s) for details on date inclusivity/exclusivity. Default value: The
|
95
|
+
# current time minus one year.
|
88
96
|
# @param [String] end_time Optional parameter: The end of the requested
|
89
|
-
# reporting period, in RFC 3339 format. See [Date
|
90
|
-
#
|
91
|
-
#
|
97
|
+
# reporting period, in RFC 3339 format. See [Date
|
98
|
+
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
|
99
|
+
# s) for details on date inclusivity/exclusivity. Default value: The
|
100
|
+
# current time.
|
92
101
|
# @param [SortOrder] sort_order Optional parameter: The order in which
|
93
102
|
# results are listed in the response (`ASC` for oldest first, `DESC` for
|
94
103
|
# newest first). Default value: `DESC`
|
95
104
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
96
105
|
# a previous call to this endpoint. Provide this to retrieve the next set of
|
97
106
|
# results for your original query. See [Paginating
|
98
|
-
# results](
|
107
|
+
# results](https://developer.squareup.com/docs/working-with-apis/pagination)
|
108
|
+
# for more information.
|
99
109
|
# @return [ListTransactionsResponse Hash] response from the API call
|
100
110
|
def list_transactions(location_id:,
|
101
111
|
begin_time: nil,
|
@@ -156,9 +166,9 @@ module Square
|
|
156
166
|
# When this response is returned, the amount of Square's processing fee
|
157
167
|
# might not yet be
|
158
168
|
# calculated. To obtain the processing fee, wait about ten seconds and call
|
159
|
-
# [RetrieveTransaction](
|
169
|
+
# [RetrieveTransaction]($e/Transactions/RetrieveTransaction). See the
|
160
170
|
# `processing_fee_money`
|
161
|
-
# field of each [Tender included](
|
171
|
+
# field of each [Tender included]($m/Tender) in the transaction.
|
162
172
|
# @param [String] location_id Required parameter: The ID of the location to
|
163
173
|
# associate the created transaction with.
|
164
174
|
# @param [ChargeRequest] body Required parameter: An object containing the
|
@@ -241,7 +251,7 @@ module Square
|
|
241
251
|
end
|
242
252
|
|
243
253
|
# Captures a transaction that was created with the
|
244
|
-
# [Charge](
|
254
|
+
# [Charge]($e/Transactions/Charge)
|
245
255
|
# endpoint with a `delay_capture` value of `true`.
|
246
256
|
# See [Delayed capture
|
247
257
|
# transactions](https://developer.squareup.com/docs/payments/transactions/ov
|
@@ -337,7 +347,8 @@ module Square
|
|
337
347
|
)
|
338
348
|
end
|
339
349
|
|
340
|
-
# Cancels a transaction that was created with the
|
350
|
+
# Cancels a transaction that was created with the
|
351
|
+
# [Charge]($e/Transactions/Charge)
|
341
352
|
# endpoint with a `delay_capture` value of `true`.
|
342
353
|
# See [Delayed capture
|
343
354
|
# transactions](https://developer.squareup.com/docs/payments/transactions/ov
|
@@ -247,7 +247,8 @@ module Square
|
|
247
247
|
# employee with that role. For example, an employee with a "Shift Manager"
|
248
248
|
# role might be able to issue refunds in Square Point of Sale, whereas an
|
249
249
|
# employee with a "Clerk" role might not.
|
250
|
-
# Roles are assigned with the
|
250
|
+
# Roles are assigned with the
|
251
|
+
# [V1UpdateEmployee]($e/V1Employees/UpdateEmployeeRole)
|
251
252
|
# endpoint. An employee can have only one role at a time.
|
252
253
|
# If an employee has no role, they have none of the permissions associated
|
253
254
|
# with roles. All employees can accept payments with Square Point of Sale.
|
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
|
-
'
|
7
|
+
'10.0.0.20210421'
|
8
8
|
end
|
9
9
|
|
10
10
|
def square_version
|
@@ -188,7 +188,7 @@ module Square
|
|
188
188
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
189
189
|
backoff_factor: 1, environment: 'production',
|
190
190
|
custom_url: 'https://connect.squareup.com',
|
191
|
-
square_version: '2021-
|
191
|
+
square_version: '2021-04-21', access_token: 'TODO: Replace',
|
192
192
|
additional_headers: {}, config: nil)
|
193
193
|
@config = if config.nil?
|
194
194
|
Configuration.new(timeout: timeout, max_retries: max_retries,
|
data/lib/square/configuration.rb
CHANGED
@@ -24,7 +24,7 @@ module Square
|
|
24
24
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
25
25
|
backoff_factor: 1, environment: 'production',
|
26
26
|
custom_url: 'https://connect.squareup.com',
|
27
|
-
square_version: '2021-
|
27
|
+
square_version: '2021-04-21', access_token: 'TODO: Replace',
|
28
28
|
additional_headers: {})
|
29
29
|
# The value to use for connection timeout
|
30
30
|
@timeout = timeout
|
@@ -10,7 +10,7 @@ class LocationsApiTests < ApiTestBase
|
|
10
10
|
# Provides information of all locations of a business.
|
11
11
|
#
|
12
12
|
#Many Square API endpoints require a `location_id` parameter.
|
13
|
-
#The `id` field of the [`Location`](
|
13
|
+
#The `id` field of the [`Location`]($m/Location) objects returned by this
|
14
14
|
#endpoint correspond to that `location_id` parameter.
|
15
15
|
def test_list_locations()
|
16
16
|
|
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: 10.0.0.20210421
|
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: 2021-04-
|
11
|
+
date: 2021-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|