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
andVerificationReport
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 webhookstolerance
model field.
Breaking changes
- Remove legacy JSONField support. This drops support for installations with the
DJSTRIPE_USE_NATIVE_JSONFIELD
setting set toFalse
.
NOTE: No migration path is available yet.
#1820 - Remove
djstripe_sync_plans_from_stripe
command (deprecated in 2.4.0).
Usedjstripe_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 toSubscription.update()
(Use Stripe's
proration_behavior
argument 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
createdRefund
object is now returned as opposed to
theCharge
object. - Resolved ambiguity between
LineItem
andInvoiceItem
models. We previously
assumed that thelines
List object onInvoice
andUpcomingInvoice
models only
returnInvoiceItem
objects. MoreoverLineItem
objects can also be of type
subscription
if the user adds a Subscription to theirInvoice
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 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_error
now also takesinstance
andapi_key
arguments- Updated deprecated
pkg_resources
toimportlib
.