v46.0.0
-
#2980 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 changes due to changes in the API- Rename
UsageThresholdConfig
toUsageThreshold
onBilling.Alert
andBilling.AlertCreateOptions
- Remove support for
Filter
onBilling.Alert
andBillingAlert.AlertCreateOptions
. Use the filters on theUsageThreshold
instead - Remove support for
CustomerConsentCollected
onTerminal.ReaderProcessSetupIntentOptions
⚠️ Other Breaking changes in the SDKRefer to our migration guide for v46 for a list of backwards incompatible changes in this release. Here is a summary of things to watch out for:
- Remove obsolete properties and methods from
Service
andServiceNested
base classes includingCreateEntity
and other*Entity
and*EntityAsync
methods,BasePath
, andBaseUrl
- Rename
Stripe.Event
toStripe.EventTypes
. This class contains constants for event type strings. - For more predictable naming of child services and their corresponding Options classes:
- Rename child service classes to have the parent service's name as a prefix, e.g.
CapabilityService
is nowAccountCapabilityService
, and rename associated Options classes to match. This makes the classes more discoverable and the relationship between parent and child more clear - Rename Options classes for child services so that the name of the service or resource (e.g.
CustomerFundingInstructions
) comes before the verb (e.g.Create
,List
).
- Rename child service classes to have the parent service's name as a prefix, e.g.
- Nested child service methods have been separated into separate services. These child services were previously represented as special methods within a parent service.
Newtonsoft.Json
dependency has been upgraded for all .NET target runtimes. This is potentially a breaking change if you also depend onNewtonsoft.Json
directly from your application. To migrate, please upgrade the version of Newtonsoft.Json your application depends on. If you have runtime conflicts with another library dependency, you can use<bindingRedirect>
to specify which version .NET should load (see https://stackoverflow.com/a/51053646 and https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element)
Additions
- Add support for
UsageThreshold
onBilling.AlertCreateOptions
andBillingAlert
- Add support for
CustomUnitAmount
onProductDefaultPriceDataOptions
- Add support for
AllowRedisplay
onTerminal.ReaderProcessSetupIntentOptions
andTerminalReaderProcessConfigOptions
- Add support for new Usage Billing APIs
Billing.MeterEvent
,Billing.MeterEventAdjustments
,Billing.MeterEventSession
,Billing.MeterEventStream
and the new Events APICore.Events
under the v2 namespace - Add method
ParseThinEvent()
on theStripeClient
class to parse thin events. - Add methods RawRequestAsync() on the
StripeClient
class that takes a HTTP method type, url and relevant parameters to make requests to the Stripe API that are not yet supported in the SDK. - Add access to services to StripeClient under
V1
andV2
property accessors, so that instead ofStripeConfiguration.ApiKey = apiKey; var svc = new CustomerService(); svc.Get(customerId);
you can write:
var client = new StripeClient(apiKey); client.V1.Customers.Get(customerId)
This supports a move towards a services-based client pattern where a
StripeClient
instance consolidates configuration and service access. This enables you simultaneously use multiple clients with different configuration options (such as API keys), and makes it much easier to discover what services are available by inspecting the V1 and V2 properties (either manually or via your code editors auto-completion). - Rename