square.rb 6.5.0.20201028 → 9.1.0.20210317
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 +42 -31
- data/lib/square.rb +1 -2
- data/lib/square/api/apple_pay_api.rb +8 -7
- data/lib/square/api/bank_accounts_api.rb +4 -4
- 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 +2 -1
- data/lib/square/api/catalog_api.rb +24 -10
- data/lib/square/api/checkout_api.rb +2 -2
- data/lib/square/api/customer_segments_api.rb +2 -2
- data/lib/square/api/disputes_api.rb +33 -35
- data/lib/square/api/inventory_api.rb +2 -2
- data/lib/square/api/invoices_api.rb +15 -12
- data/lib/square/api/loyalty_api.rb +1 -1
- data/lib/square/api/mobile_authorization_api.rb +2 -2
- data/lib/square/api/o_auth_api.rb +1 -4
- data/lib/square/api/payments_api.rb +57 -18
- data/lib/square/api/refunds_api.rb +26 -21
- data/lib/square/api/subscriptions_api.rb +4 -4
- data/lib/square/api/team_api.rb +14 -14
- data/lib/square/api/terminal_api.rb +15 -14
- data/lib/square/api/v1_employees_api.rb +0 -394
- data/lib/square/api/v1_transactions_api.rb +2 -83
- data/lib/square/client.rb +10 -14
- data/lib/square/configuration.rb +21 -6
- data/lib/square/http/faraday_client.rb +8 -2
- metadata +4 -5
- data/lib/square/api/v1_items_api.rb +0 -1766
- data/lib/square/api/v1_locations_api.rb +0 -69
@@ -1,69 +0,0 @@
|
|
1
|
-
module Square
|
2
|
-
# V1LocationsApi
|
3
|
-
class V1LocationsApi < BaseApi
|
4
|
-
def initialize(config, http_call_back: nil)
|
5
|
-
super(config, http_call_back: http_call_back)
|
6
|
-
end
|
7
|
-
|
8
|
-
# Get the general information for a business.
|
9
|
-
# @return [V1Merchant Hash] response from the API call
|
10
|
-
def retrieve_business
|
11
|
-
warn 'Endpoint retrieve_business in V1LocationsApi is deprecated'
|
12
|
-
# Prepare query url.
|
13
|
-
_query_builder = config.get_base_uri
|
14
|
-
_query_builder << '/v1/me'
|
15
|
-
_query_url = APIHelper.clean_url _query_builder
|
16
|
-
|
17
|
-
# Prepare headers.
|
18
|
-
_headers = {
|
19
|
-
'accept' => 'application/json'
|
20
|
-
}
|
21
|
-
|
22
|
-
# Prepare and execute HttpRequest.
|
23
|
-
_request = config.http_client.get(
|
24
|
-
_query_url,
|
25
|
-
headers: _headers
|
26
|
-
)
|
27
|
-
OAuth2.apply(config, _request)
|
28
|
-
_response = execute_request(_request)
|
29
|
-
|
30
|
-
# Return appropriate response type.
|
31
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
32
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
33
|
-
ApiResponse.new(
|
34
|
-
_response, data: decoded, errors: _errors
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Provides details for all business locations associated with a Square
|
39
|
-
# account, including the Square-assigned object ID for the location.
|
40
|
-
# @return [List of V1Merchant Hash] response from the API call
|
41
|
-
def list_locations
|
42
|
-
warn 'Endpoint list_locations in V1LocationsApi is deprecated'
|
43
|
-
# Prepare query url.
|
44
|
-
_query_builder = config.get_base_uri
|
45
|
-
_query_builder << '/v1/me/locations'
|
46
|
-
_query_url = APIHelper.clean_url _query_builder
|
47
|
-
|
48
|
-
# Prepare headers.
|
49
|
-
_headers = {
|
50
|
-
'accept' => 'application/json'
|
51
|
-
}
|
52
|
-
|
53
|
-
# Prepare and execute HttpRequest.
|
54
|
-
_request = config.http_client.get(
|
55
|
-
_query_url,
|
56
|
-
headers: _headers
|
57
|
-
)
|
58
|
-
OAuth2.apply(config, _request)
|
59
|
-
_response = execute_request(_request)
|
60
|
-
|
61
|
-
# Return appropriate response type.
|
62
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
63
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
64
|
-
ApiResponse.new(
|
65
|
-
_response, data: decoded, errors: _errors
|
66
|
-
)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|