#Rahim Dobani
1 messages · Page 1 of 1 (latest)
yess
I want to update card that is attach to a customer
one more question is card element deprecated?
or soon to be deprecate?
I want to update card that is attach to a customer
So the customer already has a saved card, and you want to update it? What exactly do you want to update?
one more question is card element deprecated?
Yes, we recommend using Payment Element which is more powerful. But the Card Element still works.
I have this ui. when user put all card detail i just need to attach this card to existing user how this is possible.
i am using payment element
I'm guessing you are creating a PaymentIntent?
Then you need to set setup_future_usage when you create the PaymentIntent in order to be able to reuse the card later. https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
const card = await stripe.customers.createSource(
'cus_9s6XGDTHzA66Po',
{source: 'tok_mastercard'}
);
how to use this api using payment element?
This is a very old integration that we don't recommend using. You cannot use this with the Payment Element.
If you want to use the Payment Element, you should follow this guide: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements