square.rb 9.0.0.20210226 → 9.1.0.20210317

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: d590e351e349cad97ee0e30e6f0c281f699e9357b68007ce847cdf3d69b86451
4
- data.tar.gz: 5f89a1777603830bb3b6878f3e45041522c862a2b625e8bdda39c2893678e93d
3
+ metadata.gz: 0073c43aaa6518848223c41ea272fa28f77cf58b9ade77aae705423849a37bb3
4
+ data.tar.gz: 6d1f79d5fd9c6224e3a1b6769faf8c1c7b93b2a98357878a42a816a522d2a0a5
5
5
  SHA512:
6
- metadata.gz: d460315ea4f40be58b73ae56ce056ae5a7e0d09f8ca3b8604e8e347987743054228243318d4e23cbb2cf876272c88e7c5ace6cd50ddf9ad2a116f84c20a378f0
7
- data.tar.gz: 48da57deda485630006753f057fc6962caea914f058fca58d20884696e101b3e859b8cd5bf68a6d69817ed62b66fb743bddde49b5c15d9837ccca91fe40dc806
6
+ metadata.gz: 6d9da7a0178efe277fcacb6ea12c73b4c03aee542edd5ce2791eeda0d97f5e8787d467f1031f260321305c060b0bb59904bab13ecf5218507d2d236c0b5ab945
7
+ data.tar.gz: 54f48e7dd8de672b7eadc9282e4e1dfb41e8c925a60093b450b94d2e26f7e92859f61b59c7730e65b81b1510ff9bf9affa40b28b4e8a35807e811e2a0a816802
@@ -5,17 +5,18 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
- # Activates a domain for use with Web Apple Pay and Square. A validation
9
- # will be performed on this domain by Apple to ensure is it properly set up
8
+ # Activates a domain for use with Apple Pay on the Web and Square. A
9
+ # validation
10
+ # is performed on this domain by Apple to ensure that it is properly set up
10
11
  # as
11
12
  # an Apple Pay enabled domain.
12
13
  # This endpoint provides an easy way for platform developers to bulk
13
14
  # activate
14
- # Web Apple Pay with Square for merchants using their platform.
15
- # To learn more about Apple Pay on Web see the Apple Pay section in the
16
- # [Square Payment Form
17
- # Walkthrough](https://developer.squareup.com/docs/payment-form/payment-form
18
- # -walkthrough).
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).
19
20
  # @param [RegisterDomainRequest] body Required parameter: An object
20
21
  # containing the fields to POST for the request. See the corresponding
21
22
  # object definition for field details.
@@ -8,7 +8,7 @@ module Square
8
8
  @http_call_back = http_call_back
9
9
 
10
10
  @global_headers = {
11
- 'user-agent' => 'Square-Ruby-SDK/9.0.0.20210226',
11
+ 'user-agent' => 'Square-Ruby-SDK/9.1.0.20210317',
12
12
  'Square-Version' => config.square_version
13
13
  }
14
14
  end
@@ -5,8 +5,8 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
- # Links a `checkoutId` to a `checkout_page_url` that customers will
9
- # be directed to in order to provide their payment information using a
8
+ # Links a `checkoutId` to a `checkout_page_url` that customers are
9
+ # directed to in order to provide their payment information using a
10
10
  # payment processing workflow hosted on connect.squareup.com.
11
11
  # @param [String] location_id Required parameter: The ID of the business
12
12
  # location to associate the checkout with.
@@ -83,16 +83,14 @@ module Square
83
83
  )
84
84
  end
85
85
 
86
- # Charges a payment source (for example, a card
87
- # represented by customer's card on file or a card nonce). In addition
88
- # to the payment source, the request must include the
89
- # amount to accept for the payment.
90
- # There are several optional parameters that you can include in the request
91
- # (for example, tip money, whether to autocomplete the payment, or a
92
- # reference ID
93
- # to correlate this payment with another system).
94
- # The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required
95
- # to enable application fees.
86
+ # Creates a payment using the provided source. You can use this endpoint
87
+ # to charge a card (credit/debit card or
88
+ # Square gift card) or record a payment that the seller received outside of
89
+ # Square
90
+ # (cash payment from a buyer or a payment that an external entity
91
+ # procesed on behalf of the seller).
92
+ # The endpoint creates a
93
+ # `Payment` object and returns it in the response.
96
94
  # @param [CreatePaymentRequest] body Required parameter: An object
97
95
  # containing the fields to POST for the request. See the corresponding
98
96
  # object definition for field details.
@@ -209,11 +207,53 @@ module Square
209
207
  )
210
208
  end
211
209
 
212
- # Cancels (voids) a payment. If you set `autocomplete` to `false` when
213
- # creating a payment,
214
- # you can cancel the payment using this endpoint.
215
- # @param [String] payment_id Required parameter: The `payment_id`
216
- # identifying the payment to be canceled.
210
+ # Updates a payment with the APPROVED status.
211
+ # You can update the `amount_money` and `tip_money` using this endpoint.
212
+ # @param [String] payment_id Required parameter: The ID of the payment to
213
+ # update.
214
+ # @param [UpdatePaymentRequest] body Required parameter: An object
215
+ # containing the fields to POST for the request. See the corresponding
216
+ # object definition for field details.
217
+ # @return [UpdatePaymentResponse Hash] response from the API call
218
+ def update_payment(payment_id:,
219
+ body:)
220
+ # Prepare query url.
221
+ _query_builder = config.get_base_uri
222
+ _query_builder << '/v2/payments/{payment_id}'
223
+ _query_builder = APIHelper.append_url_with_template_parameters(
224
+ _query_builder,
225
+ 'payment_id' => { 'value' => payment_id, 'encode' => true }
226
+ )
227
+ _query_url = APIHelper.clean_url _query_builder
228
+
229
+ # Prepare headers.
230
+ _headers = {
231
+ 'accept' => 'application/json',
232
+ 'content-type' => 'application/json; charset=utf-8'
233
+ }
234
+
235
+ # Prepare and execute HttpRequest.
236
+ _request = config.http_client.put(
237
+ _query_url,
238
+ headers: _headers,
239
+ parameters: body.to_json
240
+ )
241
+ OAuth2.apply(config, _request)
242
+ _response = execute_request(_request)
243
+
244
+ # Return appropriate response type.
245
+ decoded = APIHelper.json_deserialize(_response.raw_body)
246
+ _errors = APIHelper.map_response(decoded, ['errors'])
247
+ ApiResponse.new(
248
+ _response, data: decoded, errors: _errors
249
+ )
250
+ end
251
+
252
+ # Cancels (voids) a payment. You can use this endpoint to cancel a payment
253
+ # with
254
+ # the APPROVED `status`.
255
+ # @param [String] payment_id Required parameter: The ID of the payment to
256
+ # cancel.
217
257
  # @return [CancelPaymentResponse Hash] response from the API call
218
258
  def cancel_payment(payment_id:)
219
259
  # Prepare query url.
@@ -249,9 +289,8 @@ module Square
249
289
  # Completes (captures) a payment.
250
290
  # By default, payments are set to complete immediately after they are
251
291
  # created.
252
- # If you set `autocomplete` to `false` when creating a payment, you can
253
- # complete (capture)
254
- # the payment using this endpoint.
292
+ # You can use this endpoint to complete a payment with the APPROVED
293
+ # `status`.
255
294
  # @param [String] payment_id Required parameter: The unique ID identifying
256
295
  # the payment to be completed.
257
296
  # @return [CompletePaymentResponse Hash] response from the API call
@@ -83,7 +83,12 @@ module Square
83
83
  end
84
84
 
85
85
  # Refunds a payment. You can refund the entire payment amount or a
86
- # portion of it.
86
+ # portion of it. You can use this endpoint to refund a card payment or
87
+ # record a
88
+ # refund of a cash or external payment. For more information, see
89
+ # [Refund
90
+ # Payment](https://developer.squareup.com/docs/payments-api/refund-payments)
91
+ # .
87
92
  # @param [RefundPaymentRequest] body Required parameter: An object
88
93
  # containing the fields to POST for the request. See the corresponding
89
94
  # object definition for field details.
@@ -5,8 +5,9 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
- # Creates a new Terminal checkout request and sends it to the specified
9
- # device to take a payment for the requested amount.
8
+ # Creates a Terminal checkout request and sends it to the specified device
9
+ # to take a payment
10
+ # for the requested amount.
10
11
  # @param [CreateTerminalCheckoutRequest] body Required parameter: An object
11
12
  # containing the fields to POST for the request. See the corresponding
12
13
  # object definition for field details.
@@ -75,9 +76,9 @@ module Square
75
76
  )
76
77
  end
77
78
 
78
- # Retrieves a Terminal checkout request by checkout_id.
79
- # @param [String] checkout_id Required parameter: Unique ID for the desired
80
- # `TerminalCheckout`
79
+ # Retrieves a Terminal checkout request by `checkout_id`.
80
+ # @param [String] checkout_id Required parameter: The unique ID for the
81
+ # desired `TerminalCheckout`.
81
82
  # @return [GetTerminalCheckoutResponse Hash] response from the API call
82
83
  def get_terminal_checkout(checkout_id:)
83
84
  # Prepare query url.
@@ -112,8 +113,8 @@ module Square
112
113
 
113
114
  # Cancels a Terminal checkout request if the status of the request permits
114
115
  # it.
115
- # @param [String] checkout_id Required parameter: Unique ID for the desired
116
- # `TerminalCheckout`
116
+ # @param [String] checkout_id Required parameter: The unique ID for the
117
+ # desired `TerminalCheckout`.
117
118
  # @return [CancelTerminalCheckoutResponse Hash] response from the API call
118
119
  def cancel_terminal_checkout(checkout_id:)
119
120
  # Prepare query url.
@@ -181,7 +182,7 @@ module Square
181
182
  )
182
183
  end
183
184
 
184
- # Retrieves a filtered list of Terminal Interac refund requests created by
185
+ # Retrieves a filtered list of Interac Terminal refund requests created by
185
186
  # the seller making the request.
186
187
  # @param [SearchTerminalRefundsRequest] body Required parameter: An object
187
188
  # containing the fields to POST for the request. See the corresponding
@@ -216,9 +217,9 @@ module Square
216
217
  )
217
218
  end
218
219
 
219
- # Retrieves an Interac terminal refund object by ID.
220
- # @param [String] terminal_refund_id Required parameter: Unique ID for the
221
- # desired `TerminalRefund`
220
+ # Retrieves an Interac Terminal refund object by ID.
221
+ # @param [String] terminal_refund_id Required parameter: The unique ID for
222
+ # the desired `TerminalRefund`.
222
223
  # @return [GetTerminalRefundResponse Hash] response from the API call
223
224
  def get_terminal_refund(terminal_refund_id:)
224
225
  # Prepare query url.
@@ -251,10 +252,10 @@ module Square
251
252
  )
252
253
  end
253
254
 
254
- # Cancels an Interac terminal refund request by refund request ID if the
255
+ # Cancels an Interac Terminal refund request by refund request ID if the
255
256
  # status of the request permits it.
256
- # @param [String] terminal_refund_id Required parameter: Unique ID for the
257
- # desired `TerminalRefund`
257
+ # @param [String] terminal_refund_id Required parameter: The unique ID for
258
+ # the desired `TerminalRefund`.
258
259
  # @return [CancelTerminalRefundResponse Hash] response from the API call
259
260
  def cancel_terminal_refund(terminal_refund_id:)
260
261
  # Prepare query url.
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
- '9.0.0.20210226'
7
+ '9.1.0.20210317'
8
8
  end
9
9
 
10
10
  def square_version
@@ -188,7 +188,7 @@ module Square
188
188
  def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
189
189
  backoff_factor: 1, environment: 'production',
190
190
  custom_url: 'https://connect.squareup.com',
191
- square_version: '2021-02-26', access_token: 'TODO: Replace',
191
+ square_version: '2021-03-17', access_token: 'TODO: Replace',
192
192
  additional_headers: {}, config: nil)
193
193
  @config = if config.nil?
194
194
  Configuration.new(timeout: timeout, max_retries: max_retries,
@@ -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-02-26', access_token: 'TODO: Replace',
27
+ square_version: '2021-03-17', 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: 9.0.0.20210226
4
+ version: 9.1.0.20210317
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-02-26 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging