Releases: dj-stripe/dj-stripe
dj-stripe 2.8.1
This release removes a migration which caused a crash in certain cases.
dj-stripe 2.8.0
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
.
dj-stripe 2.7.2
This is a maintenance release only fixing the installation of dj-stripe on Django 4.0 and 4.1.
Release notes
- Fix installing with Poetry on Django 4.0 and higher
dj-stripe 2.7.1
Release notes
- Remove an enum value generating an extra migration
- Allow Django 4.1 as a dependency (Note: Running dj-stripe 2.7.x with Django 4.1 is
untested)
dj-stripe 2.7.0
!!! 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:
Release highlights
- Webhook Endpoints are now configured via the Django administration.
- Multiple Webhook Endpoints are now supported.
- Webhook Endpoints now have a unique, non-guessable URL.
Deprecated features
- The
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.
Breaking changes
- Remove the deprecated middleware
djstripe.middleware.SubscriptionPaymentMiddleware
- Remove support for the deprecated
DJSTRIPE_SUBSCRIPTION_REDIRECT
setting - Remove support for the
DJSTRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS
setting
Other changes
- Many Stripe Connect related fixes (Special thanks to Dominik Bartenstein of Zemtu)
- Allow passing stripe kwargs in Subscription.cancel()
- Various admin improvements
- Add support for managing subscription schedules from the admin
dj-stripe 2.6.3
Release notes
- Update migrations missed in 2.6.2 (#1819)
- Fix a crash with string representations of uninitialized Card objects
dj-stripe 2.6.2
This is a maintenance release to remove the generation of an unnecessary migration when
running dj-stripe on Django 4.0.
This release does not guarantee Django 4.0 compatibility. Run at your own risk.
Release notes
- Update migrations to be compatible with Django 4.0 (#1649)
dj-stripe 2.6.1
Release notes
- Fix for failing webhooks, usually to do with customer subscriptions (#1588)
dj-stripe 2.6.0
dj-stripe 2.6.0 (2022-01-15)
NOTE: 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.
Release highlights
- Support for Python 3.10 and Django 4.0.
- New models: Mandate, Payout, UsageRecordSummary, WebhookEndpoint (unused)
- Significant improvements and fixes to Stripe Connect features.
- Storing Stripe API keys by adding them to the Admin is now supported.
This allows for use of multiple Stripe API keys (multiple Stripe accounts). - Support for syncing Connect accounts via
djstripe_sync_models
.
Deprecated features
- The use of the old
jsonfield
-basedJSONField
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, setDJSTRIPE_USE_NATIVE_JSONFIELD
toTrue
. Set it toFalse
to remain on thejsonfield
-powered text-based fields.
A manual migration is necessary to convert existing databases from text to json. - The
DJSTRIPE_PRORATION_POLICY
setting is deprecated and will be ignored in 2.8.
Specifyproration_policy
in theSubscription.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 useCustomer.payment_methods.all()
instead.- For similar reasons,
Customer.has_valid_source()
is deprecated and will be removed
in dj-stripe 2.8.0. You can useCustomer.sources.all()
instead.
Breaking changes
- Python 3.6 is no longer supported. The new minimum version of Python is 3.7.12.
- Django 2.2 and 3.1 are no longer supported.
DJSTRIPE_USE_NATIVE_JSONFIELD
now defaults toTrue
. If you previously had it set
toFalse
, or did not have it set, you may want to explicitly set it toFalse
in
order to support a pre-existing database. A migration path will later be provided
for this use case.- The undocumented
get_stripe_api_version()
helper function has been removed. - Settings for dj-stripe are now in
djstripe.settings.djstripe_settings
(as opposed
to top-level indjstripe.settings
) Customer.subscribe()
method no longer accepts positional arguments, only keywords.charge_immediately
support in Customer.subscribe() has been removed (deprecated
in 2.4). Setcollection_method
instead.- The
at_period_end
argument toSubscription.cancel()
now defaults toFalse
,
instead of the value ofDJSTRIPE_PRORATION_POLICY
.
Other changes
- The Stripe Account that triggered an Event is now available on the field
WebhookEventTrigger.stripe_trigger_account
. - Fixed recursive fetch/update loop errors in
djstripe_sync_models
. - Migrations have been optimized and should be faster.
- dj-stripe now checks the apparent validity of API keys used and will raise
InvalidStripeAPIKey
if the API key looks completely incorrect. Customers
can now be subscribed to multiple prices and/or plans by passing theitems
argument
toCustomer.subscribe()
.- Checkout Session metadata can be used to create/link a Stripe
Customer
to the
Customer
instance specified by thedjstripe_settings.SUBSCRIBER_CUSTOMER_KEY
.
dj-stripe 2.6.0 release candidate 1
This is a release candidate for dj-stripe 2.6.0. Please see here for release notes.