Closed abierbaum closed 1 year ago
Can you please expand on your use case a bit more? Currently each product can have one claim. So
stripeProductA = premium
stripeProductB = basic
Is already possible.
@thorsten-stripe In want to be able to sell multiple digital products each of which can have separate subscriptions.
So for example:
stripeProductX = AppX Access
stripeProductY = AppY Access
stripeProductZ = AppZ Access
A user could purchase any combination of these applications. But as it stands I don't see a way to setup the firestore-stripe-subscriptions extension to tell me which combination the user has active subscriptions for through the claims.
What I was suggesting above was that it would be useful to specify both the name and value of the claim to association with the product here [1] instead of firebaseRole
. So in my case above I would specify something like:
stripeProductX - metadata: {claimName: 'prod_x', claimValue: 'access'}
stripeProductY - metadata: {claimName: 'prod_y', claimValue: 'access'}
stripeProductZ - metadata: {claimName: 'prod_z', claimValue: 'access'}
And then if someone had multiple levels of access for each product they could add on something like:
stripeProductX_premium - metadata: {claimName: 'prod_x', claimValue: 'premium'}
Did this clarify my use case?
1: https://www.gstatic.com/mobilesdk/200710_mobilesdk/ext_stripe_subscription_post_install.png
@thorsten-stripe Have there been any recent changes that would allow this type of usage? I am still looking for a way to allow people to purchase multiple products with this extensions and know about each of them in the claims.
No change here. The extension still supports at most one claim.
Is this planned? I have the same use case of needing to support different subscriptions (base + multiple addons). Only being able to set a single Firebase role does not allow to model this.
Hey Paul, this is work is not currently planned. I'd recommend setting up a custom firebase function if you need to support multiple claims.
Feature request
firestore-stripe-subscriptions
Is your feature request related to a problem? Please describe.
I have an application backend that needs to support multiple products that can each have a subscription. The current extension supports custom claims as a way to check if a product has an active subscription, but it only works for one product at a time.
See a similar request: https://github.com/stripe/stripe-firebase-extensions/issues/125
Describe the solution you'd like
I think the solution described in https://github.com/stripe/stripe-firebase-extensions/issues/125 seems reasonable. Effectively have some way in the stripe product metadata to specify both the name of the custom claim to provide and the value to use.
Thus if there are two products A and B, perhaps I would configure something that would set claims like:
Describe alternatives you've considered
I have considered adding cloud functions that monitor user subscription documents and modifiy the user claims in my own code. This may work, but it is a bit of complexity I am trying to avoid by suggesting a common shared implementation that everyone could use.
Another option would be to create a new stripe account per product, but that seems like massive overkill for this situation.