I'm trying like heck to get Stripe subscriptions working with Firebase in a web app. I added Stripe as an extension in Firebase but I'm having some issues here and there.
What's working:
- Stripe and Firestore can talk with each other, so when I log into my web app a user is created in Firestore and then a Stripe webhook updates that Firebase user's information to include a couple of pieces of data, like the
stripeId
andstripeLink
. A Stripe customer is also created in Stripe.
Stripe Customers View:
- When I create a subscription directly on Stripe's website, the user's information gets updated with the
payments
andsubscription
subcollections. This does not happen when I do this in the web app.
What's NOT working:
After the user logs in, goes to the payment page, and submits their payment, a new Stripe customer is created. That shouldn't be the case. It should use the already created customer. The bottom customer was already there. The top one was created after checkout.
When a payment is made, Firestore is not updated with the subscription that was paid for. (this is probably because of the previous problem where I have two customers created) Is there a way to let Stripe know to use the already existing customer during checkout as opposed to it making a new one after checkout has completed?