- Added Django management commands to pull data from Stripe. Use `python manage.py pull_stripe` to fetch and update Products, Prices, Customers, and Subscription data. - Added more attributes to SubscriptionItems API to include attributes such as product name, price nickname.
1.1.1
Bug fix: Subscription event handler was not properly updating the SubscriptionItem table when a price plan is deleted from a Subscription.
1.1.0
The Subscription model now has a foreign key pointing to the StripeUser model instead of the Django User model. This reduces the coupling across the application.
Migrating from older version: you will need to drop all drf-stripe tables and run Django migrate command again to recreate new ones.
Added convenience methods to the StripUser model:
property def subscription_items(self): """Returns a set of SubscriptionItem instances associated with the StripeUser"""
property def current_subscription_items(self): """Returns a set of SubscriptionItem instances that grants current access."""
property def subscribed_products(self): """Returns a set of Product instances the StripeUser currently has""" return {item.price.product for item in self.current_subscription_items}
property def subscribed_features(self): """Returns a set of Feature instances the StripeUser has access to.""" return set(chain.from_iterable(item.price.product.linked_features.all().prefetch_related("feature") for item in self.current_subscription_items))
1.0.1
Added new endpoint for listing Stripe SubscriptionItems, updated README regarding Feature.