Skip to content

Update generated code for beta #1607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ff0097d
Update generated code for v1774 and 2025-05-28.preview
stripe-openapi[bot] May 30, 2025
91323a1
Update generated code for v1779 and 2025-05-28.preview
stripe-openapi[bot] Jun 2, 2025
f49702c
Update generated code for v1780 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
7a94924
Update generated code for v1782 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
15d6de4
Update generated code for v1783 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
4057859
Update generated code for v1785 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
51e8e32
Fix event refresh (#1617)
helenye-stripe Jun 4, 2025
d911399
Bump version to 15.2.1
helenye-stripe Jun 4, 2025
647d040
Merge upstream and update generated code for v1786 and 2025-05-28.pre…
stripe-openapi[bot] Jun 4, 2025
cf091fc
Update generated code for v1787 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
f69a830
Update generated code for v1787 and 2025-05-28.preview
stripe-openapi[bot] Jun 5, 2025
f320f3b
Update generated code for v1789 and 2025-05-28.preview
stripe-openapi[bot] Jun 6, 2025
3217e93
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
71ac788
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
ad13af8
Update generated code for v1797 and 2025-05-28.preview
stripe-openapi[bot] Jun 13, 2025
4367ac9
Fix `raw_request` example in readme (#1620)
mikesea Jun 16, 2025
1881fb4
Merge upstream and update generated code for v1798 and 2025-05-28.pre…
stripe-openapi[bot] Jun 16, 2025
78b9560
Update generated code for v1799 and 2025-05-28.preview
stripe-openapi[bot] Jun 16, 2025
bffc451
Update generated code for v1800 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
da9f0e0
Disable flaky test in jruby/truffleruby (#1621)
helenye-stripe Jun 17, 2025
cec1c81
Merge upstream and update generated code for v1800 and 2025-05-28.pre…
stripe-openapi[bot] Jun 17, 2025
93dc817
Update generated code for v1801 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
d93c1ed
Update generated code for v1803 and 2025-05-28.preview
stripe-openapi[bot] Jun 18, 2025
d030a99
Update generated code for v1805 and 2025-05-28.preview
stripe-openapi[bot] Jun 18, 2025
f04ecf2
Update generated code for v1806 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
59a08b6
Update generated code for v1807 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
fd5c24b
Update generated code for v1808 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
f730d94
Update generated code for v1809 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
f99b44d
Update generated code for v1811 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
25bc66b
Update generated code for v1813 and 2025-06-30.preview
stripe-openapi[bot] Jun 18, 2025
f2db2da
Update generated code for v1814 and 2025-06-30.preview
stripe-openapi[bot] Jun 19, 2025
58b0bf6
Update generated code for v1815 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
b6ff436
Update generated code for v1816 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
9704ea2
Update generated code for v1817 and 2025-06-30.preview
stripe-openapi[bot] Jun 20, 2025
29df21d
Update generated code for v1818 and 2025-06-30.preview
stripe-openapi[bot] Jun 23, 2025
3d8ec2f
Link to the /changelog page instead of /upgrades (#1622)
ramya-stripe Jun 23, 2025
ae640e1
Merge upstream and update generated code for v1819 and 2025-06-30.pre…
stripe-openapi[bot] Jun 23, 2025
8ac3b4f
Updated stripeclient snippets in Readme.md (#1619)
prathmesh-stripe Jun 23, 2025
a7df47d
Merge upstream and update generated code for v1819 and 2025-06-30.pre…
stripe-openapi[bot] Jun 23, 2025
b69f65f
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 24, 2025
ec0e557
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 24, 2025
b1abc5f
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jun 26, 2025
adcee68
Merged beta into latest-codegen-beta after resolving conflicts
prathmesh-stripe Jun 30, 2025
f607e56
Removed changes which were accidently committed
prathmesh-stripe Jun 30, 2025
09b4685
Update generated code for v1819 and 2025-06-30.preview
stripe-openapi[bot] Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions API_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-06-30.preview
36 changes: 20 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ This release changes the pinned API version to `2025-05-28.preview`.
* Add support for `tax_transaction_attempts` on `Tax::Association`
* Add support for `confirm_config` on `Terminal::Reader::Action::ConfirmPaymentIntent` and `Terminal::Reader::ConfirmPaymentIntentParams`

## 15.2.1 - 2025-06-04
* [#1617](https://github.com/stripe/stripe-ruby/pull/1617) Fix `nil` requestor in `Webhook.construct_event` to allow for event data refresh
* Fix bug where `Event` constructed from `Webhook.construct_event` could not be refreshed due to a `nil` APIRequestor
* Raised in https://github.com/stripe/stripe-ruby/issues/1616

## 15.2.0 - 2025-05-29
This release changes the pinned API version to `2025-05-28.basil`.

Expand Down Expand Up @@ -224,15 +229,15 @@ This release changes the pinned API version to `2025-05-28.preview`.
* Adds explicit field types for resources and parameters for methods, and add RBI static annotations for all resources and services
![image](https://github.com/user-attachments/assets/1b6cd994-d3ea-4f47-8487-f5c7b9ebf885)
* See [the wiki](https://github.com/stripe/stripe-ruby/wiki/Static-Type-Annotations) for more details

* [#1543](https://github.com/stripe/stripe-ruby/pull/1543) Support for APIs in the new API version 2025-03-31.basil

This release changes the pinned API version to `2025-03-31.basil`.

### ⚠️ Breaking changes due to changes in the Stripe API

Please review details for the breaking changes and alternatives in the [Stripe API changelog](https://docs.stripe.com/changelog/basil) before upgrading.

* Remove support for resources `SubscriptionItemUsageRecordSummary` and `SubscriptionItemUsageRecord`
* Remove support for `create` method on resource `SubscriptionItemUsageRecord`
* Remove support for `list` method on resource `SubscriptionItemUsageRecordSummary`
Expand All @@ -242,9 +247,9 @@ This release changes the pinned API version to `2025-05-28.preview`.
* [#1553](https://github.com/stripe/stripe-ruby/pull/1553) Remove public idempotent_replayed? method
* ⚠️ Remove the `idempotent_replayed?` method on `StripeError`
* The information is accessible indirectly via the raw response headers, `StripeResponse.http_headers`. For example, use `resource.last_response.http_headers['Idempotent-Replayed']`

### Additions to the Stripe API

* Add support for new resource `InvoicePayment`
* Add support for `list` and `retrieve` methods on resource `InvoicePayment`

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

## 13.5.0-beta.1 - 2025-02-07
* [#1527](https://github.com/stripe/stripe-ruby/pull/1527) Update generated code for beta

## 13.5.0 - 2025-02-24
* [#1534](https://github.com/stripe/stripe-ruby/pull/1534) Update generated code
* Fixed `Stripe::InvoiceLineItem.update` method.
* [#1536](https://github.com/stripe/stripe-ruby/pull/1536) Fix InvoiceLineItem parent class
* Fix bug where `Stripe::InvoiceLineItem` had the incorrect parent class, making it error when `update` was called
* [#1533](https://github.com/stripe/stripe-ruby/pull/1533) add codeowners file

## 13.5.0-beta.1 - 2025-02-07
* [#1527](https://github.com/stripe/stripe-ruby/pull/1527) Update generated code for beta

## 13.4.1 - 2025-01-28
* [#1528](https://github.com/stripe/stripe-ruby/pull/1528) Update generated code
* ⚠️ Bugfix: `invoice` and `line_item_id` can be passed to `update` method in `InvoiceLineItem`.
Expand Down Expand Up @@ -394,7 +399,7 @@ This release changes the pinned API version to `2025-05-28.preview`.
## 13.0.0 - 2024-10-01
* [#1458](https://github.com/stripe/stripe-ruby/pull/1458) Support for APIs in the new API version 2024-09-30.acacia

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.
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.

### ⚠️ Breaking changes

Expand Down Expand Up @@ -539,7 +544,7 @@ This release changes the pinned API version to `2025-05-28.preview`.
* [#1418](https://github.com/stripe/stripe-ruby/pull/1418) Add missing static method for verify on BankAccount
* [#1419](https://github.com/stripe/stripe-ruby/pull/1419)

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.
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.

### Additions

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

* 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.
* 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.

### ⚠️ Breaking changes

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

## 10.0.0 - 2023-10-16

- 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`.
- [#1283](https://github.com/stripe/stripe-ruby/pull/1283) Update generated code
* 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`.
* [#1283](https://github.com/stripe/stripe-ruby/pull/1283) Update generated code
- Updated pinned API version
- [#1281](https://github.com/stripe/stripe-ruby/pull/1281) Update generated code
- Documentation only changes
Expand Down Expand Up @@ -1180,7 +1184,7 @@ Updated stable APIs to the latest version

- [#1144](https://github.com/stripe/stripe-ruby/pull/1144) Next major release changes

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.
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.

"⚠️" symbol highlights breaking changes.

Expand Down Expand Up @@ -1235,7 +1239,7 @@ Breaking changes that arose during code generation of the library that we postpo

## 7.0.0 - 2022-08-02

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.
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.

"⚠️" symbol highlights breaking changes.

Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1773
v1819
62 changes: 13 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ value:

```ruby
require 'stripe'
Stripe.api_key = 'sk_test_...'

client = Stripe::StripeClient.new("sk_test_...")

# list customers
Stripe::Customer.list()
customers = client.v1.customers.list()

# retrieve single customer
Stripe::Customer.retrieve('cus_123456789')
# retrieve single customer
customer = client.v1.customers.retrieve('cus_123456789')
```

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

Stripe::Customer.list(
{},
{
api_key: 'sk_test_...',
stripe_account: 'acct_...',
stripe_version: '2018-02-28',
}
)
client = Stripe::StripeClient.new("sk_test_...")

Stripe::Customer.retrieve(
'cus_123456789',
client.v1.customers.list(
{},
{
api_key: 'sk_test_...',
stripe_account: 'acct_...',
stripe_version: '2018-02-28',
}
)

Stripe::Customer.retrieve(
{
id: 'cus_123456789',
expand: %w(balance_transaction)
},
{
stripe_version: '2018-02-28',
api_key: 'sk_test_...',
}
)

Stripe::Customer.capture(
'cus_123456789',
{},
{
stripe_version: '2018-02-28',
api_key: 'sk_test_...',
}
)
```

Keep in mind that there are different method signatures depending on the action:

- When operating on a collection (e.g. `.list`, `.create`) the method signature is
`method(params, opts)`.
- When operating on resource (e.g. `.capture`, `.update`) the method signature is
`method(id, params, opts)`.
- One exception is that `retrieve`, despite being an operation on a resource, has the signature
`retrieve(id, opts)`. In addition, it will accept a Hash for the `id` param but will extract the
`id` key out and use the others as options.

### StripeClient vs legacy pattern

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.
Expand All @@ -138,15 +102,15 @@ Once the legacy pattern is deprecated, new API endpoints will only be accessible
Both indexer and accessors can be used to retrieve values of resource properties.

```ruby
customer = Stripe::Customer.retrieve('cus_123456789')
customer = client.v1.customers.retrieve('cus_123456789')
puts customer['id']
puts customer.id
```

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

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

```ruby
customer = Stripe::Customer.retrieve('cus_123456789')
customer = client.v1.customers.retrieve('cus_123456789')

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

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

# (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
deserialized_resp = client.deserialize(resp.http_body)
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/api_requestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,8 @@ def self.maybe_gc_connection_managers
TemporarySessionExpiredError.new(error_data[:message], **opts)
when "financial_account_not_open"
FinancialAccountNotOpenError.new(error_data[:message], **opts)
when "feature_not_enabled"
FeatureNotEnabledError.new(error_data[:message], **opts)
when "blocked_by_stripe"
BlockedByStripeError.new(error_data[:message], **opts)
when "already_canceled"
Expand All @@ -866,8 +868,6 @@ def self.maybe_gc_connection_managers
QuotaExceededError.new(error_data[:message], **opts)
when "recipient_not_notifiable"
RecipientNotNotifiableError.new(error_data[:message], **opts)
when "feature_not_enabled"
FeatureNotEnabledError.new(error_data[:message], **opts)
when "invalid_payout_method"
InvalidPayoutMethodError.new(error_data[:message], **opts)
when "controlled_by_dashboard"
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2025-05-28.preview"
CURRENT = "2025-06-30.preview"
end
end
6 changes: 3 additions & 3 deletions lib/stripe/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class TemporarySessionExpiredError < StripeError
class FinancialAccountNotOpenError < StripeError
end

class FeatureNotEnabledError < StripeError
end

class BlockedByStripeError < StripeError
end

Expand All @@ -186,9 +189,6 @@ class QuotaExceededError < StripeError
class RecipientNotNotifiableError < StripeError
end

class FeatureNotEnabledError < StripeError
end

class InvalidPayoutMethodError < StripeError
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true

module Stripe
# A ping event used to test the connection to an event destination.
# A ping event used to test the connection to an EventDestination.
class V2CoreEventDestinationPingEvent < Stripe::V2::Event
def self.lookup_type
"v2.core.event_destination.ping"
Expand Down
Loading