0

I spent few days reading the doc and watching tutos on how to use Stripe in Firebase to introduce premium content on my website. Except for one thing I don't want to make create a subscription.

I want to make a one-time payment so customers can enjoy a lifetime service.
Using subscriptions with firestore-stripe-payments extension it's pretty straightforward. When the customer buys something and gets redirected back to the app, the user custom claims object contains the stripeRole value equals to whatever you defined in the firebaseRole metadata on a given product.

But that doesn't seem to be an option for one-time payment, I've tried different values and settings but there is nothing in the custom claims object which can help determine if a user purchased the service or not.

Either I am not doing things correctly or there are actually no way to connect both ends without me having to implement a custom function to forward an indicator to the front.

I thank you for any help.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
vdegenne
  • 12,272
  • 14
  • 80
  • 106

1 Answers1

1

Based on the source code, it looks like role is only considered in the subscription context, so what you're describing seems to be an unsupported use case.

You'd need to customize the code to build this functionality.

Nolan H
  • 6,205
  • 1
  • 5
  • 19
  • I need to read that source code more thoroughly, thanks. And I need to try passing metadata during the checkout session creation phase to see if that can help to forward values up to the end-user. It's unfortunate that they haven't implemented that by default, isn't one-time payment a typical case for unlocking services in an application? (that's just like a subscription but without an expiration date in the end...). – vdegenne Jun 16 '23 at 17:25