#elBR

1 messages · Page 1 of 1 (latest)

tired vortexBOT
vivid crater
#

👋 happy to help

#

default payment method and invoice_settings.default_payment_method are 2 separate things

#

one is for one-off payments and the other is for recurring payments

prisma glacier
#

but how can I be shure to check what is the customer default payment method

#

I have just created cards

#

not paid anything yet with them

vivid crater
#

the card/Payment Method is never assigned as invoice_settings.default_payment_method on its own

#

you have to create that link yourself

prisma glacier
#

so I shpuld check default_source?

vivid crater
#

default_source is for one-off payments

prisma glacier
#

I have just created a customer and assigned some cards

#

that all

#

and I see on Stripe a label "default" on one of my cards

#

my question is which field rapresent that default that I see on Stripe

#

I see this

#

I have not created any invoice or subscription

vivid crater
#

ok now I understand the Q

#

would you mind sharing the customer id?

prisma glacier
#

yes

#

cus_MhDEcKBcHGaafm

#

did you check?

vivid crater
#

sorry still looking, discord is a bit busy, I'm on it

#

yes so basically default_source is the "default" card/payment method

prisma glacier
#

ok but why when I use the Stripe dashboard when I remove a payment method that was default it automatically assigns a new default card

#

this does not happen with the API

#

after I detach a paymentmethod from customer

#

and olso in create the first card created becomes default

#

insted on API these do not happen

#

I have to manually make it default

vivid crater
#

there are some behavior differences between the API and the Dashboard

prisma glacier
#

why some payment method id start with src_ some with pm_ and some with card_?

vivid crater
#

it's some legacy code that we keep for backwards compatibility

#

src is for Source, pm for Payment Method and card for Cards

#

but nowadays we should always use PaymentMethods

prisma glacier
#

but I m not understanding because as long as I have payment methods that start with "src", the default moves from one card to another if removed. Otherwise if there are no more cards that strat with "src" the default key does not move but leaves the customer without default payment method

vivid crater
#

sorry I don't follow

prisma glacier
#

If I have 2 payment method whose id starts with "src" and one of them is default, if I remove that default one, the other one gets automatically assigned as default after the removal

#

instead this behaviour does not happen with payment methods that start with "pm"

vivid crater
#

do you mean using the API?

prisma glacier
#

both cases

#

API and dashboard

rancid whale
#

yep, there's no such thing as a default payment method for a customer's one time payment in the new APIs, and they don't use fields like default_source or stuff