Skip to content

Migration guide for v30

remi-stripe edited this page Dec 4, 2019 · 2 revisions

Version 30 of Stripe.net contains a number of changes. This guide will help you update your Stripe integration so that it keeps working as expected after you upgrade to v30.

Table of Contents

Breaking changes

Removals

The following obsolete properties were removed:

Removed property Replacement
ChargeCreateOptions.ApplicationFee ChargeCreateOptions.ApplicationFeeAmount
Customer.AccountBalance Customer.Balance
Customer.TaxInfo Customer.TaxIds
Customer.TaxInfoVerification Customer.TaxIds
CustomerCreateOptions.AccountBalance CustomerCreateOptions.Balance
CustomerCreateOptions.TaxInfo CustomerCreateOptions.TaxIdData
CustomerUpdateOptions.AccountBalance CustomerUpdateOptions.Balance
CustomerUpdateOptions.TaxInfo TaxIdCreateOptions
ExternalAccountUpdateOptions.ExternalAccountCard None (this parameter was never supported by the API)
Invoice.Billing Invoice.CollectionMethod
InvoiceCreateOptions.Billing InvoiceCreateOptions.CollectionMethod
InvoiceListOptions.Billing InvoiceListOptions.CollectionMethod
InvoiceListOptions.Date InvoiceListOptions.Created
Issuing.Card.Billing None (this field was never supported by the API)
PaymentIntent.AllowedSourceTypes PaymentIntent.PaymentMethodTypes
PaymentIntentCreateOptions.AllowedSourceTypes PaymentIntentCreateOptions.PaymentMethodTypes
PaymentIntentCreateOptions.OnBehalfOf None (this parameter was never supported by the API)
PlanTier.UnitAmountDecinal PlanTier.UnitAmountDecimal
RequestOptions.StripeConnectAccountId RequestOptions.StripeAccount
SourceAuBecsDebit.AccountNumber None (this field was never supported by the API)
SourceAuBecsDebit.Last3 None (this field was never supported by the API)
StripeResponse.ResponseJson StripeResponse.Content
StripeResponse.RequestDate StripeResponse.Date
Subscription.Billing Subscription.CollectionMethod
Subscription.Start Subscription.StartDate
SubscriptionCreateOptions.Billing SubscriptionCreateOptions.CollectionMethod
SubscriptionListOptions.Billing SubscriptionListOptions.CollectionMethod
SubscriptionSchedule.Billing SubscriptionSchedule.CollectionMethod
SubscriptionScheduleCreateOptions.Billing SubscriptionScheduleCreateOptions.CollectionMethod
SubscriptionScheduleUpdateOptions.Billing SubscriptionScheduleUpdateOptions.CollectionMethod
SubscriptionUpdateOptions.Billing SubscriptionUpdateOptions.CollectionMethod
Terminal.ConnectionTokenCreateOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.LocationCreateOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.LocationListOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.LocationUpdateOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.ReaderCreateOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.ReaderListOptions.OperatorAccount None (the API no longer supports this parameter)
Terminal.ReaderUpdateOptions.OperatorAccount None (the API no longer supports this parameter)

Additionally, all ExpandX properties on service classes have been removed. Please use BaseOptions.AddExpand() to request expansion of specific fields. For instance, instead of doing this:

var invoiceService = new InvoiceService();
invoiceService.ExpandSubscription = true;
var invoice = invoiceService.Get("in_123");
// use expanded invoice.Subscription

you should now do this instead:

var invoiceService = new InvoiceService();
var options = new InvoiceGetOptions();
options.AddExpand("subscription");
var invoice = invoiceService.Get("in_123", options);
// use expanded invoice.Subscription

One advantage of this new method is that you can expand at more than one level, e.g. options.AddExpand("subscription.customer").

Name changes

The following properties have been renamed:

Old name New name
AccountCompanyVerificationDocumentOptions.BackFileId AccountCompanyVerificationDocumentOptions.Back
AccountCompanyVerificationDocumentOptions.FrontFileId AccountCompanyVerificationDocumentOptions.Front
AccountSettingsBrandingOptions.IconFileId AccountSettingsBrandingOptions.Icon
AccountSettingsBrandingOptions.LogoFileId AccountSettingsBrandingOptions.Logo
AccountLinkCreateOptions.AccountId AccountLinkCreateOptions.Account
ApplicationFeeListOptions.ChargeId ApplicationFeeListOptions.Charge
BalanceTransactionListOptions.PayoutId BalanceTransactionListOptions.Payout
BalanceTransactionListOptions.SourceId BalanceTransactionListOptions.Source
ChargeCreateOptions.CustomerId ChargeCreateOptions.Customer
ChargeListOptions.CustomerId ChargeListOptions.Customer
ChargeListOptions.PaymentIntentId ChargeListOptions.PaymentIntent
Checkout.SessionCreateOptions.CustomerId Checkout.SessionCreateOptions.Customer
Checkout.SessionSubscriptionDataItemOptions.PlanId Checkout.SessionSubscriptionDataItemOptions.Plan
CreditCardOptions.IssuingCardId CreditCardOptions.IssuingCard
CreditCardOptions.MetaData CreditCardOptions.Metadata
CreditNoteCreateOptions.InvoiceId CreditNoteCreateOptions.Invoice
CreditNoteCreateOptions.RefundId CreditNoteCreateOptions.Refund
CreditNoteListOptions.CustomerId CreditNoteListOptions.Customer
CreditNoteListOptions.InvoiceId CreditNoteListOptions.Invoice
CustomerCreateOptions.CouponId CustomerCreateOptions.Coupon
CustomerCreateOptions.PaymentMethodId CustomerCreateOptions.PaymentMethod
CustomerCreateOptions.PlanId CustomerCreateOptions.Plan
CustomerInvoiceSettingsOptions.DefaultPaymentMethodId CustomerInvoiceSettingsOptions.DefaultPaymentMethod
DisputeEvidenceOptions.CancellationPolicyFileId DisputeEvidenceOptions.CancellationPolicy
DisputeEvidenceOptions.CustomerCommunicationFileId DisputeEvidenceOptions.CustomerCommunication
DisputeEvidenceOptions.CustomerPurchaseIPAddress DisputeEvidenceOptions.CustomerPurchaseIP
DisputeEvidenceOptions.CustomerSignatureFileId DisputeEvidenceOptions.CustomerSignature
DisputeEvidenceOptions.DuplicateChargeDocumentationFileId DisputeEvidenceOptions.DuplicateChargeDocumentation
DisputeEvidenceOptions.DuplicateChargeFileId DisputeEvidenceOptions.DuplicateCharge
DisputeEvidenceOptions.ReceiptFileId DisputeEvidenceOptions.Receipt
DisputeEvidenceOptions.RefundPolicyFileId DisputeEvidenceOptions.RefundPolicy
DisputeEvidenceOptions.ServiceDocumentationFileId DisputeEvidenceOptions.ServiceDocumentation
DisputeEvidenceOptions.UncategorizedFileId DisputeEvidenceOptions.Uncategorized
EphemeralKeyCreateOptions.CustomerId EphemeralKeyCreateOptions.Customer
EphemeralKeyCreateOptions.IssuingCardId EphemeralKeyCreateOptions.IssuingCard
Evidence.CustomerPurchaseIPAddress Evidence.CustomerPurchaseIP
FileLinkCreateOptions.FileId FileLinkCreateOptions.File
FileLinkListOptions.FileId FileLinkListOptions.File
InvoiceItemCreateOptions.CustomerId InvoiceItemCreateOptions.Customer
InvoiceItemCreateOptions.InvoiceId InvoiceItemCreateOptions.Invoice
InvoiceItemCreateOptions.SubscriptionId InvoiceItemCreateOptions.Subscription
InvoiceItemListOptions.CustomerId InvoiceItemListOptions.Customer
InvoiceItemListOptions.InvoiceId InvoiceItemListOptions.Invoice
InvoiceCreateOptions.CustomerId InvoiceCreateOptions.Customer
InvoiceCreateOptions.DefaultPaymentMethodId InvoiceCreateOptions.DefaultPaymentMethod
InvoiceCreateOptions.SubscriptionId InvoiceCreateOptions.Subscription
InvoiceListLineItemsOptions.CouponId InvoiceListLineItemsOptions.Coupon
InvoiceListLineItemsOptions.CustomerId InvoiceListLineItemsOptions.Customer
InvoiceListLineItemsOptions.SubscriptionId InvoiceListLineItemsOptions.Subscription
InvoiceListLineItemsOptions.SubscriptionPlanId InvoiceListLineItemsOptions.SubscriptionPlan
InvoiceListOptions.CustomerId InvoiceListOptions.Customer
InvoiceListOptions.SubscriptionId InvoiceListOptions.Subscription
InvoiceSubscriptionItemOptions.PlanId InvoiceSubscriptionItemOptions.Plan
InvoiceUpcomingInvoiceItemOption.InvoiceItemId InvoiceUpcomingInvoiceItemOption.InvoiceItem
InvoiceUpdateOptions.DefaultPaymentMethodId InvoiceUpdateOptions.DefaultPaymentMethod
Issuing.AuthorizationListOptions.CardholderId Issuing.AuthorizationListOptions.Cardholder
Issuing.AuthorizationListOptions.CardId Issuing.AuthorizationListOptions.Card
Issuing.CardListOptions.CardholderId Issuing.CardListOptions.Cardholder
Issuing.CardListOptions.SourceId Issuing.CardListOptions.Source
Issuing.DisputeCreateOptions.DisputedTransactionId Issuing.DisputeCreateOptions.DisputedTransaction
Issuing.DisputeListOptions.TransactionId Issuing.DisputeListOptions.Transaction
Issuing.TransactionListOptions.CardholderId Issuing.TransactionListOptions.Cardholder
Issuing.TransactionListOptions.CardId Issuing.TransactionListOptions.Card
OrderCreateOptions.CustomerId OrderCreateOptions.Customer
OrderPayOptions.CustomerId OrderPayOptions.Customer
OrderPayOptions.SourceId OrderPayOptions.Source
PaymentIntentConfirmOptions.PaymentMethodId PaymentIntentConfirmOptions.PaymentMethod
PaymentIntentConfirmOptions.SourceId PaymentIntentConfirmOptions.Source
PaymentIntentCreateOptions.CustomerId PaymentIntentCreateOptions.Customer
PaymentIntentCreateOptions.PaymentMethodId PaymentIntentCreateOptions.PaymentMethod
PaymentIntentCreateOptions.SourceId PaymentIntentCreateOptions.Source
PaymentIntentListOptions.CustomerId PaymentIntentListOptions.Customer
PaymentIntentUpdateOptions.CustomerId PaymentIntentUpdateOptions.Customer
PaymentIntentUpdateOptions.PaymentMethodId PaymentIntentUpdateOptions.PaymentMethod
PaymentIntentUpdateOptions.SourceId PaymentIntentUpdateOptions.Source
PaymentMethodAttachOptions.CustomerId PaymentMethodAttachOptions.Customer
PaymentMethodCreateOptions.CustomerId PaymentMethodCreateOptions.Customer
PaymentMethodCreateOptions.PaymentMethodId PaymentMethodCreateOptions.PaymentMethod
PaymentMethodListOptions.CustomerId PaymentMethodListOptions.Customer
PersonVerificationDocumentOptions.BackFileId PersonVerificationDocumentOptions.Back
PlanListOptions.ProductId PlanListOptions.Product
PlanUpdateOptions.ProductId PlanUpdateOptions.Product
ValueListItemCreateOptions.ValueListId ValueListItemCreateOptions.ValueList
ValueListItemListOptions.ValueListId ValueListItemListOptions.ValueList
RefundCreateOptions.ChargeId RefundCreateOptions.Charge
RefundListOptions.ChargeId RefundListOptions.Charge
SetupIntentConfirmOptions.PaymentMethodId SetupIntentConfirmOptions.PaymentMethod
SetupIntentCreateOptions.CustomerId SetupIntentCreateOptions.Customer
SetupIntentCreateOptions.PaymentMethodId SetupIntentCreateOptions.PaymentMethod
SetupIntentListOptions.CustomerId SetupIntentListOptions.Customer
SetupIntentListOptions.PaymentMethodId SetupIntentListOptions.PaymentMethod
SetupIntentUpdateOptions.CustomerId SetupIntentUpdateOptions.Customer
SetupIntentUpdateOptions.PaymentMethodId SetupIntentUpdateOptions.PaymentMethod
SourceSepaDebitCreateOptions.IdealSourceId SourceSepaDebitCreateOptions.Ideal
SourceThreeDSecureCreateOptions.CardId SourceThreeDSecureCreateOptions.Card
SubscriptionItemCreateOptions.SubscriptionId SubscriptionItemCreateOptions.Subscription
SubscriptionItemCreateOptions.PlanId SubscriptionItemCreateOptions.Plan
SubscriptionItemListOptions.SubscriptionId SubscriptionItemListOptions.Subscription
SubscriptionItemUpdateOptions.PlanId SubscriptionItemUpdateOptions.Plan
SubscriptionScheduleCreateOptions.CustomerId SubscriptionScheduleCreateOptions.Customer
SubscriptionScheduleCreateOptions.DefaultPaymentMethodId SubscriptionScheduleCreateOptions.DefaultPaymentMethod
SubscriptionScheduleCreateOptions.DefaultSourceId SubscriptionScheduleCreateOptions.DefaultSource
SubscriptionScheduleCreateOptions.FromSubscriptionId SubscriptionScheduleCreateOptions.FromSubscription
SubscriptionScheduleListOptions.CustomerId SubscriptionScheduleListOptions.Customer
SubscriptionSchedulePhaseItemOptions.PlanId SubscriptionSchedulePhaseItemOptions.Plan
SubscriptionSchedulePhaseOptions.CouponId SubscriptionSchedulePhaseOptions.Coupon
SubscriptionSchedulePhaseOptions.DefaultPaymentMethodId SubscriptionSchedulePhaseOptions.DefaultPaymentMethod
SubscriptionScheduleUpdateOptions.DefaultPaymentMethodId SubscriptionScheduleUpdateOptions.DefaultPaymentMethod
SubscriptionScheduleUpdateOptions.DefaultSourceId SubscriptionScheduleUpdateOptions.DefaultSource
SubscriptionCreateOptions.CouponId SubscriptionCreateOptions.Coupon
SubscriptionCreateOptions.CustomerId SubscriptionCreateOptions.Customer
SubscriptionCreateOptions.DefaultPaymentMethodId SubscriptionCreateOptions.DefaultPaymentMethod
SubscriptionCreateOptions.PlanId SubscriptionCreateOptions.Plan
SubscriptionItemOption.PlanId SubscriptionItemOption.Plan
SubscriptionItemUpdateOption.PlanId SubscriptionItemUpdateOption.Plan
SubscriptionListOptions.CustomerId SubscriptionListOptions.Customer
SubscriptionListOptions.PlanId SubscriptionListOptions.Plan
SubscriptionUpdateOptions.CouponId SubscriptionUpdateOptions.Coupon
SubscriptionUpdateOptions.DefaultPaymentMethodId SubscriptionUpdateOptions.DefaultPaymentMethod
SubscriptionUpdateOptions.PlanId SubscriptionUpdateOptions.Plan
Terminal.ConnectionTokenCreateOptions.LocationId Terminal.ConnectionTokenCreateOptions.Location
ThreeDSecureCreateOptions.CustomerId ThreeDSecureCreateOptions.Customer
TokenCreateOptions.CustomerId TokenCreateOptions.Customer
TopupCreateOptions.SourceId TopupCreateOptions.Source
UpcomingInvoiceListLineItemsOptions.CouponId UpcomingInvoiceListLineItemsOptions.Coupon
UpcomingInvoiceListLineItemsOptions.CustomerId UpcomingInvoiceListLineItemsOptions.Customer
UpcomingInvoiceListLineItemsOptions.SubscriptionId UpcomingInvoiceListLineItemsOptions.Subscription
UpcomingInvoiceOptions.CouponId UpcomingInvoiceListLineItemsOptions.Coupon
UpcomingInvoiceOptions.CustomerId UpcomingInvoiceListLineItemsOptions.Customer
UpcomingInvoiceOptions.SubscriptionId UpcomingInvoiceListLineItemsOptions.Subscription

We apologize for the inconvenience here -- the motivation behind renaming all those fields is to match the JSON names used in the API. We now have an internal test to ensure that going forward, new properties always match their JSON names.

Type changes

Property Old type New type
SetupIntentPaymentMethodOptionsOptions.Card PaymentIntentPaymentMethodOptionsCardOptions SetupIntentPaymentMethodOptionsCardOptions

Additionally, the following types were formerly declared as C# enums and are now subclasses of the new StringEnum class:

  • PlanTierUpTo
  • SubscriptionBillingCycleAnchor
  • SubscriptionTrialEnd

This should have no impact on your integration as the possible enum values can still be accessed with the same syntax (e.g. SubscriptionTrialEnd.Now).

Behavior changes

  • Calling BankAccountService.List/ListAsync or CardService.List/ListAsync with no parameters will now only return bank accounts/cards, as it should. Previously calling these methods with no parameters would fail to include the object=bank_account or object=card filter in the API request, and the API would return all source types for the customers, not just bank accounts or cards.

    To clarify, this is a bug fix. We're listing it explicitly here because some users may have written custom code to work around the bug, which should no longer be needed.