#Hazim

1 messages · Page 1 of 1 (latest)

proper crystalBOT
turbid canyon
#

const paymentMethod = await stripe.paymentMethods.attach(
setupIntent.payment_method,
{ customer: customerId }
);
const customer = await stripe.customers.update(customerId, {
invoice_settings: "default_payment_method",
});

#

what I do is attach the payment method to the customer

#

then I want to make it as the default payment

lilac heath
turbid canyon
#

Yes but it doesnt work :/

#

I don't see the default tag near the customer payment methods :/

lilac heath
#

Can you share the request id where you made this update request please so I can further debug this?

turbid canyon
#

of course

lilac heath
#

I just tested this and it's working as expected. I think the issue might be that you're not passing the payment method id on the Customer Update request. Your code would look something like this:

const customer = await stripe.customers.update(customerId, { invoice_settings: "default_payment_method": "pm_xcn232", });

#

@turbid canyon give it a try and let me know if that does not work and share the request id for that Customer Update call please.

turbid canyon
#

oh i see

#

its an object

#

god damn it

#

I will give it a try lol

lilac heath
#

Haha!

turbid canyon
#

It works

#

thanks

#

I knew it was something stupid

#

you dev services are really premium

lilac heath
#

Yeay! Glad to hear. I do this all the time too so happy to be the rubber duck here