#YTB-Setup-Intent
1 messages · Page 1 of 1 (latest)
Hi there! Just to clarify, you are using a SetupIntent because you want to take future payments and not create a payment immediately? If you are creating a payment immediately then you shouldn't use SetupIntents -- you can use setup_future_usage with a PaymentIntent to save the card for future use as well.
I would like to create payment later on. The payment I'm trying to make now is just for testing purpose
Yes
When you passing clientSecret above, it is an object like clientSecret: 'CLIENT_SECRET'?
Have you logged that variable out?
yes to both questions 🙂
And what does the log return?
I got the setup intent
This is the error I got while trying to create a payment: {"error":"Customer didn't authorize the auto-renewable subscription"}
Can you provide the request_Id for that error?
Okay so the SetupIntent is working fine then.
Is it the request_id you want: req_RYJDrqDR6GSo0f ?
That looks like a GET request to retrieve the SetupIntent which was successful.
However, I can look at your account based on that and I'm not seeing any failed requests.
The error you mentioned is also not a Stripe generated error message.
So this error is coming from somewhere in your code I believe.
You're right. Sorry for that. I saw we're throwing this error because the setup intent status is still required_payment_method
Wasn;t the payment method attached from my client?
Trhough Element?
Based on the above request you provided, you never confirmed the SetupIntent so the PaymentMeth won't have been created yet. You need to use stripe.confirmCardSetup() (see https://stripe.com/docs/js/setup_intents/confirm_card_setup) and pass your cardElement to that method.
Yes, from the client. That call will result in the PaymentMethod being created. Take a look at our guide here: https://stripe.com/docs/payments/save-and-reuse-cards-only