Version 20 of stripe-dotnet contains some very sizable breaking changes.
The major reason that we moved forward on them was to clean up the abstraction
around properties or endpoints that can return more than one resource. Before,
we had a class that pointed to each potential sub-resource along with a Type
property to indicate which one was filled. We wanted to replace this with an
interface to make it easier to integrate and match the API more closely.
Because this is a large change, we also took the opportunity to do some housekeeping throughout the library. Most of this involves renaming fields and some resources to be more accurate according to how they're named in Stripe's REST API, but it also involves some smaller changes like moving some types and constants around.
Please see the list below for the complete set of changes.
- Most classes have been renamed to remove the
Stripe
prefix. For example:StripeCharge
is nowCharge
.StripeRefundService
is nowRefundService
.
- All
Delete
methods now return an instance of the resource withDeleted
set totrue
. We have also removed theStripeDeleted
class. - All parameters are now marked as nullable by default.
- Added interfaces to handle endpoints that can return different resources. For
example:
IPaymentSource
represents all resources that can be used to create a Charge. This can be aCard
,BankAccount
,Source
orAccount
.IBalanceTransactionSource
represents all resources that can be the source of a Balance Transaction such asCharge
orRefund
.- The
Data.Object
property ofEvent
objects is now declared asIHasObject
. Previously, it was declared asdynamic
. You can now directly cast the property to the appropriate resource type.
StripeSource
is now namedSource
as the otherSource
class was removed in favour ofIPaymentSource
. We have also added support for all existing source types and related properties or parameters.- Some fields or parameters have been renamed so that they're more consistent
with their name in Stripe's REST API or the rest of the library. For example:
DateFilter
on List APIs becomesDateRangeOptions
.LiveMode
becomesLivemode
.BirthDay
becomesDob
.LegalEntityVerification
becomesVerification
.
- Most classes used as parameters for API methods with nested parameters have
been modified to reflect the structure in Stripe's REST API. For example
PersonalAddressLine1
onStripeAccountLegalEntityOptions
has now been renamed toLine1
onAddressOptions
which is itself underPersonalAddress
onAccountLegalEntityOptions
. - We now have a dedicated service and related classes for the Invoice Item resource instead of using the ones for the Invoice Line Item resource.
- Methods for
UsageRecordService
now take a subscription item id as the first parameter. - Some fields or parameters have been renamed so that they're more consistent
with their name in Stripe's REST API or the rest of the library. For example:
DateFilter
on List APIs becomesDateRangeOptions
.LiveMode
becomesLivemode
.CityOrTown
becomesCity
.
- Moved to API version 2018-09-24
leading to the following changes:
- Removal of
StripeFileUpload
in favour ofFile
. - The
TransactionId
parameter on the Issuing Create Dispute API is now calledDisputedTransactionId
.
- Removal of
- All integer values now use
long
as their type instead ofint
.
As usual, if you find bugs, please open them on the repository, or reach out to our support team if you have any other questions.