stripe 10.15.0 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c6299b4afca3ee89da389e6dc45eee600eba9f3dfa66fa7120826e4dc9ce006
4
- data.tar.gz: 66073d85adc239428168012cc7585401347ea5ac4384ec910e13aa49c2d44dcb
3
+ metadata.gz: 2a0119245798da8cac7237cbed7a7c09633ba072b170afc497403fafa31f78ed
4
+ data.tar.gz: a0f4f05a488055d587e40b46ffab95076ad31fe61d2f647595a96a305f17a06a
5
5
  SHA512:
6
- metadata.gz: 8535cb9457a19a0acbf7d3faf0e77efc0b457f36c30adc80196b53d771db7f7170da9517f9f0cbb656ed6701411f34ba981f64e2f5f7256e67f66662d7e3f57a
7
- data.tar.gz: 1a8732f5540d740710a136fbe0a3c29f56b6d4ed904411fcec573aa30901d38a84830795c0f03aee4dc6e670fa35ed189c230c361f3e9776b9912af9af7c7892
6
+ metadata.gz: 728ba1fb75583945b56486273261846fa9ec55e98066e6a1361a81ac98ab91a35378e7851ba5f441ef9b0e896e21c40587b668a8c988eacdd0cf63fd00570ed0
7
+ data.tar.gz: f8a4c1336a7819186d4e0781bb50e3eba2e367b00fc9e88a8005df6ddd6cbb319ef5ab79941f25552a49654fc3270030bd38971f099461f3031ef67bc1c2f7cc
data/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
  # Changelog
2
+ ## 11.0.0 - 2024-04-10
3
+ * [#1374](https://github.com/stripe/stripe-ruby/pull/1374)
4
+
5
+ * This release changes the pinned API version to `2024-04-10`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-04-10) and carefully review the API changes before upgrading.
6
+
7
+ ### ⚠️ Breaking changes
8
+
9
+ * When no `x-stripe-should-retry` header is set in the response, the library now retries all requests with `status >= 500`, not just non-POST methods.
10
+
2
11
  ## 10.15.0 - 2024-04-09
3
12
  * [#1377](https://github.com/stripe/stripe-ruby/pull/1377) Add last_response to StripeObject
4
13
  * Users can now retrieve raw response from the returned resource, using the `last_response` property. See [README](https://github.com/stripe/stripe-ruby/blob/master/README.md) for an example.
@@ -138,32 +147,32 @@
138
147
  **⚠️ ACTION REQUIRED: the breaking change in this release likely affects you ⚠️**
139
148
 
140
149
  * [#1253](https://github.com/stripe/stripe-ruby/pull/1253) [#1260](https://github.com/stripe/stripe-ruby/pull/1260) Pin latest API version as the default
141
-
150
+
142
151
  In this release, Stripe API Version `2023-08-16` (the latest at time of release) will be sent by default on all requests. This is a significant change with wide ramifications. The API version affects the properties you see on responses, the parameters you are allowed to send on requests, and so on. The previous default was to use your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version).
143
-
152
+
144
153
  To successfully upgrade to stripe-ruby v9, you must either
145
-
154
+
146
155
  1. **(Recommended) Upgrade your integration to be compatible with API Version `2023-08-16`.**
147
-
156
+
148
157
  Please read the API Changelog carefully for each API Version from `2023-08-16` back to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). Determine if you are using any of the APIs that have changed in a breaking way, and adjust your integration accordingly. Carefully test your changes with Stripe [Test Mode](https://stripe.com/docs/keys#test-live-modes) before deploying them to production.
149
-
158
+
150
159
  You can read the [v9 migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v9) for more detailed instructions.
151
160
  2. **(Alternative option) Specify a version other than `2023-08-16` when initializing `stripe-ruby`.**
152
-
161
+
153
162
  If you were previously initializing stripe-ruby without an explicit API Version, you can postpone modifying your integration by specifying a version equal to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). For example:
154
-
163
+
155
164
  ```diff
156
165
  require 'stripe'
157
166
  Stripe.api_key = "sk_test_..."
158
167
  + Stripe.api_version = '2020-08-27'
159
168
  ```
160
-
169
+
161
170
  If you were already initializing stripe-ruby with an explicit API Version, upgrading to v9 will not affect your integration.
162
-
171
+
163
172
  Read the [v9 migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v9) for more details.
164
-
173
+
165
174
  Going forward, each major release of this library will be *pinned* by default to the latest Stripe API Version at the time of release.
166
-
175
+
167
176
  That is, instead of upgrading stripe-ruby and separately upgrading your Stripe API Version through the Stripe Dashboard. whenever you upgrade major versions of stripe-ruby, you should also upgrade your integration to be compatible with the latest Stripe API version.
168
177
 
169
178
  ## 8.7.0 - 2023-08-10
@@ -190,7 +199,7 @@
190
199
 
191
200
  * [#1225](https://github.com/stripe/stripe-ruby/pull/1225) Downgrade jaro_winkler
192
201
  * [#1219](https://github.com/stripe/stripe-ruby/pull/1219) Update generated code
193
-
202
+
194
203
  Documentation updates.
195
204
  * [#1215](https://github.com/stripe/stripe-ruby/pull/1215) Update generated code
196
205
 
@@ -238,7 +247,7 @@ Breaking changes that arose during code generation of the library that we postpo
238
247
  refund = Stripe::Refund.retrieve("re_123")
239
248
  refund.description = "Refund description"
240
249
  refund.save
241
-
250
+
242
251
  # after
243
252
  Stripe::Refund.update("re_123", description: "Refund description")
244
253
  ```
@@ -302,7 +311,7 @@ Breaking changes that arose during code generation of the library that we postpo
302
311
  * [#1072](https://github.com/stripe/stripe-ruby/pull/1072) Trigger workflows on beta branches
303
312
  * [#1071](https://github.com/stripe/stripe-ruby/pull/1071) Use request_stripe_object for all requests
304
313
  * [#1070](https://github.com/stripe/stripe-ruby/pull/1070) API Updates
305
-
314
+
306
315
  Switch from using meta-programing to generating explicit methods for custom methods.
307
316
  * [#1069](https://github.com/stripe/stripe-ruby/pull/1069) chore: Stop special implementation of Account.persons method.
308
317
 
@@ -318,15 +327,15 @@ Breaking changes that arose during code generation of the library that we postpo
318
327
  * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction`
319
328
  * Add support for `retrieve_payment_method` method on resource `Customer`
320
329
  * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
321
-
322
-
330
+
331
+
323
332
 
324
333
  ## 6.0.0 - 2022-05-09
325
334
  * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
326
335
  Major version release. The [migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-Guide-for-v6) contains more information.
327
-
336
+
328
337
  (⚠️ = breaking changes):
329
- * ⚠️ Replace the legacy `Order` API with the new `Order` API.
338
+ * ⚠️ Replace the legacy `Order` API with the new `Order` API.
330
339
  * New methods: `cancel`, `list_line_items`, `reopen`, and `submit`
331
340
  * Removed methods: `pay` and `return_order`
332
341
  * Removed resources: `OrderItem` and `OrderReturn`
@@ -335,7 +344,7 @@ Breaking changes that arose during code generation of the library that we postpo
335
344
  ## 5.55.0 - 2022-05-05
336
345
  * [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
337
346
  * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
338
-
347
+
339
348
 
340
349
  ## 5.54.0 - 2022-05-03
341
350
  * [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
@@ -346,7 +355,7 @@ Breaking changes that arose during code generation of the library that we postpo
346
355
  * Add support for `expire` test helper method on resource `Refund`
347
356
 
348
357
  ## 5.52.0 - 2022-04-18
349
- * [#1046](https://github.com/stripe/stripe-ruby/pull/1046) [#1047](https://github.com/stripe/stripe-ruby/pull/1047) API Updates
358
+ * [#1046](https://github.com/stripe/stripe-ruby/pull/1046) [#1047](https://github.com/stripe/stripe-ruby/pull/1047) API Updates
350
359
  * Add support for new resources `FundingInstructions` and `Terminal.Configuration`
351
360
 
352
361
  ## 5.51.0 - 2022-04-15
@@ -368,7 +377,7 @@ Breaking changes that arose during code generation of the library that we postpo
368
377
  * [#1040](https://github.com/stripe/stripe-ruby/pull/1040) API Updates
369
378
  * Add support for Search API
370
379
  * Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription`
371
-
380
+
372
381
  * [#1034](https://github.com/stripe/stripe-ruby/pull/1034) Add supporting classes for test helper generation
373
382
 
374
383
  ## 5.46.0 - 2022-03-23
data/Makefile CHANGED
@@ -5,7 +5,7 @@ update-version:
5
5
 
6
6
  codegen-format:
7
7
  bundle install --quiet
8
- bundle exec rubocop -o /dev/null --autocorrect
8
+ bundle exec rubocop --autocorrect
9
9
 
10
10
  ci-test:
11
11
  bundle install && bundle exec rake test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.15.0
1
+ 11.0.0
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Stripe
5
5
  module ApiVersion
6
- CURRENT = "2023-10-16"
6
+ CURRENT = "2024-04-10"
7
7
  end
8
8
  end
@@ -110,7 +110,7 @@ module Stripe
110
110
  # both socket errors that may represent an intermittent problem and some
111
111
  # special HTTP statuses.
112
112
  def self.should_retry?(error,
113
- method:, num_retries:, config: Stripe.config)
113
+ num_retries:, config: Stripe.config)
114
114
  return false if num_retries >= config.max_network_retries
115
115
 
116
116
  case error
@@ -143,15 +143,12 @@ module Stripe
143
143
  # These 429s are safe to retry.
144
144
  return true if error.http_status == 429 && error.code == "lock_timeout"
145
145
 
146
- # 500 Internal Server Error
146
+ # Retry on 500, 503, and other internal errors.
147
147
  #
148
- # We only bother retrying these for non-POST requests. POSTs end up
149
- # being cached by the idempotency layer so there's no purpose in
150
- # retrying them.
151
- return true if error.http_status == 500 && method != :post
152
-
153
- # 503 Service Unavailable
154
- error.http_status == 503
148
+ # Note that we expect the stripe-should-retry header to be false
149
+ # in most cases when a 500 is returned, since our idempotency framework
150
+ # would typically replay it anyway.
151
+ true if error.http_status >= 500
155
152
  else
156
153
  false
157
154
  end
@@ -490,7 +487,7 @@ module Stripe
490
487
  end
491
488
 
492
489
  http_resp =
493
- execute_request_with_rescues(method, api_base, headers, usage, context) do
490
+ execute_request_with_rescues(api_base, headers, usage, context) do
494
491
  self.class
495
492
  .default_connection_manager(config)
496
493
  .execute_request(method, url,
@@ -560,7 +557,7 @@ module Stripe
560
557
  http_status >= 400
561
558
  end
562
559
 
563
- private def execute_request_with_rescues(method, api_base, headers, usage, context)
560
+ private def execute_request_with_rescues(api_base, headers, usage, context)
564
561
  num_retries = 0
565
562
 
566
563
  begin
@@ -611,7 +608,6 @@ module Stripe
611
608
  user_data, resp, headers)
612
609
 
613
610
  if self.class.should_retry?(e,
614
- method: method,
615
611
  num_retries: num_retries,
616
612
  config: config)
617
613
  num_retries += 1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "10.15.0"
4
+ VERSION = "11.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.15.0
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-09 00:00:00.000000000 Z
11
+ date: 2024-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.