-
Notifications
You must be signed in to change notification settings - Fork 432
Migration guide for v2
If you're migrating from v1.x of stripe-python to v2.x, here's what you need to keep in mind to ensure your Stripe integration will still work after updating:
stripe-python v2.0 requires Python 2.7 or 3.4 (or higher). Python 2.6 and 3.3 are no longer supported. If you're using Python 2.6 or 3.3, consider upgrading to a more recent version as soon as possible as these versions are no longer supported and do not receive any updates (including security updates).
Stripe exception classes (InvalidRequestError
, etc.) are no longer available in the global stripe
namespace. Instead, they should now be accessed via the stripe.error
module.
Some older deprecated methods have been removed:
Removed method | Replacement |
---|---|
<Resource>.all() |
<Resource>.list() |
Customer.add_invoice_item() |
InvoiceItem.create(customer=...) |
Customer.invoices() |
Invoice.list(customer=...) |
Customer.invoice_items() |
InvoiceItem.list(customer=...) |
Customer.charges() |
Charge.list(customer=...) |
Customer.update_subscription() |
Subscription.update() |
Customer.cancel_subscription() |
Subscription.cancel() |
Recipient.transfers() |
Transfer.list(recipient=...) |
EphemeralKey.create()
no longer supports the api_version
argument, use stripe_version
instead.
In v1.x, trying to detach a source that is not currently attached to a customer would raise a NotImplementedError
exception. In v2.x, a stripe.error.InvalidRequestError
exception is raised instead.