square.rb 22.1.0.20220823 → 23.0.0.20220921

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f952653c6d92ab4ba153d309a21a095d59ce4592c5f7660b3a0f91e15ff2815a
4
- data.tar.gz: 2f714f5c6b9fcb2b93f999e0d351fffcd0f01a913bfddad6afa9df9429b6f143
3
+ metadata.gz: b74663d36bae14fe320c23d640aa2172cf62cf6c4826a626360917627cf5f7c1
4
+ data.tar.gz: d85621b6ae408a39d492d5d7a5d28721af66eb881f6b7666e1e5a0fc73639b1d
5
5
  SHA512:
6
- metadata.gz: 4ac0adc3626aea0ad54bf9a40b1200429e8359c19a72da3f8e359b33ea686642c29f0f97519a4d9f9831095e64e4b8d3b2dcec35c032dcdf20784baa4e1cb235
7
- data.tar.gz: 6b6e81d0b85c809a44df30fd0e53754cc881ebe1c3a37722ef9b4db476f0b2fb8bcf67090ed061b79ea2b0468378fdc409ac2a278bf266fb5efc97567aa5a986
6
+ metadata.gz: a8486bc18c8303c18e64183a16136fb826ffca13451106cb06a43e8d8377b03e8e169a3f54e75f3f511c99268d6c40be24472512b35919df22c3138a937c4057
7
+ data.tar.gz: cf3be15a882df1d1b323057ddb065aec10bd870da9e8ebd6ef9b625393b4af14379d6f61d1565f235647472d7a61a2e1c67e6a6a9220b4d273c3f24f05059c8b
data/README.md CHANGED
@@ -8,6 +8,14 @@
8
8
 
9
9
  Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders.
10
10
 
11
+ * [Requirements](#requirements)
12
+ * [Installation](#installation)
13
+ * [Quickstart](#quickstart)
14
+ * [Usage](#usage)
15
+ * [Tests](#tests)
16
+ * [SDK Reference](#sdk-reference)
17
+ * [Deprecated APIs](#deprecated-apis)
18
+
11
19
  ## Requirements
12
20
 
13
21
  Use of the Square Ruby SDK requires:
@@ -114,18 +122,19 @@ rake
114
122
  * [Sites]
115
123
  * [Snippets]
116
124
 
117
- ### Authorization APIs
125
+ ### Authorization
118
126
  * [Mobile Authorization]
119
127
  * [OAuth]
120
128
 
121
- ### Deprecated APIs
122
- * [Employees]
123
- * [V1 Employees]
124
- * [V1 Transactions]
125
- * [V1 Items]
126
- * [Transactions]
129
+ ## Deprecated APIs
130
+
131
+ The following Square APIs are [deprecated](https://developer.squareup.com/docs/build-basics/api-lifecycle):
127
132
 
133
+ * [Employees] - replaced by the [Team] API. For more information, see [Migrate from the Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees).
128
134
 
135
+ * [Transactions] - replaced by the [Orders] and [Payments] APIs. For more information, see [Migrate from the Transactions API](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api).
136
+
137
+
129
138
  [//]: # "Link anchor definitions"
130
139
  [Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
131
140
  [Developer Dashboard]: https://developer.squareup.com/apps
@@ -146,7 +155,6 @@ rake
146
155
  [Catalog]: doc/api/catalog.md
147
156
  [Customers]: doc/api/customers.md
148
157
  [Customer Custom Attributes]: doc/api/customer-custom-attributes.md
149
- [Employees]: doc/api/employees.md
150
158
  [Inventory]: doc/api/inventory.md
151
159
  [Labor]: doc/api/labor.md
152
160
  [Loyalty]: doc/api/loyalty.md
@@ -160,13 +168,11 @@ rake
160
168
  [Subscriptions]: doc/api/subscriptions.md
161
169
  [Mobile Authorization]: doc/api/mobile-authorization.md
162
170
  [OAuth]: doc/api/o-auth.md
163
- [V1 Employees]: doc/api/v1-employees.md
164
- [V1 Transactions]: doc/api/v1-transactions.md
165
- [V1 Items]: doc/api/v1-items.md
166
- [Transactions]: doc/api/transactions.md
167
171
  [Sites]: doc/api/sites.md
168
172
  [Snippets]: doc/api/snippets.md
169
173
  [Cards]: doc/api/cards.md
170
174
  [Payouts]: doc/api/payouts.md
171
175
  [Gift Cards]: doc/api/gift-cards.md
172
176
  [Gift Card Activities]: doc/api/gift-card-activities.md
177
+ [Employees]: doc/api/employees.md
178
+ [Transactions]: doc/api/transactions.md
@@ -13,10 +13,16 @@ module Square
13
13
  # This endpoint provides an easy way for platform developers to bulk
14
14
  # activate
15
15
  # Apple Pay on the Web with Square for merchants using their platform.
16
- # To learn more about Web Apple Pay, see
17
- # [Add the Apple Pay on the Web
18
- # Button](https://developer.squareup.com/docs/payment-form/add-digital-walle
19
- # ts/apple-pay).
16
+ # Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will
17
+ # only receive critical security updates until it is retired on October 31,
18
+ # 2022.
19
+ # You must migrate your payment form code to the Web Payments SDK to
20
+ # continue using your domain for Apple Pay. For more information on
21
+ # migrating to the Web Payments SDK, see [Migrate to the Web Payments
22
+ # SDK](https://developer.squareup.com/docs/web-payments/migrate).
23
+ # To learn more about the Web Payments SDK and how to add Apple Pay, see
24
+ # [Take an Apple Pay
25
+ # Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
20
26
  # @param [RegisterDomainRequest] body Required parameter: An object
21
27
  # containing the fields to POST for the request. See the corresponding
22
28
  # object definition for field details.
@@ -45,7 +45,7 @@ module Square
45
45
  end
46
46
 
47
47
  def get_user_agent
48
- user_agent = 'Square-Ruby-SDK/22.1.0.20220823 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
48
+ user_agent = 'Square-Ruby-SDK/23.0.0.20220921 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
49
49
  user_agent['{engine}'] = RUBY_ENGINE
50
50
  user_agent['{engine-version}'] = RUBY_ENGINE_VERSION
51
51
  user_agent['{os-info}'] = RUBY_PLATFORM
@@ -133,8 +133,11 @@ module Square
133
133
  # the loyalty program and
134
134
  # loyalty promotion. For spend-based and visit-based programs, you can call
135
135
  # [CalculateLoyaltyPoints]($e/Loyalty/CalculateLoyaltyPoints)
136
- # to compute the points earned from the loyalty program (but not points
137
- # earned from a loyalty promotion).
136
+ # to compute the points earned from the base loyalty program. For
137
+ # information about computing points earned from a loyalty promotion, see
138
+ # [Calculating promotion
139
+ # points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions
140
+ # #calculate-promotion-points).
138
141
  # @param [String] account_id Required parameter: The ID of the target
139
142
  # [loyalty account]($m/LoyaltyAccount).
140
143
  # @param [AccumulateLoyaltyPointsRequest] body Required parameter: An object
@@ -16,11 +16,11 @@ module Square
16
16
  # retrieve the next set of results for your original query to the
17
17
  # endpoint.
18
18
  # @return [List of V1Order Hash] response from the API call
19
- def list_orders(location_id:,
20
- order: nil,
21
- limit: nil,
22
- batch_token: nil)
23
- warn 'Endpoint list_orders in V1TransactionsApi is deprecated'
19
+ def v1_list_orders(location_id:,
20
+ order: nil,
21
+ limit: nil,
22
+ batch_token: nil)
23
+ warn 'Endpoint v1_list_orders in V1TransactionsApi is deprecated'
24
24
  # Prepare query url.
25
25
  _query_builder = config.get_base_uri
26
26
  _query_builder << '/v1/{location_id}/orders'
@@ -65,9 +65,9 @@ module Square
65
65
  # You obtain this value from Order objects returned by the List Orders
66
66
  # endpoint
67
67
  # @return [V1Order Hash] response from the API call
68
- def retrieve_order(location_id:,
69
- order_id:)
70
- warn 'Endpoint retrieve_order in V1TransactionsApi is deprecated'
68
+ def v1_retrieve_order(location_id:,
69
+ order_id:)
70
+ warn 'Endpoint v1_retrieve_order in V1TransactionsApi is deprecated'
71
71
  # Prepare query url.
72
72
  _query_builder = config.get_base_uri
73
73
  _query_builder << '/v1/{location_id}/orders/{order_id}'
@@ -110,10 +110,10 @@ module Square
110
110
  # containing the fields to POST for the request. See the corresponding
111
111
  # object definition for field details.
112
112
  # @return [V1Order Hash] response from the API call
113
- def update_order(location_id:,
114
- order_id:,
115
- body:)
116
- warn 'Endpoint update_order in V1TransactionsApi is deprecated'
113
+ def v1_update_order(location_id:,
114
+ order_id:,
115
+ body:)
116
+ warn 'Endpoint v1_update_order in V1TransactionsApi is deprecated'
117
117
  # Prepare query url.
118
118
  _query_builder = config.get_base_uri
119
119
  _query_builder << '/v1/{location_id}/orders/{order_id}'
@@ -180,14 +180,14 @@ module Square
180
180
  # Partial payments will have the tenders collected so far, but the
181
181
  # itemizations will be empty until the payment is completed.
182
182
  # @return [List of V1Payment Hash] response from the API call
183
- def list_payments(location_id:,
184
- order: nil,
185
- begin_time: nil,
186
- end_time: nil,
187
- limit: nil,
188
- batch_token: nil,
189
- include_partial: false)
190
- warn 'Endpoint list_payments in V1TransactionsApi is deprecated'
183
+ def v1_list_payments(location_id:,
184
+ order: nil,
185
+ begin_time: nil,
186
+ end_time: nil,
187
+ limit: nil,
188
+ batch_token: nil,
189
+ include_partial: false)
190
+ warn 'Endpoint v1_list_payments in V1TransactionsApi is deprecated'
191
191
  # Prepare query url.
192
192
  _query_builder = config.get_base_uri
193
193
  _query_builder << '/v1/{location_id}/payments'
@@ -235,9 +235,9 @@ module Square
235
235
  # endpoint, Settlement objects returned by the List Settlements endpoint, or
236
236
  # Refund objects returned by the List Refunds endpoint.
237
237
  # @return [V1Payment Hash] response from the API call
238
- def retrieve_payment(location_id:,
239
- payment_id:)
240
- warn 'Endpoint retrieve_payment in V1TransactionsApi is deprecated'
238
+ def v1_retrieve_payment(location_id:,
239
+ payment_id:)
240
+ warn 'Endpoint v1_retrieve_payment in V1TransactionsApi is deprecated'
241
241
  # Prepare query url.
242
242
  _query_builder = config.get_base_uri
243
243
  _query_builder << '/v1/{location_id}/payments/{payment_id}'
@@ -293,13 +293,13 @@ module Square
293
293
  # retrieve the next set of results for your original query to the
294
294
  # endpoint.
295
295
  # @return [List of V1Refund Hash] response from the API call
296
- def list_refunds(location_id:,
297
- order: nil,
298
- begin_time: nil,
299
- end_time: nil,
300
- limit: nil,
301
- batch_token: nil)
302
- warn 'Endpoint list_refunds in V1TransactionsApi is deprecated'
296
+ def v1_list_refunds(location_id:,
297
+ order: nil,
298
+ begin_time: nil,
299
+ end_time: nil,
300
+ limit: nil,
301
+ batch_token: nil)
302
+ warn 'Endpoint v1_list_refunds in V1TransactionsApi is deprecated'
303
303
  # Prepare query url.
304
304
  _query_builder = config.get_base_uri
305
305
  _query_builder << '/v1/{location_id}/refunds'
@@ -354,9 +354,9 @@ module Square
354
354
  # containing the fields to POST for the request. See the corresponding
355
355
  # object definition for field details.
356
356
  # @return [V1Refund Hash] response from the API call
357
- def create_refund(location_id:,
358
- body:)
359
- warn 'Endpoint create_refund in V1TransactionsApi is deprecated'
357
+ def v1_create_refund(location_id:,
358
+ body:)
359
+ warn 'Endpoint v1_create_refund in V1TransactionsApi is deprecated'
360
360
  # Prepare query url.
361
361
  _query_builder = config.get_base_uri
362
362
  _query_builder << '/v1/{location_id}/refunds'
@@ -417,14 +417,14 @@ module Square
417
417
  # retrieve the next set of results for your original query to the
418
418
  # endpoint.
419
419
  # @return [List of V1Settlement Hash] response from the API call
420
- def list_settlements(location_id:,
421
- order: nil,
422
- begin_time: nil,
423
- end_time: nil,
424
- limit: nil,
425
- status: nil,
426
- batch_token: nil)
427
- warn 'Endpoint list_settlements in V1TransactionsApi is deprecated'
420
+ def v1_list_settlements(location_id:,
421
+ order: nil,
422
+ begin_time: nil,
423
+ end_time: nil,
424
+ limit: nil,
425
+ status: nil,
426
+ batch_token: nil)
427
+ warn 'Endpoint v1_list_settlements in V1TransactionsApi is deprecated'
428
428
  # Prepare query url.
429
429
  _query_builder = config.get_base_uri
430
430
  _query_builder << '/v1/{location_id}/settlements'
@@ -485,9 +485,9 @@ module Square
485
485
  # Square-issued ID. You obtain this value from Settlement objects returned
486
486
  # by the List Settlements endpoint.
487
487
  # @return [V1Settlement Hash] response from the API call
488
- def retrieve_settlement(location_id:,
489
- settlement_id:)
490
- warn 'Endpoint retrieve_settlement in V1TransactionsApi is deprecated'
488
+ def v1_retrieve_settlement(location_id:,
489
+ settlement_id:)
490
+ warn 'Endpoint v1_retrieve_settlement in V1TransactionsApi is deprecated'
491
491
  # Prepare query url.
492
492
  _query_builder = config.get_base_uri
493
493
  _query_builder << '/v1/{location_id}/settlements/{settlement_id}'
@@ -56,8 +56,7 @@ module Square
56
56
  # @param [Integer] limit Optional parameter: The maximum number of results
57
57
  # to be returned in a single page. It is possible to receive fewer results
58
58
  # than the specified limit on a given page. The default value of 100 is also
59
- # the maximum allowed value. If the provided value is greater than 100, it
60
- # is ignored and the default value is used instead. Default: 100
59
+ # the maximum allowed value. Default: 100
61
60
  # @return [ListWebhookSubscriptionsResponse Hash] response from the API call
62
61
  def list_webhook_subscriptions(cursor: nil,
63
62
  include_disabled: false,
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
- '22.1.0.20220823'
7
+ '23.0.0.20220921'
8
8
  end
9
9
 
10
10
  def square_version
@@ -242,7 +242,7 @@ module Square
242
242
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
243
243
  retry_methods: %i[get put], environment: 'production',
244
244
  custom_url: 'https://connect.squareup.com',
245
- square_version: '2022-08-23', access_token: '',
245
+ square_version: '2022-09-21', access_token: '',
246
246
  user_agent_detail: '', additional_headers: {}, config: nil)
247
247
  @config = if config.nil?
248
248
  Configuration.new(connection: connection, adapter: adapter,
@@ -20,7 +20,7 @@ module Square
20
20
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
21
21
  retry_methods: %i[get put], environment: 'production',
22
22
  custom_url: 'https://connect.squareup.com',
23
- square_version: '2022-08-23', access_token: '',
23
+ square_version: '2022-09-21', access_token: '',
24
24
  user_agent_detail: '', additional_headers: {})
25
25
  # The Faraday connection object passed by the SDK user for making requests
26
26
  @connection = connection
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: 22.1.0.20220823
4
+ version: 23.0.0.20220921
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: 2022-08-22 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging