Closed sampl closed 6 years ago
Stripe subscriptions require stripe customers. Ensure stripe customers exist and are saved to a User on auth login so there’s one for every customer. Get the stripe customer id from the User model when creating a subscription on the backend.
Might have been cool if you could get customer if from stripe API with email, but as expected it looks like you must get with id: https://stripe.com/docs/api/node#delete_customer
On second thought this would break if there’s an email change, so maintaining a map from stripe customers to Firefly users on our side might be unavoidable
Question: how much loading state do we need to add to the subscriptions model to make the UI clear?
done d815a3051e9fbd70ee790f8eedd40b49a6189e2e
had to create stripe users on user create since there's no auth login trigger
there's a stripe_error attr of subscriptions that can be shown to users, should be all the state we need
Users can create subscriptions with stripe checkout. Only cloud functions can mark them as active. DataProvider shows subscription status on the user page.