-
Notifications
You must be signed in to change notification settings - Fork 571
Migration guide for v38 and v39
Versions 38 and 39 of Stripe.net contain a number of changes. This guide will help you update your Stripe integration so that it keeps working as expected after you upgrade to v39.
We have dropped support for .NET Framework 4.5 and now require .NET Framework 4.6.1 at a minimum. We have also bumped the required Newtonsoft.Json version for netstandard2.0 target to 11.0.1, which is the minimum version with an explicit netstandard2.0 target (with no dependencies). We kept the required Newtonsoft.Json version for net461 target to the current one (9.0.1).
We changed the default number of network retries to 2: https://github.com/stripe/stripe-dotnet#automatic-retries
We updated all our DateTime properties to use UnixDateTimeConverter
rather than DateTimeConverter
.
We set the default value for non-nullable DateTime
properties on Entities to Stripe.Infrastructure.DateTimeUtils.UnixEpoch
(Jan 1, 1970).
The following obsolete properties or parameters were removed:
Removed property | Replacement |
---|---|
InvoiceListOptions.Paid |
InvoiceListOptions.Status |
SourceMandateAcceptanceOptions.NotificationMethod |
SourceMandateOptions.cs.NotificationMethod |
TaxPercent |
DefaultTaxRates (consistent across all Billing APIs) |
ChargeCaptureOptions.Destination |
ChargeCaptureOptions.TransferData |
Events.BitcoinReceiverCreated |
Removed multiple years ago |
Events.BitcoinReceiverFilled |
Removed multiple years ago |
Events.BitcoinReceiverUpdated |
Removed multiple years ago |
Events.BitcoinReceiverTransactionUpdated |
Removed multiple years ago |
SourceType.Bitcoin |
Removed multiple years ago |
LineItem.PriceId |
LineItem.Price.Id (resource auto-expanded) |
LineItemTax.RateId |
LineItemTax.Rate.Id (resource auto-expanded) |
Invoice.TaxPercent |
Invoice.DefaultTaxRates |
SubscriptionSchedulePhase.TaxPercent |
SubscriptionSchedulePhase.DefaultTaxRates |
Subscription.TaxPercent |
Subscription.DefaultTaxRates |
ChargeCaptureOptions.Destination |
ChargeCaptureOptions.TransferData |
CustomerCreateOptions.TaxPercent |
No longer applied at the Customer level |
DisputeEvidenceOptions.Metadata |
Incorrectly added |
InvoiceCreateOptions.TaxPercent |
InvoiceCreateOptions.DefaultTaxRates |
InvoiceUpdateOptions.TaxPercent |
InvoiceUpdateOptions.DefaultTaxRates |
InvoiceListOptions.Paid |
InvoiceListOptions.Status |
CardSpendingControlsOptions.SpendingLimitsCurrency |
Incorrectly added |
SetupIntentUpdateOptions.Usage |
Incorrectly added |
AccountSettingsOptions.Dashboard |
Incorrectly added |
SubscriptionScheduleCreateOptions.InvoiceSettings |
SubscriptionScheduleDefaultSettingsOptions.InvoiceSettings |
SubscriptionScheduleUpdateOptions.InvoiceSettings |
SubscriptionScheduleDefaultSettingsOptions.InvoiceSettings |
SubscriptionSchedulePhaseOptions.TaxPercent |
SubscriptionSchedulePhaseOptions.DefaultTaxRates |
SubscriptionCreateOptions.TaxPercent |
SubscriptionCreateOptions.DefaultTaxRates |
SubscriptionUpdateOptions.TaxPercent |
SubscriptionUpdateOptions.DefaultTaxRates |
SourceMandateAcceptanceOptions.NotificationMethod |
SourceMandateOptions.NotificationMethod |
We've also removed support for the Recipient
and ThreeDSecure
resources and services from the library as those APIs have been deprecated for multiple years already. We also removed support for Source
of type Bitcoin
for similar reasons.
We have split many classes that were "shared" between APIs and duplicated them to match a coherent naming scheme. We apologize for the inconvenience here -- the motivation behind splitting all those classes is to ensure that names are consistent moving forward and can be predictable. The library is now automatically generated based on our openapi spec and we will be able to avoid renames like this in the future.
Old name | New name |
---|---|
PersonCreateOptions.SSNLast4 |
PersonCreateOptions.SsnLast4 |
PersonUpdateOptions.SSNLast4 |
PersonUpdateOptions.SsnLast4 |
TokenPersonOptions.SSNLast4 |
TokenPersonOptions.SsnLast4 |
PlanProductCreateOptions |
PlanProductOptions |
PersonCreateOptions and PersonUpdateOptions
|
merged to AccountIndividualOptions
|
ChargeDestinationCreateOptions |
ChargeDestinationOptions |
FileLinkDataOptions |
FileFileLinkDataOptions |
PaymentMethodCardCreateOptions and PaymentMethodCardUpdateOptions
|
merged to PaymentMethodCardOptions
|
PaymentMethodAuBecsDebitCreateOptions |
PaymentMethodDataAuBecsDebitOptions |
PaymentMethodBacsDebitCreateOptions |
PaymentMethodBacsDebitOptions |
PaymentMethodBancontactCreateOptions |
PaymentMethodBancontactOptions |
PaymentMethodEpsCreateOptions |
PaymentMethodEpsOptions |
PaymentMethodFpxCreateOptions |
PaymentMethodDataFpxOptions |
PaymentMethodGiropayCreateOptions |
PaymentMethodGiropayOptions |
PaymentMethodIdealCreateOptions |
PaymentMethodDataIdealOptions |
PaymentMethodInteracPresentCreateOptions |
PaymentMethodInteracPresentOptions |
PaymentMethodP24CreateOptions |
PaymentMethodP24Options |
PaymentMethodSepaDebitCreateOptions |
PaymentMethodDataSepaDebitOptions |
SourceCardUpdateOptions |
SourceCardOptions |
BankAccountOptions |
TokenBankAccountOptions |
CreditCardOptions |
TokenCardOptions |
`` | `` |
`` | `` |
Additionally, multiple classes were moved to the right namespace:
Class name | New namespace |
---|---|
CardholderCompany |
stripe.Issuing |
CardholderIndividual |
stripe.Issuing |
CardholderIndividualDob |
stripe.Issuing |
CardholderIndividualVerification |
stripe.Issuing |
CardholderIndividualVerificationDocument |
stripe.Issuing |
CardholderRequirements |
stripe.Issuing |
CardholderSpendingControls |
stripe.Issuing |
CardholderSpendingControlsSpendingLimit |
stripe.Issuing |
SessionLineItemPriceDataOptions |
stripe.Checkout |
SessionLineItemPriceDataProductDataOptions |
stripe.Checkout |
SessionLineItemPriceDataRecurringOptions |
stripe.Checkout |
We've also renamed the arguments for all services functions to id
or parentId
to be consistent across the library.
Property | Old type | New type |
---|---|---|
CustomerInvoiceSettings.CustomFields |
List<InvoiceCustomField> |
List< CustomerInvoiceSettingsCustomField> |
InvoiceItem.Period |
Period |
InvoiceItemPeriod |
InvoiceLineItem.Period |
List<Period> |
List<InvoiceLineItemPeriod> |
InvoiceLineItem.TaxAmounts |
List<InvoiceTaxAmount> |
List<InvoiceLineItemTaxAmount> |
InvoiceLineItem.DiscountAmounts |
List<CreditNoteLineItemDiscountAmount> |
List<InvoiceLineItemDiscountAmount> |
PaymentMethod.BillingDetails |
BillingDetails |
PaymentMethodBillingDetails |
PersonRequirements.Errors |
List<AccountRequirementsError> |
List<PersonRequirementsError> |
PersonVerification.AdditionalDocument |
PersonVerificationDocument |
PersonVerificationAdditionalDocument |
Product.PackageDimensions |
PackageDimensions |
ProductPackageDimensions |
Sku.PackageDimensions |
PackageDimensions |
SkuPackageDimensions |
SourceRedirect.FailureReason |
RedirectFailureReason? |
string |
SubscriptionScheduleDefaultSettings.BillingThresholds |
SubscriptionBillingThresholds |
SubscriptionScheduleDefaultSettingsBillingThresholds |
SubscriptionScheduleDefaultSettings.InvoiceSettings |
SubscriptionScheduleInvoiceSettings |
SubscriptionScheduleDefaultSettingsInvoiceSettings |
SubscriptionScheduleDefaultSettings.TransferData |
SubscriptionTransferData |
SubscriptionScheduleDefaultSettingsTransferData |
SubscriptionSchedulePhase.BillingThresholds |
SubscriptionBillingThresholds |
SubscriptionSchedulePhaseBillingThresholds |
SubscriptionSchedulePhase.InvoiceSettings |
SubscriptionScheduleInvoiceSettings |
SubscriptionSchedulePhaseInvoiceSettings |
SubscriptionSchedulePhase.TransferData |
SubscriptionTransferData |
SubscriptionSchedulePhaseTransferData |
UsageRecordSummary.Period |
Period |
UsageRecordSummaryPeriod |
AccountCreateOptions.Individual |
PersonCreateOptions |
AccountIndividualOptions |
AccountUpdateOptions.Individual |
PersonUpdateOptions |
AccountIndividualOptions |
AccountSettingsCardPaymentsOptions.DeclineOn |
AccountSettingsDeclineOnOptions |
AccountSettingsCardPaymentsDeclineOnOptions |
ChargeCreateOptions.Destination |
ChargeDestinationCreateOptions |
ChargeDestinationOptions |
SessionPaymentIntentDataOptions.TransferData |
SessionPaymentIntentTransferDataOptions |
SessionPaymentIntentDataTransferDataOptions |
CustomerInvoiceSettingsOptions.CustomFields |
List<InvoiceCustomFieldOptions> |
List<CustomerInvoiceSettingsCustomFieldOptions> |
FileCreateOptions.FileLinkData |
FileLinkDataOptions |
FileFileLinkDataOptions |
InvoiceSubscriptionItemOptions.BillingThresholds |
SubscriptionItemBillingThresholdsOptions |
InvoiceSubscriptionItemBillingThresholdsOptions |
InvoiceSubscriptionItemOptions.PriceData |
SubscriptionItemPriceDataOptions |
InvoiceSubscriptionItemPriceDataOptions |
PaymentIntentPaymentMethodDataOptions.BillingDetails |
BillingDetailsOptions |
PaymentIntentPaymentMethodDataBillingDetailsOptions |
PaymentMethodCreateOptions.BillingDetails |
BillingDetailsOptions |
PaymentMethodBillingDetailsOptions |
PaymentMethodUpdateOptions.BillingDetails |
BillingDetailsOptions |
PaymentMethodBillingDetailsOptions |
PersonVerificationOptions.AdditionalDocument |
PersonVerificationDocumentOptions |
PersonVerificationAdditionalDocumentOptions |
PlanCreateOptions.Product |
AnyOf<string, PlanProductCreateOptions> |
AnyOf<string, PlanProductOptions> |
ProductCreateOptions.PackageDimensions |
PackageDimensionOptions |
ProductPackageDimensionsOptions |
ProductUpdateOptions.PackageDimensions |
PackageDimensionOptions |
ProductPackageDimensionsOptions |
SkuCreateOptions.Inventory |
InventoryOptions |
SkuInventoryOptions |
SkuCreateOptions.PackageDimensions |
PackageDimensionOptions |
SkuPackageDimensionsOptions |
SkuUpdateOptions.Inventory |
InventoryOptions |
SkuInventoryOptions |
SkuUpdateOptions.PackageDimensions |
PackageDimensionOptions |
SkuPackageDimensionsOptions |
SourceCreateOptions.Card |
AnyOf<string, CreditCardOptions> |
AnyOf<string, SourceCardOptions> |
CreditCardOptions.Metadata |
object |
Dictionary<string, string> |
SubscriptionScheduleDefaultSettingsOptions.BillingThresholds |
SubscriptionBillingThresholdsOptions |
SubscriptionScheduleDefaultSettingsBillingThresholdsOptions |
SubscriptionScheduleDefaultSettingsOptions.InvoiceSettings |
SubscriptionScheduleInvoiceSettingsOptions |
SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions |
SubscriptionScheduleDefaultSettingsOptions.TransferData |
SubscriptionTransferDataOptions |
SubscriptionScheduleDefaultSettingsTransferDataOptions |
SubscriptionSchedulePhaseOptions.AddInvoiceItems |
List<SubscriptionAddInvoiceItemOptions> |
List<SubscriptionSchedulePhaseAddInvoiceItemOptions> |
SubscriptionSchedulePhaseOptions.BillingThresholds |
SubscriptionBillingThresholdsOptions |
SubscriptionSchedulePhaseBillingThresholdsOptions |
SubscriptionSchedulePhaseOptions.InvoiceSettings |
SubscriptionScheduleInvoiceSettingsOptions |
SubscriptionSchedulePhaseInvoiceSettingsOptions |
TokenCreateOptions.BankAccount |
AnyOf<string, BankAccountOptions> |
AnyOf<string, TokenBankAccountOptions> |
TokenCreateOptions.Card |
AnyOf<string, CreditCardOptions> |
AnyOf<string, TokenCardOptions> |
TokenAccountOptions.Individual |
TokenPersonOptions |
TokenAccountIndividualOptions |
TokenPersonVerificationOptions.AdditionalDocument |
TokenPersonVerificationDocumentOptions |
TokenPersonVerificationAdditionalDocumentOptions |
SubscriptionAddInvoiceItemOptions.PriceData |
InvoiceItemPriceDataOptions |
SubscriptionAddInvoiceItemPriceDataOptions |
TokenAccountOptions.Individual |
TokenPersonOptions |
TokenAccountIndividualOptions |
SourceUpdateOptions.Card |
SourceCardUpdateOptions |
SourceCardOptions |
We also fixed multiple properties to be marked as nullable or non-nullable as expected by our API.
We've also made all options on methods from services be nullable by default.
In some cases, API service methods that did not support arguments did not include an Options parameter in their declaration. Now, even if a method receives no arguments (e.g. DisputeService.Close
), the service method will still receive an optional instance of the appropriate options class (e.g. DisputeCloseOptions
)