square.rb 3.20191120.0 → 4.0.0.20191217
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/lib/square/api/apple_pay_api.rb +0 -5
- data/lib/square/api/base_api.rb +2 -7
- data/lib/square/api/cash_drawers_api.rb +150 -0
- data/lib/square/api/catalog_api.rb +0 -5
- data/lib/square/api/checkout_api.rb +0 -5
- data/lib/square/api/customers_api.rb +0 -5
- data/lib/square/api/employees_api.rb +0 -5
- data/lib/square/api/inventory_api.rb +0 -5
- data/lib/square/api/labor_api.rb +0 -5
- data/lib/square/api/locations_api.rb +0 -5
- data/lib/square/api/merchants_api.rb +0 -5
- data/lib/square/api/mobile_authorization_api.rb +0 -5
- data/lib/square/api/o_auth_api.rb +0 -5
- data/lib/square/api/orders_api.rb +0 -5
- data/lib/square/api/payments_api.rb +0 -5
- data/lib/square/api/refunds_api.rb +0 -5
- data/lib/square/api/reporting_api.rb +0 -5
- data/lib/square/api/transactions_api.rb +0 -5
- data/lib/square/api/v1_employees_api.rb +0 -5
- data/lib/square/api/v1_items_api.rb +0 -5
- data/lib/square/api/v1_locations_api.rb +0 -5
- data/lib/square/api/v1_transactions_api.rb +1 -7
- data/lib/square/api_helper.rb +0 -5
- data/lib/square/client.rb +8 -7
- data/lib/square/configuration.rb +0 -5
- data/lib/square/exceptions/api_exception.rb +0 -5
- data/lib/square/http/api_response.rb +0 -5
- data/lib/square/http/auth/o_auth2.rb +0 -5
- data/lib/square/http/faraday_client.rb +0 -5
- data/lib/square/http/http_call_back.rb +0 -5
- data/lib/square/http/http_client.rb +0 -5
- data/lib/square/http/http_method_enum.rb +0 -5
- data/lib/square/http/http_request.rb +0 -5
- data/lib/square/http/http_response.rb +0 -5
- data/lib/square.rb +1 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b79344dfa1ffa7565b23b554bc663e4af18402c6c158d12ed9a5c79b7bf2ea7
|
4
|
+
data.tar.gz: 1008fab3f5f0199e49158b99e364f7f3a30796596ba5a4e529b9166026cd69f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2707c254aeacf861c339e949e5b921b26fd052a16382f1e5247a6fc3faa19962ecdbc15f3051385bb6dad64da61a4b869dfd9ab35bf198aef8ed285a0dc355b4
|
7
|
+
data.tar.gz: 6d40706c4a8b70a1010883bf81ffbfb5ea1de04273f9ae11979dfc9da0f3527c38f778097eec7ca438d1ea9df090792820f4cfdad98cf07dbdb7cda4026fb4f1
|
data/lib/square/api/base_api.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
# square
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
1
|
module Square
|
7
2
|
# BaseApi.
|
8
3
|
class BaseApi
|
@@ -13,8 +8,8 @@ module Square
|
|
13
8
|
@http_call_back = http_call_back
|
14
9
|
|
15
10
|
@global_headers = {
|
16
|
-
'user-agent' => 'Square-Ruby-SDK/
|
17
|
-
'Square-Version' => '2019-
|
11
|
+
'user-agent' => 'Square-Ruby-SDK/4.0.0.20191217',
|
12
|
+
'Square-Version' => '2019-12-17'
|
18
13
|
}
|
19
14
|
end
|
20
15
|
|
@@ -0,0 +1,150 @@
|
|
1
|
+
module Square
|
2
|
+
# CashDrawersApi
|
3
|
+
class CashDrawersApi < BaseApi
|
4
|
+
def initialize(config, http_call_back: nil)
|
5
|
+
super(config, http_call_back: http_call_back)
|
6
|
+
end
|
7
|
+
|
8
|
+
# Provides the details for all of the cash drawer shifts for a location
|
9
|
+
# in a date range.
|
10
|
+
# @param [String] location_id Required parameter: The ID of the location to
|
11
|
+
# query for a list of cash drawer shifts.
|
12
|
+
# @param [SortOrder] sort_order Optional parameter: The order in which cash
|
13
|
+
# drawer shifts are listed in the response, based on their opened_at field.
|
14
|
+
# Default value: ASC
|
15
|
+
# @param [String] begin_time Optional parameter: The inclusive start time of
|
16
|
+
# the query on opened_at, in ISO 8601 format.
|
17
|
+
# @param [String] end_time Optional parameter: The exclusive end date of the
|
18
|
+
# query on opened_at, in ISO 8601 format.
|
19
|
+
# @param [Integer] limit Optional parameter: Number of cash drawer shift
|
20
|
+
# events in a page of results (200 by default, 1000 max).
|
21
|
+
# @param [String] cursor Optional parameter: Opaque cursor for fetching the
|
22
|
+
# next page of results.
|
23
|
+
# @return [ListCashDrawerShiftsResponse Hash] response from the API call
|
24
|
+
def list_cash_drawer_shifts(location_id:,
|
25
|
+
sort_order: nil,
|
26
|
+
begin_time: nil,
|
27
|
+
end_time: nil,
|
28
|
+
limit: nil,
|
29
|
+
cursor: nil)
|
30
|
+
# Prepare query url.
|
31
|
+
_query_builder = config.get_base_uri
|
32
|
+
_query_builder << '/v2/cash-drawers/shifts'
|
33
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
34
|
+
_query_builder,
|
35
|
+
'location_id' => location_id,
|
36
|
+
'sort_order' => sort_order,
|
37
|
+
'begin_time' => begin_time,
|
38
|
+
'end_time' => end_time,
|
39
|
+
'limit' => limit,
|
40
|
+
'cursor' => cursor
|
41
|
+
)
|
42
|
+
_query_url = APIHelper.clean_url _query_builder
|
43
|
+
|
44
|
+
# Prepare headers.
|
45
|
+
_headers = {
|
46
|
+
'accept' => 'application/json'
|
47
|
+
}
|
48
|
+
|
49
|
+
# Prepare and execute HttpRequest.
|
50
|
+
_request = config.http_client.get(
|
51
|
+
_query_url,
|
52
|
+
headers: _headers
|
53
|
+
)
|
54
|
+
OAuth2.apply(config, _request)
|
55
|
+
_response = execute_request(_request)
|
56
|
+
|
57
|
+
# Return appropriate response type.
|
58
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
59
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
60
|
+
ApiResponse.new(_response, data: decoded, errors: _errors)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Provides the summary details for a single cash drawer shift. See
|
64
|
+
# RetrieveCashDrawerShiftEvents for a list of cash drawer shift events.
|
65
|
+
# @param [String] location_id Required parameter: The ID of the location to
|
66
|
+
# retrieve cash drawer shifts from.
|
67
|
+
# @param [String] shift_id Required parameter: The shift ID.
|
68
|
+
# @return [RetrieveCashDrawerShiftResponse Hash] response from the API call
|
69
|
+
def retrieve_cash_drawer_shift(location_id:,
|
70
|
+
shift_id:)
|
71
|
+
# Prepare query url.
|
72
|
+
_query_builder = config.get_base_uri
|
73
|
+
_query_builder << '/v2/cash-drawers/shifts/{shift_id}'
|
74
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
75
|
+
_query_builder,
|
76
|
+
'shift_id' => shift_id
|
77
|
+
)
|
78
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
79
|
+
_query_builder,
|
80
|
+
'location_id' => location_id
|
81
|
+
)
|
82
|
+
_query_url = APIHelper.clean_url _query_builder
|
83
|
+
|
84
|
+
# Prepare headers.
|
85
|
+
_headers = {
|
86
|
+
'accept' => 'application/json'
|
87
|
+
}
|
88
|
+
|
89
|
+
# Prepare and execute HttpRequest.
|
90
|
+
_request = config.http_client.get(
|
91
|
+
_query_url,
|
92
|
+
headers: _headers
|
93
|
+
)
|
94
|
+
OAuth2.apply(config, _request)
|
95
|
+
_response = execute_request(_request)
|
96
|
+
|
97
|
+
# Return appropriate response type.
|
98
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
99
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
100
|
+
ApiResponse.new(_response, data: decoded, errors: _errors)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Provides a paginated list of events for a single cash drawer shift.
|
104
|
+
# @param [String] location_id Required parameter: The ID of the location to
|
105
|
+
# list cash drawer shifts for.
|
106
|
+
# @param [String] shift_id Required parameter: The shift ID.
|
107
|
+
# @param [Integer] limit Optional parameter: Number of resources to be
|
108
|
+
# returned in a page of results (200 by default, 1000 max).
|
109
|
+
# @param [String] cursor Optional parameter: Opaque cursor for fetching the
|
110
|
+
# next page of results.
|
111
|
+
# @return [ListCashDrawerShiftEventsResponse Hash] response from the API call
|
112
|
+
def list_cash_drawer_shift_events(location_id:,
|
113
|
+
shift_id:,
|
114
|
+
limit: nil,
|
115
|
+
cursor: nil)
|
116
|
+
# Prepare query url.
|
117
|
+
_query_builder = config.get_base_uri
|
118
|
+
_query_builder << '/v2/cash-drawers/shifts/{shift_id}/events'
|
119
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
120
|
+
_query_builder,
|
121
|
+
'shift_id' => shift_id
|
122
|
+
)
|
123
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
124
|
+
_query_builder,
|
125
|
+
'location_id' => location_id,
|
126
|
+
'limit' => limit,
|
127
|
+
'cursor' => cursor
|
128
|
+
)
|
129
|
+
_query_url = APIHelper.clean_url _query_builder
|
130
|
+
|
131
|
+
# Prepare headers.
|
132
|
+
_headers = {
|
133
|
+
'accept' => 'application/json'
|
134
|
+
}
|
135
|
+
|
136
|
+
# Prepare and execute HttpRequest.
|
137
|
+
_request = config.http_client.get(
|
138
|
+
_query_url,
|
139
|
+
headers: _headers
|
140
|
+
)
|
141
|
+
OAuth2.apply(config, _request)
|
142
|
+
_response = execute_request(_request)
|
143
|
+
|
144
|
+
# Return appropriate response type.
|
145
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
146
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
147
|
+
ApiResponse.new(_response, data: decoded, errors: _errors)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
data/lib/square/api/labor_api.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
# square
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
1
|
module Square
|
7
2
|
# V1TransactionsApi
|
8
3
|
class V1TransactionsApi < BaseApi
|
@@ -454,8 +449,7 @@ module Square
|
|
454
449
|
# *Note**: the ListSettlements endpoint does not provide entry
|
455
450
|
# information.
|
456
451
|
# @param [String] location_id Required parameter: The ID of the location to
|
457
|
-
# list settlements for.
|
458
|
-
# aggregated from all of the business's locations.
|
452
|
+
# list settlements for.
|
459
453
|
# @param [SortOrder] order Optional parameter: TThe order in which payments
|
460
454
|
# are listed in the response.
|
461
455
|
# @param [String] begin_time Optional parameter: The beginning of the
|
data/lib/square/api_helper.rb
CHANGED
data/lib/square/client.rb
CHANGED
@@ -1,19 +1,14 @@
|
|
1
|
-
# square
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
1
|
module Square
|
7
2
|
# square client class.
|
8
3
|
class Client
|
9
4
|
attr_reader :config
|
10
5
|
|
11
6
|
def sdk_version
|
12
|
-
'
|
7
|
+
'4.0.0.20191217'
|
13
8
|
end
|
14
9
|
|
15
10
|
def square_version
|
16
|
-
'2019-
|
11
|
+
'2019-12-17'
|
17
12
|
end
|
18
13
|
|
19
14
|
# Access to mobile_authorization controller.
|
@@ -58,6 +53,12 @@ module Square
|
|
58
53
|
@apple_pay ||= ApplePayApi.new config
|
59
54
|
end
|
60
55
|
|
56
|
+
# Access to cash_drawers controller.
|
57
|
+
# @return [CashDrawersApi] Returns the controller instance.
|
58
|
+
def cash_drawers
|
59
|
+
@cash_drawers ||= CashDrawersApi.new config
|
60
|
+
end
|
61
|
+
|
61
62
|
# Access to catalog controller.
|
62
63
|
# @return [CatalogApi] Returns the controller instance.
|
63
64
|
def catalog
|
data/lib/square/configuration.rb
CHANGED
data/lib/square.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
# square
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
1
|
require 'date'
|
7
2
|
require 'json'
|
8
3
|
require 'faraday'
|
@@ -38,6 +33,7 @@ require_relative 'square/api/v1_employees_api.rb'
|
|
38
33
|
require_relative 'square/api/v1_transactions_api.rb'
|
39
34
|
require_relative 'square/api/v1_items_api.rb'
|
40
35
|
require_relative 'square/api/apple_pay_api.rb'
|
36
|
+
require_relative 'square/api/cash_drawers_api.rb'
|
41
37
|
require_relative 'square/api/catalog_api.rb'
|
42
38
|
require_relative 'square/api/customers_api.rb'
|
43
39
|
require_relative 'square/api/employees_api.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.20191217
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square Developer Platform
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/square.rb
|
121
121
|
- lib/square/api/apple_pay_api.rb
|
122
122
|
- lib/square/api/base_api.rb
|
123
|
+
- lib/square/api/cash_drawers_api.rb
|
123
124
|
- lib/square/api/catalog_api.rb
|
124
125
|
- lib/square/api/checkout_api.rb
|
125
126
|
- lib/square/api/customers_api.rb
|