Migration guide for v4 (original) (raw)
Changes in v4.0.0 - 2022-08-01
"⚠️" symbol highlights breaking changes.
⚠️ Removed
- Removed deprecated
AlipayAccount,BitcoinReceiver,BitcoinTransaction,IssuerFraudRecord,Recipient,RecipientTransfer, andThreeDSecureclasses. - Removed deprecated
Charge.update_disputeandCharge.close_disputemethods that were using legacy REST API endpoint. Prefer Dispute.modify and Dispute.close - Removed deprecated
Card.detailsmethod andCardDetailsresource. The REST API endpoint is not longer supported. - Removed the deprecated
Source.source_transactionsmethod. PreferSubscriptionItem.list_source_transactions
before
source.source_transactions()
after
Source.list_source_transactions(item.id)
- Removed the deprecated
SubscriptionItem.usage_record_summariesmethod. PreferSubscriptionItem.list_usage_record_summaries
before
item.usage_record_summaries()
after
SubscriptionItem.list_usage_record_summaries(item.id)
- Removed the deprecated
Charge.refundmethod. Prefer Refund.create
before
charge.refund()
after
Refund.create(charge=charge.id)
⚠️ Changed
- To be consistent with other resource methods,
ApplicationFee.refundreturns an instance ofApplicationFeeand doesn't mutate the instance ofApplicationFee. To revert to old behavior:
before
fee.refund()
after
fee = fee.refund()
- To be consistent with other resource methods, the
Customer.delete_discountno longer resets thediscountproperty toNoneand returns the deleted discount instead. If you were relying on this behavior, reset the discount property manually:
before
customer.delete_discount()
after
customer.delete_discount()
customer.discount = None
- The
LineItemresource now inherits fromStripeObjectas it has no methods of it's own. - To be consistent with other resource methods, the
Subscription.delete_discountreturns an instance of deleted discount and doesn't mutate the instance ofSubscription. To revert to old behavior:
before
subscription.delete_discount()
after
subscription = subscription.delete_discount()
- Update the CA certificate bundle.