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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/lib/square/api/apple_pay_api.rb +15 -11
  4. data/lib/square/api/bank_accounts_api.rb +12 -12
  5. data/lib/square/api/base_api.rb +2 -1
  6. data/lib/square/api/booking_custom_attributes_api.rb +44 -44
  7. data/lib/square/api/bookings_api.rb +53 -53
  8. data/lib/square/api/cards_api.rb +16 -16
  9. data/lib/square/api/cash_drawers_api.rb +12 -12
  10. data/lib/square/api/catalog_api.rb +67 -57
  11. data/lib/square/api/checkout_api.rb +111 -26
  12. data/lib/square/api/customer_custom_attributes_api.rb +40 -40
  13. data/lib/square/api/customer_groups_api.rb +20 -20
  14. data/lib/square/api/customer_segments_api.rb +8 -8
  15. data/lib/square/api/customers_api.rb +144 -54
  16. data/lib/square/api/devices_api.rb +20 -20
  17. data/lib/square/api/disputes_api.rb +36 -36
  18. data/lib/square/api/employees_api.rb +8 -8
  19. data/lib/square/api/events_api.rb +84 -0
  20. data/lib/square/api/gift_card_activities_api.rb +10 -11
  21. data/lib/square/api/gift_cards_api.rb +36 -33
  22. data/lib/square/api/inventory_api.rb +52 -52
  23. data/lib/square/api/invoices_api.rb +109 -41
  24. data/lib/square/api/labor_api.rb +81 -80
  25. data/lib/square/api/location_custom_attributes_api.rb +44 -44
  26. data/lib/square/api/locations_api.rb +18 -17
  27. data/lib/square/api/loyalty_api.rb +72 -72
  28. data/lib/square/api/merchant_custom_attributes_api.rb +44 -44
  29. data/lib/square/api/merchants_api.rb +8 -8
  30. data/lib/square/api/mobile_authorization_api.rb +4 -4
  31. data/lib/square/api/o_auth_api.rb +15 -69
  32. data/lib/square/api/order_custom_attributes_api.rb +44 -44
  33. data/lib/square/api/orders_api.rb +32 -32
  34. data/lib/square/api/payments_api.rb +67 -31
  35. data/lib/square/api/payouts_api.rb +12 -12
  36. data/lib/square/api/refunds_api.rb +31 -13
  37. data/lib/square/api/sites_api.rb +4 -4
  38. data/lib/square/api/snippets_api.rb +12 -12
  39. data/lib/square/api/subscriptions_api.rb +48 -48
  40. data/lib/square/api/team_api.rb +146 -40
  41. data/lib/square/api/terminal_api.rb +95 -53
  42. data/lib/square/api/transactions_api.rb +16 -16
  43. data/lib/square/api/v1_transactions_api.rb +13 -292
  44. data/lib/square/api/vendors_api.rb +28 -28
  45. data/lib/square/api/webhook_subscriptions_api.rb +32 -32
  46. data/lib/square/client.rb +32 -24
  47. data/lib/square/configuration.rb +43 -15
  48. data/lib/square/http/api_response.rb +1 -1
  49. data/lib/square/http/auth/o_auth2.rb +21 -2
  50. data/lib/square.rb +4 -3
  51. data/test/api/api_test_base.rb +1 -1
  52. data/test/api/test_locations_api.rb +1 -1
  53. data/test/api/test_refunds_api.rb +4 -1
  54. data/test/webhooks/test_webhooks_helper.rb +17 -0
  55. metadata +12 -17
@@ -14,7 +14,7 @@ module Square
14
14
  # endpoint to retrieve the merchant information.
15
15
  # @param [Integer] cursor Optional parameter: The cursor generated by the
16
16
  # previous response.
17
- # @return [ListMerchantsResponse Hash] response from the API call
17
+ # @return [ApiResponse] the complete http response with raw body and status code.
18
18
  def list_merchants(cursor: nil)
19
19
  new_api_call_builder
20
20
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -24,9 +24,9 @@ module Square
24
24
  .header_param(new_parameter('application/json', key: 'accept'))
25
25
  .auth(Single.new('global')))
26
26
  .response(new_response_handler
27
- .deserializer(APIHelper.method(:json_deserialize))
28
- .is_api_response(true)
29
- .convertor(ApiResponse.method(:create)))
27
+ .deserializer(APIHelper.method(:json_deserialize))
28
+ .is_api_response(true)
29
+ .convertor(ApiResponse.method(:create)))
30
30
  .execute
31
31
  end
32
32
 
@@ -34,7 +34,7 @@ module Square
34
34
  # @param [String] merchant_id Required parameter: The ID of the merchant to
35
35
  # retrieve. If the string "me" is supplied as the ID, then retrieve the
36
36
  # merchant that is currently accessible to this call.
37
- # @return [RetrieveMerchantResponse Hash] response from the API call
37
+ # @return [ApiResponse] the complete http response with raw body and status code.
38
38
  def retrieve_merchant(merchant_id:)
39
39
  new_api_call_builder
40
40
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -45,9 +45,9 @@ module Square
45
45
  .header_param(new_parameter('application/json', key: 'accept'))
46
46
  .auth(Single.new('global')))
47
47
  .response(new_response_handler
48
- .deserializer(APIHelper.method(:json_deserialize))
49
- .is_api_response(true)
50
- .convertor(ApiResponse.method(:create)))
48
+ .deserializer(APIHelper.method(:json_deserialize))
49
+ .is_api_response(true)
50
+ .convertor(ApiResponse.method(:create)))
51
51
  .execute
52
52
  end
53
53
  end
@@ -17,7 +17,7 @@ module Square
17
17
  # @param [CreateMobileAuthorizationCodeRequest] body Required parameter: An
18
18
  # object containing the fields to POST for the request. See the
19
19
  # corresponding object definition for field details.
20
- # @return [CreateMobileAuthorizationCodeResponse Hash] response from the API call
20
+ # @return [ApiResponse] the complete http response with raw body and status code.
21
21
  def create_mobile_authorization_code(body:)
22
22
  new_api_call_builder
23
23
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -29,9 +29,9 @@ 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
- .deserializer(APIHelper.method(:json_deserialize))
33
- .is_api_response(true)
34
- .convertor(ApiResponse.method(:create)))
32
+ .deserializer(APIHelper.method(:json_deserialize))
33
+ .is_api_response(true)
34
+ .convertor(ApiResponse.method(:create)))
35
35
  .execute
36
36
  end
37
37
  end
@@ -1,58 +1,6 @@
1
1
  module Square
2
2
  # OAuthApi
3
3
  class OAuthApi < BaseApi
4
- # `RenewToken` is deprecated. For information about refreshing OAuth access
5
- # tokens, see
6
- # [Migrate from Renew to Refresh OAuth
7
- # Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-t
8
- # okens).
9
- # Renews an OAuth access token before it expires.
10
- # OAuth access tokens besides your application's personal access token
11
- # expire after 30 days.
12
- # You can also renew expired tokens within 15 days of their expiration.
13
- # You cannot renew an access token that has been expired for more than 15
14
- # days.
15
- # Instead, the associated user must recomplete the OAuth flow from the
16
- # beginning.
17
- # __Important:__ The `Authorization` header for this endpoint must have the
18
- # following format:
19
- # ```
20
- # Authorization: Client APPLICATION_SECRET
21
- # ```
22
- # Replace `APPLICATION_SECRET` with the application secret on the
23
- # **Credentials**
24
- # page in the [Developer Dashboard](https://developer.squareup.com/apps).
25
- # @param [String] client_id Required parameter: Your application ID, which
26
- # is available on the **OAuth** page in the [Developer
27
- # Dashboard](https://developer.squareup.com/apps).
28
- # @param [RenewTokenRequest] body Required parameter: An object containing
29
- # the fields to POST for the request. See the corresponding object
30
- # definition for field details.
31
- # @param [String] authorization Required parameter: Client
32
- # APPLICATION_SECRET
33
- # @return [RenewTokenResponse Hash] response from the API call
34
- def renew_token(client_id:,
35
- body:,
36
- authorization:)
37
- warn 'Endpoint renew_token in OAuthApi is deprecated'
38
- new_api_call_builder
39
- .request(new_request_builder(HttpMethodEnum::POST,
40
- '/oauth2/clients/{client_id}/access-token/renew',
41
- 'default')
42
- .template_param(new_parameter(client_id, key: 'client_id')
43
- .should_encode(true))
44
- .header_param(new_parameter('application/json', key: 'Content-Type'))
45
- .body_param(new_parameter(body))
46
- .header_param(new_parameter(authorization, key: 'Authorization'))
47
- .header_param(new_parameter('application/json', key: 'accept'))
48
- .body_serializer(proc do |param| param.to_json unless param.nil? end))
49
- .response(new_response_handler
50
- .deserializer(APIHelper.method(:json_deserialize))
51
- .is_api_response(true)
52
- .convertor(ApiResponse.method(:create)))
53
- .execute
54
- end
55
-
56
4
  # Revokes an access token generated with the OAuth flow.
57
5
  # If an account has more than one OAuth access token for your application,
58
6
  # this
@@ -69,7 +17,7 @@ module Square
69
17
  # definition for field details.
70
18
  # @param [String] authorization Required parameter: Client
71
19
  # APPLICATION_SECRET
72
- # @return [RevokeTokenResponse Hash] response from the API call
20
+ # @return [ApiResponse] the complete http response with raw body and status code.
73
21
  def revoke_token(body:,
74
22
  authorization:)
75
23
  new_api_call_builder
@@ -82,9 +30,9 @@ module Square
82
30
  .header_param(new_parameter('application/json', key: 'accept'))
83
31
  .body_serializer(proc do |param| param.to_json unless param.nil? end))
84
32
  .response(new_response_handler
85
- .deserializer(APIHelper.method(:json_deserialize))
86
- .is_api_response(true)
87
- .convertor(ApiResponse.method(:create)))
33
+ .deserializer(APIHelper.method(:json_deserialize))
34
+ .is_api_response(true)
35
+ .convertor(ApiResponse.method(:create)))
88
36
  .execute
89
37
  end
90
38
 
@@ -107,7 +55,7 @@ module Square
107
55
  # @param [ObtainTokenRequest] body Required parameter: An object containing
108
56
  # the fields to POST for the request. See the corresponding object
109
57
  # definition for field details.
110
- # @return [ObtainTokenResponse Hash] response from the API call
58
+ # @return [ApiResponse] the complete http response with raw body and status code.
111
59
  def obtain_token(body:)
112
60
  new_api_call_builder
113
61
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -118,9 +66,9 @@ module Square
118
66
  .header_param(new_parameter('application/json', key: 'accept'))
119
67
  .body_serializer(proc do |param| param.to_json unless param.nil? end))
120
68
  .response(new_response_handler
121
- .deserializer(APIHelper.method(:json_deserialize))
122
- .is_api_response(true)
123
- .convertor(ApiResponse.method(:create)))
69
+ .deserializer(APIHelper.method(:json_deserialize))
70
+ .is_api_response(true)
71
+ .convertor(ApiResponse.method(:create)))
124
72
  .execute
125
73
  end
126
74
 
@@ -141,20 +89,18 @@ module Square
141
89
  # ).
142
90
  # If the access token is expired or not a valid access token, the endpoint
143
91
  # returns an `UNAUTHORIZED` error.
144
- # @param [String] authorization Required parameter: Client
145
- # APPLICATION_SECRET
146
- # @return [RetrieveTokenStatusResponse Hash] response from the API call
147
- def retrieve_token_status(authorization:)
92
+ # @return [ApiResponse] the complete http response with raw body and status code.
93
+ def retrieve_token_status
148
94
  new_api_call_builder
149
95
  .request(new_request_builder(HttpMethodEnum::POST,
150
96
  '/oauth2/token/status',
151
97
  'default')
152
- .header_param(new_parameter(authorization, key: 'Authorization'))
153
- .header_param(new_parameter('application/json', key: 'accept')))
98
+ .header_param(new_parameter('application/json', key: 'accept'))
99
+ .auth(Single.new('global')))
154
100
  .response(new_response_handler
155
- .deserializer(APIHelper.method(:json_deserialize))
156
- .is_api_response(true)
157
- .convertor(ApiResponse.method(:create)))
101
+ .deserializer(APIHelper.method(:json_deserialize))
102
+ .is_api_response(true)
103
+ .convertor(ApiResponse.method(:create)))
158
104
  .execute
159
105
  end
160
106
  end
@@ -28,7 +28,7 @@ module Square
28
28
  # see
29
29
  # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
30
30
  # ion).
31
- # @return [ListOrderCustomAttributeDefinitionsResponse Hash] response from the API call
31
+ # @return [ApiResponse] the complete http response with raw body and status code.
32
32
  def list_order_custom_attribute_definitions(visibility_filter: nil,
33
33
  cursor: nil,
34
34
  limit: nil)
@@ -42,9 +42,9 @@ module Square
42
42
  .header_param(new_parameter('application/json', key: 'accept'))
43
43
  .auth(Single.new('global')))
44
44
  .response(new_response_handler
45
- .deserializer(APIHelper.method(:json_deserialize))
46
- .is_api_response(true)
47
- .convertor(ApiResponse.method(:create)))
45
+ .deserializer(APIHelper.method(:json_deserialize))
46
+ .is_api_response(true)
47
+ .convertor(ApiResponse.method(:create)))
48
48
  .execute
49
49
  end
50
50
 
@@ -57,7 +57,7 @@ module Square
57
57
  # @param [CreateOrderCustomAttributeDefinitionRequest] body Required
58
58
  # parameter: An object containing the fields to POST for the request. See
59
59
  # the corresponding object definition for field details.
60
- # @return [CreateOrderCustomAttributeDefinitionResponse Hash] response from the API call
60
+ # @return [ApiResponse] the complete http response with raw body and status code.
61
61
  def create_order_custom_attribute_definition(body:)
62
62
  new_api_call_builder
63
63
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -69,9 +69,9 @@ module Square
69
69
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
70
70
  .auth(Single.new('global')))
71
71
  .response(new_response_handler
72
- .deserializer(APIHelper.method(:json_deserialize))
73
- .is_api_response(true)
74
- .convertor(ApiResponse.method(:create)))
72
+ .deserializer(APIHelper.method(:json_deserialize))
73
+ .is_api_response(true)
74
+ .convertor(ApiResponse.method(:create)))
75
75
  .execute
76
76
  end
77
77
 
@@ -80,7 +80,7 @@ module Square
80
80
  # Only the definition owner can delete a custom attribute definition.
81
81
  # @param [String] key Required parameter: The key of the custom attribute
82
82
  # definition to delete.
83
- # @return [DeleteOrderCustomAttributeDefinitionResponse Hash] response from the API call
83
+ # @return [ApiResponse] the complete http response with raw body and status code.
84
84
  def delete_order_custom_attribute_definition(key:)
85
85
  new_api_call_builder
86
86
  .request(new_request_builder(HttpMethodEnum::DELETE,
@@ -91,9 +91,9 @@ module Square
91
91
  .header_param(new_parameter('application/json', key: 'accept'))
92
92
  .auth(Single.new('global')))
93
93
  .response(new_response_handler
94
- .deserializer(APIHelper.method(:json_deserialize))
95
- .is_api_response(true)
96
- .convertor(ApiResponse.method(:create)))
94
+ .deserializer(APIHelper.method(:json_deserialize))
95
+ .is_api_response(true)
96
+ .convertor(ApiResponse.method(:create)))
97
97
  .execute
98
98
  end
99
99
 
@@ -111,7 +111,7 @@ module Square
111
111
  # concurrency](https://developer.squareup.com/docs/build-basics/common-api-p
112
112
  # atterns/optimistic-concurrency) control, include this optional field and
113
113
  # specify the current version of the custom attribute.
114
- # @return [RetrieveOrderCustomAttributeDefinitionResponse Hash] response from the API call
114
+ # @return [ApiResponse] the complete http response with raw body and status code.
115
115
  def retrieve_order_custom_attribute_definition(key:,
116
116
  version: nil)
117
117
  new_api_call_builder
@@ -124,9 +124,9 @@ module Square
124
124
  .header_param(new_parameter('application/json', key: 'accept'))
125
125
  .auth(Single.new('global')))
126
126
  .response(new_response_handler
127
- .deserializer(APIHelper.method(:json_deserialize))
128
- .is_api_response(true)
129
- .convertor(ApiResponse.method(:create)))
127
+ .deserializer(APIHelper.method(:json_deserialize))
128
+ .is_api_response(true)
129
+ .convertor(ApiResponse.method(:create)))
130
130
  .execute
131
131
  end
132
132
 
@@ -140,7 +140,7 @@ module Square
140
140
  # @param [UpdateOrderCustomAttributeDefinitionRequest] body Required
141
141
  # parameter: An object containing the fields to POST for the request. See
142
142
  # the corresponding object definition for field details.
143
- # @return [UpdateOrderCustomAttributeDefinitionResponse Hash] response from the API call
143
+ # @return [ApiResponse] the complete http response with raw body and status code.
144
144
  def update_order_custom_attribute_definition(key:,
145
145
  body:)
146
146
  new_api_call_builder
@@ -155,9 +155,9 @@ module Square
155
155
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
156
156
  .auth(Single.new('global')))
157
157
  .response(new_response_handler
158
- .deserializer(APIHelper.method(:json_deserialize))
159
- .is_api_response(true)
160
- .convertor(ApiResponse.method(:create)))
158
+ .deserializer(APIHelper.method(:json_deserialize))
159
+ .is_api_response(true)
160
+ .convertor(ApiResponse.method(:create)))
161
161
  .execute
162
162
  end
163
163
 
@@ -185,7 +185,7 @@ module Square
185
185
  # @param [BulkDeleteOrderCustomAttributesRequest] body Required parameter:
186
186
  # An object containing the fields to POST for the request. See the
187
187
  # corresponding object definition for field details.
188
- # @return [BulkDeleteOrderCustomAttributesResponse Hash] response from the API call
188
+ # @return [ApiResponse] the complete http response with raw body and status code.
189
189
  def bulk_delete_order_custom_attributes(body:)
190
190
  new_api_call_builder
191
191
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -197,9 +197,9 @@ module Square
197
197
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
198
198
  .auth(Single.new('global')))
199
199
  .response(new_response_handler
200
- .deserializer(APIHelper.method(:json_deserialize))
201
- .is_api_response(true)
202
- .convertor(ApiResponse.method(:create)))
200
+ .deserializer(APIHelper.method(:json_deserialize))
201
+ .is_api_response(true)
202
+ .convertor(ApiResponse.method(:create)))
203
203
  .execute
204
204
  end
205
205
 
@@ -228,7 +228,7 @@ module Square
228
228
  # @param [BulkUpsertOrderCustomAttributesRequest] body Required parameter:
229
229
  # An object containing the fields to POST for the request. See the
230
230
  # corresponding object definition for field details.
231
- # @return [BulkUpsertOrderCustomAttributesResponse Hash] response from the API call
231
+ # @return [ApiResponse] the complete http response with raw body and status code.
232
232
  def bulk_upsert_order_custom_attributes(body:)
233
233
  new_api_call_builder
234
234
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -240,9 +240,9 @@ module Square
240
240
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
241
241
  .auth(Single.new('global')))
242
242
  .response(new_response_handler
243
- .deserializer(APIHelper.method(:json_deserialize))
244
- .is_api_response(true)
245
- .convertor(ApiResponse.method(:create)))
243
+ .deserializer(APIHelper.method(:json_deserialize))
244
+ .is_api_response(true)
245
+ .convertor(ApiResponse.method(:create)))
246
246
  .execute
247
247
  end
248
248
 
@@ -280,7 +280,7 @@ module Square
280
280
  # each custom attribute. Set this parameter to `true` to get the name and
281
281
  # description of each custom attribute, information about the data type, or
282
282
  # other definition details. The default value is `false`.
283
- # @return [ListOrderCustomAttributesResponse Hash] response from the API call
283
+ # @return [ApiResponse] the complete http response with raw body and status code.
284
284
  def list_order_custom_attributes(order_id:,
285
285
  visibility_filter: nil,
286
286
  cursor: nil,
@@ -299,9 +299,9 @@ module Square
299
299
  .header_param(new_parameter('application/json', key: 'accept'))
300
300
  .auth(Single.new('global')))
301
301
  .response(new_response_handler
302
- .deserializer(APIHelper.method(:json_deserialize))
303
- .is_api_response(true)
304
- .convertor(ApiResponse.method(:create)))
302
+ .deserializer(APIHelper.method(:json_deserialize))
303
+ .is_api_response(true)
304
+ .convertor(ApiResponse.method(:create)))
305
305
  .execute
306
306
  end
307
307
 
@@ -317,7 +317,7 @@ module Square
317
317
  # @param [String] custom_attribute_key Required parameter: The key of the
318
318
  # custom attribute to delete. This key must match the key of an existing
319
319
  # custom attribute definition.
320
- # @return [DeleteOrderCustomAttributeResponse Hash] response from the API call
320
+ # @return [ApiResponse] the complete http response with raw body and status code.
321
321
  def delete_order_custom_attribute(order_id:,
322
322
  custom_attribute_key:)
323
323
  new_api_call_builder
@@ -331,9 +331,9 @@ module Square
331
331
  .header_param(new_parameter('application/json', key: 'accept'))
332
332
  .auth(Single.new('global')))
333
333
  .response(new_response_handler
334
- .deserializer(APIHelper.method(:json_deserialize))
335
- .is_api_response(true)
336
- .convertor(ApiResponse.method(:create)))
334
+ .deserializer(APIHelper.method(:json_deserialize))
335
+ .is_api_response(true)
336
+ .convertor(ApiResponse.method(:create)))
337
337
  .execute
338
338
  end
339
339
 
@@ -363,7 +363,7 @@ module Square
363
363
  # each custom attribute. Set this parameter to `true` to get the name and
364
364
  # description of each custom attribute, information about the data type, or
365
365
  # other definition details. The default value is `false`.
366
- # @return [RetrieveOrderCustomAttributeResponse Hash] response from the API call
366
+ # @return [ApiResponse] the complete http response with raw body and status code.
367
367
  def retrieve_order_custom_attribute(order_id:,
368
368
  custom_attribute_key:,
369
369
  version: nil,
@@ -381,9 +381,9 @@ module Square
381
381
  .header_param(new_parameter('application/json', key: 'accept'))
382
382
  .auth(Single.new('global')))
383
383
  .response(new_response_handler
384
- .deserializer(APIHelper.method(:json_deserialize))
385
- .is_api_response(true)
386
- .convertor(ApiResponse.method(:create)))
384
+ .deserializer(APIHelper.method(:json_deserialize))
385
+ .is_api_response(true)
386
+ .convertor(ApiResponse.method(:create)))
387
387
  .execute
388
388
  end
389
389
 
@@ -409,7 +409,7 @@ module Square
409
409
  # @param [UpsertOrderCustomAttributeRequest] body Required parameter: An
410
410
  # object containing the fields to POST for the request. See the
411
411
  # corresponding object definition for field details.
412
- # @return [UpsertOrderCustomAttributeResponse Hash] response from the API call
412
+ # @return [ApiResponse] the complete http response with raw body and status code.
413
413
  def upsert_order_custom_attribute(order_id:,
414
414
  custom_attribute_key:,
415
415
  body:)
@@ -427,9 +427,9 @@ module Square
427
427
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
428
428
  .auth(Single.new('global')))
429
429
  .response(new_response_handler
430
- .deserializer(APIHelper.method(:json_deserialize))
431
- .is_api_response(true)
432
- .convertor(ApiResponse.method(:create)))
430
+ .deserializer(APIHelper.method(:json_deserialize))
431
+ .is_api_response(true)
432
+ .convertor(ApiResponse.method(:create)))
433
433
  .execute
434
434
  end
435
435
  end
@@ -12,7 +12,7 @@ module Square
12
12
  # @param [CreateOrderRequest] body Required parameter: An object containing
13
13
  # the fields to POST for the request. See the corresponding object
14
14
  # definition for field details.
15
- # @return [CreateOrderResponse Hash] response from the API call
15
+ # @return [ApiResponse] the complete http response with raw body and status code.
16
16
  def create_order(body:)
17
17
  new_api_call_builder
18
18
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -24,9 +24,9 @@ module Square
24
24
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
25
25
  .auth(Single.new('global')))
26
26
  .response(new_response_handler
27
- .deserializer(APIHelper.method(:json_deserialize))
28
- .is_api_response(true)
29
- .convertor(ApiResponse.method(:create)))
27
+ .deserializer(APIHelper.method(:json_deserialize))
28
+ .is_api_response(true)
29
+ .convertor(ApiResponse.method(:create)))
30
30
  .execute
31
31
  end
32
32
 
@@ -36,7 +36,7 @@ module Square
36
36
  # @param [BatchRetrieveOrdersRequest] body Required parameter: An object
37
37
  # containing the fields to POST for the request. See the corresponding
38
38
  # object definition for field details.
39
- # @return [BatchRetrieveOrdersResponse Hash] response from the API call
39
+ # @return [ApiResponse] the complete http response with raw body and status code.
40
40
  def batch_retrieve_orders(body:)
41
41
  new_api_call_builder
42
42
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -48,9 +48,9 @@ module Square
48
48
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
49
49
  .auth(Single.new('global')))
50
50
  .response(new_response_handler
51
- .deserializer(APIHelper.method(:json_deserialize))
52
- .is_api_response(true)
53
- .convertor(ApiResponse.method(:create)))
51
+ .deserializer(APIHelper.method(:json_deserialize))
52
+ .is_api_response(true)
53
+ .convertor(ApiResponse.method(:create)))
54
54
  .execute
55
55
  end
56
56
 
@@ -58,7 +58,7 @@ module Square
58
58
  # @param [CalculateOrderRequest] body Required parameter: An object
59
59
  # containing the fields to POST for the request. See the corresponding
60
60
  # object definition for field details.
61
- # @return [CalculateOrderResponse Hash] response from the API call
61
+ # @return [ApiResponse] the complete http response with raw body and status code.
62
62
  def calculate_order(body:)
63
63
  new_api_call_builder
64
64
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -70,9 +70,9 @@ module Square
70
70
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
71
71
  .auth(Single.new('global')))
72
72
  .response(new_response_handler
73
- .deserializer(APIHelper.method(:json_deserialize))
74
- .is_api_response(true)
75
- .convertor(ApiResponse.method(:create)))
73
+ .deserializer(APIHelper.method(:json_deserialize))
74
+ .is_api_response(true)
75
+ .convertor(ApiResponse.method(:create)))
76
76
  .execute
77
77
  end
78
78
 
@@ -83,7 +83,7 @@ module Square
83
83
  # @param [CloneOrderRequest] body Required parameter: An object containing
84
84
  # the fields to POST for the request. See the corresponding object
85
85
  # definition for field details.
86
- # @return [CloneOrderResponse Hash] response from the API call
86
+ # @return [ApiResponse] the complete http response with raw body and status code.
87
87
  def clone_order(body:)
88
88
  new_api_call_builder
89
89
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -95,9 +95,9 @@ module Square
95
95
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
96
96
  .auth(Single.new('global')))
97
97
  .response(new_response_handler
98
- .deserializer(APIHelper.method(:json_deserialize))
99
- .is_api_response(true)
100
- .convertor(ApiResponse.method(:create)))
98
+ .deserializer(APIHelper.method(:json_deserialize))
99
+ .is_api_response(true)
100
+ .convertor(ApiResponse.method(:create)))
101
101
  .execute
102
102
  end
103
103
 
@@ -121,7 +121,7 @@ module Square
121
121
  # @param [SearchOrdersRequest] body Required parameter: An object containing
122
122
  # the fields to POST for the request. See the corresponding object
123
123
  # definition for field details.
124
- # @return [SearchOrdersResponse Hash] response from the API call
124
+ # @return [ApiResponse] the complete http response with raw body and status code.
125
125
  def search_orders(body:)
126
126
  new_api_call_builder
127
127
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -133,16 +133,16 @@ module Square
133
133
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
134
134
  .auth(Single.new('global')))
135
135
  .response(new_response_handler
136
- .deserializer(APIHelper.method(:json_deserialize))
137
- .is_api_response(true)
138
- .convertor(ApiResponse.method(:create)))
136
+ .deserializer(APIHelper.method(:json_deserialize))
137
+ .is_api_response(true)
138
+ .convertor(ApiResponse.method(:create)))
139
139
  .execute
140
140
  end
141
141
 
142
142
  # Retrieves an [Order]($m/Order) by ID.
143
143
  # @param [String] order_id Required parameter: The ID of the order to
144
144
  # retrieve.
145
- # @return [RetrieveOrderResponse Hash] response from the API call
145
+ # @return [ApiResponse] the complete http response with raw body and status code.
146
146
  def retrieve_order(order_id:)
147
147
  new_api_call_builder
148
148
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -153,9 +153,9 @@ module Square
153
153
  .header_param(new_parameter('application/json', key: 'accept'))
154
154
  .auth(Single.new('global')))
155
155
  .response(new_response_handler
156
- .deserializer(APIHelper.method(:json_deserialize))
157
- .is_api_response(true)
158
- .convertor(ApiResponse.method(:create)))
156
+ .deserializer(APIHelper.method(:json_deserialize))
157
+ .is_api_response(true)
158
+ .convertor(ApiResponse.method(:create)))
159
159
  .execute
160
160
  end
161
161
 
@@ -182,7 +182,7 @@ module Square
182
182
  # @param [UpdateOrderRequest] body Required parameter: An object containing
183
183
  # the fields to POST for the request. See the corresponding object
184
184
  # definition for field details.
185
- # @return [UpdateOrderResponse Hash] response from the API call
185
+ # @return [ApiResponse] the complete http response with raw body and status code.
186
186
  def update_order(order_id:,
187
187
  body:)
188
188
  new_api_call_builder
@@ -197,9 +197,9 @@ module Square
197
197
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
198
198
  .auth(Single.new('global')))
199
199
  .response(new_response_handler
200
- .deserializer(APIHelper.method(:json_deserialize))
201
- .is_api_response(true)
202
- .convertor(ApiResponse.method(:create)))
200
+ .deserializer(APIHelper.method(:json_deserialize))
201
+ .is_api_response(true)
202
+ .convertor(ApiResponse.method(:create)))
203
203
  .execute
204
204
  end
205
205
 
@@ -227,7 +227,7 @@ module Square
227
227
  # @param [PayOrderRequest] body Required parameter: An object containing the
228
228
  # fields to POST for the request. See the corresponding object definition
229
229
  # for field details.
230
- # @return [PayOrderResponse Hash] response from the API call
230
+ # @return [ApiResponse] the complete http response with raw body and status code.
231
231
  def pay_order(order_id:,
232
232
  body:)
233
233
  new_api_call_builder
@@ -242,9 +242,9 @@ module Square
242
242
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
243
243
  .auth(Single.new('global')))
244
244
  .response(new_response_handler
245
- .deserializer(APIHelper.method(:json_deserialize))
246
- .is_api_response(true)
247
- .convertor(ApiResponse.method(:create)))
245
+ .deserializer(APIHelper.method(:json_deserialize))
246
+ .is_api_response(true)
247
+ .convertor(ApiResponse.method(:create)))
248
248
  .execute
249
249
  end
250
250
  end