square.rb 10.0.0.202104217 → 11.0.0.20210513
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/lib/square.rb +2 -0
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/catalog_api.rb +2 -1
- data/lib/square/api/loyalty_api.rb +9 -3
- data/lib/square/api/orders_api.rb +27 -27
- data/lib/square/api/sites_api.rb +42 -0
- data/lib/square/api/snippets_api.rb +146 -0
- data/lib/square/api/v1_transactions_api.rb +9 -0
- data/lib/square/client.rb +14 -2
- data/lib/square/configuration.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bd47b45ea9eca98fd3703e49daddc69b4b2ff2dea6d7badf813f75712ef1a41
|
4
|
+
data.tar.gz: a26991adca5e6f459a2467678cce0f61e244b2a997aa60750ed2d3a17f183aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4923c144ec01aade0ca6386fef939d257213eac3f55565fcf29f34c9876e032c9ff47004e04d36453b70028d00b04573911c59434654cd500f655b3a718df04b
|
7
|
+
data.tar.gz: 9b2539e8da3c4d0e613c76e27a0ae82c64accac2008e7db8ca324cb48e19cfe663e65f1b86118ba56f133daeaf813e98dad05f1bd75144c198494c07fe61457d
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Square Ruby SDK
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![Build](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml/badge.svg)](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml)
|
6
6
|
[![Gem version](https://badge.fury.io/rb/square.rb.svg?new)](https://badge.fury.io/rb/square.rb)
|
7
7
|
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
|
8
8
|
|
@@ -73,9 +73,13 @@ gem 'square.rb'
|
|
73
73
|
### Financials
|
74
74
|
* [Bank Accounts]
|
75
75
|
|
76
|
+
### Online
|
77
|
+
* [Sites]
|
78
|
+
* [Snippets]
|
79
|
+
|
76
80
|
### Authorization APIs
|
77
81
|
* [Mobile Authorization]
|
78
|
-
* [
|
82
|
+
* [OAuth]
|
79
83
|
|
80
84
|
### Deprecated APIs
|
81
85
|
* [V1 Employees]
|
@@ -322,8 +326,10 @@ You can also use the Square API to create applications or services that work wit
|
|
322
326
|
[Refunds]: doc/api/refunds.md
|
323
327
|
[Subscriptions]: doc/api/subscriptions.md
|
324
328
|
[Mobile Authorization]: doc/api/mobile-authorization.md
|
325
|
-
[
|
329
|
+
[OAuth]: doc/api/o-auth.md
|
326
330
|
[V1 Employees]: doc/api/v1-employees.md
|
327
331
|
[V1 Transactions]: doc/api/v1-transactions.md
|
328
332
|
[V1 Items]: doc/api/v1-items.md
|
329
333
|
[Transactions]: doc/api/transactions.md
|
334
|
+
[Sites]: doc/api/sites.md
|
335
|
+
[Snippets]: doc/api/snippets.md
|
data/lib/square.rb
CHANGED
@@ -55,6 +55,8 @@ require_relative 'square/api/merchants_api.rb'
|
|
55
55
|
require_relative 'square/api/orders_api.rb'
|
56
56
|
require_relative 'square/api/payments_api.rb'
|
57
57
|
require_relative 'square/api/refunds_api.rb'
|
58
|
+
require_relative 'square/api/sites_api.rb'
|
59
|
+
require_relative 'square/api/snippets_api.rb'
|
58
60
|
require_relative 'square/api/subscriptions_api.rb'
|
59
61
|
require_relative 'square/api/team_api.rb'
|
60
62
|
require_relative 'square/api/terminal_api.rb'
|
data/lib/square/api/base_api.rb
CHANGED
@@ -241,7 +241,8 @@ module Square
|
|
241
241
|
# [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
|
242
242
|
# and set the `include_deleted_objects` attribute value to `true`.
|
243
243
|
# @param [String] cursor Optional parameter: The pagination cursor returned
|
244
|
-
# in the previous response. Leave unset for an initial request.
|
244
|
+
# in the previous response. Leave unset for an initial request. The page
|
245
|
+
# size is currently set to be 100. See
|
245
246
|
# [Pagination](https://developer.squareup.com/docs/basics/api101/pagination)
|
246
247
|
# for more information.
|
247
248
|
# @param [String] types Optional parameter: An optional case-insensitive,
|
@@ -6,8 +6,7 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Creates a loyalty account. To create a loyalty account, you must provide
|
9
|
-
# the `program_id` and
|
10
|
-
# `mappings` field.
|
9
|
+
# the `program_id` and a `mapping` with the `phone_number` of the buyer.
|
11
10
|
# @param [CreateLoyaltyAccountRequest] body Required parameter: An object
|
12
11
|
# containing the fields to POST for the request. See the corresponding
|
13
12
|
# object definition for field details.
|
@@ -254,9 +253,16 @@ module Square
|
|
254
253
|
end
|
255
254
|
|
256
255
|
# Returns a list of loyalty programs in the seller's account.
|
257
|
-
#
|
256
|
+
# Loyalty programs define how buyers can earn points and redeem points for
|
257
|
+
# rewards. Square sellers can have only one loyalty program, which is
|
258
|
+
# created and managed from the Seller Dashboard. For more information, see
|
259
|
+
# [Loyalty Program
|
260
|
+
# Overview](https://developer.squareup.com/docs/loyalty/overview).
|
261
|
+
# Replaced with [RetrieveLoyaltyProgram]($e/Loyalty/RetrieveLoyaltyProgram)
|
262
|
+
# when used with the keyword `main`.
|
258
263
|
# @return [ListLoyaltyProgramsResponse Hash] response from the API call
|
259
264
|
def list_loyalty_programs
|
265
|
+
warn 'Endpoint list_loyalty_programs in LoyaltyApi is deprecated'
|
260
266
|
# Prepare query url.
|
261
267
|
_query_builder = config.get_base_uri
|
262
268
|
_query_builder << '/v2/loyalty/programs'
|
@@ -5,13 +5,12 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
-
# Creates a new [
|
9
|
-
# for
|
8
|
+
# Creates a new [order]($m/Order) that can include information about
|
9
|
+
# products for
|
10
10
|
# purchase and settings to apply to the purchase.
|
11
|
-
# To pay for a created order,
|
11
|
+
# To pay for a created order, see
|
12
12
|
# [Pay for
|
13
|
-
# Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders)
|
14
|
-
# guide.
|
13
|
+
# Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).
|
15
14
|
# You can modify open orders using the [UpdateOrder]($e/Orders/UpdateOrder)
|
16
15
|
# endpoint.
|
17
16
|
# @param [CreateOrderRequest] body Required parameter: An object containing
|
@@ -47,8 +46,8 @@ module Square
|
|
47
46
|
)
|
48
47
|
end
|
49
48
|
|
50
|
-
# Retrieves a set of [
|
51
|
-
# If a given
|
49
|
+
# Retrieves a set of [orders]($m/Order) by their IDs.
|
50
|
+
# If a given order ID does not exist, the ID is ignored instead of
|
52
51
|
# generating an error.
|
53
52
|
# @param [BatchRetrieveOrdersRequest] body Required parameter: An object
|
54
53
|
# containing the fields to POST for the request. See the corresponding
|
@@ -119,17 +118,18 @@ module Square
|
|
119
118
|
|
120
119
|
# Search all orders for one or more locations. Orders include all sales,
|
121
120
|
# returns, and exchanges regardless of how or when they entered the Square
|
122
|
-
#
|
123
|
-
# SearchOrders requests need to specify which locations to search and
|
124
|
-
# a
|
125
|
-
# [
|
126
|
-
# how to sort or filter the results. Your SearchOrdersQuery can:
|
121
|
+
# ecosystem (such as Point of Sale, Invoices, and Connect APIs).
|
122
|
+
# `SearchOrders` requests need to specify which locations to search and
|
123
|
+
# define a
|
124
|
+
# [SearchOrdersQuery]($m/SearchOrdersQuery) object that controls
|
125
|
+
# how to sort or filter the results. Your `SearchOrdersQuery` can:
|
127
126
|
# Set filter criteria.
|
128
|
-
# Set sort order.
|
129
|
-
# Determine whether to return results as complete Order objects
|
127
|
+
# Set the sort order.
|
128
|
+
# Determine whether to return results as complete `Order` objects or as
|
130
129
|
# [OrderEntry]($m/OrderEntry) objects.
|
131
130
|
# Note that details for orders processed with Square Point of Sale while in
|
132
|
-
# offline mode
|
131
|
+
# offline mode might not be transmitted to Square for up to 72 hours.
|
132
|
+
# Offline
|
133
133
|
# orders have a `created_at` value that reflects the time the order was
|
134
134
|
# created,
|
135
135
|
# not the time it was subsequently transmitted to Square.
|
@@ -201,24 +201,24 @@ module Square
|
|
201
201
|
)
|
202
202
|
end
|
203
203
|
|
204
|
-
# Updates an open [
|
204
|
+
# Updates an open [order]($m/Order) by adding, replacing, or deleting
|
205
205
|
# fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated.
|
206
|
-
# An UpdateOrder request requires the following:
|
206
|
+
# An `UpdateOrder` request requires the following:
|
207
207
|
# - The `order_id` in the endpoint path, identifying the order to update.
|
208
208
|
# - The latest `version` of the order to update.
|
209
209
|
# - The [sparse
|
210
210
|
# order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse
|
211
211
|
# -order-objects)
|
212
|
-
# containing only the fields to update and the version the update
|
213
|
-
#
|
212
|
+
# containing only the fields to update and the version to which the update
|
213
|
+
# is
|
214
|
+
# being applied.
|
214
215
|
# - If deleting fields, the [dot notation
|
215
216
|
# paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot
|
216
217
|
# -notation)
|
217
|
-
# identifying fields to clear.
|
218
|
-
# To pay for an order,
|
218
|
+
# identifying the fields to clear.
|
219
|
+
# To pay for an order, see
|
219
220
|
# [Pay for
|
220
|
-
# Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders)
|
221
|
-
# guide.
|
221
|
+
# Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).
|
222
222
|
# @param [String] order_id Required parameter: The ID of the order to
|
223
223
|
# update.
|
224
224
|
# @param [UpdateOrderRequest] body Required parameter: An object containing
|
@@ -260,23 +260,23 @@ module Square
|
|
260
260
|
end
|
261
261
|
|
262
262
|
# Pay for an [order]($m/Order) using one or more approved
|
263
|
-
# [payments]($m/Payment)
|
263
|
+
# [payments]($m/Payment)
|
264
264
|
# or settle an order with a total of `0`.
|
265
265
|
# The total of the `payment_ids` listed in the request must be equal to the
|
266
266
|
# order
|
267
267
|
# total. Orders with a total amount of `0` can be marked as paid by
|
268
268
|
# specifying an empty
|
269
269
|
# array of `payment_ids` in the request.
|
270
|
-
# To be used with PayOrder
|
270
|
+
# To be used with `PayOrder`, a payment must:
|
271
271
|
# - Reference the order by specifying the `order_id` when [creating the
|
272
272
|
# payment]($e/Payments/CreatePayment).
|
273
273
|
# Any approved payments that reference the same `order_id` not specified in
|
274
274
|
# the
|
275
|
-
# `payment_ids`
|
275
|
+
# `payment_ids` is canceled.
|
276
276
|
# - Be approved with [delayed
|
277
277
|
# capture](https://developer.squareup.com/docs/payments-api/take-payments#de
|
278
278
|
# layed-capture).
|
279
|
-
# Using a delayed capture payment with PayOrder
|
279
|
+
# Using a delayed capture payment with `PayOrder` completes the approved
|
280
280
|
# payment.
|
281
281
|
# @param [String] order_id Required parameter: The ID of the order being
|
282
282
|
# paid.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Square
|
2
|
+
# SitesApi
|
3
|
+
class SitesApi < BaseApi
|
4
|
+
def initialize(config, http_call_back: nil)
|
5
|
+
super(config, http_call_back: http_call_back)
|
6
|
+
end
|
7
|
+
|
8
|
+
# Lists the Square Online sites that belong to a seller.
|
9
|
+
# __Note:__ Square Online APIs are publicly available as part of an early
|
10
|
+
# access program. For more information, see [Early access program for Square
|
11
|
+
# Online
|
12
|
+
# APIs](https://developer.squareup.com/docs/online-api#early-access-program-
|
13
|
+
# for-square-online-apis).
|
14
|
+
# @return [ListSitesResponse Hash] response from the API call
|
15
|
+
def list_sites
|
16
|
+
# Prepare query url.
|
17
|
+
_query_builder = config.get_base_uri
|
18
|
+
_query_builder << '/v2/sites'
|
19
|
+
_query_url = APIHelper.clean_url _query_builder
|
20
|
+
|
21
|
+
# Prepare headers.
|
22
|
+
_headers = {
|
23
|
+
'accept' => 'application/json'
|
24
|
+
}
|
25
|
+
|
26
|
+
# Prepare and execute HttpRequest.
|
27
|
+
_request = config.http_client.get(
|
28
|
+
_query_url,
|
29
|
+
headers: _headers
|
30
|
+
)
|
31
|
+
OAuth2.apply(config, _request)
|
32
|
+
_response = execute_request(_request)
|
33
|
+
|
34
|
+
# Return appropriate response type.
|
35
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
36
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
37
|
+
ApiResponse.new(
|
38
|
+
_response, data: decoded, errors: _errors
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
module Square
|
2
|
+
# SnippetsApi
|
3
|
+
class SnippetsApi < BaseApi
|
4
|
+
def initialize(config, http_call_back: nil)
|
5
|
+
super(config, http_call_back: http_call_back)
|
6
|
+
end
|
7
|
+
|
8
|
+
# Removes your snippet from a Square Online site.
|
9
|
+
# You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites
|
10
|
+
# that belong to a seller.
|
11
|
+
# __Note:__ Square Online APIs are publicly available as part of an early
|
12
|
+
# access program. For more information, see [Early access program for Square
|
13
|
+
# Online
|
14
|
+
# APIs](https://developer.squareup.com/docs/online-api#early-access-program-
|
15
|
+
# for-square-online-apis).
|
16
|
+
# @param [String] site_id Required parameter: The ID of the site that
|
17
|
+
# contains the snippet.
|
18
|
+
# @return [DeleteSnippetResponse Hash] response from the API call
|
19
|
+
def delete_snippet(site_id:)
|
20
|
+
# Prepare query url.
|
21
|
+
_query_builder = config.get_base_uri
|
22
|
+
_query_builder << '/v2/sites/{site_id}/snippet'
|
23
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
24
|
+
_query_builder,
|
25
|
+
'site_id' => { 'value' => site_id, 'encode' => true }
|
26
|
+
)
|
27
|
+
_query_url = APIHelper.clean_url _query_builder
|
28
|
+
|
29
|
+
# Prepare headers.
|
30
|
+
_headers = {
|
31
|
+
'accept' => 'application/json'
|
32
|
+
}
|
33
|
+
|
34
|
+
# Prepare and execute HttpRequest.
|
35
|
+
_request = config.http_client.delete(
|
36
|
+
_query_url,
|
37
|
+
headers: _headers
|
38
|
+
)
|
39
|
+
OAuth2.apply(config, _request)
|
40
|
+
_response = execute_request(_request)
|
41
|
+
|
42
|
+
# Return appropriate response type.
|
43
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
44
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
45
|
+
ApiResponse.new(
|
46
|
+
_response, data: decoded, errors: _errors
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Retrieves your snippet from a Square Online site. A site can contain
|
51
|
+
# snippets from multiple snippet applications, but you can retrieve only the
|
52
|
+
# snippet that was added by your application.
|
53
|
+
# You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites
|
54
|
+
# that belong to a seller.
|
55
|
+
# __Note:__ Square Online APIs are publicly available as part of an early
|
56
|
+
# access program. For more information, see [Early access program for Square
|
57
|
+
# Online
|
58
|
+
# APIs](https://developer.squareup.com/docs/online-api#early-access-program-
|
59
|
+
# for-square-online-apis).
|
60
|
+
# @param [String] site_id Required parameter: The ID of the site that
|
61
|
+
# contains the snippet.
|
62
|
+
# @return [RetrieveSnippetResponse Hash] response from the API call
|
63
|
+
def retrieve_snippet(site_id:)
|
64
|
+
# Prepare query url.
|
65
|
+
_query_builder = config.get_base_uri
|
66
|
+
_query_builder << '/v2/sites/{site_id}/snippet'
|
67
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
68
|
+
_query_builder,
|
69
|
+
'site_id' => { 'value' => site_id, 'encode' => true }
|
70
|
+
)
|
71
|
+
_query_url = APIHelper.clean_url _query_builder
|
72
|
+
|
73
|
+
# Prepare headers.
|
74
|
+
_headers = {
|
75
|
+
'accept' => 'application/json'
|
76
|
+
}
|
77
|
+
|
78
|
+
# Prepare and execute HttpRequest.
|
79
|
+
_request = config.http_client.get(
|
80
|
+
_query_url,
|
81
|
+
headers: _headers
|
82
|
+
)
|
83
|
+
OAuth2.apply(config, _request)
|
84
|
+
_response = execute_request(_request)
|
85
|
+
|
86
|
+
# Return appropriate response type.
|
87
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
88
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
89
|
+
ApiResponse.new(
|
90
|
+
_response, data: decoded, errors: _errors
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Adds a snippet to a Square Online site or updates the existing snippet on
|
95
|
+
# the site.
|
96
|
+
# The snippet code is appended to the end of the `head` element on every
|
97
|
+
# page of the site, except checkout pages. A snippet application can add one
|
98
|
+
# snippet to a given site.
|
99
|
+
# You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites
|
100
|
+
# that belong to a seller.
|
101
|
+
# __Note:__ Square Online APIs are publicly available as part of an early
|
102
|
+
# access program. For more information, see [Early access program for Square
|
103
|
+
# Online
|
104
|
+
# APIs](https://developer.squareup.com/docs/online-api#early-access-program-
|
105
|
+
# for-square-online-apis).
|
106
|
+
# @param [String] site_id Required parameter: The ID of the site where you
|
107
|
+
# want to add or update the snippet.
|
108
|
+
# @param [UpsertSnippetRequest] body Required parameter: An object
|
109
|
+
# containing the fields to POST for the request. See the corresponding
|
110
|
+
# object definition for field details.
|
111
|
+
# @return [UpsertSnippetResponse Hash] response from the API call
|
112
|
+
def upsert_snippet(site_id:,
|
113
|
+
body:)
|
114
|
+
# Prepare query url.
|
115
|
+
_query_builder = config.get_base_uri
|
116
|
+
_query_builder << '/v2/sites/{site_id}/snippet'
|
117
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
118
|
+
_query_builder,
|
119
|
+
'site_id' => { 'value' => site_id, 'encode' => true }
|
120
|
+
)
|
121
|
+
_query_url = APIHelper.clean_url _query_builder
|
122
|
+
|
123
|
+
# Prepare headers.
|
124
|
+
_headers = {
|
125
|
+
'accept' => 'application/json',
|
126
|
+
'content-type' => 'application/json; charset=utf-8'
|
127
|
+
}
|
128
|
+
|
129
|
+
# Prepare and execute HttpRequest.
|
130
|
+
_request = config.http_client.post(
|
131
|
+
_query_url,
|
132
|
+
headers: _headers,
|
133
|
+
parameters: body.to_json
|
134
|
+
)
|
135
|
+
OAuth2.apply(config, _request)
|
136
|
+
_response = execute_request(_request)
|
137
|
+
|
138
|
+
# Return appropriate response type.
|
139
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
140
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
141
|
+
ApiResponse.new(
|
142
|
+
_response, data: decoded, errors: _errors
|
143
|
+
)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -20,6 +20,7 @@ module Square
|
|
20
20
|
order: nil,
|
21
21
|
limit: nil,
|
22
22
|
batch_token: nil)
|
23
|
+
warn 'Endpoint list_orders in V1TransactionsApi is deprecated'
|
23
24
|
# Prepare query url.
|
24
25
|
_query_builder = config.get_base_uri
|
25
26
|
_query_builder << '/v1/{location_id}/orders'
|
@@ -66,6 +67,7 @@ module Square
|
|
66
67
|
# @return [V1Order Hash] response from the API call
|
67
68
|
def retrieve_order(location_id:,
|
68
69
|
order_id:)
|
70
|
+
warn 'Endpoint retrieve_order in V1TransactionsApi is deprecated'
|
69
71
|
# Prepare query url.
|
70
72
|
_query_builder = config.get_base_uri
|
71
73
|
_query_builder << '/v1/{location_id}/orders/{order_id}'
|
@@ -111,6 +113,7 @@ module Square
|
|
111
113
|
def update_order(location_id:,
|
112
114
|
order_id:,
|
113
115
|
body:)
|
116
|
+
warn 'Endpoint update_order in V1TransactionsApi is deprecated'
|
114
117
|
# Prepare query url.
|
115
118
|
_query_builder = config.get_base_uri
|
116
119
|
_query_builder << '/v1/{location_id}/orders/{order_id}'
|
@@ -184,6 +187,7 @@ module Square
|
|
184
187
|
limit: nil,
|
185
188
|
batch_token: nil,
|
186
189
|
include_partial: false)
|
190
|
+
warn 'Endpoint list_payments in V1TransactionsApi is deprecated'
|
187
191
|
# Prepare query url.
|
188
192
|
_query_builder = config.get_base_uri
|
189
193
|
_query_builder << '/v1/{location_id}/payments'
|
@@ -233,6 +237,7 @@ module Square
|
|
233
237
|
# @return [V1Payment Hash] response from the API call
|
234
238
|
def retrieve_payment(location_id:,
|
235
239
|
payment_id:)
|
240
|
+
warn 'Endpoint retrieve_payment in V1TransactionsApi is deprecated'
|
236
241
|
# Prepare query url.
|
237
242
|
_query_builder = config.get_base_uri
|
238
243
|
_query_builder << '/v1/{location_id}/payments/{payment_id}'
|
@@ -294,6 +299,7 @@ module Square
|
|
294
299
|
end_time: nil,
|
295
300
|
limit: nil,
|
296
301
|
batch_token: nil)
|
302
|
+
warn 'Endpoint list_refunds in V1TransactionsApi is deprecated'
|
297
303
|
# Prepare query url.
|
298
304
|
_query_builder = config.get_base_uri
|
299
305
|
_query_builder << '/v1/{location_id}/refunds'
|
@@ -350,6 +356,7 @@ module Square
|
|
350
356
|
# @return [V1Refund Hash] response from the API call
|
351
357
|
def create_refund(location_id:,
|
352
358
|
body:)
|
359
|
+
warn 'Endpoint create_refund in V1TransactionsApi is deprecated'
|
353
360
|
# Prepare query url.
|
354
361
|
_query_builder = config.get_base_uri
|
355
362
|
_query_builder << '/v1/{location_id}/refunds'
|
@@ -417,6 +424,7 @@ module Square
|
|
417
424
|
limit: nil,
|
418
425
|
status: nil,
|
419
426
|
batch_token: nil)
|
427
|
+
warn 'Endpoint list_settlements in V1TransactionsApi is deprecated'
|
420
428
|
# Prepare query url.
|
421
429
|
_query_builder = config.get_base_uri
|
422
430
|
_query_builder << '/v1/{location_id}/settlements'
|
@@ -479,6 +487,7 @@ module Square
|
|
479
487
|
# @return [V1Settlement Hash] response from the API call
|
480
488
|
def retrieve_settlement(location_id:,
|
481
489
|
settlement_id:)
|
490
|
+
warn 'Endpoint retrieve_settlement in V1TransactionsApi is deprecated'
|
482
491
|
# Prepare query url.
|
483
492
|
_query_builder = config.get_base_uri
|
484
493
|
_query_builder << '/v1/{location_id}/settlements/{settlement_id}'
|
data/lib/square/client.rb
CHANGED
@@ -4,7 +4,7 @@ module Square
|
|
4
4
|
attr_reader :config
|
5
5
|
|
6
6
|
def sdk_version
|
7
|
-
'
|
7
|
+
'11.0.0.20210513'
|
8
8
|
end
|
9
9
|
|
10
10
|
def square_version
|
@@ -167,6 +167,18 @@ module Square
|
|
167
167
|
@refunds ||= RefundsApi.new config
|
168
168
|
end
|
169
169
|
|
170
|
+
# Access to sites controller.
|
171
|
+
# @return [SitesApi] Returns the controller instance.
|
172
|
+
def sites
|
173
|
+
@sites ||= SitesApi.new config
|
174
|
+
end
|
175
|
+
|
176
|
+
# Access to snippets controller.
|
177
|
+
# @return [SnippetsApi] Returns the controller instance.
|
178
|
+
def snippets
|
179
|
+
@snippets ||= SnippetsApi.new config
|
180
|
+
end
|
181
|
+
|
170
182
|
# Access to subscriptions controller.
|
171
183
|
# @return [SubscriptionsApi] Returns the controller instance.
|
172
184
|
def subscriptions
|
@@ -188,7 +200,7 @@ module Square
|
|
188
200
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
189
201
|
backoff_factor: 1, environment: 'production',
|
190
202
|
custom_url: 'https://connect.squareup.com',
|
191
|
-
square_version: '2021-
|
203
|
+
square_version: '2021-05-13', access_token: 'TODO: Replace',
|
192
204
|
additional_headers: {}, config: nil)
|
193
205
|
@config = if config.nil?
|
194
206
|
Configuration.new(timeout: timeout, max_retries: max_retries,
|
data/lib/square/configuration.rb
CHANGED
@@ -24,7 +24,7 @@ module Square
|
|
24
24
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
25
25
|
backoff_factor: 1, environment: 'production',
|
26
26
|
custom_url: 'https://connect.squareup.com',
|
27
|
-
square_version: '2021-
|
27
|
+
square_version: '2021-05-13', access_token: 'TODO: Replace',
|
28
28
|
additional_headers: {})
|
29
29
|
# The value to use for connection timeout
|
30
30
|
@timeout = timeout
|
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: 11.0.0.20210513
|
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: 2021-
|
11
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -160,6 +160,8 @@ files:
|
|
160
160
|
- lib/square/api/orders_api.rb
|
161
161
|
- lib/square/api/payments_api.rb
|
162
162
|
- lib/square/api/refunds_api.rb
|
163
|
+
- lib/square/api/sites_api.rb
|
164
|
+
- lib/square/api/snippets_api.rb
|
163
165
|
- lib/square/api/subscriptions_api.rb
|
164
166
|
- lib/square/api/team_api.rb
|
165
167
|
- lib/square/api/terminal_api.rb
|