Upgrading stripe 3 to 4
Breaking3.5.0 → 4.2.1Breaking3Security1New8Changed9Fixed4Other2
SecurityReplaces the bundled CA certificates with Stripe's root certificates because the previous bundle trusted a compromised root CA.Advisory ↗
BreakingUpgrade verdict
3 breaking changes and a security fix.
In plain terms
- If you rely on beta API features, you now have to specify the beta API version yourself instead of the library doing it for you.
- This major release includes breaking changes that were held back from earlier versions. Developers should read the migration guide before upgrading.
- Next major release changes in PR #845.
- The package now ships with Stripe's own root certificates instead of the old bundle, which trusted a certificate authority that was compromised.
Must act 4 items need code or config changes
stripe publishes an official migration guide for version 4. It covers more than the release notes do.
Migration guide ↗Python requirement changed in 4.2.1: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* → !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7.
What you must change
Breaking3
Beta Stripe-Version headers are no longer pinned by default and must be set manually.
Stripe-VersionApplies breaking changes from code generation postponed to this major version, with migration details in the v4 migration guide.
Next major release changes in PR #845.
Security1
Replaces the bundled CA certificates with Stripe's root certificates because the previous bundle trusted a compromised root CA.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
export AlipayAccount - removed:
export BitcoinReceiver - removed:
export BitcoinTransaction - removed:
export IssuerFraudRecord - removed:
export Recipient - removed:
export RecipientTransfer - removed:
export ThreeDSecure - added:
export CustomerCashBalanceTransaction
- added:
static method SearchableAPIResource.search(*args, **kwargs) - added:
static method SearchableAPIResource.search_auto_paging_iter(*args, **kwargs)
- removed:
class AlipayAccount(DeletableAPIResource, UpdateableAPIResource) - removed:
field AlipayAccount.OBJECT_NAME - removed:
method AlipayAccount.instance_url() - removed:
static method AlipayAccount.modify(customer, id, **params) - removed:
static method AlipayAccount.retrieve(id, api_key=…, stripe_version=…, stripe_account=…, **params)
- removed:
class BitcoinReceiver(ListableAPIResource) - removed:
field BitcoinReceiver.OBJECT_NAME - removed:
method BitcoinReceiver.instance_url() - removed:
static method BitcoinReceiver.class_url()
- removed:
class BitcoinTransaction(StripeObject) - removed:
field BitcoinTransaction.OBJECT_NAME
- removed:
method Charge.close_dispute(idempotency_key=…, **params) - removed:
method Charge.refund(idempotency_key=…, **params) - removed:
method Charge.update_dispute(idempotency_key=…, **params)
- added:
method Session.list_line_items(idempotency_key=…, **params)
- changed:
method Customer.delete_discount(**params) → method Customer.delete_discount(idempotency_key=…, **params) - changed:
static method Customer.modify_cash_balance(customer, nested_id=…, api_key=…, stripe_version=…, stripe_account=…, **params) → static method Customer.modify_cash_balance(customer, api_key=…, stripe_version=…, stripe_account=…, **params) - changed:
static method Customer.retrieve_cash_balance(customer, nested_id=…, api_key=…, stripe_version=…, stripe_account=…, **params) → static method Customer.retrieve_cash_balance(customer, api_key=…, stripe_version=…, stripe_account=…, **params)
- added:
class CustomerCashBalanceTransaction(ListableAPIResource) - added:
field CustomerCashBalanceTransaction.OBJECT_NAME
- added:
static method Invoice.upcoming_lines(api_key=…, stripe_version=…, stripe_account=…, **params)
- removed:
class IssuerFraudRecord(ListableAPIResource) - removed:
field IssuerFraudRecord.OBJECT_NAME
- removed:
export CardDetails
- removed:
method Card.details(idempotency_key=…, **params)
- removed:
class CardDetails(StripeObject) - removed:
field CardDetails.OBJECT_NAME
- changed:
class LineItem(APIResource) → class LineItem(StripeObject)
- removed:
class Recipient(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource) - removed:
field Recipient.OBJECT_NAME
- removed:
method Source.source_transactions(**params) - changed:
class Source(CreateableAPIResource, UpdateableAPIResource, VerifyMixin) → class Source(CreateableAPIResource, UpdateableAPIResource) - added:
method Source.list_source_transactions(idempotency_key=…, **params) - added:
method Source.verify(idempotency_key=…, **params)
- changed:
method Subscription.delete_discount(**params) → method Subscription.delete_discount(idempotency_key=…, **params) - added:
method Subscription.cancel(idempotency_key=…, **params)
- removed:
method SubscriptionItem.usage_record_summaries(**params)
- removed:
class ThreeDSecure(CreateableAPIResource) - removed:
field ThreeDSecure.OBJECT_NAME - removed:
static method ThreeDSecure.class_url()
- removed:
method Transfer.cancel(idempotency_key=…, **params)