#Aliciant - API Upgrades
1 messages ยท Page 1 of 1 (latest)
HI ๐
Our API docs are always based on the most current version
It's a kind of passive aggressive way to get people to stay up-to-date on their version ๐
Ok, so I am trying to store card information on a client's account.
I follow the instructions and it says to setupIntent, collect payment info and then confirmSetup.
But I keep getting an error that says Invalid value for stripe.confirmSetup(): elements should have a mounted Payment Element.
Okay
So in that case you'll want to use a different JS function: https://stripe.com/docs/js/setup_intents/confirm_card_setup
Ok, so I think I'm making progress. I was able to confirm card setup. But it isn't attached to the customer object yet. Do I need to explicitly attached the card to the customer?
Did you create the Setup Intent with a Customer?
yep! I did setupIntent and then the confirmCardSetup
Can you share the request ID for the create setup Intent?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
i see the problem - i think that I am not passing the clientSecret correctly. Here is the request ID: req_RgLZYTZwofBMwA
But in that case, I don't see the correct way to pass the clientSecret
Oh! Actually, I think it worked!
Ok great! I think I'm getting the hang of it.
๐
Thanks so much for your help!
I haven't been able to find any guidance that tells me how to display the card info once it's been saved.
Any thoughts there?
Hello! Catching up now... are you using Payment Methods?
If so there's information on the Payment Method object you can display, such as brand, last4, and so on: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card
I am using the CardElement to capture the information.
I create a setupIntent, then confirmCardSetup
And once that information is saved, I'd like to display the last 4 digits of the user's card
but I don't find anything that tells me how to do that using elements
You don't do this using Elements, you do this using regular HTML.
You fetch the Payment Method server-side and pass the data you want to display to the client.
fantastic! thank you!