I have implemented Google OAuth 2.0 with Streamlit, and now I want to use Stripe as a payment processor.
Are there any people here who have implemented a payment processor with Streamlit? Not necessarily Stripe, although that would be great, considering it’s my current implementation.
I would like to know how you managed the payment states provided by Stripe. How can I capture the information whether a payment has been made or not? I’m a bit stuck at this stage. Perhaps you can guide me towards some specific resources for Streamlit. Thank you very much!
You can definitely integrate Stripe with Streamlit via the Stripe API – have you checked out Stripe’s API docs? I’d imagine that after a payment has been completed, you’d want to store that info using session state.
Hi @Caroline I’m looking to do something similar to @Cosmin_Andrei with Stripe. Is there a step by step tutorial available somewhere demonstrating how to do something like this:
User uploads a file or types in a URL link etc. and hits Submit button
User goes through Stripe payment workflow
Upon notification of successful payment, Streamlit displays a custom response based on the file or URL the user input
Thanks @Caroline ! @Tyler was super helpful as I was building a custom implementation for my Streamlit app.
For anyone curious, my requirements were:
I needed to accept one-off (not subscription) variable-priced (meaning they’re not set prices known in advance) payments via Stripe
I needed Stripe to redirect back to the app upon payment completion so that the product can be delivered after the app has verified that the payment went through
For me the best solution turned out to be Stripe Checkout. Its API allows you to generate a Checkout session at any price, store arbitrary metadata in the Checkout object, and specify a redirect URL upon successful payment.
So what my app now does is:
User puts in a podcast URL they want to summarize
App calculates a price and generates a Stripe Checkout session with a custom transaction ID (which is included in the Checkout metadata object)
User fills out the Stripe payment form
Stripe redirects back to the app with a query param that includes the transaction ID
App hits Stripe API to find Checkout session with matching transaction_id in the metadata object
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.