Skip to content

dj-stripe 2.8.0

Latest
Compare
Choose a tag to compare
@jleclanche jleclanche released this 08 Aug 11:57
· 117 commits to master since this release
It is not possible to upgrade to dj-stripe 2.8.0 from versions older than 2.5.0.
To upgrade from an older version, first upgrade to dj-stripe 2.5.0.

Release highlights

This release introduces support for Stripe Identity.

It is also slated to be the last major release before dj-stripe 3.0, which will introduce
significant, backwards-incompatible changes.

  • Python 3.11 is now supported.
  • Django 4.1 and 4.2 are now supported.
  • Python 3.7 is no longer supported. Python 3.8 or higher is required.
  • Added LineItem model.
  • Added Discount model.
  • Added SourceTransaction, VerificationSession and VerificationReport models.

Deprecated features

  • DJSTRIPE_WEBHOOK_EVENT_CALLBACK is deprecated in favour of the new webhook signals.
  • DJSTRIPE_WEBHOOK_TOLERANCE is deprecated in favour of the new UUID webhooks tolerance model field.

Breaking changes

  • Remove legacy JSONField support. This drops support for installations with the
    DJSTRIPE_USE_NATIVE_JSONFIELD setting set to False.
    NOTE: No migration path is available yet.
    #1820
  • Remove djstripe_sync_plans_from_stripe command (deprecated in 2.4.0).
    Use djstripe_sync_models price instead.
  • Remove Customer.can_charge(), Customer.has_valid_source() ()
  • Remove DJSTRIPE_PRORATION_POLICY setting (deprecated in 2.6.0)
  • Remove deprecated prorate argument to Subscription.update() (Use Stripe's
    proration_behavior argument instead)
  • Remove undocumented set_stripe_api_version() helper function
    and context manager stripe_temporary_api_version().
    The API version is now set on each request individually.
  • Updated Charge.refund(...) helper function
    to correctly create the desired refund. Note that the
    created Refund object is now returned as opposed to
    the Charge object.
  • Resolved ambiguity between LineItem and InvoiceItem models. We previously
    assumed that the lines List object on Invoice and UpcomingInvoice models only
    return InvoiceItem objects. Moreover LineItem objects can also be of type
    subscription if the user adds a Subscription to their Invoice as a lineitem.

Other changes

  • Updated the Stripe API key and webhook django system check to warning instead of critical.
  • Added various missing model field to CheckoutSession and Payout models.
  • Added support for running tests using the real Stripe API calls.
  • stripe.api_version is no longer manipulated by dj-stripe.
  • New webhook signals are available:
    • djstripe.signals.webhook_pre_validate(instance, api_key): Fired before webhook validation
    • djstripe.signals.webhook_post_validate(instance, api_key, valid): Fired after validation (even unsuccessful validations)
    • djstripe.signals.webhook_pre_process(instance, api_key): Fired before webhook processing. Not fired if the validation failed.
    • djstripe.signals.webhook_post_process(instance, api_key): Fired after webhook successful processing.
  • djstripe.signals.webhook_processing_error now also takes instance and api_key arguments
  • Updated deprecated pkg_resources to importlib.