Skip to content

Migration guide for v6

Olivier Bellone edited this page Jul 30, 2018 · 7 revisions

Deleted models

All Deleted* models have been removed. Instead, deletable resources now have a deleted attribute.

Deprecated methods

All methods that accepted a String apiKey as their last argument have been removed. If you want to send a request with a specific API key, use the signature with the RequestOptions options argument instead.

E.g.:

// Don't do this
Charge charge = Charge.create(chargeParams, "sk_...");

// Instead do this
RequestOptions options = (new RequestOptionsBuilder()).setApiKey("sk_...").build();
Charge charge = Charge.create(chargeParams, options);

// Or even better, use the `Stripe-Account` header
RequestOptions options = (new RequestOptionsBuilder()).setStripeAccount("acct_...").build();
Charge charge = Charge.create(chargeParams, options);

Some older deprecated methods have been removed:

Removed method Replacement
<Resource>.all() <Resource>.list()
ApplicationFee.refund() ApplicationFee.getRefunds().create()
Charge.closeDispute() Dispute.close()
Charge.updateDispute() Dispute.update()
Customer.cancelSubscription() Subscription.cancel()
Customer.createBankAccount() Customer.getSources().create()
Customer.createCard() Customer.getSources().create()
Customer.createSubscription() Subscription.create()
Customer.updateSubscription() Subscription.update()
Recipient.createCard() Recipient.getCards().create()

Capitalization changes

The library now adheres strictly to Google's Java style rules. Only the first letter of acronyms is capitalized.

Old name New name
APIConnectionException ApiConnectionException
APIResource ApiResource
getURL() getUrl()
getRedirectURL() getRedirectUrl()
getReturnURL() getReturnUrl()

Numeric types

Resource attributes with numeric types have now been unified:

  • all integer types are now Long (previously, they were either Integer or Long)
  • all floating point types are now BigDecimal (previously, they were either Float or Double)