I made a subscription using a card, i want to do another subscription with the existing saved card. While subscribing the second time I want to use my previously saved card while the first subscription. I have that card detail from the strip payment method list API
I am creating subscription
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{
price: priceId,
}],
payment_behavior: 'default_incomplete',
expand: ['latest_invoice.payment_intent'],
});
res.send({
subscriptionId: subscription.id,
clientSecret: subscription.latest_invoice.payment_intent.client_secret,
});
and on the UI i am doing confirmCardPayment with stripe for the first subscription
stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: cardElement,
billing_details: {
name: nameInput.value,
},
}
})
I have the list of saved cards in the UI now i want to use the saved card and do the subscription