Skip to content

Commit ff00ff7

Browse files
Merge pull request #1607 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 5e3c815 + 09b4685 commit ff00ff7

File tree

159 files changed

+20441
-13953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+20441
-13953
lines changed

API_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-06-30.preview

CHANGELOG.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ This release changes the pinned API version to `2025-05-28.preview`.
4242
* Add support for `tax_transaction_attempts` on `Tax::Association`
4343
* Add support for `confirm_config` on `Terminal::Reader::Action::ConfirmPaymentIntent` and `Terminal::Reader::ConfirmPaymentIntentParams`
4444

45+
## 15.2.1 - 2025-06-04
46+
* [#1617](https://github.com/stripe/stripe-ruby/pull/1617) Fix `nil` requestor in `Webhook.construct_event` to allow for event data refresh
47+
* Fix bug where `Event` constructed from `Webhook.construct_event` could not be refreshed due to a `nil` APIRequestor
48+
* Raised in https://github.com/stripe/stripe-ruby/issues/1616
49+
4550
## 15.2.0 - 2025-05-29
4651
This release changes the pinned API version to `2025-05-28.basil`.
4752

@@ -224,15 +229,15 @@ This release changes the pinned API version to `2025-05-28.preview`.
224229
* Adds explicit field types for resources and parameters for methods, and add RBI static annotations for all resources and services
225230
![image](https://github.com/user-attachments/assets/1b6cd994-d3ea-4f47-8487-f5c7b9ebf885)
226231
* See [the wiki](https://github.com/stripe/stripe-ruby/wiki/Static-Type-Annotations) for more details
227-
232+
228233
* [#1543](https://github.com/stripe/stripe-ruby/pull/1543) Support for APIs in the new API version 2025-03-31.basil
229234

230235
This release changes the pinned API version to `2025-03-31.basil`.
231-
236+
232237
### ⚠️ Breaking changes due to changes in the Stripe API
233238

234239
Please review details for the breaking changes and alternatives in the [Stripe API changelog](https://docs.stripe.com/changelog/basil) before upgrading.
235-
240+
236241
* Remove support for resources `SubscriptionItemUsageRecordSummary` and `SubscriptionItemUsageRecord`
237242
* Remove support for `create` method on resource `SubscriptionItemUsageRecord`
238243
* Remove support for `list` method on resource `SubscriptionItemUsageRecordSummary`
@@ -242,9 +247,9 @@ This release changes the pinned API version to `2025-05-28.preview`.
242247
* [#1553](https://github.com/stripe/stripe-ruby/pull/1553) Remove public idempotent_replayed? method
243248
* ⚠️ Remove the `idempotent_replayed?` method on `StripeError`
244249
* The information is accessible indirectly via the raw response headers, `StripeResponse.http_headers`. For example, use `resource.last_response.http_headers['Idempotent-Replayed']`
245-
250+
246251
### Additions to the Stripe API
247-
252+
248253
* Add support for new resource `InvoicePayment`
249254
* Add support for `list` and `retrieve` methods on resource `InvoicePayment`
250255

@@ -255,16 +260,16 @@ This release changes the pinned API version to `2025-05-28.preview`.
255260
* Add support for `succeed_input_collection` and `timeout_input_collection` test helper methods on resource `Terminal.Reader`
256261
* [#1545](https://github.com/stripe/stripe-ruby/pull/1545) fix ruby merge conflict for beta
257262

258-
## 13.5.0-beta.1 - 2025-02-07
259-
* [#1527](https://github.com/stripe/stripe-ruby/pull/1527) Update generated code for beta
260-
261263
## 13.5.0 - 2025-02-24
262264
* [#1534](https://github.com/stripe/stripe-ruby/pull/1534) Update generated code
263265
* Fixed `Stripe::InvoiceLineItem.update` method.
264266
* [#1536](https://github.com/stripe/stripe-ruby/pull/1536) Fix InvoiceLineItem parent class
265267
* Fix bug where `Stripe::InvoiceLineItem` had the incorrect parent class, making it error when `update` was called
266268
* [#1533](https://github.com/stripe/stripe-ruby/pull/1533) add codeowners file
267269

270+
## 13.5.0-beta.1 - 2025-02-07
271+
* [#1527](https://github.com/stripe/stripe-ruby/pull/1527) Update generated code for beta
272+
268273
## 13.4.1 - 2025-01-28
269274
* [#1528](https://github.com/stripe/stripe-ruby/pull/1528) Update generated code
270275
* ⚠️ Bugfix: `invoice` and `line_item_id` can be passed to `update` method in `InvoiceLineItem`.
@@ -394,7 +399,7 @@ This release changes the pinned API version to `2025-05-28.preview`.
394399
## 13.0.0 - 2024-10-01
395400
* [#1458](https://github.com/stripe/stripe-ruby/pull/1458) Support for APIs in the new API version 2024-09-30.acacia
396401
397-
This release changes the pinned API version to `2024-09-30.acacia`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-09-30.acacia) and carefully review the API changes before upgrading.
402+
This release changes the pinned API version to `2024-09-30.acacia`. Please read the [API Changelog](https://docs.stripe.com/changelog/acacia#2024-09-30.acacia) and carefully review the API changes before upgrading.
398403
399404
### ⚠️ Breaking changes
400405
@@ -539,7 +544,7 @@ This release changes the pinned API version to `2025-05-28.preview`.
539544
* [#1418](https://github.com/stripe/stripe-ruby/pull/1418) Add missing static method for verify on BankAccount
540545
* [#1419](https://github.com/stripe/stripe-ruby/pull/1419)
541546

542-
This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading.
547+
This release changes the pinned API version to 2024-06-20. Please read the [API Changelog](https://docs.stripe.com/changelog/2024-06-20) and carefully review the API changes before upgrading.
543548

544549
### Additions
545550

@@ -600,7 +605,7 @@ This release changes the pinned API version to `2025-05-28.preview`.
600605
## 11.0.0 - 2024-04-10
601606
* [#1374](https://github.com/stripe/stripe-ruby/pull/1374)
602607

603-
* 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.
608+
* This release changes the pinned API version to `2024-04-10`. Please read the [API Changelog](https://docs.stripe.com/changelog/2024-04-10) and carefully review the API changes before upgrading.
604609

605610
### ⚠️ Breaking changes
606611

@@ -829,9 +834,8 @@ Updated stable APIs to the latest version
829834
- [#1282](https://github.com/stripe/stripe-ruby/pull/1282) Update generated code for beta
830835

831836
## 10.0.0 - 2023-10-16
832-
833-
- This release changes the pinned API version to `2023-10-16`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2023-10-16) and carefully review the API changes before upgrading `stripe-ruby`.
834-
- [#1283](https://github.com/stripe/stripe-ruby/pull/1283) Update generated code
837+
* This release changes the pinned API version to `2023-10-16`. Please read the [API Changelog](https://docs.stripe.com/changelog/2023-10-16) and carefully review the API changes before upgrading `stripe-ruby`.
838+
* [#1283](https://github.com/stripe/stripe-ruby/pull/1283) Update generated code
835839
- Updated pinned API version
836840
- [#1281](https://github.com/stripe/stripe-ruby/pull/1281) Update generated code
837841
- Documentation only changes
@@ -1180,7 +1184,7 @@ Updated stable APIs to the latest version
11801184
11811185
- [#1144](https://github.com/stripe/stripe-ruby/pull/1144) Next major release changes
11821186
1183-
Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15.
1187+
Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://docs.stripe.com/changelog/2022-11-15.
11841188
11851189
"⚠️" symbol highlights breaking changes.
11861190
@@ -1235,7 +1239,7 @@ Breaking changes that arose during code generation of the library that we postpo
12351239
12361240
## 7.0.0 - 2022-08-02
12371241
1238-
Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v7. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01.
1242+
Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v7. For changes to the Stripe products, read more at https://docs.stripe.com/changelog/2022-08-01.
12391243
12401244
"⚠️" symbol highlights breaking changes.
12411245

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1773
1+
v1819

README.md

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ value:
6060

6161
```ruby
6262
require 'stripe'
63-
Stripe.api_key = 'sk_test_...'
63+
64+
client = Stripe::StripeClient.new("sk_test_...")
6465

6566
# list customers
66-
Stripe::Customer.list()
67+
customers = client.v1.customers.list()
6768

68-
# retrieve single customer
69-
Stripe::Customer.retrieve('cus_123456789')
69+
# retrieve single customer
70+
customer = client.v1.customers.retrieve('cus_123456789')
7071
```
7172

7273
### Per-request Configuration
@@ -78,55 +79,18 @@ per-request key and/or account:
7879
```ruby
7980
require "stripe"
8081

81-
Stripe::Customer.list(
82-
{},
83-
{
84-
api_key: 'sk_test_...',
85-
stripe_account: 'acct_...',
86-
stripe_version: '2018-02-28',
87-
}
88-
)
82+
client = Stripe::StripeClient.new("sk_test_...")
8983

90-
Stripe::Customer.retrieve(
91-
'cus_123456789',
84+
client.v1.customers.list(
85+
{},
9286
{
9387
api_key: 'sk_test_...',
9488
stripe_account: 'acct_...',
9589
stripe_version: '2018-02-28',
9690
}
9791
)
98-
99-
Stripe::Customer.retrieve(
100-
{
101-
id: 'cus_123456789',
102-
expand: %w(balance_transaction)
103-
},
104-
{
105-
stripe_version: '2018-02-28',
106-
api_key: 'sk_test_...',
107-
}
108-
)
109-
110-
Stripe::Customer.capture(
111-
'cus_123456789',
112-
{},
113-
{
114-
stripe_version: '2018-02-28',
115-
api_key: 'sk_test_...',
116-
}
117-
)
11892
```
11993

120-
Keep in mind that there are different method signatures depending on the action:
121-
122-
- When operating on a collection (e.g. `.list`, `.create`) the method signature is
123-
`method(params, opts)`.
124-
- When operating on resource (e.g. `.capture`, `.update`) the method signature is
125-
`method(id, params, opts)`.
126-
- One exception is that `retrieve`, despite being an operation on a resource, has the signature
127-
`retrieve(id, opts)`. In addition, it will accept a Hash for the `id` param but will extract the
128-
`id` key out and use the others as options.
129-
13094
### StripeClient vs legacy pattern
13195

13296
We introduced the `StripeClient` class in v13 of the Ruby SDK. The legacy pattern used prior to that version is still available to use but will be marked as deprecated soon. Review the [migration guide to use StripeClient](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v13) to move from the legacy pattern.
@@ -138,15 +102,15 @@ Once the legacy pattern is deprecated, new API endpoints will only be accessible
138102
Both indexer and accessors can be used to retrieve values of resource properties.
139103

140104
```ruby
141-
customer = Stripe::Customer.retrieve('cus_123456789')
105+
customer = client.v1.customers.retrieve('cus_123456789')
142106
puts customer['id']
143107
puts customer.id
144108
```
145109

146110
NOTE: If the resource property is not defined, the accessors will raise an exception, while the indexer will return `nil`.
147111

148112
```ruby
149-
customer = Stripe::Customer.retrieve('cus_123456789')
113+
customer = client.v1.customers.retrieve('cus_123456789')
150114
puts customer['unknown'] # nil
151115
puts customer.unknown # raises NoMethodError
152116
```
@@ -156,7 +120,7 @@ puts customer.unknown # raises NoMethodError
156120
Get access to response objects by using the `last_response` property of the returned resource:
157121

158122
```ruby
159-
customer = Stripe::Customer.retrieve('cus_123456789')
123+
customer = client.v1.customers.retrieve('cus_123456789')
160124

161125
print(customer.last_response.http_status) # to retrieve status code
162126
print(customer.last_response.http_headers) # to retrieve headers
@@ -388,8 +352,8 @@ If you:
388352
you can now use the `raw_request` method on `StripeClient`.
389353

390354
```ruby
391-
client = Stripe::StripeClient.new(...)
392-
resp = client.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
355+
client = Stripe::StripeClient.new('sk_test_...')
356+
resp = client.raw_request(:post, "/v1/beta_endpoint", params: {param: 123}, opts: {stripe_version: "2022-11-15; feature_beta=v3"})
393357

394358
# (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
395359
deserialized_resp = client.deserialize(resp.http_body)

lib/stripe/api_requestor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,8 @@ def self.maybe_gc_connection_managers
854854
TemporarySessionExpiredError.new(error_data[:message], **opts)
855855
when "financial_account_not_open"
856856
FinancialAccountNotOpenError.new(error_data[:message], **opts)
857+
when "feature_not_enabled"
858+
FeatureNotEnabledError.new(error_data[:message], **opts)
857859
when "blocked_by_stripe"
858860
BlockedByStripeError.new(error_data[:message], **opts)
859861
when "already_canceled"
@@ -866,8 +868,6 @@ def self.maybe_gc_connection_managers
866868
QuotaExceededError.new(error_data[:message], **opts)
867869
when "recipient_not_notifiable"
868870
RecipientNotNotifiableError.new(error_data[:message], **opts)
869-
when "feature_not_enabled"
870-
FeatureNotEnabledError.new(error_data[:message], **opts)
871871
when "invalid_payout_method"
872872
InvalidPayoutMethodError.new(error_data[:message], **opts)
873873
when "controlled_by_dashboard"

lib/stripe/api_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
module Stripe
55
module ApiVersion
6-
CURRENT = "2025-05-28.preview"
6+
CURRENT = "2025-06-30.preview"
77
end
88
end

lib/stripe/errors.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ class TemporarySessionExpiredError < StripeError
168168
class FinancialAccountNotOpenError < StripeError
169169
end
170170

171+
class FeatureNotEnabledError < StripeError
172+
end
173+
171174
class BlockedByStripeError < StripeError
172175
end
173176

@@ -186,9 +189,6 @@ class QuotaExceededError < StripeError
186189
class RecipientNotNotifiableError < StripeError
187190
end
188191

189-
class FeatureNotEnabledError < StripeError
190-
end
191-
192192
class InvalidPayoutMethodError < StripeError
193193
end
194194

lib/stripe/events/v2_core_event_destination_ping_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# frozen_string_literal: true
33

44
module Stripe
5-
# A ping event used to test the connection to an event destination.
5+
# A ping event used to test the connection to an EventDestination.
66
class V2CoreEventDestinationPingEvent < Stripe::V2::Event
77
def self.lookup_type
88
"v2.core.event_destination.ping"

0 commit comments

Comments
 (0)