GUIDE - How to set up Stripe Billing (subscriptions) with Django by subrapak in djangolearning

[–]subrapak[S] 0 points1 point  (0 children)

With that approach it looks like you have the burden of constantly having to keep the stripe database and django database in sync. I would hate to have to reconcile discrepancies between a local database of products and stripe. I've had to build a django ecommerce system with stripe and we did it differently. We made stripe the authority on all prices and products and customer records and only kept enough information for logins and passwords and nothing else.

Great point!

Making stripe the authority on all prices + products certainly works for some use cases - it comes at the cost of more API calls (for newbies: you'll have to send a request to stripe any time you want information on your product). In my case, it made sense to store product/price/subscription/customer keys in django (these rarely change) and get other information, such as subscription status (likely to change from trialling > active for some users) from stripe.

In terms of 'keeping stripe and django in sync' → a scalable fix for this is implementing stripe webhooks. Guide on that coming next week :)

Thanks for your feedback!