-
Notifications
You must be signed in to change notification settings - Fork 362
Migration guide for v6
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 |
SourceCodeVerificationFlow |
Source.CodeVerificationFlow |
SourceOwner |
Source.Owner |
SourceReceiverFlow |
Source.ReceiverFlow |
SourceRedirectFlow |
Source.RedirectFlow |
StatusTransitions |
Order.StatusTransitions |
Summary |
Transfer.Summary |
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
)
A new exception class IdempotencyException
was added, and may be raised by all Stripe methods. If you use idempotent requests, you should catch this new exception. (Previously, such errors were raised InvalidRequestException
.)