square.rb 28.0.0.20230517 → 29.0.0.20230608

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: 7aad233be99bfca2993a00a7c626631d148ed55b31b1e066374f4140f24e39d8
4
- data.tar.gz: 495f1f8e3090fdcff82d59bb5f3a107d6e3041054c84ab025a6f10349bfc0103
3
+ metadata.gz: 6f8d15edb9a8dd68b46a879c0afacf648c322c9e31373fce770c109b4dfae6b6
4
+ data.tar.gz: 892d648f4b7bfe44d6fb162e13d544867df6a8b6e3b173f5ca516ca78aa3e3e4
5
5
  SHA512:
6
- metadata.gz: '08e41c2920e1801d7a40ec683df94518d41b00953c46079de8749dd8f1c6a207750f17ea001d4e293d8cd493dee568b7d23204e2e60c9a864bf25933841bd1a0'
7
- data.tar.gz: e6f513724723fd25e7009dff20d565ce765b20312496409822bd492a96157c71e5c31eb207b2508faa75e9d5f8d424cc43bf670c19626fdfe6dae7bf9f78a3b2
6
+ metadata.gz: 0b83f14d0f0291d461b694c853e38bad88b508a1bbab94df7faac7a550ddd99e499bba08882b4ce82a194eefeae64b5515481a708c6194dfcefa40c2b85eb98e
7
+ data.tar.gz: 169dc96d375401735be90799acb4b08e96199286a4ec89395015edfcc28736bde58e8e4ed41e784d97e8e5652287a6e96ffd0cc0e6aa8515eebe0fcaf988cb72
@@ -4,7 +4,7 @@ module Square
4
4
  attr_accessor :config, :http_call_back
5
5
 
6
6
  def self.user_agent
7
- 'Square-Ruby-SDK/28.0.0.20230517 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
7
+ 'Square-Ruby-SDK/29.0.0.20230608 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
8
8
  end
9
9
 
10
10
  def self.user_agent_parameters
@@ -20,10 +20,10 @@ module Square
20
20
  # Authorization: Client APPLICATION_SECRET
21
21
  # ```
22
22
  # Replace `APPLICATION_SECRET` with the application secret on the
23
- # Credentials
23
+ # **Credentials**
24
24
  # page in the [Developer Dashboard](https://developer.squareup.com/apps).
25
25
  # @param [String] client_id Required parameter: Your application ID, which
26
- # is available in the OAuth page in the [Developer
26
+ # is available on the **OAuth** page in the [Developer
27
27
  # Dashboard](https://developer.squareup.com/apps).
28
28
  # @param [RenewTokenRequest] body Required parameter: An object containing
29
29
  # the fields to POST for the request. See the corresponding object
@@ -65,8 +65,8 @@ module Square
65
65
  # ```
66
66
  # Authorization: Client APPLICATION_SECRET
67
67
  # ```
68
- # Replace `APPLICATION_SECRET` with the application secret on the OAuth
69
- # page for your application on the Developer Dashboard.
68
+ # Replace `APPLICATION_SECRET` with the application secret on the **OAuth**
69
+ # page for your application in the Developer Dashboard.
70
70
  # @param [RevokeTokenRequest] body Required parameter: An object containing
71
71
  # the fields to POST for the request. See the corresponding object
72
72
  # definition for field details.
@@ -97,7 +97,7 @@ module Square
97
97
  # The `grant_type` parameter specifies the type of OAuth request. If
98
98
  # `grant_type` is `authorization_code`, you must include the authorization
99
99
  # code you received when a seller granted you authorization. If `grant_type`
100
- # is `refresh_token`, you must provide a valid refresh token. If you are
100
+ # is `refresh_token`, you must provide a valid refresh token. If you're
101
101
  # using
102
102
  # an old version of the Square APIs (prior to March 13, 2019), `grant_type`
103
103
  # can be `migration_token` and you must provide a valid migration token.
@@ -1,13 +1,16 @@
1
1
  module Square
2
2
  # SubscriptionsApi
3
3
  class SubscriptionsApi < BaseApi
4
- # Creates a subscription to a subscription plan by a customer.
4
+ # Enrolls a customer in a subscription.
5
5
  # If you provide a card on file in the request, Square charges the card for
6
- # the subscription. Otherwise, Square bills an invoice to the customer's
6
+ # the subscription. Otherwise, Square sends an invoice to the customer's
7
7
  # email
8
8
  # address. The subscription starts immediately, unless the request includes
9
9
  # the optional `start_date`. Each individual subscription is associated with
10
10
  # a particular location.
11
+ # For more information, see [Create a
12
+ # subscription](https://developer.squareup.com/docs/subscriptions-api/manage
13
+ # -subscriptions#create-a-subscription).
11
14
  # @param [CreateSubscriptionRequest] body Required parameter: An object
12
15
  # containing the fields to POST for the request. See the corresponding
13
16
  # object definition for field details.
@@ -42,10 +45,6 @@ module Square
42
45
  # If the request specifies customer IDs, the endpoint orders results
43
46
  # first by location, within location by customer ID, and within
44
47
  # customer by subscription creation date.
45
- # For more information, see
46
- # [Retrieve
47
- # subscriptions](https://developer.squareup.com/docs/subscriptions-api/overv
48
- # iew#retrieve-subscriptions).
49
48
  # @param [SearchSubscriptionsRequest] body Required parameter: An object
50
49
  # containing the fields to POST for the request. See the corresponding
51
50
  # object definition for field details.
@@ -67,7 +66,7 @@ module Square
67
66
  .execute
68
67
  end
69
68
 
70
- # Retrieves a subscription.
69
+ # Retrieves a specific subscription.
71
70
  # @param [String] subscription_id Required parameter: The ID of the
72
71
  # subscription to retrieve.
73
72
  # @param [String] include Optional parameter: A query parameter to specify
@@ -93,8 +92,9 @@ module Square
93
92
  .execute
94
93
  end
95
94
 
96
- # Updates a subscription. You can set, modify, and clear the
97
- # `subscription` field values.
95
+ # Updates a subscription by modifying or clearing `subscription` field
96
+ # values.
97
+ # To clear a field, set its value to `null`.
98
98
  # @param [String] subscription_id Required parameter: The ID of the
99
99
  # subscription to update.
100
100
  # @param [UpdateSubscriptionRequest] body Required parameter: An object
@@ -146,11 +146,10 @@ module Square
146
146
  .execute
147
147
  end
148
148
 
149
- # Schedules a `CANCEL` action to cancel an active subscription
150
- # by setting the `canceled_date` field to the end of the active billing
151
- # period
152
- # and changing the subscription status from ACTIVE to CANCELED after this
153
- # date.
149
+ # Schedules a `CANCEL` action to cancel an active subscription. This
150
+ # sets the `canceled_date` field to the end of the active billing period.
151
+ # After this date,
152
+ # the subscription status changes from ACTIVE to CANCELED.
154
153
  # @param [String] subscription_id Required parameter: The ID of the
155
154
  # subscription to cancel.
156
155
  # @return [CancelSubscriptionResponse Hash] response from the API call
@@ -170,7 +169,9 @@ module Square
170
169
  .execute
171
170
  end
172
171
 
173
- # Lists all events for a specific subscription.
172
+ # Lists all
173
+ # [events](https://developer.squareup.com/docs/subscriptions-api/actions-eve
174
+ # nts) for a specific subscription.
174
175
  # @param [String] subscription_id Required parameter: The ID of the
175
176
  # subscription to retrieve the events for.
176
177
  # @param [String] cursor Optional parameter: When the total number of
@@ -178,8 +179,8 @@ module Square
178
179
  # specify the cursor returned from a preceding response here to fetch the
179
180
  # next set of results. If the cursor is unset, the response contains the
180
181
  # last page of the results. For more information, see
181
- # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
182
- # ion).
182
+ # [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
183
+ # atterns/pagination).
183
184
  # @param [Integer] limit Optional parameter: The upper limit on the number
184
185
  # of subscription events to return in a paged response.
185
186
  # @return [ListSubscriptionEventsResponse Hash] response from the API call
@@ -258,8 +259,11 @@ module Square
258
259
  .execute
259
260
  end
260
261
 
261
- # Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing
262
- # subscription.
262
+ # Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an
263
+ # existing subscription.
264
+ # For more information, see [Swap Subscription Plan
265
+ # Variations](https://developer.squareup.com/docs/subscriptions-api/swap-pla
266
+ # n-variations).
263
267
  # @param [String] subscription_id Required parameter: The ID of the
264
268
  # subscription to swap the subscription plan for.
265
269
  # @param [SwapPlanRequest] body Required parameter: An object containing the
@@ -50,7 +50,7 @@ module Square
50
50
  # Retrieves a Terminal action request by `action_id`. Terminal action
51
51
  # requests are available for 30 days.
52
52
  # @param [String] action_id Required parameter: Unique ID for the desired
53
- # `TerminalAction`
53
+ # `TerminalAction`.
54
54
  # @return [GetTerminalActionResponse Hash] response from the API call
55
55
  def get_terminal_action(action_id:)
56
56
  new_api_call_builder
@@ -70,7 +70,7 @@ module Square
70
70
 
71
71
  # Cancels a Terminal action request if the status of the request permits it.
72
72
  # @param [String] action_id Required parameter: Unique ID for the desired
73
- # `TerminalAction`
73
+ # `TerminalAction`.
74
74
  # @return [CancelTerminalActionResponse Hash] response from the API call
75
75
  def cancel_terminal_action(action_id:)
76
76
  new_api_call_builder
@@ -88,6 +88,30 @@ module Square
88
88
  .execute
89
89
  end
90
90
 
91
+ # Dismisses a Terminal action request if the status and type of the request
92
+ # permits it.
93
+ # See [Link and Dismiss
94
+ # Actions](https://developer.squareup.com/docs/terminal-api/advanced-feature
95
+ # s/custom-workflows/link-and-dismiss-actions) for more details.
96
+ # @param [String] action_id Required parameter: Unique ID for the
97
+ # `TerminalAction` associated with the waiting dialog to be dismissed.
98
+ # @return [DismissTerminalActionResponse Hash] response from the API call
99
+ def dismiss_terminal_action(action_id:)
100
+ new_api_call_builder
101
+ .request(new_request_builder(HttpMethodEnum::POST,
102
+ '/v2/terminals/actions/{action_id}/dismiss',
103
+ 'default')
104
+ .template_param(new_parameter(action_id, key: 'action_id')
105
+ .should_encode(true))
106
+ .header_param(new_parameter('application/json', key: 'accept'))
107
+ .auth(Single.new('global')))
108
+ .response(new_response_handler
109
+ .deserializer(APIHelper.method(:json_deserialize))
110
+ .is_api_response(true)
111
+ .convertor(ApiResponse.method(:create)))
112
+ .execute
113
+ end
114
+
91
115
  # Creates a Terminal checkout request and sends it to the specified device
92
116
  # to take a payment
93
117
  # for the requested amount.
data/lib/square/client.rb CHANGED
@@ -4,7 +4,7 @@ module Square
4
4
  attr_reader :config, :auth_managers
5
5
 
6
6
  def sdk_version
7
- '28.0.0.20230517'
7
+ '29.0.0.20230608'
8
8
  end
9
9
 
10
10
  def square_version
@@ -267,7 +267,7 @@ module Square
267
267
  retry_methods: %i[get put], http_callback: nil,
268
268
  environment: 'production',
269
269
  custom_url: 'https://connect.squareup.com', access_token: '',
270
- square_version: '2023-05-17', user_agent_detail: '',
270
+ square_version: '2023-06-08', user_agent_detail: '',
271
271
  additional_headers: {}, config: nil)
272
272
  @config = if config.nil?
273
273
  Configuration.new(connection: connection, adapter: adapter,
@@ -19,7 +19,7 @@ module Square
19
19
  retry_methods: %i[get put], http_callback: nil,
20
20
  environment: 'production',
21
21
  custom_url: 'https://connect.squareup.com', access_token: '',
22
- square_version: '2023-05-17', user_agent_detail: '',
22
+ square_version: '2023-06-08', user_agent_detail: '',
23
23
  additional_headers: {})
24
24
 
25
25
  super connection: connection, adapter: adapter, 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: 28.0.0.20230517
4
+ version: 29.0.0.20230608
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: 2023-05-16 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces