Skip to content

Migration guide for v22

anniel-stripe edited this page Apr 4, 2023 · 3 revisions

Changes in 22.0.0 - 2022-11-16

Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15.

"⚠️" symbol highlights breaking changes.

  • ⚠️ Inline several "shared" classes for consistency (#1455)
  • ⚠️ Removed LineItem.Product property that was released by mistake. (#1456)
  • ⚠️ Removed Charges property on PaymentIntent and replace it with LatestCharge (#1473)
  • ⚠️ Removed deprecated Amount, Currency, Description, Images, Name properties from SessionCreateParams.LineItem (#1473
  • ⚠️ Remove support for tos_shown_and_accepted on CheckoutSessionCreateParams.payment_method_options.paynow (#1473
  • ⚠️ Removed deprecated Sku resource (#1459)
  • ⚠️ Removed deprecated EphemeralKey.associatedObjects field. (#1470)
  • ⚠️ Removed RequestOptions.getStripeVersionOverride, RequestOptions.setStripeVersionOverride, and RequestOptions.clearStripeVersionOverride (#1464)

Use of setStripeVersionOverride is discouraged and can lead to unexpected errors during service calls because Java SDK class shapes are not guaranteed to match API responses on arbitrary versions.

If you were using these methods in conjunction with EphemeralKey resource prefer the EphemeralKeyCreateParamsBuilder.setStripeVersion.

EphemeralKeyCreateParams params = EphemeralKeyCreateParams.builder()
  .setStripeVersion("XXXX-YY-ZZ")
  .build();

If you have a use case that requires per-request version overrides, please file an issue on stripe-java repository to ensure we are aware and can add first-class support for it. In the meantime you can use unsafeSetStripeVersionOverride method as a workaround.

RequestOptions.RequestOptionsBuilder builder = RequestOptions.builder();
builder.setApiKey(...)
            .setClientId(...);

RequestOptionsBuilder.unsafeSetStripeVersionOverride(builder, "2022-11-15");
  • ⚠️ Remove support for tos_shown_and_accepted on CheckoutSessionCreateParams.payment_method_options.paynow. The property was mistakenly released and never worked. (#1474)

⚠️ Inlined and moved classes

  • Inlined AutomaticPaymentMethodsPaymentIntent class to PaymentIntent.AutomaticPaymentMethods inner class
  • Inlined CreditedItems class to InvoiceLineItem.CreditedItems inner class
  • Inlined EventData class to Event.Data inner class
  • Inlined EventRequest class to Event.Request inner class
  • Inlined InvoiceLineItemPeriod class to InvoiceItem.Period inner class
  • Inlined PackageDimensions class to Sku.PackageDimensions and Product.PackageDimensions inner classeses.`
  • Inlined ProrationDetails class to InvoiceLineItem.ProrationDetails inner class
  • Inlined radar.Rule class to Charge.Rule inner class
  • Inlined treasury.FlowDetails class to TransactionEntry.FlowDetails inner class
  • Deleted StripeErrorResponse class that was unused.
  • Moved Account.DeclineChargeOn to Account.SettingsCardPayments.DeclineChargeOn
  • Moved Account.PayoutSchedule to Account.SettingsPayouts.PayoutSchedule
  • Moved Account.SettingsBranding to Account.Settings.Branding
  • Moved Account.SettingsCardPayments to Account.Settings.CardPayments
  • Moved Account.SettingsDashboard to Account.Settings.Dashboard
  • Moved Account.SettingsPayments to Account.Settings.Payments
  • Moved Account.SettingsPayouts to Account.Settings.Payouts
  • Moved Charge.PaymentMethodDetails.Store to Charge.PaymentMethodDetails.Konbini.Store
  • Moved Invoice.PaymentMethodOptions to Invoice.PaymentSettings.PaymentMethodOptions
  • Moved Invoice.ThresholdItemReason to Invoice.ThresholdReason.ItemReason
  • Moved Mandate.AuBecsDebit to Mandate.PaymentMethodDetails.AuBecsDebit
  • Moved Mandate.BacsDebit to Mandate.PaymentMethodDetails.BacsDebit
  • Moved PaymentIntent.PaymentMethodOptions.BlikMandateOptionsOffSessionDetails to Mandate.PaymentMethodDetails.Blik.OffSession
  • Moved PaymentIntent.PaymentMethodOptions.BankTransfer to PaymentIntent.PaymentMethodOptions.CustomerBalance.BankTransfer
  • Moved PaymentIntent.NextActionAlipayHandleRedirect to PaymentIntent.NextAction.AlipayHandleRedirect
  • Moved PaymentIntent.NextActionCardAwaitNotification to PaymentIntent.NextAction.CardAwaitNotification
  • Moved PaymentIntent.NextActionDisplayBankTransferInstructions to PaymentIntent.NextAction.DisplayBankTransferInstructions
  • Moved PaymentIntent.NextActionDisplayBoletoDetails to PaymentIntent.NextAction.BoletoDisplayDetails
  • Moved PaymentIntent.NextActionKonbiniDisplayDetails to PaymentIntent.NextAction.KonbiniDisplayDetails
  • Moved PaymentIntent.NextActionOxxoDisplayDetails to PaymentIntent.NextAction.OxxoDisplayDetails
  • Moved PaymentIntent.NextActionRedirectToUrl to PaymentIntent.NextAction.RedirectToUrl
  • Moved PaymentIntent.PaymentMethodOptions.SepaDebitMandateOptions to PaymentIntent.PaymentMethodOptions.SepaDebit.MandateOptions
  • Moved Person.VerificationDocument to Person.Verification.Document
  • Moved Person.VerificationDocument to Person.Verification.AdditionalDocument
  • Moved PromotionCode.CurrencyOption to PromotionCode.Restrictions.CurrencyOption
  • Moved Quote.Recurring to Quote.Computed.Recurring
  • Moved Quote.Upfront to Quote.Computed.Upfront
  • Moved Refund.NextActionDisplayDetails to Refund.NextAction.DisplayDetails
  • Moved SetupIntent.PaymentMethodOptions.BlikMandateOptions to SetupIntent.PaymentMethodOptions.Blik.MandateOptions
  • Moved SetupIntent.NextActionRedirectToUrl to SetupIntent.NextAction.RedirectToUrl
  • Moved SetupIntent.PaymentMethodOptions.SepaDebitMandateOptions to SetupIntent.PaymentMethodOptions.SepaDebit.MandateOptions
  • Moved ShippingRate.CurrencyOption to ShippingRate.FixedAmount.CurrencyOption
  • Moved Source.OrderItem to Source.Order.OrderItem
  • Moved Subscription.PaymentMethodOptions to Subscription.PaymentSettings.PaymentMethodOptions
  • Renamed Person.JapanAddress to Person.AddressKanji
  • Renamed Account.Company.Verification.VerificationDocument to Account.Company.Verification.Document
  • Moved SubscriptionSchedule.AddInvoiceItem to SubscriptionSchedule.Phase.AddInvoiceItem
  • Renamed Person.JapanAddress to Person.AddressKana
  • Moved SubscriptionSchedule.InvoiceSettings to SubscriptionSchedule.DefaultSettings.InvoiceSettings
  • Moved SubscriptionSchedule.PhaseItem to SubscriptionSchedule.Phase.Item
  • Renamed Account.FutureRequirements.Errors to Account.FutureRequirements.Error
  • Renamed Account.Requirements.Errors to Account.Requirements.Error
  • Renamed Account.Settings.SettingsCardIssuing to Account.Settings.CardIssuing
  • Renamed Account.Settings.SettingsTreasury to Account.Settings.Treasury
  • Renamed Balance.Money to Balance.Available
  • Renamed Balance.Money to Balance.ConnectReserved
  • Renamed Balance.Money to Balance.InstantAvailable
  • Renamed Balance.Details to Balance.Issuing
  • Renamed Balance.Money to Balance.Pending
  • Renamed BalanceTransaction.Fee to BalanceTransaction.FeeDetail
  • Renamed Capability.FutureRequirements.Errors to Capability.FutureRequirements.Error
  • Renamed CashBalance.BalanceSettings to CashBalance.Settings
  • Renamed Session.CustomerDetails.TaxID to Session.CustomerDetails.TaxId
  • Renamed Session.PaymentMethodOptions.GrabPay to Session.PaymentMethodOptions.Grabpay
  • Renamed Session.TaxIDCollection to Session.TaxIdCollection
  • Renamed CountrySpec.VerificationFields.Details to CountrySpec.VerificationFields.Company
  • Renamed CountrySpec.VerificationFields.Details to CountrySpec.VerificationFields.Individual
  • Renamed Account.Balance.CashBalance to Account.Balance.Cash
  • Renamed Account.Balance.CreditBalance to Account.Balance.Credit
  • Renamed VerificationReport.Document.DateOfBirth to VerificationReport.Document.Dob
  • Renamed VerificationReport.Document.DocumentCheckError to VerificationReport.Document.Error
  • Renamed VerificationReport.IdNumber.DateOfBirth to VerificationReport.IdNumber.Dob
  • Renamed VerificationReport.IdNumber.IdNumberCheckError to VerificationReport.IdNumber.Error
  • Renamed VerificationReport.Selfie.SelfieCheckError to VerificationReport.Selfie.Error
  • Renamed VerificationSession.VerifiedOutputs.DateOfBirth to VerificationSession.VerifiedOutputs.Dob
  • Renamed Invoice.DiscountAmount to Invoice.TotalDiscountAmount
  • Renamed Invoice.TaxAmount to Invoice.TotalTaxAmount
  • Renamed Cardholder.Individual.DateOfBirth to Cardholder.Individual.Dob
  • Renamed Transaction.PurchaseDetails.Flight.Segments to Transaction.PurchaseDetails.Flight.Segment
  • Renamed PaymentIntent.PaymentMethodOptions.Card.Installments.Plan to PaymentIntent.PaymentMethodOptions.Card.Installments.AvailablePlan
  • Renamed PaymentMethod.Klarna.DateOfBirth to PaymentMethod.Klarna.Dob
  • Renamed PaymentMethod.USBankAccount to PaymentMethod.UsBankAccount
  • Renamed Person.DateOfBirth to Person.Dob
  • Renamed Person.FutureRequirements.Errors to Person.FutureRequirements.Error
  • Renamed Review.Location to Review.IpAddressLocation
  • Renamed ScheduledQueryRun.RunError to ScheduledQueryRun.Error
  • Renamed Source.CodeVerificationFlow to Source.CodeVerification
  • Renamed Source.ReceiverFlow to Source.Receiver
  • Renamed Source.RedirectFlow to Source.Redirect
  • Renamed Source.Order to Source.SourceOrder
  • Renamed SourceMandateNotification.AcssDebitData to SourceMandateNotification.AcssDebit
  • Renamed SourceMandateNotification.BacsDebitData to SourceMandateNotification.BacsDebit
  • Renamed SourceMandateNotification.SepaDebitData to SourceMandateNotification.SepaDebit
  • Renamed SourceTransaction.AchCreditTransferData to SourceTransaction.AchCreditTransfer
  • Renamed SourceTransaction.ChfCreditTransferData to SourceTransaction.ChfCreditTransfer
  • Renamed SourceTransaction.GbpCreditTransferData to SourceTransaction.GbpCreditTransfer
  • Renamed SourceTransaction.PaperCheckData to SourceTransaction.PaperCheck
  • Renamed SourceTransaction.SepaCreditTransferData to SourceTransaction.SepaCreditTransfer
  • Renamed Reader.ReaderAction to Reader.Action
  • Renamed FinancialAccountFeatures.FinancialAddresses.Aba.StatusDetails to FinancialAccountFeatures.FinancialAddresses.Aba.StatusDetail
  • Renamed FinancialAccountFeatures.CardIssuing.StatusDetails to FinancialAccountFeatures.CardIssuing.StatusDetail
  • Renamed FinancialAccountFeatures.DepositInsurance.StatusDetails to FinancialAccountFeatures.DepositInsurance.StatusDetail
  • Renamed FinancialAccountFeatures.InboundTransfers.Ach.StatusDetails to FinancialAccountFeatures.InboundTransfers.Ach.StatusDetail
  • Renamed FinancialAccountFeatures.IntraStripeFlows.StatusDetails to FinancialAccountFeatures.IntraStripeFlows.StatusDetail
  • Renamed FinancialAccountFeatures.OutboundPayments.Ach.StatusDetails to FinancialAccountFeatures.OutboundPayments.Ach.StatusDetail
  • Renamed FinancialAccountFeatures.OutboundPayments.UsDomesticWire.StatusDetails to FinancialAccountFeatures.OutboundPayments.UsDomesticWire.StatusDetail
  • Renamed FinancialAccountFeatures.OutboundTransfers.Ach.StatusDetails to FinancialAccountFeatures.OutboundTransfers.Ach.StatusDetail
  • Renamed FinancialAccountFeatures.OutboundTransfers.UsDomesticWire.StatusDetails to FinancialAccountFeatures.OutboundTransfers.UsDomesticWire.StatusDetail