square.rb 13.1.0.20210818 → 16.0.1.20211117
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +35 -22
- data/lib/square/api/apple_pay_api.rb +1 -1
- data/lib/square/api/base_api.rb +2 -4
- data/lib/square/api/bookings_api.rb +64 -4
- data/lib/square/api/cards_api.rb +1 -1
- data/lib/square/api/catalog_api.rb +10 -10
- data/lib/square/api/checkout_api.rb +1 -1
- data/lib/square/api/customer_groups_api.rb +3 -3
- data/lib/square/api/customer_segments_api.rb +1 -1
- data/lib/square/api/customers_api.rb +5 -5
- data/lib/square/api/devices_api.rb +1 -1
- data/lib/square/api/disputes_api.rb +1 -1
- data/lib/square/api/gift_card_activities_api.rb +26 -20
- data/lib/square/api/gift_cards_api.rb +29 -24
- data/lib/square/api/inventory_api.rb +6 -6
- data/lib/square/api/invoices_api.rb +5 -5
- data/lib/square/api/labor_api.rb +6 -6
- data/lib/square/api/locations_api.rb +2 -2
- data/lib/square/api/loyalty_api.rb +9 -9
- data/lib/square/api/mobile_authorization_api.rb +1 -1
- data/lib/square/api/o_auth_api.rb +22 -15
- data/lib/square/api/orders_api.rb +43 -6
- data/lib/square/api/payments_api.rb +12 -6
- data/lib/square/api/refunds_api.rb +1 -1
- data/lib/square/api/sites_api.rb +2 -1
- data/lib/square/api/snippets_api.rb +1 -1
- data/lib/square/api/subscriptions_api.rb +159 -16
- data/lib/square/api/team_api.rb +6 -6
- data/lib/square/api/terminal_api.rb +4 -4
- data/lib/square/api/transactions_api.rb +0 -188
- data/lib/square/api/v1_transactions_api.rb +2 -2
- data/lib/square/api_helper.rb +1 -0
- data/lib/square/client.rb +6 -11
- data/lib/square/configuration.rb +19 -20
- data/lib/square/http/api_response.rb +1 -1
- data/lib/square/http/faraday_client.rb +20 -1
- data/lib/square/utilities/file_wrapper.rb +1 -2
- data/lib/square.rb +48 -49
- data/test/test_helper.rb +1 -1
- metadata +7 -11
- data/lib/square/api/v1_employees_api.rb +0 -362
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaa278b9bc1f61b0e659dbe860cfc070db0e2e0f6d281def02b9f27bc42da721
|
4
|
+
data.tar.gz: 11e335e2982f650a5af6b7ee93e70c6574652f70e6154d71b484d0e7ad7415f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e54deb4e4f35f0796c9cd65b191282d95cf088812c2b23a072cdc37212283c739ec98848488c046403df8b2ff146146459c1232ab40f9ef29edcc9f7d107597
|
7
|
+
data.tar.gz: 1984f4566d0e0c03258ad3b230a4a25a12113fb5f7a02412bb512ae0d47684c4449ab314d83f4cfb1084b882a11a8dceec83d414e7cace41ed454914857a75ba
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Use this gem to integrate Square payments into your app and grow your business w
|
|
10
10
|
|
11
11
|
## Requirements
|
12
12
|
|
13
|
-
We support Ruby 2.5.x, 2.6.x,
|
13
|
+
We support Ruby 2.5.x, 2.6.x, 2.7.x, and 3.0.x.
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -37,6 +37,9 @@ gem 'square.rb'
|
|
37
37
|
* [Disputes]
|
38
38
|
* [Checkout]
|
39
39
|
* [Apple Pay]
|
40
|
+
* [Cards]
|
41
|
+
|
42
|
+
### Terminal
|
40
43
|
* [Terminal]
|
41
44
|
|
42
45
|
### Orders
|
@@ -60,6 +63,10 @@ gem 'square.rb'
|
|
60
63
|
### Loyalty
|
61
64
|
* [Loyalty]
|
62
65
|
|
66
|
+
### Gift Cards
|
67
|
+
* [Gift Cards]
|
68
|
+
* [Gift Card Activities]
|
69
|
+
|
63
70
|
### Bookings
|
64
71
|
* [Bookings]
|
65
72
|
|
@@ -67,12 +74,11 @@ gem 'square.rb'
|
|
67
74
|
* [Merchants]
|
68
75
|
* [Locations]
|
69
76
|
* [Devices]
|
77
|
+
* [Cash Drawers]
|
70
78
|
|
71
79
|
### Team
|
72
80
|
* [Team]
|
73
|
-
* [Employees]
|
74
81
|
* [Labor]
|
75
|
-
* [Cash Drawers]
|
76
82
|
|
77
83
|
### Financials
|
78
84
|
* [Bank Accounts]
|
@@ -86,6 +92,7 @@ gem 'square.rb'
|
|
86
92
|
* [OAuth]
|
87
93
|
|
88
94
|
### Deprecated APIs
|
95
|
+
* [Employees]
|
89
96
|
* [V1 Employees]
|
90
97
|
* [V1 Transactions]
|
91
98
|
* [V1 Items]
|
@@ -108,8 +115,8 @@ require 'square'
|
|
108
115
|
# for the Square account whose assets you want to manage.
|
109
116
|
|
110
117
|
client = Square::Client.new(
|
111
|
-
|
112
|
-
|
118
|
+
access_token: 'YOUR SANDBOX ACCESS TOKEN HERE',
|
119
|
+
environment: 'sandbox'
|
113
120
|
)
|
114
121
|
|
115
122
|
# Call list_locations method to get all locations in this Square account
|
@@ -117,10 +124,10 @@ result = client.locations.list_locations
|
|
117
124
|
|
118
125
|
# Call the #success? method to see if the call succeeded
|
119
126
|
if result.success?
|
120
|
-
|
127
|
+
# The #data Struct contains a list of locations
|
121
128
|
locations = result.data.locations
|
122
129
|
|
123
|
-
|
130
|
+
# Iterate over the list
|
124
131
|
locations.each do |location|
|
125
132
|
# Each location is represented as a Hash
|
126
133
|
location.each do |key, value|
|
@@ -169,6 +176,7 @@ This error was returned when an invalid token was used to call the API.
|
|
169
176
|
After you’ve tried out the Square APIs and tested your application using sandbox, you will want to switch to your production credentials so that you can manage real Square resources. Don't forget to switch your access token from sandbox to production for real data.
|
170
177
|
|
171
178
|
## SDK patterns
|
179
|
+
|
172
180
|
If you know a few patterns, you’ll be able to call any API in the SDK. Here are some important ones:
|
173
181
|
|
174
182
|
### Get an access token
|
@@ -189,30 +197,31 @@ To use the Square API, you import the Client class, instantiate a Client object,
|
|
189
197
|
|
190
198
|
- Instantiate a `Square::Client` object with the access token for the Square account whose resources you want to manage. To access sandbox resources, initialize the `Square::Client` with environment set to sandbox:
|
191
199
|
|
192
|
-
```ruby
|
193
|
-
client = Square::Client.new(
|
200
|
+
```ruby
|
201
|
+
client = Square::Client.new(
|
194
202
|
access_token: 'SANDBOX ACCESS TOKEN HERE',
|
195
203
|
environment: 'sandbox'
|
196
|
-
)
|
197
|
-
```
|
204
|
+
)
|
205
|
+
```
|
198
206
|
|
199
207
|
- To access production resources, set environment to production:
|
200
208
|
|
201
|
-
```ruby
|
202
|
-
client = Square::Client.new(
|
209
|
+
```ruby
|
210
|
+
client = Square::Client.new(
|
203
211
|
access_token: 'ACCESS TOKEN HERE',
|
204
212
|
environment: 'production'
|
205
|
-
)
|
206
|
-
```
|
213
|
+
)
|
214
|
+
```
|
207
215
|
|
208
216
|
- To set a custom environment provide a `custom_url`, and set environment to `custom`:
|
209
217
|
|
210
|
-
```ruby
|
211
|
-
client = Square::Client.new(
|
218
|
+
```ruby
|
219
|
+
client = Square::Client.new(
|
212
220
|
access_token:'ACCESS TOKEN HERE',
|
213
221
|
environment: 'custom',
|
214
222
|
custom_url: 'https://your.customdomain.com'
|
215
|
-
)
|
223
|
+
)
|
224
|
+
```
|
216
225
|
|
217
226
|
### Get an Instance of an API object and call its methods
|
218
227
|
|
@@ -220,9 +229,9 @@ Each API is implemented as a class. The Client object instantiates every API cla
|
|
220
229
|
|
221
230
|
- Work with an API by calling the methods on the API object. For example, you would call list_customers to get a list of all customers in the Square account:
|
222
231
|
|
223
|
-
```ruby
|
224
|
-
result = client.customers.list_customers
|
225
|
-
```
|
232
|
+
```ruby
|
233
|
+
result = client.customers.list_customers
|
234
|
+
```
|
226
235
|
|
227
236
|
See the SDK documentation for the list of methods for each API class.
|
228
237
|
|
@@ -243,6 +252,7 @@ result = client.customers.create_customer(request_body)
|
|
243
252
|
```
|
244
253
|
|
245
254
|
If your call succeeds, you’ll see a response that looks like this:
|
255
|
+
|
246
256
|
```
|
247
257
|
{'customer': {'created_at': '2019-06-28T21:23:05.126Z', 'creation_source': 'THIRD_PARTY', 'family_name': 'Earhardt', 'given_name': 'Amelia', 'id': 'CBASEDwl3El91nohQ2FLEk4aBfcgAQ', 'preferences': {'email_unsubscribed': False}, 'updated_at': '2019-06-28T21:23:05.126Z'}}
|
248
258
|
```
|
@@ -267,7 +277,7 @@ end
|
|
267
277
|
|
268
278
|
## Tests
|
269
279
|
|
270
|
-
First, clone the
|
280
|
+
First, clone the repo locally and `cd` into the directory.
|
271
281
|
|
272
282
|
```sh
|
273
283
|
git clone https://github.com/square/square-ruby-sdk.git
|
@@ -337,3 +347,6 @@ You can also use the Square API to create applications or services that work wit
|
|
337
347
|
[Transactions]: doc/api/transactions.md
|
338
348
|
[Sites]: doc/api/sites.md
|
339
349
|
[Snippets]: doc/api/snippets.md
|
350
|
+
[Cards]: doc/api/cards.md
|
351
|
+
[Gift Cards]: doc/api/gift-cards.md
|
352
|
+
[Gift Card Activities]: doc/api/gift-card-activities.md
|
data/lib/square/api/base_api.rb
CHANGED
@@ -8,7 +8,7 @@ module Square
|
|
8
8
|
@http_call_back = http_call_back
|
9
9
|
|
10
10
|
@global_headers = {
|
11
|
-
'user-agent' => 'Square-Ruby-SDK/
|
11
|
+
'user-agent' => 'Square-Ruby-SDK/16.0.1.20211117',
|
12
12
|
'Square-Version' => config.square_version
|
13
13
|
}
|
14
14
|
end
|
@@ -24,9 +24,7 @@ module Square
|
|
24
24
|
|
25
25
|
APIHelper.clean_hash(request.headers)
|
26
26
|
request.headers.merge!(@global_headers)
|
27
|
-
unless config.additional_headers.nil?
|
28
|
-
request.headers.merge!(config.additional_headers)
|
29
|
-
end
|
27
|
+
request.headers.merge!(config.additional_headers) unless config.additional_headers.nil?
|
30
28
|
|
31
29
|
response = if binary
|
32
30
|
config.http_client.execute_as_binary(request)
|
@@ -5,6 +5,66 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
+
# Retrieve a collection of bookings.
|
9
|
+
# @param [Integer] limit Optional parameter: The maximum number of results
|
10
|
+
# per page to return in a paged response.
|
11
|
+
# @param [String] cursor Optional parameter: The pagination cursor from the
|
12
|
+
# preceding response to return the next page of the results. Do not set this
|
13
|
+
# when retrieving the first page of the results.
|
14
|
+
# @param [String] team_member_id Optional parameter: The team member for
|
15
|
+
# whom to retrieve bookings. If this is not set, bookings of all members are
|
16
|
+
# retrieved.
|
17
|
+
# @param [String] location_id Optional parameter: The location for which to
|
18
|
+
# retrieve bookings. If this is not set, all locations' bookings are
|
19
|
+
# retrieved.
|
20
|
+
# @param [String] start_at_min Optional parameter: The RFC 3339 timestamp
|
21
|
+
# specifying the earliest of the start time. If this is not set, the current
|
22
|
+
# time is used.
|
23
|
+
# @param [String] start_at_max Optional parameter: The RFC 3339 timestamp
|
24
|
+
# specifying the latest of the start time. If this is not set, the time of
|
25
|
+
# 31 days after `start_at_min` is used.
|
26
|
+
# @return [ListBookingsResponse Hash] response from the API call
|
27
|
+
def list_bookings(limit: nil,
|
28
|
+
cursor: nil,
|
29
|
+
team_member_id: nil,
|
30
|
+
location_id: nil,
|
31
|
+
start_at_min: nil,
|
32
|
+
start_at_max: nil)
|
33
|
+
# Prepare query url.
|
34
|
+
_query_builder = config.get_base_uri
|
35
|
+
_query_builder << '/v2/bookings'
|
36
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
37
|
+
_query_builder,
|
38
|
+
'limit' => limit,
|
39
|
+
'cursor' => cursor,
|
40
|
+
'team_member_id' => team_member_id,
|
41
|
+
'location_id' => location_id,
|
42
|
+
'start_at_min' => start_at_min,
|
43
|
+
'start_at_max' => start_at_max
|
44
|
+
)
|
45
|
+
_query_url = APIHelper.clean_url _query_builder
|
46
|
+
|
47
|
+
# Prepare headers.
|
48
|
+
_headers = {
|
49
|
+
'accept' => 'application/json'
|
50
|
+
}
|
51
|
+
|
52
|
+
# Prepare and execute HttpRequest.
|
53
|
+
_request = config.http_client.get(
|
54
|
+
_query_url,
|
55
|
+
headers: _headers
|
56
|
+
)
|
57
|
+
OAuth2.apply(config, _request)
|
58
|
+
_response = execute_request(_request)
|
59
|
+
|
60
|
+
# Return appropriate response type.
|
61
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
62
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
63
|
+
ApiResponse.new(
|
64
|
+
_response, data: decoded, errors: _errors
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
8
68
|
# Creates a booking.
|
9
69
|
# @param [CreateBookingRequest] body Required parameter: An object
|
10
70
|
# containing the fields to POST for the request. See the corresponding
|
@@ -19,7 +79,7 @@ module Square
|
|
19
79
|
# Prepare headers.
|
20
80
|
_headers = {
|
21
81
|
'accept' => 'application/json',
|
22
|
-
'
|
82
|
+
'Content-Type' => 'application/json'
|
23
83
|
}
|
24
84
|
|
25
85
|
# Prepare and execute HttpRequest.
|
@@ -53,7 +113,7 @@ module Square
|
|
53
113
|
# Prepare headers.
|
54
114
|
_headers = {
|
55
115
|
'accept' => 'application/json',
|
56
|
-
'
|
116
|
+
'Content-Type' => 'application/json'
|
57
117
|
}
|
58
118
|
|
59
119
|
# Prepare and execute HttpRequest.
|
@@ -242,7 +302,7 @@ module Square
|
|
242
302
|
# Prepare headers.
|
243
303
|
_headers = {
|
244
304
|
'accept' => 'application/json',
|
245
|
-
'
|
305
|
+
'Content-Type' => 'application/json'
|
246
306
|
}
|
247
307
|
|
248
308
|
# Prepare and execute HttpRequest.
|
@@ -283,7 +343,7 @@ module Square
|
|
283
343
|
# Prepare headers.
|
284
344
|
_headers = {
|
285
345
|
'accept' => 'application/json',
|
286
|
-
'
|
346
|
+
'Content-Type' => 'application/json'
|
287
347
|
}
|
288
348
|
|
289
349
|
# Prepare and execute HttpRequest.
|
data/lib/square/api/cards_api.rb
CHANGED
@@ -29,7 +29,7 @@ module Square
|
|
29
29
|
# Prepare headers.
|
30
30
|
_headers = {
|
31
31
|
'accept' => 'application/json',
|
32
|
-
'
|
32
|
+
'Content-Type' => 'application/json'
|
33
33
|
}
|
34
34
|
|
35
35
|
# Prepare and execute HttpRequest.
|
@@ -68,7 +68,7 @@ module Square
|
|
68
68
|
# Prepare headers.
|
69
69
|
_headers = {
|
70
70
|
'accept' => 'application/json',
|
71
|
-
'
|
71
|
+
'Content-Type' => 'application/json'
|
72
72
|
}
|
73
73
|
|
74
74
|
# Prepare and execute HttpRequest.
|
@@ -115,7 +115,7 @@ module Square
|
|
115
115
|
# Prepare headers.
|
116
116
|
_headers = {
|
117
117
|
'accept' => 'application/json',
|
118
|
-
'
|
118
|
+
'Content-Type' => 'application/json'
|
119
119
|
}
|
120
120
|
|
121
121
|
# Prepare and execute HttpRequest.
|
@@ -307,7 +307,7 @@ module Square
|
|
307
307
|
# Prepare headers.
|
308
308
|
_headers = {
|
309
309
|
'accept' => 'application/json',
|
310
|
-
'
|
310
|
+
'Content-Type' => 'application/json'
|
311
311
|
}
|
312
312
|
|
313
313
|
# Prepare and execute HttpRequest.
|
@@ -435,7 +435,7 @@ module Square
|
|
435
435
|
# Searches for [CatalogObject]($m/CatalogObject) of any type by matching
|
436
436
|
# supported search attribute values,
|
437
437
|
# excluding custom attribute values on items or item variations, against one
|
438
|
-
# or more of the specified query
|
438
|
+
# or more of the specified query filters.
|
439
439
|
# This (`SearchCatalogObjects`) endpoint differs from the
|
440
440
|
# [SearchCatalogItems]($e/Catalog/SearchCatalogItems)
|
441
441
|
# endpoint in the following aspects:
|
@@ -462,7 +462,7 @@ module Square
|
|
462
462
|
# Prepare headers.
|
463
463
|
_headers = {
|
464
464
|
'accept' => 'application/json',
|
465
|
-
'
|
465
|
+
'Content-Type' => 'application/json'
|
466
466
|
}
|
467
467
|
|
468
468
|
# Prepare and execute HttpRequest.
|
@@ -485,7 +485,7 @@ module Square
|
|
485
485
|
# Searches for catalog items or item variations by matching supported search
|
486
486
|
# attribute values, including
|
487
487
|
# custom attribute values, against one or more of the specified query
|
488
|
-
#
|
488
|
+
# filters.
|
489
489
|
# This (`SearchCatalogItems`) endpoint differs from the
|
490
490
|
# [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
|
491
491
|
# endpoint in the following aspects:
|
@@ -512,7 +512,7 @@ module Square
|
|
512
512
|
# Prepare headers.
|
513
513
|
_headers = {
|
514
514
|
'accept' => 'application/json',
|
515
|
-
'
|
515
|
+
'Content-Type' => 'application/json'
|
516
516
|
}
|
517
517
|
|
518
518
|
# Prepare and execute HttpRequest.
|
@@ -548,7 +548,7 @@ module Square
|
|
548
548
|
# Prepare headers.
|
549
549
|
_headers = {
|
550
550
|
'accept' => 'application/json',
|
551
|
-
'
|
551
|
+
'Content-Type' => 'application/json'
|
552
552
|
}
|
553
553
|
|
554
554
|
# Prepare and execute HttpRequest.
|
@@ -584,7 +584,7 @@ module Square
|
|
584
584
|
# Prepare headers.
|
585
585
|
_headers = {
|
586
586
|
'accept' => 'application/json',
|
587
|
-
'
|
587
|
+
'Content-Type' => 'application/json'
|
588
588
|
}
|
589
589
|
|
590
590
|
# Prepare and execute HttpRequest.
|
@@ -13,7 +13,7 @@ module Square
|
|
13
13
|
# ion).
|
14
14
|
# @param [Integer] limit Optional parameter: The maximum number of results
|
15
15
|
# to return in a single page. This limit is advisory. The response might
|
16
|
-
# contain more or fewer results.
|
16
|
+
# contain more or fewer results. The limit is ignored if it is less than 1
|
17
17
|
# or greater than 50. The default value is 50. For more information, see
|
18
18
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
19
19
|
# ion).
|
@@ -66,7 +66,7 @@ module Square
|
|
66
66
|
# Prepare headers.
|
67
67
|
_headers = {
|
68
68
|
'accept' => 'application/json',
|
69
|
-
'
|
69
|
+
'Content-Type' => 'application/json'
|
70
70
|
}
|
71
71
|
|
72
72
|
# Prepare and execute HttpRequest.
|
@@ -177,7 +177,7 @@ module Square
|
|
177
177
|
# Prepare headers.
|
178
178
|
_headers = {
|
179
179
|
'accept' => 'application/json',
|
180
|
-
'
|
180
|
+
'Content-Type' => 'application/json'
|
181
181
|
}
|
182
182
|
|
183
183
|
# Prepare and execute HttpRequest.
|
@@ -13,7 +13,7 @@ module Square
|
|
13
13
|
# ion).
|
14
14
|
# @param [Integer] limit Optional parameter: The maximum number of results
|
15
15
|
# to return in a single page. This limit is advisory. The response might
|
16
|
-
# contain more or fewer results.
|
16
|
+
# contain more or fewer results. The limit is ignored if it is less than 1
|
17
17
|
# or greater than 50. The default value is 50. For more information, see
|
18
18
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
19
19
|
# ion).
|
@@ -19,7 +19,7 @@ module Square
|
|
19
19
|
# ion).
|
20
20
|
# @param [Integer] limit Optional parameter: The maximum number of results
|
21
21
|
# to return in a single page. This limit is advisory. The response might
|
22
|
-
# contain more or fewer results.
|
22
|
+
# contain more or fewer results. The limit is ignored if it is less than 1
|
23
23
|
# or greater than 100. The default value is 100. For more information, see
|
24
24
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
25
25
|
# ion).
|
@@ -88,7 +88,7 @@ module Square
|
|
88
88
|
# Prepare headers.
|
89
89
|
_headers = {
|
90
90
|
'accept' => 'application/json',
|
91
|
-
'
|
91
|
+
'Content-Type' => 'application/json'
|
92
92
|
}
|
93
93
|
|
94
94
|
# Prepare and execute HttpRequest.
|
@@ -132,7 +132,7 @@ module Square
|
|
132
132
|
# Prepare headers.
|
133
133
|
_headers = {
|
134
134
|
'accept' => 'application/json',
|
135
|
-
'
|
135
|
+
'Content-Type' => 'application/json'
|
136
136
|
}
|
137
137
|
|
138
138
|
# Prepare and execute HttpRequest.
|
@@ -274,7 +274,7 @@ module Square
|
|
274
274
|
# Prepare headers.
|
275
275
|
_headers = {
|
276
276
|
'accept' => 'application/json',
|
277
|
-
'
|
277
|
+
'Content-Type' => 'application/json'
|
278
278
|
}
|
279
279
|
|
280
280
|
# Prepare and execute HttpRequest.
|
@@ -320,7 +320,7 @@ module Square
|
|
320
320
|
# Prepare headers.
|
321
321
|
_headers = {
|
322
322
|
'accept' => 'application/json',
|
323
|
-
'
|
323
|
+
'Content-Type' => 'application/json'
|
324
324
|
}
|
325
325
|
|
326
326
|
# Prepare and execute HttpRequest.
|
@@ -13,29 +13,35 @@ module Square
|
|
13
13
|
# for a gift card,
|
14
14
|
# for all gift cards in a specific region, or for activities within a time
|
15
15
|
# window.
|
16
|
-
# @param [String] gift_card_id Optional parameter: If
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# @param [String] type Optional parameter: If
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
16
|
+
# @param [String] gift_card_id Optional parameter: If a gift card ID is
|
17
|
+
# provided, the endpoint returns activities related to the specified gift
|
18
|
+
# card. Otherwise, the endpoint returns all gift card activities for the
|
19
|
+
# seller.
|
20
|
+
# @param [String] type Optional parameter: If a
|
21
|
+
# [type]($m/GiftCardActivityType) is provided, the endpoint returns gift
|
22
|
+
# card activities of the specified type. Otherwise, the endpoint returns
|
23
|
+
# all types of gift card activities.
|
24
|
+
# @param [String] location_id Optional parameter: If a location ID is
|
25
|
+
# provided, the endpoint returns gift card activities for the specified
|
26
|
+
# location. Otherwise, the endpoint returns gift card activities for all
|
27
|
+
# locations.
|
26
28
|
# @param [String] begin_time Optional parameter: The timestamp for the
|
27
|
-
# beginning of the reporting period, in RFC 3339 format.
|
28
|
-
# The current time minus one year.
|
29
|
+
# beginning of the reporting period, in RFC 3339 format. This start time is
|
30
|
+
# inclusive. The default value is the current time minus one year.
|
29
31
|
# @param [String] end_time Optional parameter: The timestamp for the end of
|
30
|
-
# the reporting period, in RFC 3339 format.
|
31
|
-
# time.
|
32
|
-
# @param [Integer] limit Optional parameter: If
|
33
|
-
#
|
34
|
-
#
|
32
|
+
# the reporting period, in RFC 3339 format. This end time is inclusive. The
|
33
|
+
# default value is the current time.
|
34
|
+
# @param [Integer] limit Optional parameter: If a limit is provided, the
|
35
|
+
# endpoint returns the specified number of results (or fewer) per page. The
|
36
|
+
# maximum value is 100. The default value is 50. For more information, see
|
37
|
+
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
38
|
+
# ion).
|
35
39
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
36
40
|
# a previous call to this endpoint. Provide this cursor to retrieve the next
|
37
|
-
# set of results for the original query. If
|
38
|
-
#
|
41
|
+
# set of results for the original query. If a cursor is not provided, the
|
42
|
+
# endpoint returns the first page of the results. For more information, see
|
43
|
+
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
44
|
+
# ion).
|
39
45
|
# @param [String] sort_order Optional parameter: The order in which the
|
40
46
|
# endpoint returns the activities, based on `created_at`. - `ASC` - Oldest
|
41
47
|
# to newest. - `DESC` - Newest to oldest (default).
|
@@ -104,7 +110,7 @@ module Square
|
|
104
110
|
# Prepare headers.
|
105
111
|
_headers = {
|
106
112
|
'accept' => 'application/json',
|
107
|
-
'
|
113
|
+
'Content-Type' => 'application/json'
|
108
114
|
}
|
109
115
|
|
110
116
|
# Prepare and execute HttpRequest.
|