I allow users to add new cards during the checkout. What happens is that the paymentIntent uses the 'setup_future_usage' option, which automatically attaches the payment method to the customer.
await stripe.paymentIntents.create({
customer: customer_id,
setup_future_usage: 'off_session',
amount: calculateOrderAmount(items),
currency: items.currency.toLowerCase()
})
The problem with this is that it means that the user can enter the same card multiple times, and stripe will attach them all as individual cards to the user. I tried to take off 'setup_future_usage', but it gave me an error when trying to confirm payments saying that the payment wasn't attached to the customer. Does anyone know of a way within the Javascript SDK of making it so Stripe won't save duplicate cards on a per customer basis?