#notlit-Setup Intent
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
when you create a SetupIntent you can't use the confirm:true param unless you pass a payment method id which is usually a discouraged approach
instead, remove the confirm: true from your backend code
once the SetupIntent is created, send the client_secret to the front-end
use it with Elements
and confirm the Setup Intent using stripe.confirmSetup
you can read more about this here https://stripe.com/docs/payments/setup-intents
alright thanks
let me know if you need any more help
ah but the documentation for it is not present of confirmStep in python
confirmSetup is on the front-end
not the back end
sorry I should have been more precise
nah its all good
let me know if you need any more help
actually you didnt got me, i was trying to confirm a setupintent with python in vs code for testng purposes it throws me the error i showed i was asking the fix for that
@unique juniper
Hi! I'm taking over this thread.
Can you share the request ID of the error you get?
Is it this one req_DDIFnpEGgrzCbK ?
Thanks! The error message is pretty clear: "You cannot confirm this SetupIntent because it's missing a payment method."
How do you collect the payment method?
im not currently launched, but im just trying to test the things with python so for now im collecting the payment methods through requests as data
In theory it works like this:
- Create the SetupIntent in the backend
- use the
client_secretof the SetupIntent on the frontent to collect payment with the PaymentElement
This is explained here: https://stripe.com/docs/payments/save-and-reuse?platform=web
But if you are just doing some tests, you can create the SetupIntent with a PaymentMethod directly, something like this: payment_method: "pm_card_visa".
throws me this error when i try to put the payment method as "pm_card_visa"
tripe.error.InvalidRequestError: Request req_xEob97H9Lnyl2Y: You cannot use the test ID 'pm_card_visa' in livemode. If you are testing your integration, please use your testmode API keys instead.
sorry if im being annoying im kinda new
No worries! Did you manage to solve your issue?
not yet,
tripe.error.InvalidRequestError: Request req_xEob97H9Lnyl2Y: You cannot use the test ID 'pm_card_visa' in livemode. If you are testing your integration, please use your testmode API keys instead. throws this error
Right, since you are doing tests, you need to use your test API key, not your live API key.
You can find it in your dashboard here: https://dashboard.stripe.com/test/apikeys
It looks like sk_test_xxx.
ah ok alright thanks for your help
Happy to help ๐
just a final question where can i find the docs about the real api key the one which supports the live key @winged whale
whenever i search on google it just gives me the test api one
docs about the real api key the one which supports the live key
What do you mean? What exactly are you trying to achieve?
im asking for it because, i might need it later for running the actual stripe (not tests) where can i find the docs about that
This is the doc on how to use a SetupIntent properly: https://stripe.com/docs/payments/save-and-reuse?platform=web