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
@@ -20,7 +20,7 @@ module Square
|
|
20
20
|
# @param [BatchDeleteCatalogObjectsRequest] body Required parameter: An
|
21
21
|
# object containing the fields to POST for the request. See the
|
22
22
|
# corresponding object definition for field details.
|
23
|
-
# @return [
|
23
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
24
24
|
def batch_delete_catalog_objects(body:)
|
25
25
|
new_api_call_builder
|
26
26
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -32,9 +32,9 @@ module Square
|
|
32
32
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
33
33
|
.auth(Single.new('global')))
|
34
34
|
.response(new_response_handler
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
36
|
+
.is_api_response(true)
|
37
|
+
.convertor(ApiResponse.method(:create)))
|
38
38
|
.execute
|
39
39
|
end
|
40
40
|
|
@@ -47,7 +47,7 @@ module Square
|
|
47
47
|
# @param [BatchRetrieveCatalogObjectsRequest] body Required parameter: An
|
48
48
|
# object containing the fields to POST for the request. See the
|
49
49
|
# corresponding object definition for field details.
|
50
|
-
# @return [
|
50
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
51
51
|
def batch_retrieve_catalog_objects(body:)
|
52
52
|
new_api_call_builder
|
53
53
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -59,9 +59,9 @@ module Square
|
|
59
59
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
60
60
|
.auth(Single.new('global')))
|
61
61
|
.response(new_response_handler
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
63
|
+
.is_api_response(true)
|
64
|
+
.convertor(ApiResponse.method(:create)))
|
65
65
|
.execute
|
66
66
|
end
|
67
67
|
|
@@ -87,7 +87,7 @@ module Square
|
|
87
87
|
# @param [BatchUpsertCatalogObjectsRequest] body Required parameter: An
|
88
88
|
# object containing the fields to POST for the request. See the
|
89
89
|
# corresponding object definition for field details.
|
90
|
-
# @return [
|
90
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
91
91
|
def batch_upsert_catalog_objects(body:)
|
92
92
|
new_api_call_builder
|
93
93
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -99,9 +99,9 @@ module Square
|
|
99
99
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
100
100
|
.auth(Single.new('global')))
|
101
101
|
.response(new_response_handler
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
103
|
+
.is_api_response(true)
|
104
|
+
.convertor(ApiResponse.method(:create)))
|
105
105
|
.execute
|
106
106
|
end
|
107
107
|
|
@@ -115,7 +115,7 @@ module Square
|
|
115
115
|
# JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
|
116
116
|
# @param [CreateCatalogImageRequest] request Optional parameter: Example:
|
117
117
|
# @param [File | UploadIO] image_file Optional parameter: Example:
|
118
|
-
# @return [
|
118
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
119
119
|
def create_catalog_image(request: nil,
|
120
120
|
image_file: nil)
|
121
121
|
new_api_call_builder
|
@@ -129,9 +129,9 @@ module Square
|
|
129
129
|
.header_param(new_parameter('application/json', key: 'accept'))
|
130
130
|
.auth(Single.new('global')))
|
131
131
|
.response(new_response_handler
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
133
|
+
.is_api_response(true)
|
134
|
+
.convertor(ApiResponse.method(:create)))
|
135
135
|
.execute
|
136
136
|
end
|
137
137
|
|
@@ -144,7 +144,7 @@ module Square
|
|
144
144
|
# object to update the encapsulated image file.
|
145
145
|
# @param [UpdateCatalogImageRequest] request Optional parameter: Example:
|
146
146
|
# @param [File | UploadIO] image_file Optional parameter: Example:
|
147
|
-
# @return [
|
147
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
148
148
|
def update_catalog_image(image_id:,
|
149
149
|
request: nil,
|
150
150
|
image_file: nil)
|
@@ -161,15 +161,15 @@ module Square
|
|
161
161
|
.header_param(new_parameter('application/json', key: 'accept'))
|
162
162
|
.auth(Single.new('global')))
|
163
163
|
.response(new_response_handler
|
164
|
-
|
165
|
-
|
166
|
-
|
164
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
165
|
+
.is_api_response(true)
|
166
|
+
.convertor(ApiResponse.method(:create)))
|
167
167
|
.execute
|
168
168
|
end
|
169
169
|
|
170
170
|
# Retrieves information about the Square Catalog API, such as batch size
|
171
171
|
# limits that can be used by the `BatchUpsertCatalogObjects` endpoint.
|
172
|
-
# @return [
|
172
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
173
173
|
def catalog_info
|
174
174
|
new_api_call_builder
|
175
175
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -178,9 +178,9 @@ module Square
|
|
178
178
|
.header_param(new_parameter('application/json', key: 'accept'))
|
179
179
|
.auth(Single.new('global')))
|
180
180
|
.response(new_response_handler
|
181
|
-
|
182
|
-
|
183
|
-
|
181
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
182
|
+
.is_api_response(true)
|
183
|
+
.convertor(ApiResponse.method(:create)))
|
184
184
|
.execute
|
185
185
|
end
|
186
186
|
|
@@ -218,7 +218,7 @@ module Square
|
|
218
218
|
# matched against the [CatalogObject]($m/CatalogObject)s' `version`
|
219
219
|
# attribute. If not included, results will be from the current version of
|
220
220
|
# the catalog.
|
221
|
-
# @return [
|
221
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
222
222
|
def list_catalog(cursor: nil,
|
223
223
|
types: nil,
|
224
224
|
catalog_version: nil)
|
@@ -232,9 +232,9 @@ module Square
|
|
232
232
|
.header_param(new_parameter('application/json', key: 'accept'))
|
233
233
|
.auth(Single.new('global')))
|
234
234
|
.response(new_response_handler
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
236
|
+
.is_api_response(true)
|
237
|
+
.convertor(ApiResponse.method(:create)))
|
238
238
|
.execute
|
239
239
|
end
|
240
240
|
|
@@ -247,7 +247,7 @@ module Square
|
|
247
247
|
# @param [UpsertCatalogObjectRequest] body Required parameter: An object
|
248
248
|
# containing the fields to POST for the request. See the corresponding
|
249
249
|
# object definition for field details.
|
250
|
-
# @return [
|
250
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
251
251
|
def upsert_catalog_object(body:)
|
252
252
|
new_api_call_builder
|
253
253
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -259,9 +259,9 @@ module Square
|
|
259
259
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
260
260
|
.auth(Single.new('global')))
|
261
261
|
.response(new_response_handler
|
262
|
-
|
263
|
-
|
264
|
-
|
262
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
263
|
+
.is_api_response(true)
|
264
|
+
.convertor(ApiResponse.method(:create)))
|
265
265
|
.execute
|
266
266
|
end
|
267
267
|
|
@@ -282,7 +282,7 @@ module Square
|
|
282
282
|
# to be deleted. When an object is deleted, other objects in the graph that
|
283
283
|
# depend on that object will be deleted as well (for example, deleting a
|
284
284
|
# catalog item will delete its catalog item variations).
|
285
|
-
# @return [
|
285
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
286
286
|
def delete_catalog_object(object_id:)
|
287
287
|
new_api_call_builder
|
288
288
|
.request(new_request_builder(HttpMethodEnum::DELETE,
|
@@ -293,9 +293,9 @@ module Square
|
|
293
293
|
.header_param(new_parameter('application/json', key: 'accept'))
|
294
294
|
.auth(Single.new('global')))
|
295
295
|
.response(new_response_handler
|
296
|
-
|
297
|
-
|
298
|
-
|
296
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
297
|
+
.is_api_response(true)
|
298
|
+
.convertor(ApiResponse.method(:create)))
|
299
299
|
.execute
|
300
300
|
end
|
301
301
|
|
@@ -328,10 +328,19 @@ module Square
|
|
328
328
|
# of an object can be found in the version field of
|
329
329
|
# [CatalogObject]($m/CatalogObject)s. If not included, results will be from
|
330
330
|
# the current version of the catalog.
|
331
|
-
# @
|
331
|
+
# @param [TrueClass | FalseClass] include_category_path_to_root Optional
|
332
|
+
# parameter: Specifies whether or not to include the `path_to_root` list for
|
333
|
+
# each returned category instance. The `path_to_root` list consists of
|
334
|
+
# `CategoryPathToRootNode` objects and specifies the path that starts with
|
335
|
+
# the immediate parent category of the returned category and ends with its
|
336
|
+
# root category. If the returned category is a top-level category, the
|
337
|
+
# `path_to_root` list is empty and is not returned in the response
|
338
|
+
# payload.
|
339
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
332
340
|
def retrieve_catalog_object(object_id:,
|
333
341
|
include_related_objects: false,
|
334
|
-
catalog_version: nil
|
342
|
+
catalog_version: nil,
|
343
|
+
include_category_path_to_root: false)
|
335
344
|
new_api_call_builder
|
336
345
|
.request(new_request_builder(HttpMethodEnum::GET,
|
337
346
|
'/v2/catalog/object/{object_id}',
|
@@ -340,12 +349,13 @@ module Square
|
|
340
349
|
.should_encode(true))
|
341
350
|
.query_param(new_parameter(include_related_objects, key: 'include_related_objects'))
|
342
351
|
.query_param(new_parameter(catalog_version, key: 'catalog_version'))
|
352
|
+
.query_param(new_parameter(include_category_path_to_root, key: 'include_category_path_to_root'))
|
343
353
|
.header_param(new_parameter('application/json', key: 'accept'))
|
344
354
|
.auth(Single.new('global')))
|
345
355
|
.response(new_response_handler
|
346
|
-
|
347
|
-
|
348
|
-
|
356
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
357
|
+
.is_api_response(true)
|
358
|
+
.convertor(ApiResponse.method(:create)))
|
349
359
|
.execute
|
350
360
|
end
|
351
361
|
|
@@ -369,7 +379,7 @@ module Square
|
|
369
379
|
# @param [SearchCatalogObjectsRequest] body Required parameter: An object
|
370
380
|
# containing the fields to POST for the request. See the corresponding
|
371
381
|
# object definition for field details.
|
372
|
-
# @return [
|
382
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
373
383
|
def search_catalog_objects(body:)
|
374
384
|
new_api_call_builder
|
375
385
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -381,9 +391,9 @@ module Square
|
|
381
391
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
382
392
|
.auth(Single.new('global')))
|
383
393
|
.response(new_response_handler
|
384
|
-
|
385
|
-
|
386
|
-
|
394
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
395
|
+
.is_api_response(true)
|
396
|
+
.convertor(ApiResponse.method(:create)))
|
387
397
|
.execute
|
388
398
|
end
|
389
399
|
|
@@ -407,7 +417,7 @@ module Square
|
|
407
417
|
# @param [SearchCatalogItemsRequest] body Required parameter: An object
|
408
418
|
# containing the fields to POST for the request. See the corresponding
|
409
419
|
# object definition for field details.
|
410
|
-
# @return [
|
420
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
411
421
|
def search_catalog_items(body:)
|
412
422
|
new_api_call_builder
|
413
423
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -419,9 +429,9 @@ module Square
|
|
419
429
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
420
430
|
.auth(Single.new('global')))
|
421
431
|
.response(new_response_handler
|
422
|
-
|
423
|
-
|
424
|
-
|
432
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
433
|
+
.is_api_response(true)
|
434
|
+
.convertor(ApiResponse.method(:create)))
|
425
435
|
.execute
|
426
436
|
end
|
427
437
|
|
@@ -431,7 +441,7 @@ module Square
|
|
431
441
|
# @param [UpdateItemModifierListsRequest] body Required parameter: An object
|
432
442
|
# containing the fields to POST for the request. See the corresponding
|
433
443
|
# object definition for field details.
|
434
|
-
# @return [
|
444
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
435
445
|
def update_item_modifier_lists(body:)
|
436
446
|
new_api_call_builder
|
437
447
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -443,9 +453,9 @@ module Square
|
|
443
453
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
444
454
|
.auth(Single.new('global')))
|
445
455
|
.response(new_response_handler
|
446
|
-
|
447
|
-
|
448
|
-
|
456
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
457
|
+
.is_api_response(true)
|
458
|
+
.convertor(ApiResponse.method(:create)))
|
449
459
|
.execute
|
450
460
|
end
|
451
461
|
|
@@ -455,7 +465,7 @@ module Square
|
|
455
465
|
# @param [UpdateItemTaxesRequest] body Required parameter: An object
|
456
466
|
# containing the fields to POST for the request. See the corresponding
|
457
467
|
# object definition for field details.
|
458
|
-
# @return [
|
468
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
459
469
|
def update_item_taxes(body:)
|
460
470
|
new_api_call_builder
|
461
471
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -467,9 +477,9 @@ module Square
|
|
467
477
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
468
478
|
.auth(Single.new('global')))
|
469
479
|
.response(new_response_handler
|
470
|
-
|
471
|
-
|
472
|
-
|
480
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
481
|
+
.is_api_response(true)
|
482
|
+
.convertor(ApiResponse.method(:create)))
|
473
483
|
.execute
|
474
484
|
end
|
475
485
|
end
|
@@ -13,7 +13,7 @@ module Square
|
|
13
13
|
# @param [CreateCheckoutRequest] body Required parameter: An object
|
14
14
|
# containing the fields to POST for the request. See the corresponding
|
15
15
|
# object definition for field details.
|
16
|
-
# @return [
|
16
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
17
17
|
def create_checkout(location_id:,
|
18
18
|
body:)
|
19
19
|
warn 'Endpoint create_checkout in CheckoutApi is deprecated'
|
@@ -29,9 +29,94 @@ module Square
|
|
29
29
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
30
30
|
.auth(Single.new('global')))
|
31
31
|
.response(new_response_handler
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
33
|
+
.is_api_response(true)
|
34
|
+
.convertor(ApiResponse.method(:create)))
|
35
|
+
.execute
|
36
|
+
end
|
37
|
+
|
38
|
+
# Retrieves the location-level settings for a Square-hosted checkout page.
|
39
|
+
# @param [String] location_id Required parameter: The ID of the location for
|
40
|
+
# which to retrieve settings.
|
41
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
42
|
+
def retrieve_location_settings(location_id:)
|
43
|
+
new_api_call_builder
|
44
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
45
|
+
'/v2/online-checkout/location-settings/{location_id}',
|
46
|
+
'default')
|
47
|
+
.template_param(new_parameter(location_id, key: 'location_id')
|
48
|
+
.should_encode(true))
|
49
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
50
|
+
.auth(Single.new('global')))
|
51
|
+
.response(new_response_handler
|
52
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
53
|
+
.is_api_response(true)
|
54
|
+
.convertor(ApiResponse.method(:create)))
|
55
|
+
.execute
|
56
|
+
end
|
57
|
+
|
58
|
+
# Updates the location-level settings for a Square-hosted checkout page.
|
59
|
+
# @param [String] location_id Required parameter: The ID of the location for
|
60
|
+
# which to retrieve settings.
|
61
|
+
# @param [UpdateLocationSettingsRequest] body Required parameter: An object
|
62
|
+
# containing the fields to POST for the request. See the corresponding
|
63
|
+
# object definition for field details.
|
64
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
65
|
+
def update_location_settings(location_id:,
|
66
|
+
body:)
|
67
|
+
new_api_call_builder
|
68
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
69
|
+
'/v2/online-checkout/location-settings/{location_id}',
|
70
|
+
'default')
|
71
|
+
.template_param(new_parameter(location_id, key: 'location_id')
|
72
|
+
.should_encode(true))
|
73
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
74
|
+
.body_param(new_parameter(body))
|
75
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
76
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
77
|
+
.auth(Single.new('global')))
|
78
|
+
.response(new_response_handler
|
79
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
80
|
+
.is_api_response(true)
|
81
|
+
.convertor(ApiResponse.method(:create)))
|
82
|
+
.execute
|
83
|
+
end
|
84
|
+
|
85
|
+
# Retrieves the merchant-level settings for a Square-hosted checkout page.
|
86
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
87
|
+
def retrieve_merchant_settings
|
88
|
+
new_api_call_builder
|
89
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
90
|
+
'/v2/online-checkout/merchant-settings',
|
91
|
+
'default')
|
92
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
93
|
+
.auth(Single.new('global')))
|
94
|
+
.response(new_response_handler
|
95
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
96
|
+
.is_api_response(true)
|
97
|
+
.convertor(ApiResponse.method(:create)))
|
98
|
+
.execute
|
99
|
+
end
|
100
|
+
|
101
|
+
# Updates the merchant-level settings for a Square-hosted checkout page.
|
102
|
+
# @param [UpdateMerchantSettingsRequest] body Required parameter: An object
|
103
|
+
# containing the fields to POST for the request. See the corresponding
|
104
|
+
# object definition for field details.
|
105
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
106
|
+
def update_merchant_settings(body:)
|
107
|
+
new_api_call_builder
|
108
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
109
|
+
'/v2/online-checkout/merchant-settings',
|
110
|
+
'default')
|
111
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
112
|
+
.body_param(new_parameter(body))
|
113
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
114
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
115
|
+
.auth(Single.new('global')))
|
116
|
+
.response(new_response_handler
|
117
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
118
|
+
.is_api_response(true)
|
119
|
+
.convertor(ApiResponse.method(:create)))
|
35
120
|
.execute
|
36
121
|
end
|
37
122
|
|
@@ -40,14 +125,14 @@ module Square
|
|
40
125
|
# a previous call to this endpoint. Provide this cursor to retrieve the next
|
41
126
|
# set of results for the original query. If a cursor is not provided, the
|
42
127
|
# endpoint returns the first page of the results. For more information, see
|
43
|
-
# [Pagination](https://developer.squareup.com/docs/basics/
|
44
|
-
# .
|
128
|
+
# [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
|
129
|
+
# atterns/pagination).
|
45
130
|
# @param [Integer] limit Optional parameter: A limit on the number of
|
46
131
|
# results to return per page. The limit is advisory and the implementation
|
47
132
|
# might return more or less results. If the supplied limit is negative,
|
48
133
|
# zero, or greater than the maximum limit of 1000, it is ignored. Default
|
49
134
|
# value: `100`
|
50
|
-
# @return [
|
135
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
51
136
|
def list_payment_links(cursor: nil,
|
52
137
|
limit: nil)
|
53
138
|
new_api_call_builder
|
@@ -59,9 +144,9 @@ module Square
|
|
59
144
|
.header_param(new_parameter('application/json', key: 'accept'))
|
60
145
|
.auth(Single.new('global')))
|
61
146
|
.response(new_response_handler
|
62
|
-
|
63
|
-
|
64
|
-
|
147
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
148
|
+
.is_api_response(true)
|
149
|
+
.convertor(ApiResponse.method(:create)))
|
65
150
|
.execute
|
66
151
|
end
|
67
152
|
|
@@ -70,7 +155,7 @@ module Square
|
|
70
155
|
# @param [CreatePaymentLinkRequest] body Required parameter: An object
|
71
156
|
# containing the fields to POST for the request. See the corresponding
|
72
157
|
# object definition for field details.
|
73
|
-
# @return [
|
158
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
74
159
|
def create_payment_link(body:)
|
75
160
|
new_api_call_builder
|
76
161
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -82,16 +167,16 @@ module Square
|
|
82
167
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
83
168
|
.auth(Single.new('global')))
|
84
169
|
.response(new_response_handler
|
85
|
-
|
86
|
-
|
87
|
-
|
170
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
171
|
+
.is_api_response(true)
|
172
|
+
.convertor(ApiResponse.method(:create)))
|
88
173
|
.execute
|
89
174
|
end
|
90
175
|
|
91
176
|
# Deletes a payment link.
|
92
177
|
# @param [String] id Required parameter: The ID of the payment link to
|
93
178
|
# delete.
|
94
|
-
# @return [
|
179
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
95
180
|
def delete_payment_link(id:)
|
96
181
|
new_api_call_builder
|
97
182
|
.request(new_request_builder(HttpMethodEnum::DELETE,
|
@@ -102,15 +187,15 @@ module Square
|
|
102
187
|
.header_param(new_parameter('application/json', key: 'accept'))
|
103
188
|
.auth(Single.new('global')))
|
104
189
|
.response(new_response_handler
|
105
|
-
|
106
|
-
|
107
|
-
|
190
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
191
|
+
.is_api_response(true)
|
192
|
+
.convertor(ApiResponse.method(:create)))
|
108
193
|
.execute
|
109
194
|
end
|
110
195
|
|
111
196
|
# Retrieves a payment link.
|
112
197
|
# @param [String] id Required parameter: The ID of link to retrieve.
|
113
|
-
# @return [
|
198
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
114
199
|
def retrieve_payment_link(id:)
|
115
200
|
new_api_call_builder
|
116
201
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -121,9 +206,9 @@ module Square
|
|
121
206
|
.header_param(new_parameter('application/json', key: 'accept'))
|
122
207
|
.auth(Single.new('global')))
|
123
208
|
.response(new_response_handler
|
124
|
-
|
125
|
-
|
126
|
-
|
209
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
210
|
+
.is_api_response(true)
|
211
|
+
.convertor(ApiResponse.method(:create)))
|
127
212
|
.execute
|
128
213
|
end
|
129
214
|
|
@@ -136,7 +221,7 @@ module Square
|
|
136
221
|
# @param [UpdatePaymentLinkRequest] body Required parameter: An object
|
137
222
|
# containing the fields to POST for the request. See the corresponding
|
138
223
|
# object definition for field details.
|
139
|
-
# @return [
|
224
|
+
# @return [ApiResponse] the complete http response with raw body and status code.
|
140
225
|
def update_payment_link(id:,
|
141
226
|
body:)
|
142
227
|
new_api_call_builder
|
@@ -151,9 +236,9 @@ module Square
|
|
151
236
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
152
237
|
.auth(Single.new('global')))
|
153
238
|
.response(new_response_handler
|
154
|
-
|
155
|
-
|
156
|
-
|
239
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
240
|
+
.is_api_response(true)
|
241
|
+
.convertor(ApiResponse.method(:create)))
|
157
242
|
.execute
|
158
243
|
end
|
159
244
|
end
|