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:
stripeId
and stripeLink
. A Stripe customer is also created in Stripe.Stripe Customers View:
payments
and subscription
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?
The 'checkout' process you're referring to, is it using Stripe Checkout / Payment Links / Pricing Tables ?
If so, that might be why.
If you're using one of the following:
-Checkout in subscription
mode.
-Payment Links / Pricing Tables with recurring items.
Then Stripe Checkout automatically creates a Customer for you.
-With Stripe Checkout, you can disable this by setting your own existing Customer with the customer
argument:
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#handling-existing-customers
-With Payment Links and Pricing Tables, there is no current way to do this.
Hope my hunch is correct about your checkout process or else this is pointless.