- My goal:
To accept donations via Stripe card payments
- Issue:
I have a Stripe card component and have connected successfully to my Stripe account via the API.
I can't work out how to actually make the payment. The Retool information (Which looks like it comes directly from the Stripe API documentation) says to create the PaymentMethod as part of the PaymentIntent. When I try to do this the PaymentMethod Data does not have "card" listed as a type.
- Steps I've taken to troubleshoot:
I've looked at all the documentation. I've checked that card is an allowable PaymentMethod on my account.
- Additional info: (Cloud)
Hi @jclutterbuck,
Yes a lot of our docs on our Stripe integration come for their docs or point to their docs. It also looks like there are more than one way to 'skin a cat' in this scenario so lets go through what could work for your needs.
From Stripe's docs it seems that Payment Method is what Stripe previously used for their now deprecated and Legacy Charges API.
While Payment Intent is used in the highly recommended and modern Payment Intents API.
The Retool card component which you set up you screenshot will take in a user's card information and return a token. This token should be passed to Stripe's API via a POST request to /v1/payment_intents to create a Payment Intent in Stripe's system.
This API route should be a default option in a Stripe Query to a Stripe Resource which it sounds like you have set up and connected.
Make sure you fill out the Query's Header with the right specifier for your Stripe account and to also fill out the Body with currency
and amount
which can be values taken from a Retool component using {{}} syntax.
Using this method, you're creating and immediately confirming a PaymentIntent
with a card token. This avoids the need to first create a PaymentMethod
, then attach/confirm.
Don't use the Charges API unless you're maintaining legacy code. Stripe recommends all new implementations use PaymentIntents.
Hope this helps and let me know if it works!
1 Like
Thanks Jack, but I'm still a bit lacking.
I'd sort of got this far.
What I didn't have any luck with is matching the "Stripe Token" stripeToken
with any of the API parameters. The Stripe Token doesn't seem to match a PaymentMethod ID and so I don't know what to pass the Stripe Token as or where or how?
Hi @jclutterbuck,
No worries, Stripe has made this way too complex in my opinion as I was doing some more testing and it seems like you are correct in that it is not inherently clear how the newly created token
should be passed in with the Stripe Query 
I was imaging you could add it to the body, but none of the predefined options include stripeToken
but it appears that Retool's Stripe query is outdated and is still pull in body options from the outdated PaymentMethod
API.
It looks like we have an internal ticket to fix that, I can add a +1 to that ticket but it seems to be far down the teams roadmap 
In terms of current options:
- I found this other forum post here about some creative work arounds that a forum power user built out to accept payments in Retool with Stripe.
The gist is that you could use a REST API Resource instead to build your own query, that will pass the token from the component in the query's body as outlined in Stripe's docs here.
The user also builds their own custom component to handle all the logic which is definitely some heavy lifting, but could be a viable option if fully built out.
- Another potentially easier option would be to have a button in a Retool app redirect users to a Stripe hosted checkout page at another URL, as I describe in another post with a user here. This way the Stripe hosted page handles all the code logic and card processing and you don't need to built out a REST API query/resource in Retool to accomplish the same thing.
My guess is that opening this in a new tab would allow the Retool app to stay open and not require a redirect URL.
To be frank, since Retool is made for internal tools, the majority of our Stripe integrations are for getting information and data about a user's Stripe accounts to be used as an internal tool for viewing and monitoring customer payments and Stripe events(such as a dashboard or using a table).
Retool was not created to be an externally facing app that accepts payments. If the above work arounds are not configurable or working as needed and payment intake is a critical part of your app, I would likely recommend another tool which has Stripe Payment accepting integrations as a major feature, such as Wix or Square.