Releases: stripe/stripe-ruby
Releases · stripe/stripe-ruby
v13.2.0-beta.2
- #1480 Update generated code for beta
- Add support for new resources
Issuing.FraudLiabilityDebit
,PaymentAttemptRecord
, andPaymentRecord
- Add support for
list
andretrieve
methods on resourcesFraudLiabilityDebit
andPaymentAttemptRecord
- Add support for
report_payment_attempt_canceled
,report_payment_attempt_failed
,report_payment_attempt_guaranteed
,report_payment_attempt
,report_payment
, andretrieve
methods on resourcePaymentRecord
- Add support for new resources
v13.1.1
v13.2.0-beta.1
- #1477 Update generated code for beta
- Add support for
trigger_action
method on resourcePaymentIntent
- Add support for
v13.1.0
- #1472 This release changes the pinned API version to
2024-10-28.acacia
.- Add support for
submit_card
test helper method on resourceIssuing.Card
- Add support for new resource
V2.EventDestinations
- Add support for
create
,retrieve
,update
,list
,delete
,disable
,enable
andping
methods on resourceV2.EventDestinations
- Add support for
- #1476 Fix APIResource#retrieve bug not returning instance of custom resources
- Fix bug in APIResource#refresh and APIResource#retrieve where they returned an instance of
StripeObject
for custom resources. They should now return the instance of the custom resource.
- Fix bug in APIResource#refresh and APIResource#retrieve where they returned an instance of
v13.0.2
-
#1473 Always return the result of APIResource#refresh in APIResource.retrieve
- Fix bug where we would not return the mutated
self
object when callingAPIResource.retrieve
- Fix bug where we would not return the mutated
v13.1.0-beta.3
- #1469 Update generated code for beta
v13.0.1
v13.1.0-beta.2
- #1468 Update generated code for beta
- Add support for
submit_card
test helper method on resourceIssuing.Card
- Add support for
v13.1.0-beta.1
- #1465 Updates to the
Preview
class- Remove
Stripe::Preview
. UseStripeClient#raw_request
instead (see below). - Marked
Stripe.raw_request
andStripe.deserialize
as deprecated. UseStripeClient#raw_request
andStripeClient#deserialize
instead. In StripeClient, the params and opts parameters are passed as keyword arguments:# 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") resp = client.raw_request(:post, "/v1/charges", params: {p1: "p1"}, opts: {stripe_account: "acct_123"}) charge = client.deserialize(resp.data)
- Remove
v13.0.0
-
#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 and carefully review the API changes before upgrading.⚠️ Breaking changesPlease refer to our migration guide for v13 for more information about the backwards incompatible changes.
❗
StripeClient
and related changes- Move
StripeClient
and requestor logic toAPIRequestor
.StripeClient#request
is still available, but is deprecated and will be removed. We encourageStripeClient#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 thev1
andv2
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 anupdate
. - 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
- max retries:
- Remove
StripeClient#connection_manager
. This was a legacy method from years ago. - Singleton
retrieve
method now requiresparams
to be passed as the first argument. Existing calls to singletonretrieve
method with onlyopts
argument will have to be updated to account for the addition ofparams
argument.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)
- Moved the
Stripe.raw_request()
method that was recently added toStripeClient
. This will use the configuration set on the StripeClient instead of the global configuration used before. - Remove
APIResource.request
. Instead, useStripeClient#raw_request
now.# 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)
- Add an additional parameter to
APIResource.execute_resource_request
. However, we discourage use of this in favor ofStripeClient#raw_request
.APIResource.execute_resource_request(method, url, params = {}, opts = {}, usage = []) # is now, with base_address being one of [:api, :files, :connect, :meter_events] APIResource.execute_resource_request(method, url, base_address = :api, params = {}, opts = {}, usage = [])
- Change parameters to
APIRequestor.execute_request
(previouslyStripeClient.execute_request
). It now returns all request options from our internal request framework as the second value in the returned tuple, instead of only the API key used:# 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 APICore.Events
in the v2 namespace - Add method
parse_thin_event()
on theStripeClient
class to parse thin events.
- Move