square.rb 6.2.0.20200812 → 8.0.0.20201216
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +34 -33
- data/lib/square.rb +61 -62
- 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 +68 -32
- 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 +10 -5
- data/lib/square/api/inventory_api.rb +30 -15
- data/lib/square/api/invoices_api.rb +42 -38
- data/lib/square/api/labor_api.rb +131 -22
- 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 +111 -90
- 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 +29 -28
- 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 -31
- 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 +14 -20
- 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 -16
- data/lib/square/api/reporting_api.rb +0 -138
- data/lib/square/api/v1_locations_api.rb +0 -65
@@ -6,32 +6,36 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Retrieves a list of refunds for the account making the request.
|
9
|
-
#
|
10
|
-
# @param [String] begin_time Optional parameter:
|
11
|
-
# of the requested reporting period, in RFC 3339 format. Default:
|
12
|
-
# current time minus one year.
|
13
|
-
# @param [String] end_time Optional parameter:
|
14
|
-
# requested reporting period, in RFC 3339 format. Default: The current
|
9
|
+
# The maximum results per page is 100.
|
10
|
+
# @param [String] begin_time Optional parameter: The timestamp for the
|
11
|
+
# beginning of the requested reporting period, in RFC 3339 format. Default:
|
12
|
+
# The current time minus one year.
|
13
|
+
# @param [String] end_time Optional parameter: The timestamp for the end of
|
14
|
+
# the requested reporting period, in RFC 3339 format. Default: The current
|
15
15
|
# time.
|
16
16
|
# @param [String] sort_order Optional parameter: The order in which results
|
17
|
-
# are listed
|
17
|
+
# are listed: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest
|
18
18
|
# (default).
|
19
19
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
20
|
-
# a previous call to this endpoint. Provide this to retrieve the next
|
21
|
-
# results for the original query.
|
20
|
+
# a previous call to this endpoint. Provide this cursor to retrieve the next
|
21
|
+
# set of results for the original query. For more information, see
|
22
22
|
# [Pagination](https://developer.squareup.com/docs/basics/api101/pagination)
|
23
|
-
#
|
23
|
+
# .
|
24
24
|
# @param [String] location_id Optional parameter: Limit results to the
|
25
25
|
# location supplied. By default, results are returned for all locations
|
26
|
-
# associated with the
|
26
|
+
# associated with the seller.
|
27
27
|
# @param [String] status Optional parameter: If provided, only refunds with
|
28
28
|
# the given status are returned. For a list of refund status values, see
|
29
|
-
# [PaymentRefund](#type-paymentrefund). Default: If omitted refunds are
|
30
|
-
# returned regardless of status.
|
29
|
+
# [PaymentRefund](#type-paymentrefund). Default: If omitted, refunds are
|
30
|
+
# returned regardless of their status.
|
31
31
|
# @param [String] source_type Optional parameter: If provided, only refunds
|
32
32
|
# with the given source type are returned. - `CARD` - List refunds only for
|
33
|
-
# payments where
|
34
|
-
# refunds are returned regardless of source type.
|
33
|
+
# payments where `CARD` was specified as the payment source. Default: If
|
34
|
+
# omitted, refunds are returned regardless of the source type.
|
35
|
+
# @param [Integer] limit Optional parameter: The maximum number of results
|
36
|
+
# to be returned in a single page. It is possible to receive fewer results
|
37
|
+
# than the specified limit on a given page. If the supplied value is
|
38
|
+
# greater than 100, no more than 100 results are returned. Default: 100
|
35
39
|
# @return [ListPaymentRefundsResponse Hash] response from the API call
|
36
40
|
def list_payment_refunds(begin_time: nil,
|
37
41
|
end_time: nil,
|
@@ -39,7 +43,8 @@ module Square
|
|
39
43
|
cursor: nil,
|
40
44
|
location_id: nil,
|
41
45
|
status: nil,
|
42
|
-
source_type: nil
|
46
|
+
source_type: nil,
|
47
|
+
limit: nil)
|
43
48
|
# Prepare query url.
|
44
49
|
_query_builder = config.get_base_uri
|
45
50
|
_query_builder << '/v2/refunds'
|
@@ -51,7 +56,8 @@ module Square
|
|
51
56
|
'cursor' => cursor,
|
52
57
|
'location_id' => location_id,
|
53
58
|
'status' => status,
|
54
|
-
'source_type' => source_type
|
59
|
+
'source_type' => source_type,
|
60
|
+
'limit' => limit
|
55
61
|
)
|
56
62
|
_query_url = APIHelper.clean_url _query_builder
|
57
63
|
|
@@ -71,13 +77,13 @@ module Square
|
|
71
77
|
# Return appropriate response type.
|
72
78
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
73
79
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
74
|
-
ApiResponse.new(
|
80
|
+
ApiResponse.new(
|
81
|
+
_response, data: decoded, errors: _errors
|
82
|
+
)
|
75
83
|
end
|
76
84
|
|
77
85
|
# Refunds a payment. You can refund the entire payment amount or a
|
78
|
-
# portion of it.
|
79
|
-
# [Payments and Refunds
|
80
|
-
# Overview](https://developer.squareup.com/docs/payments-api/overview).
|
86
|
+
# portion of it.
|
81
87
|
# @param [RefundPaymentRequest] body Required parameter: An object
|
82
88
|
# containing the fields to POST for the request. See the corresponding
|
83
89
|
# object definition for field details.
|
@@ -106,12 +112,14 @@ module Square
|
|
106
112
|
# Return appropriate response type.
|
107
113
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
108
114
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
109
|
-
ApiResponse.new(
|
115
|
+
ApiResponse.new(
|
116
|
+
_response, data: decoded, errors: _errors
|
117
|
+
)
|
110
118
|
end
|
111
119
|
|
112
|
-
# Retrieves a specific
|
113
|
-
# @param [String] refund_id Required parameter:
|
114
|
-
# `PaymentRefund`.
|
120
|
+
# Retrieves a specific refund using the `refund_id`.
|
121
|
+
# @param [String] refund_id Required parameter: The unique ID for the
|
122
|
+
# desired `PaymentRefund`.
|
115
123
|
# @return [GetPaymentRefundResponse Hash] response from the API call
|
116
124
|
def get_payment_refund(refund_id:)
|
117
125
|
# Prepare query url.
|
@@ -119,7 +127,7 @@ module Square
|
|
119
127
|
_query_builder << '/v2/refunds/{refund_id}'
|
120
128
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
121
129
|
_query_builder,
|
122
|
-
'refund_id' => refund_id
|
130
|
+
'refund_id' => { 'value' => refund_id, 'encode' => true }
|
123
131
|
)
|
124
132
|
_query_url = APIHelper.clean_url _query_builder
|
125
133
|
|
@@ -139,7 +147,9 @@ module Square
|
|
139
147
|
# Return appropriate response type.
|
140
148
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
141
149
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
142
|
-
ApiResponse.new(
|
150
|
+
ApiResponse.new(
|
151
|
+
_response, data: decoded, errors: _errors
|
152
|
+
)
|
143
153
|
end
|
144
154
|
end
|
145
155
|
end
|
@@ -12,10 +12,6 @@ module Square
|
|
12
12
|
# address. The subscription starts immediately, unless the request includes
|
13
13
|
# the optional `start_date`. Each individual subscription is associated with
|
14
14
|
# a particular location.
|
15
|
-
# For more information,
|
16
|
-
# see [Subscription API
|
17
|
-
# Overview](https://developer.squareup.com/docs/docs/subscriptions-api/overv
|
18
|
-
# iew).
|
19
15
|
# @param [CreateSubscriptionRequest] body Required parameter: An object
|
20
16
|
# containing the fields to POST for the request. See the corresponding
|
21
17
|
# object definition for field details.
|
@@ -44,7 +40,9 @@ module Square
|
|
44
40
|
# Return appropriate response type.
|
45
41
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
46
42
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
47
|
-
ApiResponse.new(
|
43
|
+
ApiResponse.new(
|
44
|
+
_response, data: decoded, errors: _errors
|
45
|
+
)
|
48
46
|
end
|
49
47
|
|
50
48
|
# Searches for subscriptions.
|
@@ -62,8 +60,8 @@ module Square
|
|
62
60
|
# customer by subscription creation date.
|
63
61
|
# For more information, see
|
64
62
|
# [Retrieve
|
65
|
-
# subscriptions](https://developer.squareup.com/docs/
|
66
|
-
#
|
63
|
+
# subscriptions](https://developer.squareup.com/docs/subscriptions-api/overv
|
64
|
+
# iew#retrieve-subscriptions).
|
67
65
|
# @param [SearchSubscriptionsRequest] body Required parameter: An object
|
68
66
|
# containing the fields to POST for the request. See the corresponding
|
69
67
|
# object definition for field details.
|
@@ -92,7 +90,9 @@ module Square
|
|
92
90
|
# Return appropriate response type.
|
93
91
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
94
92
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
95
|
-
ApiResponse.new(
|
93
|
+
ApiResponse.new(
|
94
|
+
_response, data: decoded, errors: _errors
|
95
|
+
)
|
96
96
|
end
|
97
97
|
|
98
98
|
# Retrieves a subscription.
|
@@ -105,7 +105,7 @@ module Square
|
|
105
105
|
_query_builder << '/v2/subscriptions/{subscription_id}'
|
106
106
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
107
107
|
_query_builder,
|
108
|
-
'subscription_id' => subscription_id
|
108
|
+
'subscription_id' => { 'value' => subscription_id, 'encode' => true }
|
109
109
|
)
|
110
110
|
_query_url = APIHelper.clean_url _query_builder
|
111
111
|
|
@@ -125,14 +125,13 @@ module Square
|
|
125
125
|
# Return appropriate response type.
|
126
126
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
127
127
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
128
|
-
ApiResponse.new(
|
128
|
+
ApiResponse.new(
|
129
|
+
_response, data: decoded, errors: _errors
|
130
|
+
)
|
129
131
|
end
|
130
132
|
|
131
133
|
# Updates a subscription. You can set, modify, and clear the
|
132
|
-
# `subscription` field values.
|
133
|
-
# [Update
|
134
|
-
# subscriptions](https://developer.squareup.com/docs/docs/subscriptions-api/
|
135
|
-
# overview#update-subscriptions).
|
134
|
+
# `subscription` field values.
|
136
135
|
# @param [String] subscription_id Required parameter: The ID for the
|
137
136
|
# subscription to update.
|
138
137
|
# @param [UpdateSubscriptionRequest] body Required parameter: An object
|
@@ -146,7 +145,7 @@ module Square
|
|
146
145
|
_query_builder << '/v2/subscriptions/{subscription_id}'
|
147
146
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
148
147
|
_query_builder,
|
149
|
-
'subscription_id' => subscription_id
|
148
|
+
'subscription_id' => { 'value' => subscription_id, 'encode' => true }
|
150
149
|
)
|
151
150
|
_query_url = APIHelper.clean_url _query_builder
|
152
151
|
|
@@ -168,15 +167,13 @@ module Square
|
|
168
167
|
# Return appropriate response type.
|
169
168
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
170
169
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
171
|
-
ApiResponse.new(
|
170
|
+
ApiResponse.new(
|
171
|
+
_response, data: decoded, errors: _errors
|
172
|
+
)
|
172
173
|
end
|
173
174
|
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# endpoint to cancel a subscription at a future date. For more
|
177
|
-
# information, see
|
178
|
-
# [CancelSubscriptions](https://developer.squareup.com/docs/docs/subscriptio
|
179
|
-
# ns-api/overview#cancel-subscriptions).
|
175
|
+
# Sets the `canceled_date` field to the end of the active billing period.
|
176
|
+
# After this date, the status changes from ACTIVE to CANCELED.
|
180
177
|
# @param [String] subscription_id Required parameter: The ID of the
|
181
178
|
# subscription to cancel.
|
182
179
|
# @return [CancelSubscriptionResponse Hash] response from the API call
|
@@ -186,7 +183,7 @@ module Square
|
|
186
183
|
_query_builder << '/v2/subscriptions/{subscription_id}/cancel'
|
187
184
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
188
185
|
_query_builder,
|
189
|
-
'subscription_id' => subscription_id
|
186
|
+
'subscription_id' => { 'value' => subscription_id, 'encode' => true }
|
190
187
|
)
|
191
188
|
_query_url = APIHelper.clean_url _query_builder
|
192
189
|
|
@@ -206,7 +203,9 @@ module Square
|
|
206
203
|
# Return appropriate response type.
|
207
204
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
208
205
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
209
|
-
ApiResponse.new(
|
206
|
+
ApiResponse.new(
|
207
|
+
_response, data: decoded, errors: _errors
|
208
|
+
)
|
210
209
|
end
|
211
210
|
|
212
211
|
# Lists all events for a specific subscription.
|
@@ -218,8 +217,8 @@ module Square
|
|
218
217
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
219
218
|
# a previous call to this endpoint. Provide this to retrieve the next set of
|
220
219
|
# results for the original query. For more information, see
|
221
|
-
# [Pagination](https://developer.squareup.com/docs/
|
222
|
-
#
|
220
|
+
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
221
|
+
# ion).
|
223
222
|
# @param [Integer] limit Optional parameter: The upper limit on the number
|
224
223
|
# of subscription events to return in the response. Default: `200`
|
225
224
|
# @return [ListSubscriptionEventsResponse Hash] response from the API call
|
@@ -231,7 +230,7 @@ module Square
|
|
231
230
|
_query_builder << '/v2/subscriptions/{subscription_id}/events'
|
232
231
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
233
232
|
_query_builder,
|
234
|
-
'subscription_id' => subscription_id
|
233
|
+
'subscription_id' => { 'value' => subscription_id, 'encode' => true }
|
235
234
|
)
|
236
235
|
_query_builder = APIHelper.append_url_with_query_parameters(
|
237
236
|
_query_builder,
|
@@ -256,7 +255,9 @@ module Square
|
|
256
255
|
# Return appropriate response type.
|
257
256
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
258
257
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
259
|
-
ApiResponse.new(
|
258
|
+
ApiResponse.new(
|
259
|
+
_response, data: decoded, errors: _errors
|
260
|
+
)
|
260
261
|
end
|
261
262
|
end
|
262
263
|
end
|
data/lib/square/api/team_api.rb
CHANGED
@@ -8,11 +8,11 @@ module Square
|
|
8
8
|
# Creates a single `TeamMember` object. The `TeamMember` will be returned on
|
9
9
|
# successful creates.
|
10
10
|
# You must provide the following values in your request to this endpoint:
|
11
|
-
# - `
|
12
|
-
# - `
|
11
|
+
# - `given_name`
|
12
|
+
# - `family_name`
|
13
13
|
# Learn about [Troubleshooting the Teams
|
14
|
-
# API](https://developer.squareup.com/docs/
|
15
|
-
#
|
14
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#createteamme
|
15
|
+
# mber).
|
16
16
|
# @param [CreateTeamMemberRequest] body Required parameter: An object
|
17
17
|
# containing the fields to POST for the request. See the corresponding
|
18
18
|
# object definition for field details.
|
@@ -41,7 +41,9 @@ module Square
|
|
41
41
|
# Return appropriate response type.
|
42
42
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
43
43
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
44
|
-
ApiResponse.new(
|
44
|
+
ApiResponse.new(
|
45
|
+
_response, data: decoded, errors: _errors
|
46
|
+
)
|
45
47
|
end
|
46
48
|
|
47
49
|
# Creates multiple `TeamMember` objects. The created `TeamMember` objects
|
@@ -52,8 +54,8 @@ module Square
|
|
52
54
|
# marked as failed, but the body of the response
|
53
55
|
# will contain explicit error information for this particular create.
|
54
56
|
# Learn about [Troubleshooting the Teams
|
55
|
-
# API](https://developer.squareup.com/docs/
|
56
|
-
#
|
57
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#bulkcreatete
|
58
|
+
# ammembers).
|
57
59
|
# @param [BulkCreateTeamMembersRequest] body Required parameter: An object
|
58
60
|
# containing the fields to POST for the request. See the corresponding
|
59
61
|
# object definition for field details.
|
@@ -82,7 +84,9 @@ module Square
|
|
82
84
|
# Return appropriate response type.
|
83
85
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
84
86
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
85
|
-
ApiResponse.new(
|
87
|
+
ApiResponse.new(
|
88
|
+
_response, data: decoded, errors: _errors
|
89
|
+
)
|
86
90
|
end
|
87
91
|
|
88
92
|
# Updates multiple `TeamMember` objects. The updated `TeamMember` objects
|
@@ -93,8 +97,8 @@ module Square
|
|
93
97
|
# marked as failed, but the body of the response
|
94
98
|
# will contain explicit error information for this particular update.
|
95
99
|
# Learn about [Troubleshooting the Teams
|
96
|
-
# API](https://developer.squareup.com/docs/
|
97
|
-
#
|
100
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#bulkupdatete
|
101
|
+
# ammembers).
|
98
102
|
# @param [BulkUpdateTeamMembersRequest] body Required parameter: An object
|
99
103
|
# containing the fields to POST for the request. See the corresponding
|
100
104
|
# object definition for field details.
|
@@ -123,13 +127,15 @@ module Square
|
|
123
127
|
# Return appropriate response type.
|
124
128
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
125
129
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
126
|
-
ApiResponse.new(
|
130
|
+
ApiResponse.new(
|
131
|
+
_response, data: decoded, errors: _errors
|
132
|
+
)
|
127
133
|
end
|
128
134
|
|
129
135
|
# Returns a paginated list of `TeamMember` objects for a business.
|
130
136
|
# The list to be returned can be filtered by:
|
131
137
|
# - location IDs **and**
|
132
|
-
# - `
|
138
|
+
# - `status`
|
133
139
|
# @param [SearchTeamMembersRequest] body Required parameter: An object
|
134
140
|
# containing the fields to POST for the request. See the corresponding
|
135
141
|
# object definition for field details.
|
@@ -158,13 +164,15 @@ module Square
|
|
158
164
|
# Return appropriate response type.
|
159
165
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
160
166
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
161
|
-
ApiResponse.new(
|
167
|
+
ApiResponse.new(
|
168
|
+
_response, data: decoded, errors: _errors
|
169
|
+
)
|
162
170
|
end
|
163
171
|
|
164
|
-
# Retrieve a `TeamMember` object for the given `TeamMember.id
|
172
|
+
# Retrieve a `TeamMember` object for the given `TeamMember.id`.
|
165
173
|
# Learn about [Troubleshooting the Teams
|
166
|
-
# API](https://developer.squareup.com/docs/
|
167
|
-
#
|
174
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#retrieveteam
|
175
|
+
# member).
|
168
176
|
# @param [String] team_member_id Required parameter: The ID of the team
|
169
177
|
# member to retrieve.
|
170
178
|
# @return [RetrieveTeamMemberResponse Hash] response from the API call
|
@@ -174,7 +182,7 @@ module Square
|
|
174
182
|
_query_builder << '/v2/team-members/{team_member_id}'
|
175
183
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
176
184
|
_query_builder,
|
177
|
-
'team_member_id' => team_member_id
|
185
|
+
'team_member_id' => { 'value' => team_member_id, 'encode' => true }
|
178
186
|
)
|
179
187
|
_query_url = APIHelper.clean_url _query_builder
|
180
188
|
|
@@ -194,14 +202,16 @@ 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
|
# Updates a single `TeamMember` object. The `TeamMember` will be returned on
|
201
211
|
# successful updates.
|
202
212
|
# Learn about [Troubleshooting the Teams
|
203
|
-
# API](https://developer.squareup.com/docs/
|
204
|
-
#
|
213
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#updateteamme
|
214
|
+
# mber).
|
205
215
|
# @param [String] team_member_id Required parameter: The ID of the team
|
206
216
|
# member to update.
|
207
217
|
# @param [UpdateTeamMemberRequest] body Required parameter: An object
|
@@ -215,7 +225,7 @@ module Square
|
|
215
225
|
_query_builder << '/v2/team-members/{team_member_id}'
|
216
226
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
217
227
|
_query_builder,
|
218
|
-
'team_member_id' => team_member_id
|
228
|
+
'team_member_id' => { 'value' => team_member_id, 'encode' => true }
|
219
229
|
)
|
220
230
|
_query_url = APIHelper.clean_url _query_builder
|
221
231
|
|
@@ -237,14 +247,16 @@ 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
|
# Retrieve a `WageSetting` object for a team member specified
|
244
256
|
# by `TeamMember.id`.
|
245
257
|
# Learn about [Troubleshooting the Teams
|
246
|
-
# API](https://developer.squareup.com/docs/
|
247
|
-
#
|
258
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#retrievewage
|
259
|
+
# setting).
|
248
260
|
# @param [String] team_member_id Required parameter: The ID of the team
|
249
261
|
# member to retrieve wage setting for
|
250
262
|
# @return [RetrieveWageSettingResponse Hash] response from the API call
|
@@ -254,7 +266,7 @@ module Square
|
|
254
266
|
_query_builder << '/v2/team-members/{team_member_id}/wage-setting'
|
255
267
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
256
268
|
_query_builder,
|
257
|
-
'team_member_id' => team_member_id
|
269
|
+
'team_member_id' => { 'value' => team_member_id, 'encode' => true }
|
258
270
|
)
|
259
271
|
_query_url = APIHelper.clean_url _query_builder
|
260
272
|
|
@@ -274,7 +286,9 @@ module Square
|
|
274
286
|
# Return appropriate response type.
|
275
287
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
276
288
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
277
|
-
ApiResponse.new(
|
289
|
+
ApiResponse.new(
|
290
|
+
_response, data: decoded, errors: _errors
|
291
|
+
)
|
278
292
|
end
|
279
293
|
|
280
294
|
# Creates or updates a `WageSetting` object. The object is created if a
|
@@ -283,8 +297,8 @@ module Square
|
|
283
297
|
# it fully replaces the `WageSetting` object for the team member.
|
284
298
|
# The `WageSetting` will be returned upon successful update.
|
285
299
|
# Learn about [Troubleshooting the Teams
|
286
|
-
# API](https://developer.squareup.com/docs/
|
287
|
-
#
|
300
|
+
# API](https://developer.squareup.com/docs/team/troubleshooting#updatewagese
|
301
|
+
# tting).
|
288
302
|
# @param [String] team_member_id Required parameter: The ID of the team
|
289
303
|
# member to update the `WageSetting` object for.
|
290
304
|
# @param [UpdateWageSettingRequest] body Required parameter: An object
|
@@ -298,7 +312,7 @@ module Square
|
|
298
312
|
_query_builder << '/v2/team-members/{team_member_id}/wage-setting'
|
299
313
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
300
314
|
_query_builder,
|
301
|
-
'team_member_id' => team_member_id
|
315
|
+
'team_member_id' => { 'value' => team_member_id, 'encode' => true }
|
302
316
|
)
|
303
317
|
_query_url = APIHelper.clean_url _query_builder
|
304
318
|
|
@@ -320,7 +334,9 @@ module Square
|
|
320
334
|
# Return appropriate response type.
|
321
335
|
decoded = APIHelper.json_deserialize(_response.raw_body)
|
322
336
|
_errors = APIHelper.map_response(decoded, ['errors'])
|
323
|
-
ApiResponse.new(
|
337
|
+
ApiResponse.new(
|
338
|
+
_response, data: decoded, errors: _errors
|
339
|
+
)
|
324
340
|
end
|
325
341
|
end
|
326
342
|
end
|