#Sadeed

1 messages · Page 1 of 1 (latest)

hoary duneBOT
merry atlas
#

Have you tried the List Customer Payment Methods?

serene dagger
#

not yet, we were using only using the sources api before and just randomly came across this issue

merry atlas
#

Sure let's try it to see if you can see other cards over there

serene dagger
#

okay so it is showing there

#

what could be the issue ?

merry atlas
#

Simply that a Customer can have both Source and PaymentMethods. They are 2 different type of information

#

You would want to List both to have the full list

serene dagger
#

okay

serene dagger
#

One more thing, can i retrieve the card id from a payment method or is that a different thing

#

@merry atlas

merry atlas
#

Card Id is a different thing

serene dagger
#

okay

#

can I set a payment method as default ?

merry atlas
#

Yep, set it as Customer's invoice_settings.default_payment_method

serene dagger
#

how would I unset a default source ?

#

since I have to handle both sources and payment methods now. I cant just set one as a default and not consider if the other type was also set as default previously

#

so i need to set one field and unset the other

#

@merry atlas

merry atlas
#

There are 2 fields default_payment_method and default_source. Default Payment Method will take precedence

serene dagger
#

yes that is what i am doing, but when I try to set a source as default it doesn't work since the default_payment_method field is already set.
What i want is a way to unset default_payment_method while i set default_source and vice versa

merry atlas
#

Um not sure but probably if you pass in null or blank it will unset the default_payment_method

#

(please try in test mode)

#

My advice would be deprecate all source if possible

#

it will save you headaches on the long run