#Naqet-Customer

1 messages · Page 1 of 1 (latest)

hushed relic
median comet
#

But in the docs in source info there is this information. I have token with card details etc. and I would want exactly the same behaviour as the one listed here.

When creating new card token I do not have ID of payment method. I would need to fetch it after adding new source, and delete it manually.

I just want to replace old card with new one if that makes sense. And this source info does exactly that

#

Does it not work or do I make something wrong?

#

Because new card is added, but is not replacing the old one. This is main problem right now.

hushed relic
#

Hmm looks like it should replace the old one then. Could you provide the request Id that didn't work for you?

hushed relic
#

Hi, I think for this customer cus_KAcXdU1cE5qLHR, it has the source tok_1JglSyHtsP0GbMaLGiAyiQY9 you set as default source

median comet
#

The second card was added via token, and it is not set as default

hushed relic
#

Did you add the 4199 one before or after the request req_wZNvtUngZqtjQD?

median comet
#

Is has been added with stripe.customers.update function.

I just added source attribute to the request and it was added. If I understand correctly, it should have replaced it with the default card, but it did not

hushed relic
#

Hi, I can't know which object related to that 4199 card. Could you provide the request id that you attach that card?

median comet
#

tok_1JglSyHtsP0GbMaLGiAyiQY9 this token had all information about the card

#

req_wZNvtUngZqtjQD this request was made with stripe.customers.update

#

and it added new payment method

#

But for some reason it did not replace the old one

#

req_ohijrJ68hV864o this request created the token that I used after

hushed relic
#

Sorry for late response. Yes I can see the 4199 should be the default, and from our end I can confirm it's the default as well

hushed relic
#

the 1052 is an older Card, correct?

median comet
hushed relic
#

Hi, sorry I have to run for today. Let me ask @humble glen for help you in further

humble glen
#

so note that updating the customer and passing source only replaces other sources/cards/legacy objects

#

if the customer has an invoice_settings[default_payment_method] and PaymentMethods pm_xxx (as that one does), those are completely unaffected

#

just ignore Sources/Cards/Tokens, they're legacy! were you using them before today or did you just start using them because you saw in the docs that customer.update(source=xxx) replaces cards and it's what you wanted?

#

if you're not actually working on a legacy integration that already has customers with card_xxx s, just ignore that part of the API(and the source and default_source fields on the Customer object), it's legacy and irrelevant to you!