Hello! I'm looking for help understanding how I can integrate Stripe Payment Links with Retool.
My goal is simple: I want a form to add a coach to a database after payment. This form will include several fields and an email address (used for payment). The process should involve a button that opens a Stripe payment URL. After the payment is successful, I need to use the email address provided during the payment to add the coach to the database.
My problem lies with the Stripe integration. I've tried reading the documentation, but I'm not sure how to implement this specific part. I have correctly set up the Stripe API and everything else, but I'm stuck on this final step.
Just to clarify, is the issue that you are unable to redirect the user to a Stripe Checkout Session at another URL?
Or that you are not able to access the email from the form in Retool to add into the database?
I just checked the Stripe API docs and it appears that if you want to open up a Stripe-hosted payment page (i.e., a Stripe Checkout session), you use the endpoint
POST /v1/checkout/sessions
This endpoint of the API creates a Checkout Session, which includes a url field. Redirecting the user to this URL takes them to the Stripe-hosted payment page. The URL will be in the Stripe server's Response and look something like this in the JSON
So on button click in the form, you would fire this query, get the response and then redirect the user to this checkout page. I would guess that once the payment is completed, the API would return some kind of success response.
Then once you get that payment conformation, you can add the email from form1.data.email to your database with a post request.
Is the issue that you need to pass form data to the Stripe page? It appears that the Stripe API also has a Payments Intents API that is able to complete transactions directly from a JSON payload. Which you could create via a Retool Query and passing in the data from the form component!