-
Notifications
You must be signed in to change notification settings - Fork 367
Migration guide for v6
Olivier Bellone edited this page Jul 30, 2018
·
7 revisions
All Deleted*
models have been removed. Instead, deletable resources now have a deleted
attribute.
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() |
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() |
Resource attributes with numeric types have now been unified:
- all integer types are now
Long
(previously, they were eitherInteger
orLong
) - all floating point types are now
BigDecimal
(previously, they were eitherFloat
orDouble
)