dj-stripe 2.8.0 (2023-06-28)
NOTE: 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
LineItemmodel. - Added
Discountmodel. - Added
SourceTransaction,VerificationSessionandVerificationReportmodels.
Deprecated features
DJSTRIPE_WEBHOOK_EVENT_CALLBACKis deprecated in favour of the new webhook signals.DJSTRIPE_WEBHOOK_TOLERANCEis deprecated in favour of the new UUID webhookstolerancemodel field.
Breaking changes
- Remove legacy JSONField support. This drops support for installations with the
DJSTRIPE_USE_NATIVE_JSONFIELDsetting set toFalse. NOTE: No migration path is available yet. https://github.com/dj-stripe/dj-stripe/issues/1820 - Remove
djstripe_sync_plans_from_stripecommand (deprecated in 2.4.0). Usedjstripe_sync_models priceinstead. - Remove
Customer.can_charge(),Customer.has_valid_source()() - Remove
DJSTRIPE_PRORATION_POLICYsetting (deprecated in 2.6.0) - Remove deprecated
prorateargument toSubscription.update()(Use Stripe'sproration_behaviorargument instead) - Remove undocumented
set_stripe_api_version()helper function and context managerstripe_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 createdRefundobject is now returned as opposed to theChargeobject. - Resolved ambiguity between
LineItemandInvoiceItemmodels. We previously assumed that thelinesList object onInvoiceandUpcomingInvoicemodels only returnInvoiceItemobjects. MoreoverLineItemobjects can also be of typesubscriptionif the user adds a Subscription to theirInvoiceas 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_versionis no longer manipulated by dj-stripe.- New webhook signals are available:
djstripe.signals.webhook_pre_validate(instance, api_key): Fired before webhook validationdjstripe.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_errornow also takesinstanceandapi_keyarguments- Updated deprecated
pkg_resourcestoimportlib.