square.rb 6.3.0.20200826 → 8.1.0.20210121
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 +34 -31
- data/lib/square.rb +61 -61
- data/lib/square/api/apple_pay_api.rb +5 -3
- data/lib/square/api/bank_accounts_api.rb +16 -19
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/bookings_api.rb +308 -0
- data/lib/square/api/cash_drawers_api.rb +13 -6
- data/lib/square/api/catalog_api.rb +71 -35
- data/lib/square/api/checkout_api.rb +4 -2
- data/lib/square/api/customer_groups_api.rb +18 -8
- data/lib/square/api/customer_segments_api.rb +9 -5
- data/lib/square/api/customers_api.rb +47 -27
- data/lib/square/api/devices_api.rb +17 -6
- data/lib/square/api/disputes_api.rb +71 -68
- data/lib/square/api/employees_api.rb +7 -3
- data/lib/square/api/inventory_api.rb +27 -13
- data/lib/square/api/invoices_api.rb +44 -40
- data/lib/square/api/labor_api.rb +57 -25
- data/lib/square/api/locations_api.rb +16 -13
- data/lib/square/api/loyalty_api.rb +60 -66
- data/lib/square/api/merchants_api.rb +7 -3
- data/lib/square/api/mobile_authorization_api.rb +5 -3
- data/lib/square/api/o_auth_api.rb +11 -8
- data/lib/square/api/orders_api.rb +55 -16
- data/lib/square/api/payments_api.rb +75 -65
- data/lib/square/api/refunds_api.rb +37 -27
- data/lib/square/api/subscriptions_api.rb +26 -14
- data/lib/square/api/team_api.rb +46 -30
- data/lib/square/api/terminal_api.rb +156 -7
- data/lib/square/api/transactions_api.rb +32 -18
- data/lib/square/api/v1_employees_api.rb +59 -33
- data/lib/square/api/v1_items_api.rb +195 -115
- data/lib/square/api/v1_transactions_api.rb +49 -27
- data/lib/square/api_helper.rb +14 -9
- data/lib/square/client.rb +8 -8
- data/lib/square/configuration.rb +2 -2
- data/lib/square/http/api_response.rb +2 -0
- data/lib/square/http/faraday_client.rb +9 -2
- data/spec/user_journey_spec.rb +2 -5
- data/test/api/api_test_base.rb +1 -6
- data/test/api/test_catalog_api.rb +1 -4
- data/test/api/test_customers_api.rb +1 -4
- data/test/api/test_employees_api.rb +1 -4
- data/test/api/test_labor_api.rb +2 -6
- data/test/api/test_locations_api.rb +22 -33
- data/test/api/test_merchants_api.rb +1 -4
- data/test/api/test_payments_api.rb +3 -6
- data/test/api/test_refunds_api.rb +3 -6
- data/test/http_response_catcher.rb +0 -5
- data/test/test_helper.rb +0 -5
- metadata +33 -15
- data/lib/square/api/v1_locations_api.rb +0 -65
@@ -8,16 +8,13 @@ module Square
|
|
8
8
|
# Returns a list of invoices for a given location. The response
|
9
9
|
# is paginated. If truncated, the response includes a `cursor` that you
|
10
10
|
# use in a subsequent request to fetch the next set of invoices.
|
11
|
-
# For more information about retrieving invoices, see [Retrieve
|
12
|
-
# invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#r
|
13
|
-
# etrieve-invoices).
|
14
11
|
# @param [String] location_id Required parameter: The ID of the location for
|
15
12
|
# which to list invoices.
|
16
13
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
17
14
|
# a previous call to this endpoint. Provide this cursor to retrieve the
|
18
15
|
# next set of results for your original query. For more information, see
|
19
|
-
# [Pagination](https://developer.squareup.com/docs/
|
20
|
-
#
|
16
|
+
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
17
|
+
# ion).
|
21
18
|
# @param [Integer] limit Optional parameter: The maximum number of invoices
|
22
19
|
# to return (200 is the maximum `limit`). If not provided, the server uses
|
23
20
|
# a default limit of 100 invoices.
|
@@ -52,7 +49,9 @@ module Square
|
|
52
49
|
# Return appropriate response type.
|
53
50
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
54
51
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
55
|
-
ApiResponse.new(
|
52
|
+
ApiResponse.new(
|
53
|
+
_response, data: decoded, errors: _errors
|
54
|
+
)
|
56
55
|
end
|
57
56
|
|
58
57
|
# Creates a draft [invoice](#type-invoice)
|
@@ -60,8 +59,6 @@ module Square
|
|
60
59
|
# A draft invoice remains in your account and no action is taken.
|
61
60
|
# You must publish the invoice before Square can process it (send it to the
|
62
61
|
# customer's email address or charge the customer’s card on file).
|
63
|
-
# For more information, see [Manage Invoices Using the Invoices
|
64
|
-
# API](https://developer.squareup.com/docs/docs/invoices-api/overview).
|
65
62
|
# @param [CreateInvoiceRequest] body Required parameter: An object
|
66
63
|
# containing the fields to POST for the request. See the corresponding
|
67
64
|
# object definition for field details.
|
@@ -90,7 +87,9 @@ module Square
|
|
90
87
|
# Return appropriate response type.
|
91
88
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
92
89
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
93
|
-
ApiResponse.new(
|
90
|
+
ApiResponse.new(
|
91
|
+
_response, data: decoded, errors: _errors
|
92
|
+
)
|
94
93
|
end
|
95
94
|
|
96
95
|
# Searches for invoices from a location specified in
|
@@ -100,9 +99,6 @@ module Square
|
|
100
99
|
# optionally one customer.
|
101
100
|
# The response is paginated. If truncated, the response includes a `cursor`
|
102
101
|
# that you use in a subsequent request to fetch the next set of invoices.
|
103
|
-
# For more information about retrieving invoices, see [Retrieve
|
104
|
-
# invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#r
|
105
|
-
# etrieve-invoices).
|
106
102
|
# @param [SearchInvoicesRequest] body Required parameter: An object
|
107
103
|
# containing the fields to POST for the request. See the corresponding
|
108
104
|
# object definition for field details.
|
@@ -131,13 +127,15 @@ module Square
|
|
131
127
|
# Return appropriate response type.
|
132
128
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
133
129
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
134
|
-
ApiResponse.new(
|
130
|
+
ApiResponse.new(
|
131
|
+
_response, data: decoded, errors: _errors
|
132
|
+
)
|
135
133
|
end
|
136
134
|
|
137
135
|
# Deletes the specified invoice. When an invoice is deleted, the
|
138
136
|
# associated Order status changes to CANCELED. You can only delete a draft
|
139
|
-
# invoice (you cannot delete
|
140
|
-
#
|
137
|
+
# invoice (you cannot delete a published invoice, including one that is
|
138
|
+
# scheduled for processing).
|
141
139
|
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
142
140
|
# delete.
|
143
141
|
# @param [Integer] version Optional parameter: The version of the
|
@@ -152,7 +150,7 @@ module Square
|
|
152
150
|
_query_builder << '/v2/invoices/{invoice_id}'
|
153
151
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
154
152
|
_query_builder,
|
155
|
-
'invoice_id' => invoice_id
|
153
|
+
'invoice_id' => { 'value' => invoice_id, 'encode' => true }
|
156
154
|
)
|
157
155
|
_query_builder = APIHelper.append_url_with_query_parameters(
|
158
156
|
_query_builder,
|
@@ -176,7 +174,9 @@ module Square
|
|
176
174
|
# Return appropriate response type.
|
177
175
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
178
176
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
179
|
-
ApiResponse.new(
|
177
|
+
ApiResponse.new(
|
178
|
+
_response, data: decoded, errors: _errors
|
179
|
+
)
|
180
180
|
end
|
181
181
|
|
182
182
|
# Retrieves an invoice by invoice ID.
|
@@ -189,7 +189,7 @@ module Square
|
|
189
189
|
_query_builder << '/v2/invoices/{invoice_id}'
|
190
190
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
191
191
|
_query_builder,
|
192
|
-
'invoice_id' => invoice_id
|
192
|
+
'invoice_id' => { 'value' => invoice_id, 'encode' => true }
|
193
193
|
)
|
194
194
|
_query_url = APIHelper.clean_url _query_builder
|
195
195
|
|
@@ -209,18 +209,20 @@ module Square
|
|
209
209
|
# Return appropriate response type.
|
210
210
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
211
211
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
212
|
-
ApiResponse.new(
|
212
|
+
ApiResponse.new(
|
213
|
+
_response, data: decoded, errors: _errors
|
214
|
+
)
|
213
215
|
end
|
214
216
|
|
215
|
-
# Updates an invoice by modifying
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
219
|
-
# However,
|
220
|
-
#
|
221
|
-
#
|
222
|
-
#
|
223
|
-
# @param [String] invoice_id Required parameter: The
|
217
|
+
# Updates an invoice by modifying fields, clearing fields, or both. For most
|
218
|
+
# updates, you can use a sparse
|
219
|
+
# `Invoice` object to add fields or change values, and use the
|
220
|
+
# `fields_to_clear` field to specify fields to clear.
|
221
|
+
# However, some restrictions apply. For example, you cannot change the
|
222
|
+
# `order_id` or `location_id` field, and you
|
223
|
+
# must provide the complete `custom_fields` list to update a custom field.
|
224
|
+
# Published invoices have additional restrictions.
|
225
|
+
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
224
226
|
# update.
|
225
227
|
# @param [UpdateInvoiceRequest] body Required parameter: An object
|
226
228
|
# containing the fields to POST for the request. See the corresponding
|
@@ -233,7 +235,7 @@ module Square
|
|
233
235
|
_query_builder << '/v2/invoices/{invoice_id}'
|
234
236
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
235
237
|
_query_builder,
|
236
|
-
'invoice_id' => invoice_id
|
238
|
+
'invoice_id' => { 'value' => invoice_id, 'encode' => true }
|
237
239
|
)
|
238
240
|
_query_url = APIHelper.clean_url _query_builder
|
239
241
|
|
@@ -255,13 +257,15 @@ module Square
|
|
255
257
|
# Return appropriate response type.
|
256
258
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
257
259
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
258
|
-
ApiResponse.new(
|
260
|
+
ApiResponse.new(
|
261
|
+
_response, data: decoded, errors: _errors
|
262
|
+
)
|
259
263
|
end
|
260
264
|
|
261
265
|
# Cancels an invoice. The seller cannot collect payments for
|
262
266
|
# the canceled invoice.
|
263
|
-
# You cannot cancel an invoice in a terminal state:
|
264
|
-
# `CANCELED`, or `FAILED`.
|
267
|
+
# You cannot cancel an invoice in the `DRAFT` state or in a terminal state:
|
268
|
+
# `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`.
|
265
269
|
# @param [String] invoice_id Required parameter: The ID of the
|
266
270
|
# [invoice](#type-invoice) to cancel.
|
267
271
|
# @param [CancelInvoiceRequest] body Required parameter: An object
|
@@ -275,7 +279,7 @@ module Square
|
|
275
279
|
_query_builder << '/v2/invoices/{invoice_id}/cancel'
|
276
280
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
277
281
|
_query_builder,
|
278
|
-
'invoice_id' => invoice_id
|
282
|
+
'invoice_id' => { 'value' => invoice_id, 'encode' => true }
|
279
283
|
)
|
280
284
|
_query_url = APIHelper.clean_url _query_builder
|
281
285
|
|
@@ -297,7 +301,9 @@ module Square
|
|
297
301
|
# Return appropriate response type.
|
298
302
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
299
303
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
300
|
-
ApiResponse.new(
|
304
|
+
ApiResponse.new(
|
305
|
+
_response, data: decoded, errors: _errors
|
306
|
+
)
|
301
307
|
end
|
302
308
|
|
303
309
|
# Publishes the specified draft invoice.
|
@@ -313,10 +319,6 @@ module Square
|
|
313
319
|
# Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on
|
314
320
|
# file for a portion of the
|
315
321
|
# invoice amount).
|
316
|
-
# For more information, see
|
317
|
-
# [Create and publish an
|
318
|
-
# invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#cr
|
319
|
-
# eate-and-publish-an-invoice).
|
320
322
|
# @param [String] invoice_id Required parameter: The id of the invoice to
|
321
323
|
# publish.
|
322
324
|
# @param [PublishInvoiceRequest] body Required parameter: An object
|
@@ -330,7 +332,7 @@ module Square
|
|
330
332
|
_query_builder << '/v2/invoices/{invoice_id}/publish'
|
331
333
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
332
334
|
_query_builder,
|
333
|
-
'invoice_id' => invoice_id
|
335
|
+
'invoice_id' => { 'value' => invoice_id, 'encode' => true }
|
334
336
|
)
|
335
337
|
_query_url = APIHelper.clean_url _query_builder
|
336
338
|
|
@@ -352,7 +354,9 @@ module Square
|
|
352
354
|
# Return appropriate response type.
|
353
355
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
354
356
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
355
|
-
ApiResponse.new(
|
357
|
+
ApiResponse.new(
|
358
|
+
_response, data: decoded, errors: _errors
|
359
|
+
)
|
356
360
|
end
|
357
361
|
end
|
358
362
|
end
|
data/lib/square/api/labor_api.rb
CHANGED
@@ -44,7 +44,9 @@ module Square
|
|
44
44
|
# Return appropriate response type.
|
45
45
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
46
46
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
47
|
-
ApiResponse.new(
|
47
|
+
ApiResponse.new(
|
48
|
+
_response, data: decoded, errors: _errors
|
49
|
+
)
|
48
50
|
end
|
49
51
|
|
50
52
|
# Creates a new `BreakType`.
|
@@ -88,7 +90,9 @@ module Square
|
|
88
90
|
# Return appropriate response type.
|
89
91
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
90
92
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
91
|
-
ApiResponse.new(
|
93
|
+
ApiResponse.new(
|
94
|
+
_response, data: decoded, errors: _errors
|
95
|
+
)
|
92
96
|
end
|
93
97
|
|
94
98
|
# Deletes an existing `BreakType`.
|
@@ -102,7 +106,7 @@ module Square
|
|
102
106
|
_query_builder << '/v2/labor/break-types/{id}'
|
103
107
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
104
108
|
_query_builder,
|
105
|
-
'id' => id
|
109
|
+
'id' => { 'value' => id, 'encode' => true }
|
106
110
|
)
|
107
111
|
_query_url = APIHelper.clean_url _query_builder
|
108
112
|
|
@@ -122,7 +126,9 @@ module Square
|
|
122
126
|
# Return appropriate response type.
|
123
127
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
124
128
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
125
|
-
ApiResponse.new(
|
129
|
+
ApiResponse.new(
|
130
|
+
_response, data: decoded, errors: _errors
|
131
|
+
)
|
126
132
|
end
|
127
133
|
|
128
134
|
# Returns a single `BreakType` specified by id.
|
@@ -135,7 +141,7 @@ module Square
|
|
135
141
|
_query_builder << '/v2/labor/break-types/{id}'
|
136
142
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
137
143
|
_query_builder,
|
138
|
-
'id' => id
|
144
|
+
'id' => { 'value' => id, 'encode' => true }
|
139
145
|
)
|
140
146
|
_query_url = APIHelper.clean_url _query_builder
|
141
147
|
|
@@ -155,7 +161,9 @@ module Square
|
|
155
161
|
# Return appropriate response type.
|
156
162
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
157
163
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
158
|
-
ApiResponse.new(
|
164
|
+
ApiResponse.new(
|
165
|
+
_response, data: decoded, errors: _errors
|
166
|
+
)
|
159
167
|
end
|
160
168
|
|
161
169
|
# Updates an existing `BreakType`.
|
@@ -172,7 +180,7 @@ module Square
|
|
172
180
|
_query_builder << '/v2/labor/break-types/{id}'
|
173
181
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
174
182
|
_query_builder,
|
175
|
-
'id' => id
|
183
|
+
'id' => { 'value' => id, 'encode' => true }
|
176
184
|
)
|
177
185
|
_query_url = APIHelper.clean_url _query_builder
|
178
186
|
|
@@ -194,7 +202,9 @@ module Square
|
|
194
202
|
# Return appropriate response type.
|
195
203
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
196
204
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
197
|
-
ApiResponse.new(
|
205
|
+
ApiResponse.new(
|
206
|
+
_response, data: decoded, errors: _errors
|
207
|
+
)
|
198
208
|
end
|
199
209
|
|
200
210
|
# Returns a paginated list of `EmployeeWage` instances for a business.
|
@@ -237,7 +247,9 @@ module Square
|
|
237
247
|
# Return appropriate response type.
|
238
248
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
239
249
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
240
|
-
ApiResponse.new(
|
250
|
+
ApiResponse.new(
|
251
|
+
_response, data: decoded, errors: _errors
|
252
|
+
)
|
241
253
|
end
|
242
254
|
|
243
255
|
# Returns a single `EmployeeWage` specified by id.
|
@@ -251,7 +263,7 @@ module Square
|
|
251
263
|
_query_builder << '/v2/labor/employee-wages/{id}'
|
252
264
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
253
265
|
_query_builder,
|
254
|
-
'id' => id
|
266
|
+
'id' => { 'value' => id, 'encode' => true }
|
255
267
|
)
|
256
268
|
_query_url = APIHelper.clean_url _query_builder
|
257
269
|
|
@@ -271,7 +283,9 @@ module Square
|
|
271
283
|
# Return appropriate response type.
|
272
284
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
273
285
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
274
|
-
ApiResponse.new(
|
286
|
+
ApiResponse.new(
|
287
|
+
_response, data: decoded, errors: _errors
|
288
|
+
)
|
275
289
|
end
|
276
290
|
|
277
291
|
# Creates a new `Shift`.
|
@@ -319,7 +333,9 @@ module Square
|
|
319
333
|
# Return appropriate response type.
|
320
334
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
321
335
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
322
|
-
ApiResponse.new(
|
336
|
+
ApiResponse.new(
|
337
|
+
_response, data: decoded, errors: _errors
|
338
|
+
)
|
323
339
|
end
|
324
340
|
|
325
341
|
# Returns a paginated list of `Shift` records for a business.
|
@@ -363,7 +379,9 @@ module Square
|
|
363
379
|
# Return appropriate response type.
|
364
380
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
365
381
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
366
|
-
ApiResponse.new(
|
382
|
+
ApiResponse.new(
|
383
|
+
_response, data: decoded, errors: _errors
|
384
|
+
)
|
367
385
|
end
|
368
386
|
|
369
387
|
# Deletes a `Shift`.
|
@@ -376,7 +394,7 @@ module Square
|
|
376
394
|
_query_builder << '/v2/labor/shifts/{id}'
|
377
395
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
378
396
|
_query_builder,
|
379
|
-
'id' => id
|
397
|
+
'id' => { 'value' => id, 'encode' => true }
|
380
398
|
)
|
381
399
|
_query_url = APIHelper.clean_url _query_builder
|
382
400
|
|
@@ -396,7 +414,9 @@ module Square
|
|
396
414
|
# Return appropriate response type.
|
397
415
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
398
416
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
399
|
-
ApiResponse.new(
|
417
|
+
ApiResponse.new(
|
418
|
+
_response, data: decoded, errors: _errors
|
419
|
+
)
|
400
420
|
end
|
401
421
|
|
402
422
|
# Returns a single `Shift` specified by id.
|
@@ -409,7 +429,7 @@ module Square
|
|
409
429
|
_query_builder << '/v2/labor/shifts/{id}'
|
410
430
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
411
431
|
_query_builder,
|
412
|
-
'id' => id
|
432
|
+
'id' => { 'value' => id, 'encode' => true }
|
413
433
|
)
|
414
434
|
_query_url = APIHelper.clean_url _query_builder
|
415
435
|
|
@@ -429,7 +449,9 @@ module Square
|
|
429
449
|
# Return appropriate response type.
|
430
450
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
431
451
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
432
|
-
ApiResponse.new(
|
452
|
+
ApiResponse.new(
|
453
|
+
_response, data: decoded, errors: _errors
|
454
|
+
)
|
433
455
|
end
|
434
456
|
|
435
457
|
# Updates an existing `Shift`.
|
@@ -451,7 +473,7 @@ module Square
|
|
451
473
|
_query_builder << '/v2/labor/shifts/{id}'
|
452
474
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
453
475
|
_query_builder,
|
454
|
-
'id' => id
|
476
|
+
'id' => { 'value' => id, 'encode' => true }
|
455
477
|
)
|
456
478
|
_query_url = APIHelper.clean_url _query_builder
|
457
479
|
|
@@ -473,7 +495,9 @@ module Square
|
|
473
495
|
# Return appropriate response type.
|
474
496
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
475
497
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
476
|
-
ApiResponse.new(
|
498
|
+
ApiResponse.new(
|
499
|
+
_response, data: decoded, errors: _errors
|
500
|
+
)
|
477
501
|
end
|
478
502
|
|
479
503
|
# Returns a paginated list of `TeamMemberWage` instances for a business.
|
@@ -515,7 +539,9 @@ module Square
|
|
515
539
|
# Return appropriate response type.
|
516
540
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
517
541
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
518
|
-
ApiResponse.new(
|
542
|
+
ApiResponse.new(
|
543
|
+
_response, data: decoded, errors: _errors
|
544
|
+
)
|
519
545
|
end
|
520
546
|
|
521
547
|
# Returns a single `TeamMemberWage` specified by id.
|
@@ -528,7 +554,7 @@ module Square
|
|
528
554
|
_query_builder << '/v2/labor/team-member-wages/{id}'
|
529
555
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
530
556
|
_query_builder,
|
531
|
-
'id' => id
|
557
|
+
'id' => { 'value' => id, 'encode' => true }
|
532
558
|
)
|
533
559
|
_query_url = APIHelper.clean_url _query_builder
|
534
560
|
|
@@ -548,7 +574,9 @@ module Square
|
|
548
574
|
# Return appropriate response type.
|
549
575
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
550
576
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
551
|
-
ApiResponse.new(
|
577
|
+
ApiResponse.new(
|
578
|
+
_response, data: decoded, errors: _errors
|
579
|
+
)
|
552
580
|
end
|
553
581
|
|
554
582
|
# Returns a list of `WorkweekConfig` instances for a business.
|
@@ -585,7 +613,9 @@ module Square
|
|
585
613
|
# Return appropriate response type.
|
586
614
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
587
615
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
588
|
-
ApiResponse.new(
|
616
|
+
ApiResponse.new(
|
617
|
+
_response, data: decoded, errors: _errors
|
618
|
+
)
|
589
619
|
end
|
590
620
|
|
591
621
|
# Updates a `WorkweekConfig`.
|
@@ -602,7 +632,7 @@ module Square
|
|
602
632
|
_query_builder << '/v2/labor/workweek-configs/{id}'
|
603
633
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
604
634
|
_query_builder,
|
605
|
-
'id' => id
|
635
|
+
'id' => { 'value' => id, 'encode' => true }
|
606
636
|
)
|
607
637
|
_query_url = APIHelper.clean_url _query_builder
|
608
638
|
|
@@ -624,7 +654,9 @@ module Square
|
|
624
654
|
# Return appropriate response type.
|
625
655
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
626
656
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
627
|
-
ApiResponse.new(
|
657
|
+
ApiResponse.new(
|
658
|
+
_response, data: decoded, errors: _errors
|
659
|
+
)
|
628
660
|
end
|
629
661
|
end
|
630
662
|
end
|