Skip to content

Migration guide for v8 breaking changes

mickjermsurawong-stripe edited this page Mar 19, 2019 · 2 revisions

The following sections contain breaking changes in classes, fields, and methods. They do not contain those in v7 already marked with @Deprecated.

Classes Renamed

Current Class New Class
EvidenceSubObject Dispute.Evidence
Reversal TransferReversal

Version change 2014-08-04

  • Associated classes for otherTransfers, summary, and transactions in Transfer are removed. Use BalanceTransaction#list instead.
Class Name
Transfer.Summary
TransferTransaction
TransferTransactionCollection

Version change on PaymentIntent 2019-02-11

  • PaymentIntentSourceAction and PaymentIntentSourceActionValueAuthorizeWithUrl are removed in favor of PaymentIntent.NextAction and PaymentIntent.NextActionRedirectToUrl respectively.
Class Name
PaymentIntentSourceAction
PaymentIntentSourceActionValueAuthorizeWithUrl

Version change on Account 2019-02-19

  • Account.Verification is removed in favor of Account.Requirements, and Account#keys is removed in favor of authenticating connected accounts with their own key via Stripe-Account header.
Class Name
Account.Keys
Account.Verification
  • LegalEntity and inner classes are removed in favor of Person and Account.Company.
Class Name
LegalEntity
LegalEntity.DateOfBirth
LegalEntity.JapanAddress
LegalEntity.Owner
LegalEntity.Verification

Classes Removed

  • CustomerSubscriptionCollection static methods were deprecated and now the class is removed in favor of methods in Subscription. The collection class itself is now removed in favor SubscriptionCollection with no associated method.

  • Subscription.TransferData is removed in favor of the existing Invoice.TransferData

  • RecipientCardCollection is removed in favor of CardCollection with no associated method.

  • Account.TransferSchedule is removed in favor of Account.PayoutSchedulein version change.

  • Charge.Outcome.Rule as nested class is removed in favor of radar.Rule.

  • Customer.NextRecurringCharge is removed in favor of calling Invoice#upcoming in version change

  • issuing.Card.Billing was for a deprecated feature allowing issuing card creation without a card holder, and is now removed.

  • ChargeRefundCollection static methods were deprecated and now the class is removed infavor of methods in Refund. The collection class itself is now removed in favorof RefundCollection with no associated method.

  • LoginLinkCollection usage now is only to create a LoginLink, use LoginLink#createOnAccount instead.

  • PaymentIntentLastPaymentError is removed in favor of the existing StripeError attached to StripeException.

  • CustomerCardCollection is removed from Customer in version change. Use Customer#sources to get PaymentSourceCollection instead.

Fields Conflicted

Expandable field is now a full model.

Current Class Current Field New Field
issuing.Authorization ExpandableField<issuing.Card> card issuing.Card card
issuing.CardDetails ExpandableField<issuing.Card> card issuing.Card card

Expandable field of HasId is now expandable of a specific class.

Current Class Current Field New Field
BalanceTransaction ExpandableField<HasId> source ExpandableField<BalanceTransactionSource> source
  • getParentObject() currently only expands as SKU, but not discount, shipping, or tax information. Non-expanded value at getParent() remains the same.
Current Class Current Field New Field
OrderItem ExpandableField<HasId> parent ExpandableField<Sku> parent

Field type is changed.

  • Specific collection types are no longer supported, in favor of more general ones.
Current Class Current Field New Field
Charge ChargeRefundCollection refunds RefundCollection refunds
Recipient RecipientCardCollection cards CardCollection cards
  • Field transferData at Subscription has the same property as that in Invoice.
Current Class Current Field New Field
Subscription Subscription.TransferData transferData Invoice.TransferData transferData
  • The amount should be Long instead of String.
Current Class Current Field New Field
issuing.Authorization String authorizedAmount Long authorizedAmount
  • Field error String is now an inner class Error, where the root-level error value is now at Error#message.
Current Class Current Field New Field
sigma.ScheduledQueryRun String error sigma.ScheduledQueryRun.Error error

Integer field is now of Long type.

  • Month and year values are now standardized to Long values, consistent with other all long values in this Java binding.
Current Class Current Field New Field
issuing.CardDetails Integer expMonth Long expMonth
issuing.CardDetails Integer expYear Long expYear
issuing.Card Integer expMonth Long expMonth
issuing.Card Integer expYear Long expYear

Source no longer extends ExternalAccount, but implements PaymentSource interface.

Current Class Current Field New Field
Charge ExternalAccount source PaymentSource source
Customer ExpandableField<ExternalAccount> defaultSource ExpandableField<PaymentSource> defaultSource
Customer ExternalAccountCollection sources PaymentSourceCollection sources
Invoice ExpandableField<ExternalAccount> defaultSource ExpandableField<PaymentSource> defaultSource
PaymentIntentLastPaymentError ExternalAccount source PaymentSource source
PaymentIntent ExpandableField<ExternalAccount> source ExpandableField<PaymentSource> source
StripeError ExternalAccount source PaymentSource source
Subscription ExpandableField<ExternalAccount> defaultSource ExpandableField<PaymentSource> defaultSource

String field is now expandable of a class.

Current Class Current Field New Field
Card String recipient ExpandableField<Recipient> recipient
Discount String customer ExpandableField<Customer> customer
EvidenceSubObject String cancellationPolicy ExpandableField<File> cancellationPolicy
EvidenceSubObject String customerCommunication ExpandableField<File> customerCommunication
EvidenceSubObject String customerSignature ExpandableField<File> customerSignature
EvidenceSubObject String duplicateChargeDocumentation ExpandableField<File> duplicateChargeDocumentation
EvidenceSubObject String receipt ExpandableField<File> receipt
EvidenceSubObject String refundPolicy ExpandableField<File> refundPolicy
EvidenceSubObject String serviceDocumentation ExpandableField<File> serviceDocumentation
EvidenceSubObject String shippingDocumentation ExpandableField<File> shippingDocumentation
EvidenceSubObject String uncategorizedFile ExpandableField<File> uncategorizedFile
issuing.Dispute.EvidenceFraudulent String uncategorizedFile ExpandableField<File> uncategorizedFile
issuing.Dispute.EvidenceOther String uncategorizedFile ExpandableField<File> uncategorizedFile

Version change on Account 2019-02-12

  • Use Person.Verification#document to get full VerificationDocument instead.
Current Class Current Field New Field
LegalEntity.Verification String document Person.VerificationDocument document

Fields Removed

ExternalAccount is now an interface.

  • Fields previously in the abstract class are removed. Only BankAccount and Card now implements the interface.
Current Class Removed Field
ExternalAccount String account
ExternalAccount String customer
ExternalAccount String id
ExternalAccount Map<String, String> metadata
ExternalAccount String object

Field is now unsupported and removed.

  • Fields are currently present in the Java binding release, but the values will never have been returned in the public API. Any successful integration should have handled null values, and can now eliminate the non-null code path.
Current Class Removed Field
radar.ValueList String updateBy
radar.ValueList Long updated
  • 3D-secured field in card is currently not supported are now removed.
Current Class Removed Field
Card ThreeDSecure threeDSecure
  • Field customerData at root-level is always null, and is currently returned in typeData for source transaction of ACH credit transfer only. Now with with typed data for each eligible source type, use SourceTransaction.AchCreditTransferData#customerData instead.
Current Class Removed Field
SourceTransaction String customerData
Current Class Removed Field
Account.Verification Boolean contacted
  • Field is now unsupported in Java binding, but is still publicly available in via custom integration.
Current Class Removed Field
Balance.Money.SourceTypes Long alipayAccount
Balance.Money.SourceTypes Long bitcoinReceiver
BitcoinTransaction String customer
Current Class Removed Field
Product SkuCollection skus
  • HasSourceTypeData interface is removed, and all possible source types are at the root-level (same level as typeData). This means that instead of getTypeData() returning a map, check getType() for your source type and use getter for that source type. For example, if getType() returns a String ach_credit_transfer, you can access non-null data at getAchCreditTransfer(), while other getters of the source type will return null.
Current Class Removed Field
SourceMandateNotification Map<String, String> typeData
SourceTransaction Map<String, String> typeData
Source Map<String, String> typeData
  • Fields in some subclasses of ExternalAccount are currently not returned in standard API response, and now removed from the binding.
Current Class Removed Field
AlipayAccount String status
BitcoinReceiver Boolean rejectTransactions
BitcoinReceiver String status
Card String status
  • Currently available to allow LoginLinkCollection creation, and never contain any actual login links. The field is now removed in favor an explicit LoginLink#createOnAccount method instead.
Current Class Removed Field
Account LoginLinkCollection loginLinks
  • Refer to field evidence instead
Current Class Removed Field
Dispute EvidenceSubObject evidenceSubObject
  • Discount has no valid ID, and is now consistent with the API reference.
Current Class Removed Field
Discount String id
  • Check for nullable application field instead.
Current Class Removed Field
WebhookEndpoint Boolean connect
  • The field value will be returned as a possible enum in status field instead. Deprecated in version change.
Current Class Removed Field
BankAccount Boolean validated
  • The field was for a deprecated behavior allowing issuing card creation without a card holder. The value in API response is currently null, and the field is now removed.
Current Class Removed Field
issuing.Card issuing.Card.Billing billing
Current Class Removed Field
Transfer String applicationFee
Transfer BankAccount bankAccount
Transfer Long date
Transfer String failureCode
Transfer String failureMessage
Transfer String statementDescriptor
Transfer String status
Transfer String type
  • The token fields are currently not supported, and removed to reflect the standard API response.
Current Class Removed Field
Token Long amount
Token String currency

Non-static inner class is removed.

  • Non-static inner classes is now static, and thus looses the implicit reference this$0 to its outer class instance.
Current Class Removed Field
issuing.Authorization.RequestHistory issuing.Authorization this$0
issuing.Authorization.VerificationData issuing.Authorization this$0
issuing.Card.AuthorizationControls issuing.Card this$0
issuing.Card.Shipping issuing.Card this$0
issuing.Cardholder.Billing issuing.Cardholder this$0
issuing.Dispute.EvidenceFraudulent issuing.Dispute this$0
issuing.Dispute.EvidenceOther issuing.Dispute this$0
issuing.Dispute.Evidence issuing.Dispute this$0
reporting.ReportRun.Parameters reporting.ReportRun this$0

Static field is removed.

  • USER_REPORT and FRAUD_DETAILS contains a parameter name for update charge fraud details. Please refer to API refs doc for full usage.
Current Class Removed Field
Charge.FraudDetails String USER_REPORT
Charge String FRAUD_DETAILS

Version change on Account 2019-02-12

  • fieldsNeeded is removed in favor categorized lists according to their time significance. dueBy is represented in currentDeadline
Current Class Removed Field
Account.Verification Long dueBy
Account.Verification List<String> fieldsNeeded
  • Use Person.Verification#document to get full VerificationDocument instead.
Current Class Removed Field
LegalEntity.Verification String documentBack
Person.Verification Person.VerificationDocument documentSubObject

Version change on Invoice 2019-03-14

  • finalizedAt is removed in favor of StatusTransitions containing timestamps when an invoice was finalized, paid, marked uncollectible, or voided. Field date marked with @Deprecated is also removed.
Current Class Removed Field
Invoice Long finalizedAt

Methods Changed

Class no longer has associated API methods.

  • Use Source to operate on AliPayAccount instead
Current Class Removed Method
AlipayAccount public AlipayAccount delete()
AlipayAccount public AlipayAccount delete(RequestOptions arg)
AlipayAccount public AlipayAccount update(Map<String, Object> arg)
AlipayAccount public AlipayAccount update(Map<String, Object> arg,RequestOptions arg)

ExternalAccount is now an interface.

  • Concrete methods ExternalAccount are now abstract methods in the interface (implemented by its subtypes.)
Current Class Current Method New Method
ExternalAccount public ExternalAccount delete() public abstract ExternalAccount delete()
ExternalAccount public ExternalAccount delete(RequestOptions arg) public abstract ExternalAccount delete(RequestOptions arg)
ExternalAccount public ExternalAccount update(Map<String, Object> arg) public abstract ExternalAccount update(Map<String, Object> arg)
ExternalAccount public ExternalAccount update(Map<String, Object> arg, RequestOptions arg) public abstract ExternalAccount update(Map<String, Object> arg, RequestOptions arg)

Returns resource on delete method.

Current Class Current Method New Method
Customer public void deleteDiscount() public Discount deleteDiscount()
Subscription public void deleteDiscount() public Discount deleteDiscount()

Methods Removed

Method is removed in favor of a new usage.

  • Use UsageRecord#createOnSubscriptionItem with explicit subscription item id instead.
Current Class Removed Method
UsageRecord public static UsageRecord create(Map<String, Object> arg, RequestOptions arg)
  • Use general update method with parameter map instead.
Current Class Removed Method
Charge public Charge markFraudulent(RequestOptions arg)
Charge public Charge markSafe(RequestOptions arg)
  • Use Source#detach instead.
Current Class Removed Method
Source public Source delete(RequestOptions arg)
  • Use deleteDiscount(Map<String, Object>, RequestOptions) instead.
Current Class Removed Method
Customer public void deleteDiscount(RequestOptions arg)
Subscription public void deleteDiscount(RequestOptions arg)
  • Method verify is only applicable to BankAccount and not general ExternalAccount.
Current Class Removed Method
ExternalAccount public ExternalAccount verify(Map<String, Object> arg)
ExternalAccount public ExternalAccount verify(Map<String, Object> arg, RequestOptions arg)