Skip to content

Migration guide for v4

Kamil Pajdzik edited this page Jul 31, 2022 · 2 revisions

Changes in v4.0.0 - 2022-08-01

"⚠️" symbol highlights breaking changes.

⚠️ Removed

  • Removed deprecated AlipayAccount, BitcoinReceiver, BitcoinTransaction, IssuerFraudRecord, Recipient, RecipientTransfer, and ThreeDSecure classes.
  • Removed deprecated Charge.update_dispute and Charge.close_dispute methods that were using legacy REST API endpoint. Prefer Dispute.modify and Dispute.close
  • Removed deprecated Card.details method and CardDetails resource. The REST API endpoint is not longer supported.
  • Removed the deprecated Source.source_transactions method. Prefer SubscriptionItem.list_source_transactions
    # before
    source.source_transactions()
    # after
    Source.list_source_transactions(item.id)
  • Removed the deprecated SubscriptionItem.usage_record_summaries method. Prefer SubscriptionItem.list_usage_record_summaries
    # before
    item.usage_record_summaries()
    # after
    SubscriptionItem.list_usage_record_summaries(item.id)
  • Removed the deprecated Charge.refund method. Prefer Refund.create
    # before
    charge.refund()
    # after
    Refund.create(charge=charge.id)

⚠️ Changed

  • To be consistent with other resource methods, ApplicationFee.refund returns an instance of ApplicationFee and doesn't mutate the instance of ApplicationFee. To revert to old behavior:
    # before
    fee.refund()
    # after
    fee = fee.refund()
  • To be consistent with other resource methods, the Customer.delete_discount no longer resets the discount property to None and 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 LineItem resource now inherits from StripeObject as it has no methods of it's own.
  • To be consistent with other resource methods, the Subscription.delete_discount returns an instance of deleted discount and doesn't mutate the instance of Subscription. To revert to old behavior:
    # before
    subscription.delete_discount()
    # after
    subscription = subscription.delete_discount()
  • Update the CA certificate bundle.