Skip to content

Commit e9fd90d

Browse files
remi-stripeob-stripe
authored andcommitted
Add a migration guide for v20.0
1 parent eb4b4e3 commit e9fd90d

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

v20_migration_guide.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# V20 Migration Guide
2+
3+
Version 20 of stripe-dotnet contains some very sizable breaking changes.
4+
5+
The major reason that we moved forward on them was to clean up the abstraction
6+
around properties or endpoints that can return more than one resource. Before,
7+
we had a class that pointed to each potential sub-resource along with a `Type`
8+
property to indicate which one was filled. We wanted to replace this with an
9+
interface to make it easier to integrate and match the API more closely.
10+
11+
Because this is a large change, we also took the opportunity to do some
12+
housekeeping throughout the library. Most of this involves renaming fields and
13+
some resources to be more accurate according to how they're named in Stripe's
14+
REST API, but it also involves some smaller changes like moving some types and
15+
constants around.
16+
17+
Please see the list below for the complete set of changes.
18+
19+
* Most classes have been renamed to remove the `Stripe` prefix. For example:
20+
* `StripeCharge` is now `Charge`.
21+
* `StripeRefundService` is now `RefundService`.
22+
* All `Delete` methods now return an instance of the resource with `Deleted` set
23+
to `true`. We have also removed the `StripeDeleted` class.
24+
* All parameters are now marked as nullable by default.
25+
* Added interfaces to handle endpoints that can return different resources. For
26+
example:
27+
* `IPaymentSource` represents all resources that can be used to create a
28+
Charge. This can be a `Card`, `BankAccount`, `Source` or `Account`.
29+
* `IBalanceTransactionSource` represents all resources that can be the
30+
source of a Balance Transaction such as `Charge` or `Refund`.
31+
* `StripeSource` is now named `Source` as the other `Source` class was removed
32+
in favour of `IPaymentSource`. We have also added support for all existing
33+
source types and related properties or parameters.
34+
* Some fields or parameters have been renamed so that they're more consistent
35+
with their name in Stripe's REST API or the rest of the library. For example:
36+
* `DateFilter` on List APIs becomes `DateRangeOptions`.
37+
* `LiveMode` becomes `Livemode`.
38+
* `BirthDay` becomes `Dob`.
39+
* `LegalEntityVerification` becomes `Verification`.
40+
* Most classes used as parameters for API methods with nested parameters have
41+
been modified to reflect the structure in Stripe's REST API. For example
42+
`PersonalAddressLine1` on `StripeAccountLegalEntityOptions` has now been
43+
renamed to `Line1` on `AddressOptions` which is itself under `PersonalAddress`
44+
on `AccountLegalEntityOptions`.
45+
* We now have a dedicated service and related classes for the Invoice Item
46+
resource instead of using the ones for the Invoice Line Item resource.
47+
* Methods for `UsageRecordService` now take a subscription item id as the first
48+
parameter.
49+
* Some fields or parameters have been renamed so that they're more consistent
50+
with their name in Stripe's REST API or the rest of the library. For example:
51+
* `DateFilter` on List APIs becomes `DateRangeOptions`.
52+
* `LiveMode` becomes `Livemode`.
53+
* `CityOrTown` becomes `City`.
54+
* Moved to API version [2018-09-24](https://stripe.com/docs/upgrades#2018-09-24)
55+
leading to the following changes:
56+
* Removal of `StripeFileUpload` in favour of `File`.
57+
* The `TransactionId` parameter on the Issuing Create Dispute API is now
58+
called `DisputedTransactionId`.
59+
* All integer values now use `long` as their type instead of `int`.
60+
61+
As usual, if you find bugs, please [open them on the repository][issues], or
62+
reach out to [our support team][support_team] if you have any other questions.
63+
64+
[issues]: https://github.com/stripe/stripe-dotnet/issues/new
65+
[support_team]: https://support.stripe.com/email

0 commit comments

Comments
 (0)