#victorconnexion
1 messages · Page 1 of 1 (latest)
Can you share the customer ID (cus_xxx)?
The default payment method is set under default_source instead of invoice_settings.default_payment_method
thanks
No problem! Happy to help 😄
question , why default_source is incorrect?
now they both refer to the different id
default_source: 'card_1OFrJ8EDHsfYjXUPkuiWZyCw',
invoice_settings: {
custom_fields: null,
default_payment_method: 'pm_1OEpNPEDHsfYjXUPHxxdGZ6e',
footer: null,
rendering_options: null
},
{
id: 'cus_P2v6QBqJ8YQzTI',
object: 'customer',
address: null,
balance: 0,
created: 1700555111,
currency: 'usd',
default_source: 'card_1OFrJ8EDHsfYjXUPkuiWZyCw',
delinquent: false,
description: null,
discount: null,
email: 'portatest@gmail.com',
invoice_prefix: 'B5D97FE9',
invoice_settings: {
custom_fields: null,
default_payment_method: 'pm_1OEpNPEDHsfYjXUPHxxdGZ6e',
footer: null,
rendering_options: null
},
livemode: false,
metadata: {},
name: 'CXZ:117184:FC9CA381',
next_invoice_sequence: 2,
phone: null,
preferred_locales: [],
shipping: null,
tax_exempt: 'none',
test_clock: null
}
What do you mean by default_source is incorrect? Can you share what you're trying to achieve here?
I want to find out the correct default payment id
When Stripe attempt to charge to a customer on his/her default payment method, it will look at invoice_settings.default_payment_method first, then default_source
In this case, we will look at the one on invoice_settings.default_payment_method which is pm_1OEpNPEDHsfYjXUPHxxdGZ6e
default_source is the older integration and some interfaces on Stripe still uses it. So it's possible to have two different values. The order will be invoice_settings.default_payment_method first, then default_source
ok, thanks