Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
25e66db
Update generated code for v1473
stripe-openapi[bot] Feb 7, 2025
886c40e
Update generated code for v1479
stripe-openapi[bot] Feb 10, 2025
eb0087f
Update generated code for v1481
stripe-openapi[bot] Feb 11, 2025
4652eeb
Update generated code for v1483
stripe-openapi[bot] Feb 11, 2025
cf3a254
Update generated code for v1486
stripe-openapi[bot] Feb 12, 2025
23835db
Update generated code for v1487
stripe-openapi[bot] Feb 12, 2025
ce661f2
add codeowners file (#1533)
xavdid-stripe Feb 13, 2025
3b69aff
Merge upstream and update generated code for v1488
stripe-openapi[bot] Feb 13, 2025
73ae77d
Update generated code for v1490
stripe-openapi[bot] Feb 13, 2025
f7cdb2c
Update generated code for v1493
stripe-openapi[bot] Feb 14, 2025
ad90417
Update generated code for v1494
stripe-openapi[bot] Feb 14, 2025
de68f00
Update generated code for v1495
stripe-openapi[bot] Feb 14, 2025
99092ff
Update generated code for v1495
stripe-openapi[bot] Feb 14, 2025
346e696
Update generated code for v1496
stripe-openapi[bot] Feb 19, 2025
94a05c4
Fix InvoiceLineItem parent class (#1536)
helenye-stripe Feb 21, 2025
427ab37
Update generated code for v1502
stripe-openapi[bot] Feb 21, 2025
21b8733
Update generated code for v1504
stripe-openapi[bot] Feb 24, 2025
a0bc8dc
Update generated code for v1505
stripe-openapi[bot] Feb 24, 2025
d5fd589
Update generated code for v1505
stripe-openapi[bot] Feb 24, 2025
13eb7c5
Update generated code (#1534)
stripe-openapi[bot] Feb 24, 2025
7a29654
Bump version to 13.5.0
prathmesh-stripe Feb 24, 2025
a9254a2
InvoiceLineItem's parent is APIResource
ramya-stripe Mar 14, 2025
3a2f1e7
Locking rbi gem like we did in #1549
ramya-stripe Mar 14, 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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# All files should be reviewed by a member of the SDKs team
* @stripe/api-library-reviewers
74 changes: 40 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
## 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.4.1 - 2025-01-28
* [#1528](https://github.com/stripe/stripe-ruby/pull/1528) Update generated code
Expand Down Expand Up @@ -31,31 +37,31 @@
* Support parameter and resource fields with typed RBIs
* [#1509](https://github.com/stripe/stripe-ruby/pull/1509) (beta) Publish RBIs with gem
* [#1505](https://github.com/stripe/stripe-ruby/pull/1505) Add method parameter type classes to all resources and services
* Add method parameter classes for all resources and service methods.

* Add method parameter classes for all resources and service methods.
* These changes are NOT breaking and are purely additive. The method parameter classes are not required, we still accept hashes as well as the new `RequestParams` classes. Any additional gated parameters are still available to pass via hash. Resource fields define publicly documented fields and other deserialized fields are still accessible.

## 13.3.1 - 2025-01-13
* [#1512](https://github.com/stripe/stripe-ruby/pull/1512) Import global configuration for options not available on StripeClient options
* Fixes bug where `StripeClient` was not falling back to global options for options that are not available to be set per-client
* [#1516](https://github.com/stripe/stripe-ruby/pull/1516) ThinEvent reason and livemode
- Add `livemode` and optional `reason` fields to ThinEvent
- Add `livemode` and optional `reason` fields to ThinEvent
* [#1518](https://github.com/stripe/stripe-ruby/pull/1518) Pin ubuntu version in Test action
* [#1508](https://github.com/stripe/stripe-ruby/pull/1508) Added pull request template

## 13.3.0 - 2024-12-18
* [#1500](https://github.com/stripe/stripe-ruby/pull/1500) This release changes the pinned API version to `2024-12-18.acacia`.

* [#1507](https://github.com/stripe/stripe-ruby/pull/1507) Pass requestor to all deserialized objects including lists

* Fixes bug where `StripeObject` retrieved from lists could not be used to make requests, such as `refresh`

## 13.3.0-beta.3 - 2024-12-12
* [#1499](https://github.com/stripe/stripe-ruby/pull/1499) Update generated code for beta
* Add support for `AllowRedisplay` on `Card` and `Source`
* Add support for new values `am_tin`, `ao_tin`, `ba_tin`, `bb_tin`, `bs_tin`, `cd_nif`, `gn_nif`, `kh_tin`, `me_pib`, `mk_vat`, `mr_nif`, `np_pan`, `sn_ninea`, `sr_fin`, `tj_tin`, `ug_tin`, `zm_tin`, and `zw_tin` on enums `CheckoutSessionCollectedInformationTaxIdsType` and `OrderTaxDetailsTaxIdsType`
* Add support for new value `network_fallback` on enum `IssuingAuthorizationRequestHistoryReason`
* Remove support for `AmountRefunded` on `PaymentRecord`
* Add support for `AllowRedisplay` on `Card` and `Source`
* Add support for new values `am_tin`, `ao_tin`, `ba_tin`, `bb_tin`, `bs_tin`, `cd_nif`, `gn_nif`, `kh_tin`, `me_pib`, `mk_vat`, `mr_nif`, `np_pan`, `sn_ninea`, `sr_fin`, `tj_tin`, `ug_tin`, `zm_tin`, and `zw_tin` on enums `CheckoutSessionCollectedInformationTaxIdsType` and `OrderTaxDetailsTaxIdsType`
* Add support for new value `network_fallback` on enum `IssuingAuthorizationRequestHistoryReason`
* Remove support for `AmountRefunded` on `PaymentRecord`
* Add support for `Account` on `TerminalReaderActionCollectPaymentMethod`, `TerminalReaderActionConfirmPaymentIntent`, `TerminalReaderActionProcessPaymentIntent`, and `TerminalReaderActionRefundPayment`

## 13.3.0-beta.2 - 2024-12-05
Expand Down Expand Up @@ -105,62 +111,62 @@
* Add support for `submit_card` test helper method on resource `Issuing.Card`

## 13.1.0-beta.1 - 2024-10-03
* [#1465](https://github.com/stripe/stripe-ruby/pull/1465) Updates to the `Preview` class
* [#1465](https://github.com/stripe/stripe-ruby/pull/1465) Updates to the `Preview` class
* Remove `Stripe::Preview`. Use `StripeClient#raw_request` instead (see below).
* Marked `Stripe.raw_request` and `Stripe.deserialize` as deprecated. Use `StripeClient#raw_request` and `StripeClient#deserialize` instead. In StripeClient, the params and opts parameters are passed as keyword arguments:
```ruby
# Before
resp = Stripe.raw_request(:post, "v1/charges", , {p1: "p1"}, {stripe_account: "acct_123"})
charge = Stripe.deserialize(resp.data)

# After
client = StripeClient.new("sk_test_123")
client = StripeClient.new("sk_test_123")
resp = client.raw_request(:post, "/v1/charges", params: {p1: "p1"}, opts: {stripe_account: "acct_123"})
charge = client.deserialize(resp.data)
```

## 13.0.2 - 2024-10-23
* [#1473](https://github.com/stripe/stripe-ruby/pull/1473) Always return the result of APIResource#refresh in APIResource.retrieve

* Fix bug where we would not return the mutated `self` object when calling `APIResource.retrieve`

## 13.0.1 - 2024-10-18
* [#1471](https://github.com/stripe/stripe-ruby/pull/1471) update object tags for meter-related classes

- fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
* [#1470](https://github.com/stripe/stripe-ruby/pull/1470) Cleaned up examples and added documentation

## 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.
### ⚠️ Breaking changes

### ⚠️ Breaking changes

Please refer to our [migration guide for v13](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v13) for more information about the backwards incompatible changes.

#### ❗ `StripeClient` and related changes
* Move `StripeClient` and requestor logic to `APIRequestor`.
* `StripeClient#request` is still available, but is deprecated and will be removed. We encourage `StripeClient#raw_request` as a replacement (see other breaking changes for more detail).
* Repurpose and introduce `StripeClient` as the the entry-point to the service-based pattern, a new interface for calling the Stripe API with many benefits over the existing resource-based paradigm. Services are available under the `v1` and `v2` accessors.
* No global config: you can simultaneously use multiple clients with different configuration options (such as API keys)
* No extra API calls. All API endpoints can be accessed with a single method call. You don't have to call `retrieve` before doing an `update`.
* No static methods. Much easier mocking.

#### Other breaking changes

* Adjust default values around retries for HTTP requests. You can use the old defaults by setting them explicitly. New values are:
- max retries: `0` -> `2`
- max retry delay (seconds) `2` -> `5`
* Remove `StripeClient#connection_manager`. This was a legacy method from years ago.
* Singleton `retrieve` method now requires `params` to be passed as the first argument. Existing calls to singleton `retrieve` method with only `opts` argument will have to be updated to account for the addition of `params` argument.
* Singleton `retrieve` method now requires `params` to be passed as the first argument. Existing calls to singleton `retrieve` method with only `opts` argument will have to be updated to account for the addition of `params` argument.
```ruby
params = { expand: ["available"] }
opts = { stripe_account: "acct_123" }

# ❌ No longer works
Stripe::Balance.retrieve(opts)

# ✅ Correct way to call retrieve method
Stripe::Balance.retrieve(params, opts)
```
Expand All @@ -169,7 +175,7 @@
```ruby
# Instead of
Stripe::APIResource.request(:get, "/v1/endpoint", params, opts)

# do
client = Stripe::StripeClient.new(...)
resp = client.raw_request(:get, "/v1/endpoint", params: params, opts: opts)
Expand All @@ -185,15 +191,15 @@
# Before
obj, api_key = StripeClient.execute_request(method, path, api_base: nil,
api_key: nil, headers: {}, params: {}, usage: [])

# is now, with base_address being one of [:api, :files, :connect, :meter_events]

obj, opts = APIRequestor.execute_request(method, path, base_address,
params: {}, opts: {}, usage: [])
puts(opts) # will output {api_key: "sk_test_123", stripe_account: "acct_123"}
```


### Additions
* Add support for new Usage Billing APIs `Billing.MeterEvent`, `Billing.MeterEventAdjustments`, `Billing.MeterEventSession`, `Billing.MeterEventStream` and the new Events API `Core.Events` in the [v2 namespace ](https://docs.corp.stripe.com/api-v2-overview)
* Add method `parse_thin_event()` on the `StripeClient` class to parse [thin events](https://docs.corp.stripe.com/event-destinations#events-overview).
Expand Down Expand Up @@ -250,7 +256,7 @@

* [#1433](https://github.com/stripe/stripe-ruby/pull/1433) Add usage to raw_request call
* [#1431](https://github.com/stripe/stripe-ruby/pull/1431) Add `raw_request`

- Adds the ability to make raw requests to the Stripe API, by providing an HTTP method and url. This is an alternative to using `Stripe::APIResource.request(...)` to make custom requests, which is discouraged and will be broken in a future major version.

## 12.2.0-beta.1 - 2024-07-05
Expand All @@ -263,8 +269,8 @@
* [#1425](https://github.com/stripe/stripe-ruby/pull/1425) Update generated code
* Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
* [#1420](https://github.com/stripe/stripe-ruby/pull/1420) Update static methods for delete/list on BankAccount/Card to throw NotImplementedError
* The below methods have been throwing `InvalidRequestError` because the urls used to make the requests have been buggy. Updating them to throw `NotImplementedError` instead just like their counterparts for update & retrieve because they cannot be implemented without the parent id.
* The below methods have been throwing `InvalidRequestError` because the urls used to make the requests have been buggy. Updating them to throw `NotImplementedError` instead just like their counterparts for update & retrieve because they cannot be implemented without the parent id.

Methods affected | Use these instead in the context of payment method | Use these in the context of external accounts
------ | ------ | ----
Stripe:: BankAccount.delete | Stripe::Customer.delete_source | Stripe::Account.delete_external_account
Expand All @@ -276,12 +282,12 @@

## 12.0.0 - 2024-06-24
* [#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)
* [#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.

### Additions

* Add support for `finalize_amount` test helper method on resource `Issuing.Authorization`

## 11.7.0 - 2024-06-13
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ group :development do
gem "pry"
gem "pry-byebug"
end

platforms :jruby do
gem "rbi", "0.2.4" # jruby does not support rbs, a new dependency in 0.3.0
end
end
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1472
v1505
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-01-27.acacia"
CURRENT = "2025-02-24.acacia"
end
end
10 changes: 8 additions & 2 deletions lib/stripe/resources/billing/credit_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def initialize(scope: nil)
end
# Amount of this credit grant.
attr_accessor :amount
# Configuration specifying what this credit grant applies to.
# Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
attr_accessor :applicability_config
# The category of this credit grant.
attr_accessor :category
Expand All @@ -140,6 +140,8 @@ def initialize(scope: nil)
attr_accessor :metadata
# A descriptive name shown in the Dashboard.
attr_accessor :name
# The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.
attr_accessor :priority

def initialize(
amount: nil,
Expand All @@ -150,7 +152,8 @@ def initialize(
expand: nil,
expires_at: nil,
metadata: nil,
name: nil
name: nil,
priority: nil
)
@amount = amount
@applicability_config = applicability_config
Expand All @@ -161,6 +164,7 @@ def initialize(
@expires_at = expires_at
@metadata = metadata
@name = name
@priority = priority
end
end

Expand Down Expand Up @@ -229,6 +233,8 @@ def initialize(expand: nil)
attr_reader :name
# String representing the object's type. Objects of the same type share the same value.
attr_reader :object
# The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
attr_reader :priority
# ID of the test clock this credit grant belongs to.
attr_reader :test_clock
# Time at which the object was last updated. Measured in seconds since the Unix epoch.
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/charge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ class Zip < Stripe::StripeObject; end
attr_reader :swish
# Attribute for field twint
attr_reader :twint
# The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`.
# The type of transaction-specific details of the payment method used in the payment. See [PaymentMethod.type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type) for the full list of possible types.
# An additional hash is included on `payment_method_details` with a name matching this value.
# It contains information specific to the payment method.
attr_reader :type
Expand Down
Loading