stripe-firebase-extensions icon indicating copy to clipboard operation
stripe-firebase-extensions copied to clipboard

Allow mapping one Firebase User to many Stripe Customers

Open lorenzfischer0 opened this issue 2 years ago • 0 comments

Feature request

  • Extension name: firestore-stripe-payments

Is your feature request related to a problem? Please describe.

We're building a site where one user (Firebase Auth User) might represent multiple businesses/ billing adresses and therefore needs to be connected to more than one Stripe Customer. At the moment this isn't possible as far as I know.

Describe the solution you'd like

It would be lovely, if customers/{uid} wouldn't have to be the uid of the current user, but could be any id. At the moment this doesn't seem to be possible, since youre also using the uid to check whether the user is allowed to access the customer portal for example. This could be solved by adding a uid field to the customer doc and updating the security rules accordingly, but there is probably a smarter way.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered. Alternatively it would be great if each customers/{uid} would have a collection inside allowing for multiple Stripe Customers. Like users/{uid}/customers/{id}. This way the authentification wouldn't need to change much (I think).

lorenzfischer0 avatar Sep 14 '22 15:09 lorenzfischer0