#Naitik

1 messages · Page 1 of 1 (latest)

graceful tulipBOT
open spoke
gusty bronze
#

any solution for update card number as well?

#

sometimes older card not working then how can we manage it?

open spoke
#

You should create a new card payment method then

gusty bronze
#

How can we change default

#

In code

open spoke
graceful tulipBOT
gusty bronze
#

You are not understading my question.

For ex: 2 days ago I added one credit card and today also I added new one card

You can see both card in above image

Default card is older one I want default is new one

crisp tulip
gusty bronze
#

card = await stripeClient.customers.createSource(customerId, {
source: cardToken,
metadata:{
cardHolderName: req?.body?.businessName,
cardHolderEmail: req?.body?.email,
}
});

name and email not stored

crisp tulip
#

that's an old and deprecated API overall, Sources have been replaced with PaymentMethods for serveral years.

name and email not stored
probably that means your variables like req?.body?.businessName are actually null at runtime. You can add logging in your code to check that, and you can check your Stripe API logs at https://dashboard.stripe.com/test/logs to see what you actually sent us.

gusty bronze
#

Its official document

crisp tulip
#

yep it's part of the API but like I said it's old

gusty bronze
#

okok

#

I want to create a card with name and email can you please send me a example or react code

crisp tulip
#

well the code you shared above would generally work but like I said your variables must be null; so you need to fix that part either way and get that working