#notlit-Setup Intent

1 messages ยท Page 1 of 1 (latest)

unique juniper
#

๐Ÿ‘‹ 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

tepid eagle
#

alright thanks

unique juniper
#

let me know if you need any more help

tepid eagle
#

ah but the documentation for it is not present of confirmStep in python

unique juniper
#

confirmSetup is on the front-end

#

not the back end

#

sorry I should have been more precise

tepid eagle
#

nah its all good

unique juniper
#

let me know if you need any more help

tepid eagle
#

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

winged whale
#

Hi! I'm taking over this thread.

#

Can you share the request ID of the error you get?

#

Is it this one req_DDIFnpEGgrzCbK ?

tepid eagle
#

req_Gsv7OCJapSDQfs

#

this one

winged whale
#

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?

tepid eagle
winged whale
#

In theory it works like this:

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".

tepid eagle
#

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.

tepid eagle
winged whale
#

No worries! Did you manage to solve your issue?

tepid eagle
winged whale
#

Right, since you are doing tests, you need to use your test API key, not your live API key.

#

It looks like sk_test_xxx.

tepid eagle
#

ah ok alright thanks for your help

winged whale
#

Happy to help ๐Ÿ™‚

tepid eagle
#

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

winged whale
#

docs about the real api key the one which supports the live key
What do you mean? What exactly are you trying to achieve?

tepid eagle
winged whale
tepid eagle
#

alright

#

thanks again