#theswerd-payment-setup-intents

1 messages · Page 1 of 1 (latest)

manic crest
#

No, you wouldn't pass a setup intent into a payment intent. What are you trying to do?

mild ridge
#

so i use a setup intent to collect payment info instead of a payment intent because I don't know the price ahead of time of a purchase

#

and now i'd like to make a payment with the setup intent

#

do i just use the payment method attached to the setup intent?

manic crest
#

Yes, you'd use the Payment Method that was created wen you confirmed the Setup Intent to complete payment in the Payment Intent

mild ridge
#

it isn't working

#

--> Error: The provided PaymentMethod cannot be attached. To reuse a PaymentMethod, you must attach it to a Customer first.

#

even though i've never used it before I'm running into that error

#

should I not be confirming the setupintent

manic crest
#

When you confirmed the SetupIntent did you specify a Customer? if you have a request ID that resulted in the error that would also be helpful

mild ridge
#

req_DQYNIQeINXf8SC

manic crest
#

Yeah, so you never attached that Payment Method to a customer - you have to first do that (which you can do through the API here https://stripe.com/docs/api/payment_methods/attach) before you can use it for payment. Alternatively, if you provide a customer when you create the Setup Intent that should automatically attach it to the customer for you