square.rb 33.0.0.20231018 → 42.1.0.20250416
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/lib/square/api/apple_pay_api.rb +15 -11
- data/lib/square/api/bank_accounts_api.rb +12 -12
- data/lib/square/api/base_api.rb +2 -1
- data/lib/square/api/booking_custom_attributes_api.rb +44 -44
- data/lib/square/api/bookings_api.rb +53 -53
- data/lib/square/api/cards_api.rb +16 -16
- data/lib/square/api/cash_drawers_api.rb +12 -12
- data/lib/square/api/catalog_api.rb +67 -57
- data/lib/square/api/checkout_api.rb +111 -26
- data/lib/square/api/customer_custom_attributes_api.rb +40 -40
- data/lib/square/api/customer_groups_api.rb +20 -20
- data/lib/square/api/customer_segments_api.rb +8 -8
- data/lib/square/api/customers_api.rb +144 -54
- data/lib/square/api/devices_api.rb +20 -20
- data/lib/square/api/disputes_api.rb +36 -36
- data/lib/square/api/employees_api.rb +8 -8
- data/lib/square/api/events_api.rb +84 -0
- data/lib/square/api/gift_card_activities_api.rb +10 -11
- data/lib/square/api/gift_cards_api.rb +36 -33
- data/lib/square/api/inventory_api.rb +52 -52
- data/lib/square/api/invoices_api.rb +109 -41
- data/lib/square/api/labor_api.rb +81 -80
- data/lib/square/api/location_custom_attributes_api.rb +44 -44
- data/lib/square/api/locations_api.rb +18 -17
- data/lib/square/api/loyalty_api.rb +72 -72
- data/lib/square/api/merchant_custom_attributes_api.rb +44 -44
- data/lib/square/api/merchants_api.rb +8 -8
- data/lib/square/api/mobile_authorization_api.rb +4 -4
- data/lib/square/api/o_auth_api.rb +15 -69
- data/lib/square/api/order_custom_attributes_api.rb +44 -44
- data/lib/square/api/orders_api.rb +32 -32
- data/lib/square/api/payments_api.rb +67 -31
- data/lib/square/api/payouts_api.rb +12 -12
- data/lib/square/api/refunds_api.rb +31 -13
- data/lib/square/api/sites_api.rb +4 -4
- data/lib/square/api/snippets_api.rb +12 -12
- data/lib/square/api/subscriptions_api.rb +48 -48
- data/lib/square/api/team_api.rb +146 -40
- data/lib/square/api/terminal_api.rb +95 -53
- data/lib/square/api/transactions_api.rb +16 -16
- data/lib/square/api/v1_transactions_api.rb +13 -292
- data/lib/square/api/vendors_api.rb +28 -28
- data/lib/square/api/webhook_subscriptions_api.rb +32 -32
- data/lib/square/client.rb +32 -24
- data/lib/square/configuration.rb +43 -15
- data/lib/square/http/api_response.rb +1 -1
- data/lib/square/http/auth/o_auth2.rb +21 -2
- data/lib/square.rb +4 -3
- data/test/api/api_test_base.rb +1 -1
- data/test/api/test_locations_api.rb +1 -1
- data/test/api/test_refunds_api.rb +4 -1
- data/test/webhooks/test_webhooks_helper.rb +17 -0
- metadata +12 -17
@@ -29,7 +29,7 @@ module Square
|
|
29
29
|
# @param [TrueClass | FalseClass] count Optional parameter: Indicates
|
30
30
|
# whether to return the total count of customers in the `count` field of the
|
31
31
|
# response. The default value is `false`.
|
32
|
-
# @return [
|
32
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
33
33
|
def list_customers(cursor: nil,
|
34
34
|
limit: nil,
|
35
35
|
sort_field: nil,
|
@@ -47,9 +47,9 @@ module Square
|
|
47
47
|
.header_param(new_parameter('application/json', key: 'accept'))
|
48
48
|
.auth(Single.new('global')))
|
49
49
|
.response(new_response_handler
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
51
|
+
.is_api_response(true)
|
52
|
+
.convertor(ApiResponse.method(:create)))
|
53
53
|
.execute
|
54
54
|
end
|
55
55
|
|
@@ -65,7 +65,7 @@ module Square
|
|
65
65
|
# @param [CreateCustomerRequest] body Required parameter: An object
|
66
66
|
# containing the fields to POST for the request. See the corresponding
|
67
67
|
# object definition for field details.
|
68
|
-
# @return [
|
68
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
69
69
|
def create_customer(body:)
|
70
70
|
new_api_call_builder
|
71
71
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -77,9 +77,112 @@ module Square
|
|
77
77
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
78
78
|
.auth(Single.new('global')))
|
79
79
|
.response(new_response_handler
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
81
|
+
.is_api_response(true)
|
82
|
+
.convertor(ApiResponse.method(:create)))
|
83
|
+
.execute
|
84
|
+
end
|
85
|
+
|
86
|
+
# Creates multiple [customer profiles]($m/Customer) for a business.
|
87
|
+
# This endpoint takes a map of individual create requests and returns a map
|
88
|
+
# of responses.
|
89
|
+
# You must provide at least one of the following values in each create
|
90
|
+
# request:
|
91
|
+
# - `given_name`
|
92
|
+
# - `family_name`
|
93
|
+
# - `company_name`
|
94
|
+
# - `email_address`
|
95
|
+
# - `phone_number`
|
96
|
+
# @param [BulkCreateCustomersRequest] body Required parameter: An object
|
97
|
+
# containing the fields to POST for the request. See the corresponding
|
98
|
+
# object definition for field details.
|
99
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
100
|
+
def bulk_create_customers(body:)
|
101
|
+
new_api_call_builder
|
102
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
103
|
+
'/v2/customers/bulk-create',
|
104
|
+
'default')
|
105
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
106
|
+
.body_param(new_parameter(body))
|
107
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
108
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
109
|
+
.auth(Single.new('global')))
|
110
|
+
.response(new_response_handler
|
111
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
112
|
+
.is_api_response(true)
|
113
|
+
.convertor(ApiResponse.method(:create)))
|
114
|
+
.execute
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deletes multiple customer profiles.
|
118
|
+
# The endpoint takes a list of customer IDs and returns a map of responses.
|
119
|
+
# @param [BulkDeleteCustomersRequest] body Required parameter: An object
|
120
|
+
# containing the fields to POST for the request. See the corresponding
|
121
|
+
# object definition for field details.
|
122
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
123
|
+
def bulk_delete_customers(body:)
|
124
|
+
new_api_call_builder
|
125
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
126
|
+
'/v2/customers/bulk-delete',
|
127
|
+
'default')
|
128
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
129
|
+
.body_param(new_parameter(body))
|
130
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
131
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
132
|
+
.auth(Single.new('global')))
|
133
|
+
.response(new_response_handler
|
134
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
135
|
+
.is_api_response(true)
|
136
|
+
.convertor(ApiResponse.method(:create)))
|
137
|
+
.execute
|
138
|
+
end
|
139
|
+
|
140
|
+
# Retrieves multiple customer profiles.
|
141
|
+
# This endpoint takes a list of customer IDs and returns a map of responses.
|
142
|
+
# @param [BulkRetrieveCustomersRequest] body Required parameter: An object
|
143
|
+
# containing the fields to POST for the request. See the corresponding
|
144
|
+
# object definition for field details.
|
145
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
146
|
+
def bulk_retrieve_customers(body:)
|
147
|
+
new_api_call_builder
|
148
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
149
|
+
'/v2/customers/bulk-retrieve',
|
150
|
+
'default')
|
151
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
152
|
+
.body_param(new_parameter(body))
|
153
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
154
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
155
|
+
.auth(Single.new('global')))
|
156
|
+
.response(new_response_handler
|
157
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
158
|
+
.is_api_response(true)
|
159
|
+
.convertor(ApiResponse.method(:create)))
|
160
|
+
.execute
|
161
|
+
end
|
162
|
+
|
163
|
+
# Updates multiple customer profiles.
|
164
|
+
# This endpoint takes a map of individual update requests and returns a map
|
165
|
+
# of responses.
|
166
|
+
# You cannot use this endpoint to change cards on file. To make changes, use
|
167
|
+
# the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards).
|
168
|
+
# @param [BulkUpdateCustomersRequest] body Required parameter: An object
|
169
|
+
# containing the fields to POST for the request. See the corresponding
|
170
|
+
# object definition for field details.
|
171
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
172
|
+
def bulk_update_customers(body:)
|
173
|
+
new_api_call_builder
|
174
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
175
|
+
'/v2/customers/bulk-update',
|
176
|
+
'default')
|
177
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
178
|
+
.body_param(new_parameter(body))
|
179
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
180
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
181
|
+
.auth(Single.new('global')))
|
182
|
+
.response(new_response_handler
|
183
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
184
|
+
.is_api_response(true)
|
185
|
+
.convertor(ApiResponse.method(:create)))
|
83
186
|
.execute
|
84
187
|
end
|
85
188
|
|
@@ -97,7 +200,7 @@ module Square
|
|
97
200
|
# @param [SearchCustomersRequest] body Required parameter: An object
|
98
201
|
# containing the fields to POST for the request. See the corresponding
|
99
202
|
# object definition for field details.
|
100
|
-
# @return [
|
203
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
101
204
|
def search_customers(body:)
|
102
205
|
new_api_call_builder
|
103
206
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -109,20 +212,14 @@ module Square
|
|
109
212
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
110
213
|
.auth(Single.new('global')))
|
111
214
|
.response(new_response_handler
|
112
|
-
|
113
|
-
|
114
|
-
|
215
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
216
|
+
.is_api_response(true)
|
217
|
+
.convertor(ApiResponse.method(:create)))
|
115
218
|
.execute
|
116
219
|
end
|
117
220
|
|
118
221
|
# Deletes a customer profile from a business. This operation also unlinks
|
119
222
|
# any associated cards on file.
|
120
|
-
# As a best practice, include the `version` field in the request to enable
|
121
|
-
# [optimistic
|
122
|
-
# concurrency](https://developer.squareup.com/docs/build-basics/common-api-p
|
123
|
-
# atterns/optimistic-concurrency) control.
|
124
|
-
# If included, the value must be set to the current version of the customer
|
125
|
-
# profile.
|
126
223
|
# To delete a customer profile that was created by merging existing
|
127
224
|
# profiles, you must use the ID of the newly created profile.
|
128
225
|
# @param [String] customer_id Required parameter: The ID of the customer to
|
@@ -135,7 +232,7 @@ module Square
|
|
135
232
|
# [Delete a customer
|
136
233
|
# profile](https://developer.squareup.com/docs/customers-api/use-the-api/kee
|
137
234
|
# p-records#delete-customer-profile).
|
138
|
-
# @return [
|
235
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
139
236
|
def delete_customer(customer_id:,
|
140
237
|
version: nil)
|
141
238
|
new_api_call_builder
|
@@ -148,16 +245,16 @@ module Square
|
|
148
245
|
.header_param(new_parameter('application/json', key: 'accept'))
|
149
246
|
.auth(Single.new('global')))
|
150
247
|
.response(new_response_handler
|
151
|
-
|
152
|
-
|
153
|
-
|
248
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
249
|
+
.is_api_response(true)
|
250
|
+
.convertor(ApiResponse.method(:create)))
|
154
251
|
.execute
|
155
252
|
end
|
156
253
|
|
157
254
|
# Returns details for a single customer.
|
158
255
|
# @param [String] customer_id Required parameter: The ID of the customer to
|
159
256
|
# retrieve.
|
160
|
-
# @return [
|
257
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
161
258
|
def retrieve_customer(customer_id:)
|
162
259
|
new_api_call_builder
|
163
260
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -168,23 +265,16 @@ module Square
|
|
168
265
|
.header_param(new_parameter('application/json', key: 'accept'))
|
169
266
|
.auth(Single.new('global')))
|
170
267
|
.response(new_response_handler
|
171
|
-
|
172
|
-
|
173
|
-
|
268
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
269
|
+
.is_api_response(true)
|
270
|
+
.convertor(ApiResponse.method(:create)))
|
174
271
|
.execute
|
175
272
|
end
|
176
273
|
|
177
274
|
# Updates a customer profile. This endpoint supports sparse updates, so only
|
178
275
|
# new or changed fields are required in the request.
|
179
276
|
# To add or update a field, specify the new value. To remove a field,
|
180
|
-
# specify `null
|
181
|
-
# (recommended) or specify an empty string (string fields only).
|
182
|
-
# As a best practice, include the `version` field in the request to enable
|
183
|
-
# [optimistic
|
184
|
-
# concurrency](https://developer.squareup.com/docs/build-basics/common-api-p
|
185
|
-
# atterns/optimistic-concurrency) control.
|
186
|
-
# If included, the value must be set to the current version of the customer
|
187
|
-
# profile.
|
277
|
+
# specify `null`.
|
188
278
|
# To update a customer profile that was created by merging existing
|
189
279
|
# profiles, you must use the ID of the newly created profile.
|
190
280
|
# You cannot use this endpoint to change cards on file. To make changes, use
|
@@ -194,7 +284,7 @@ module Square
|
|
194
284
|
# @param [UpdateCustomerRequest] body Required parameter: An object
|
195
285
|
# containing the fields to POST for the request. See the corresponding
|
196
286
|
# object definition for field details.
|
197
|
-
# @return [
|
287
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
198
288
|
def update_customer(customer_id:,
|
199
289
|
body:)
|
200
290
|
new_api_call_builder
|
@@ -209,9 +299,9 @@ module Square
|
|
209
299
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
210
300
|
.auth(Single.new('global')))
|
211
301
|
.response(new_response_handler
|
212
|
-
|
213
|
-
|
214
|
-
|
302
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
303
|
+
.is_api_response(true)
|
304
|
+
.convertor(ApiResponse.method(:create)))
|
215
305
|
.execute
|
216
306
|
end
|
217
307
|
|
@@ -225,7 +315,7 @@ module Square
|
|
225
315
|
# @param [CreateCustomerCardRequest] body Required parameter: An object
|
226
316
|
# containing the fields to POST for the request. See the corresponding
|
227
317
|
# object definition for field details.
|
228
|
-
# @return [
|
318
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
229
319
|
def create_customer_card(customer_id:,
|
230
320
|
body:)
|
231
321
|
warn 'Endpoint create_customer_card in CustomersApi is deprecated'
|
@@ -241,9 +331,9 @@ module Square
|
|
241
331
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
242
332
|
.auth(Single.new('global')))
|
243
333
|
.response(new_response_handler
|
244
|
-
|
245
|
-
|
246
|
-
|
334
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
335
|
+
.is_api_response(true)
|
336
|
+
.convertor(ApiResponse.method(:create)))
|
247
337
|
.execute
|
248
338
|
end
|
249
339
|
|
@@ -252,7 +342,7 @@ module Square
|
|
252
342
|
# that the card on file belongs to.
|
253
343
|
# @param [String] card_id Required parameter: The ID of the card on file to
|
254
344
|
# delete.
|
255
|
-
# @return [
|
345
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
256
346
|
def delete_customer_card(customer_id:,
|
257
347
|
card_id:)
|
258
348
|
warn 'Endpoint delete_customer_card in CustomersApi is deprecated'
|
@@ -267,9 +357,9 @@ module Square
|
|
267
357
|
.header_param(new_parameter('application/json', key: 'accept'))
|
268
358
|
.auth(Single.new('global')))
|
269
359
|
.response(new_response_handler
|
270
|
-
|
271
|
-
|
272
|
-
|
360
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
361
|
+
.is_api_response(true)
|
362
|
+
.convertor(ApiResponse.method(:create)))
|
273
363
|
.execute
|
274
364
|
end
|
275
365
|
|
@@ -280,7 +370,7 @@ module Square
|
|
280
370
|
# remove from the group.
|
281
371
|
# @param [String] group_id Required parameter: The ID of the customer group
|
282
372
|
# to remove the customer from.
|
283
|
-
# @return [
|
373
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
284
374
|
def remove_group_from_customer(customer_id:,
|
285
375
|
group_id:)
|
286
376
|
new_api_call_builder
|
@@ -294,9 +384,9 @@ module Square
|
|
294
384
|
.header_param(new_parameter('application/json', key: 'accept'))
|
295
385
|
.auth(Single.new('global')))
|
296
386
|
.response(new_response_handler
|
297
|
-
|
298
|
-
|
299
|
-
|
387
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
388
|
+
.is_api_response(true)
|
389
|
+
.convertor(ApiResponse.method(:create)))
|
300
390
|
.execute
|
301
391
|
end
|
302
392
|
|
@@ -307,7 +397,7 @@ module Square
|
|
307
397
|
# add to a group.
|
308
398
|
# @param [String] group_id Required parameter: The ID of the customer group
|
309
399
|
# to add the customer to.
|
310
|
-
# @return [
|
400
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
311
401
|
def add_group_to_customer(customer_id:,
|
312
402
|
group_id:)
|
313
403
|
new_api_call_builder
|
@@ -321,9 +411,9 @@ module Square
|
|
321
411
|
.header_param(new_parameter('application/json', key: 'accept'))
|
322
412
|
.auth(Single.new('global')))
|
323
413
|
.response(new_response_handler
|
324
|
-
|
325
|
-
|
326
|
-
|
414
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
415
|
+
.is_api_response(true)
|
416
|
+
.convertor(ApiResponse.method(:create)))
|
327
417
|
.execute
|
328
418
|
end
|
329
419
|
end
|
@@ -15,7 +15,7 @@ module Square
|
|
15
15
|
# in a single page.
|
16
16
|
# @param [String] location_id Optional parameter: If present, only returns
|
17
17
|
# devices at the target location.
|
18
|
-
# @return [
|
18
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
19
19
|
def list_devices(cursor: nil,
|
20
20
|
sort_order: nil,
|
21
21
|
limit: nil,
|
@@ -31,9 +31,9 @@ module Square
|
|
31
31
|
.header_param(new_parameter('application/json', key: 'accept'))
|
32
32
|
.auth(Single.new('global')))
|
33
33
|
.response(new_response_handler
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
35
|
+
.is_api_response(true)
|
36
|
+
.convertor(ApiResponse.method(:create)))
|
37
37
|
.execute
|
38
38
|
end
|
39
39
|
|
@@ -52,7 +52,7 @@ module Square
|
|
52
52
|
# @param [DeviceCodeStatus] status Optional parameter: If specified, returns
|
53
53
|
# DeviceCodes with the specified statuses. Returns DeviceCodes of status
|
54
54
|
# `PAIRED` and `UNPAIRED` if empty.
|
55
|
-
# @return [
|
55
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
56
56
|
def list_device_codes(cursor: nil,
|
57
57
|
location_id: nil,
|
58
58
|
product_type: nil,
|
@@ -68,9 +68,9 @@ module Square
|
|
68
68
|
.header_param(new_parameter('application/json', key: 'accept'))
|
69
69
|
.auth(Single.new('global')))
|
70
70
|
.response(new_response_handler
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
72
|
+
.is_api_response(true)
|
73
|
+
.convertor(ApiResponse.method(:create)))
|
74
74
|
.execute
|
75
75
|
end
|
76
76
|
|
@@ -80,7 +80,7 @@ module Square
|
|
80
80
|
# @param [CreateDeviceCodeRequest] body Required parameter: An object
|
81
81
|
# containing the fields to POST for the request. See the corresponding
|
82
82
|
# object definition for field details.
|
83
|
-
# @return [
|
83
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
84
84
|
def create_device_code(body:)
|
85
85
|
new_api_call_builder
|
86
86
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -92,16 +92,16 @@ module Square
|
|
92
92
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
93
93
|
.auth(Single.new('global')))
|
94
94
|
.response(new_response_handler
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
96
|
+
.is_api_response(true)
|
97
|
+
.convertor(ApiResponse.method(:create)))
|
98
98
|
.execute
|
99
99
|
end
|
100
100
|
|
101
101
|
# Retrieves DeviceCode with the associated ID.
|
102
102
|
# @param [String] id Required parameter: The unique identifier for the
|
103
103
|
# device code.
|
104
|
-
# @return [
|
104
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
105
105
|
def get_device_code(id:)
|
106
106
|
new_api_call_builder
|
107
107
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -112,16 +112,16 @@ module Square
|
|
112
112
|
.header_param(new_parameter('application/json', key: 'accept'))
|
113
113
|
.auth(Single.new('global')))
|
114
114
|
.response(new_response_handler
|
115
|
-
|
116
|
-
|
117
|
-
|
115
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
116
|
+
.is_api_response(true)
|
117
|
+
.convertor(ApiResponse.method(:create)))
|
118
118
|
.execute
|
119
119
|
end
|
120
120
|
|
121
121
|
# Retrieves Device with the associated `device_id`.
|
122
122
|
# @param [String] device_id Required parameter: The unique ID for the
|
123
123
|
# desired `Device`.
|
124
|
-
# @return [
|
124
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
125
125
|
def get_device(device_id:)
|
126
126
|
new_api_call_builder
|
127
127
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -132,9 +132,9 @@ module Square
|
|
132
132
|
.header_param(new_parameter('application/json', key: 'accept'))
|
133
133
|
.auth(Single.new('global')))
|
134
134
|
.response(new_response_handler
|
135
|
-
|
136
|
-
|
137
|
-
|
135
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
136
|
+
.is_api_response(true)
|
137
|
+
.convertor(ApiResponse.method(:create)))
|
138
138
|
.execute
|
139
139
|
end
|
140
140
|
end
|
@@ -13,7 +13,7 @@ module Square
|
|
13
13
|
# @param [String] location_id Optional parameter: The ID of the location for
|
14
14
|
# which to return a list of disputes. If not specified, the endpoint returns
|
15
15
|
# disputes associated with all locations.
|
16
|
-
# @return [
|
16
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
17
17
|
def list_disputes(cursor: nil,
|
18
18
|
states: nil,
|
19
19
|
location_id: nil)
|
@@ -27,16 +27,16 @@ module Square
|
|
27
27
|
.header_param(new_parameter('application/json', key: 'accept'))
|
28
28
|
.auth(Single.new('global')))
|
29
29
|
.response(new_response_handler
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
31
|
+
.is_api_response(true)
|
32
|
+
.convertor(ApiResponse.method(:create)))
|
33
33
|
.execute
|
34
34
|
end
|
35
35
|
|
36
36
|
# Returns details about a specific dispute.
|
37
37
|
# @param [String] dispute_id Required parameter: The ID of the dispute you
|
38
38
|
# want more details about.
|
39
|
-
# @return [
|
39
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
40
40
|
def retrieve_dispute(dispute_id:)
|
41
41
|
new_api_call_builder
|
42
42
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -47,9 +47,9 @@ module Square
|
|
47
47
|
.header_param(new_parameter('application/json', key: 'accept'))
|
48
48
|
.auth(Single.new('global')))
|
49
49
|
.response(new_response_handler
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
51
|
+
.is_api_response(true)
|
52
|
+
.convertor(ApiResponse.method(:create)))
|
53
53
|
.execute
|
54
54
|
end
|
55
55
|
|
@@ -61,7 +61,7 @@ module Square
|
|
61
61
|
# does not have sufficient funds, Square debits the associated bank account.
|
62
62
|
# @param [String] dispute_id Required parameter: The ID of the dispute you
|
63
63
|
# want to accept.
|
64
|
-
# @return [
|
64
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
65
65
|
def accept_dispute(dispute_id:)
|
66
66
|
new_api_call_builder
|
67
67
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -72,9 +72,9 @@ module Square
|
|
72
72
|
.header_param(new_parameter('application/json', key: 'accept'))
|
73
73
|
.auth(Single.new('global')))
|
74
74
|
.response(new_response_handler
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
76
|
+
.is_api_response(true)
|
77
|
+
.convertor(ApiResponse.method(:create)))
|
78
78
|
.execute
|
79
79
|
end
|
80
80
|
|
@@ -85,7 +85,7 @@ module Square
|
|
85
85
|
# set of results for the original query. For more information, see
|
86
86
|
# [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
|
87
87
|
# atterns/pagination).
|
88
|
-
# @return [
|
88
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
89
89
|
def list_dispute_evidence(dispute_id:,
|
90
90
|
cursor: nil)
|
91
91
|
new_api_call_builder
|
@@ -98,9 +98,9 @@ module Square
|
|
98
98
|
.header_param(new_parameter('application/json', key: 'accept'))
|
99
99
|
.auth(Single.new('global')))
|
100
100
|
.response(new_response_handler
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
102
|
+
.is_api_response(true)
|
103
|
+
.convertor(ApiResponse.method(:create)))
|
104
104
|
.execute
|
105
105
|
end
|
106
106
|
|
@@ -113,7 +113,7 @@ module Square
|
|
113
113
|
# @param [CreateDisputeEvidenceFileRequest] request Optional parameter:
|
114
114
|
# Defines the parameters for a `CreateDisputeEvidenceFile` request.
|
115
115
|
# @param [File | UploadIO] image_file Optional parameter: Example:
|
116
|
-
# @return [
|
116
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
117
117
|
def create_dispute_evidence_file(dispute_id:,
|
118
118
|
request: nil,
|
119
119
|
image_file: nil)
|
@@ -130,9 +130,9 @@ module Square
|
|
130
130
|
.header_param(new_parameter('application/json', key: 'accept'))
|
131
131
|
.auth(Single.new('global')))
|
132
132
|
.response(new_response_handler
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
134
|
+
.is_api_response(true)
|
135
|
+
.convertor(ApiResponse.method(:create)))
|
136
136
|
.execute
|
137
137
|
end
|
138
138
|
|
@@ -142,7 +142,7 @@ module Square
|
|
142
142
|
# @param [CreateDisputeEvidenceTextRequest] body Required parameter: An
|
143
143
|
# object containing the fields to POST for the request. See the
|
144
144
|
# corresponding object definition for field details.
|
145
|
-
# @return [
|
145
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
146
146
|
def create_dispute_evidence_text(dispute_id:,
|
147
147
|
body:)
|
148
148
|
new_api_call_builder
|
@@ -157,9 +157,9 @@ module Square
|
|
157
157
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
158
158
|
.auth(Single.new('global')))
|
159
159
|
.response(new_response_handler
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
161
|
+
.is_api_response(true)
|
162
|
+
.convertor(ApiResponse.method(:create)))
|
163
163
|
.execute
|
164
164
|
end
|
165
165
|
|
@@ -169,7 +169,7 @@ module Square
|
|
169
169
|
# which you want to remove evidence.
|
170
170
|
# @param [String] evidence_id Required parameter: The ID of the evidence you
|
171
171
|
# want to remove.
|
172
|
-
# @return [
|
172
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
173
173
|
def delete_dispute_evidence(dispute_id:,
|
174
174
|
evidence_id:)
|
175
175
|
new_api_call_builder
|
@@ -183,9 +183,9 @@ module Square
|
|
183
183
|
.header_param(new_parameter('application/json', key: 'accept'))
|
184
184
|
.auth(Single.new('global')))
|
185
185
|
.response(new_response_handler
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
187
|
+
.is_api_response(true)
|
188
|
+
.convertor(ApiResponse.method(:create)))
|
189
189
|
.execute
|
190
190
|
end
|
191
191
|
|
@@ -196,7 +196,7 @@ module Square
|
|
196
196
|
# which you want to retrieve evidence metadata.
|
197
197
|
# @param [String] evidence_id Required parameter: The ID of the evidence to
|
198
198
|
# retrieve.
|
199
|
-
# @return [
|
199
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
200
200
|
def retrieve_dispute_evidence(dispute_id:,
|
201
201
|
evidence_id:)
|
202
202
|
new_api_call_builder
|
@@ -210,9 +210,9 @@ module Square
|
|
210
210
|
.header_param(new_parameter('application/json', key: 'accept'))
|
211
211
|
.auth(Single.new('global')))
|
212
212
|
.response(new_response_handler
|
213
|
-
|
214
|
-
|
215
|
-
|
213
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
214
|
+
.is_api_response(true)
|
215
|
+
.convertor(ApiResponse.method(:create)))
|
216
216
|
.execute
|
217
217
|
end
|
218
218
|
|
@@ -227,7 +227,7 @@ module Square
|
|
227
227
|
# a dispute after submission.
|
228
228
|
# @param [String] dispute_id Required parameter: The ID of the dispute for
|
229
229
|
# which you want to submit evidence.
|
230
|
-
# @return [
|
230
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
231
231
|
def submit_evidence(dispute_id:)
|
232
232
|
new_api_call_builder
|
233
233
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -238,9 +238,9 @@ module Square
|
|
238
238
|
.header_param(new_parameter('application/json', key: 'accept'))
|
239
239
|
.auth(Single.new('global')))
|
240
240
|
.response(new_response_handler
|
241
|
-
|
242
|
-
|
243
|
-
|
241
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
242
|
+
.is_api_response(true)
|
243
|
+
.convertor(ApiResponse.method(:create)))
|
244
244
|
.execute
|
245
245
|
end
|
246
246
|
end
|