#Rahim Dobani
1 messages · Page 1 of 1 (latest)
Any one can help on this?
Hi! Let me help you with this.
What's your use case?
SetupIntetnt is designed to collect a new Payment Method.
yess so how i can make this new card default one?
because when i am creating subscription
its giving me this error This customer has no attached payment source or default payment method.
so i want to make new card default one
i have added a card but can't make it default one
You have to update the Customer and set invoice_settings.default_payment_method to that PM: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
const customer = await stripe.customers.update(
'cus_O4eGaxiPZArPrs',
"pm_1NIUyNAOo6YEPSo0JRTFfQPP"
);
like this?
const customer = await stripe.customers.update(
'cus_O4eGaxiPZArPrs',
{
'invoice_settings': {
'default_payment_method': "pm_1NIUyNAOo6YEPSo0JRTFfQPP"
}
});
thanks working now
Happy to help!