-
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() |
Some classes that were used to represent nested properties of main API resources have been moved directly onto the API resource class:
Old class | New name |
---|---|
AccountDeclineChargeOn |
Account.DeclineChargeOn |
AccountPayoutSchedule |
Account.PayoutSchedule |
AccountTosAcceptance |
Account.TosAcceptance |
AccountTransferSchedule |
Account.TransferSchedule |
AlternateStatementDescriptors |
Charge.AlternateStatementDescriptors |
ChargeLevel3 |
Charge.Level3 |
ChargeLevel3LineItem |
Charge.Level3.LineItem |
ChargeOutcome |
Charge.Outcome |
ChargeOutcomeRule |
Charge.Outcome.Rule |
Inventory |
Sku.Inventory |
Money |
Balance.Money |
NextRecurringCharge |
Customer.NextRecurringCharge |
PaymentIntentTransferData |
PaymentIntent.TransferData |
PlanTier |
Plan.Tier |
PlanTransformUsage |
Plan.TransformUsage |
ShippingMethod |
Order.ShippingMethod |
StatusTransitions |
Order. StatusTransitions |
VerificationFields |
CountrySpec.VerificationFields |
VerificationFieldsDetails |
CountrySpec.VerificationFields.Details |
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() |
SKU |
Sku |
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
)