Closed layby42 closed 5 years ago
UPDATE: I've looked at Source (CustomerParams), but it does not look like it supports Payment Method
@layby42 objects with the id pm_123
are PaymentMethod objects: https://stripe.com/docs/api/payment_methods/object
This is a new abstraction that is entirely separate from the Card or the Source objects.
When you have a PaymentMethod, you can pass its id in invoice_settings[default_payment_method]
instead.
@remi-stripe thanks. so even if payment method type is "card" it cannot be default card for customer unless its ID starts with card_
. hm... OK. I'll try invoice_settings[default_payment_method]
Correct, because there's the Card object, the Source object of type card and the PaymentMethod object of type card. They are all entirely separate objects.
If you are now using PaymentMethods you should ignore the default_source
field moving forward.
looks like a bug, but I'm not sure:
Customer has a number of cards returned by PaymentMethods. One has ID
card_XXXX
(created using old-way Stripe Token), another has IDpm_XXXX
(created via Setup Intent -> Payment Method Confirmation -> Payment Method attached to customer).I have no problem change customer's default card to "old"
card_XXXX
(using DefaultSource=card_XXXX
), but attempt to change it to "new"pm_XXXX
(using DefaultSource=pm_XXXX
) results inNo such source: pm_XXXX
error.Should it be possible to make Payment Method default for customer? How?