#Benoît

1 messages · Page 1 of 1 (latest)

gloomy windBOT
plain shadow
#

👋 happy to help

#

is this for billing?

gusty trout
#

Yes

plain shadow
#

you can update the customer's invoice_settings.default_payment_method

gusty trout
#

Ah great !

#

I'm going to test this

#

(Thank you)

plain shadow
#

did it work?

gusty trout
#

Yes it worked !
Now i'm searching how i could set the card as default when i created it by a token from StripeJs

#

The only solution i found until now is to remove the elder ones before creating the new one

plain shadow
#

why are you still using tokens?

gusty trout
#

🤷‍♂️

#

This code has 4 years, maybe it was the only solution at this time ? I d'ont know

plain shadow
#

actually there is

#

you can use the Customer's default_source

gusty trout
#

Yes i saw this, but it's said : "Provide the ID of a payment source already attached to this customer"

So i can't create the source AND set it as default in the same time, as i don't have the source ID yet

plain shadow
gusty trout
#

Yes that's what i do now, but i searched for a way to do this in a unique API call. That's not possible it seems

plain shadow
#

the first API call is necessary, so you transform the token to a source