Is there a way to implement a pay per use method using Stripe or any other providers?

I’ve seen paywall implementations in most examples (below):

However, I haven’t come across a way to do “Pay $5 to use the service 5 times” type of approach? As opposed to “pay $5 once and get it forever”, or “pay $5 every month and use it forever”.

Any thoughts?

I don’t think this is something that we have an official suggestion of how to implement. However, I can imagine a system that upon Stripe payment adds credits to some postgres db for a particular user that then gets checked and consumed at the beginning of the streamlit app execution.

Hm interesting, I’m not aware of how to get the Stripe Payment to interact with a database. From your insights, would you recommend any “searches” for me to dive into and do research on my own just to get started?