dj-stripe automatically syncs your Stripe Data to your local database as pre-implemented Django Models allowing you to use the Django ORM, in your code, to work with the data making it easier and faster.
This release removes a migration which caused a crash in certain cases.
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.
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.
LineItem
model.Discount
model.SourceTransaction
, VerificationSession
and VerificationReport
models.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.DJSTRIPE_USE_NATIVE_JSONFIELD
setting set to False
.
NOTE: No migration path is available yet.
https://github.com/dj-stripe/dj-stripe/issues/1820
djstripe_sync_plans_from_stripe
command (deprecated in 2.4.0).
Use djstripe_sync_models price
instead.Customer.can_charge()
, Customer.has_valid_source()
()DJSTRIPE_PRORATION_POLICY
setting (deprecated in 2.6.0)prorate
argument to Subscription.update()
(Use Stripe's
proration_behavior
argument instead)set_stripe_api_version()
helper function
and context manager stripe_temporary_api_version()
.
The API version is now set on each request individually.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.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.stripe.api_version
is no longer manipulated by dj-stripe.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 takes instance
and api_key
argumentspkg_resources
to importlib
.!!! attention
It is not possible to upgrade to dj-stripe 2.7.0 from versions older than 2.4.0.
To upgrade from an older version, first upgrade to dj-stripe 2.4.0.
This release focuses on Webhook Endpoints. For more information on the reasoning behind the changes, please see the discussion on Github:
https://github.com/dj-stripe/dj-stripe/discussions/1437
DJSTRIPE_WEBHOOK_URL
setting is deprecated. It will be removed in dj-stripe
2.9. It was added to give a way of "hiding" the webhook endpoint URL, but that is no
longer necessary with the new webhook endpoint system.djstripe.middleware.SubscriptionPaymentMiddleware
DJSTRIPE_SUBSCRIPTION_REDIRECT
settingDJSTRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS
settingNOTE: It is not possible to upgrade to dj-stripe 2.6.0 from versions older than 2.3.0. To upgrade from an older version, first upgrade to dj-stripe 2.3.0.
djstripe_sync_models
.jsonfield
-based JSONField
is deprecated and support for it
will be dropped in dj-stripe 2.8.0. django.models.JSONField
is available since
Django 3.1.0. To switch to the newer JSONFields, set DJSTRIPE_USE_NATIVE_JSONFIELD
to True
. Set it to False
to remain on the jsonfield
-powered text-based fields.
A manual migration is necessary to convert existing databases from text to json.DJSTRIPE_PRORATION_POLICY
setting is deprecated and will be ignored in 2.8.
Specify proration_policy
in the Subscription.update()
method explicitly instead.Customer.can_charge()
is now deprecated. This was a very misleading method which
resulted in incorrect behaviour when Customers had multiple payment methods. It will
be removed in dj-stripe 2.8.0. You can use Customer.payment_methods.all()
instead.Customer.has_valid_source()
is deprecated and will be removed
in dj-stripe 2.8.0. You can use Customer.sources.all()
instead.DJSTRIPE_USE_NATIVE_JSONFIELD
now defaults to True
. If you previously had it set
to False
, or did not have it set, you may want to explicitly set it to False
in
order to support a pre-existing database. A migration path will later be provided
for this use case.get_stripe_api_version()
helper function has been removed.djstripe.settings.djstripe_settings
(as opposed
to top-level in djstripe.settings
)Customer.subscribe()
method no longer accepts positional arguments, only keywords.charge_immediately
support in Customer.subscribe() has been removed (deprecated
in 2.4). Set collection_method
instead.at_period_end
argument to Subscription.cancel()
now defaults to False
,
instead of the value of DJSTRIPE_PRORATION_POLICY
.WebhookEventTrigger.stripe_trigger_account
.djstripe_sync_models
.InvalidStripeAPIKey
if the API key looks completely incorrect.Customers
can now be subscribed to multiple prices and/or plans by passing the items
argument
to Customer.subscribe()
.Customer
to the
Customer
instance specified by the djstripe_settings.SUBSCRIBER_CUSTOMER_KEY
.This is a release candidate for dj-stripe 2.6.0. Please see here for release notes.