#vitozev-default-pm

1 messages ยท Page 1 of 1 (latest)

polar junco
#

Hello there! That would depends on which API you're using, but generally invoice_settings.default_payment_method is the preferred route for new integrations

rotund heron
#

Thanks! If there are some "old" customers, is it reliable to 1) check the invoice settings for the primary payment method; 2) as a fallback, check for the "default_source"

I'm trying to display the "primary payment method" label in the payment methods list, and I'm curious what would be the best way to check for it.

polar junco
#

Well, in some cases they night not be set at all. Are you using Billing?

rotund heron
#

Yes

polar junco
#

And you're definitely setting the payment method as default to the customer? This will need to be done manually, we don't do that automatically currently

#

In some instances it might be set as the default_payment_method on the Subscription (which takes precedence)

rotund heron
#

Yes, we are setting the payment method as default to the customer, and not on the subscription level. Are there any other cases when the payment method might be missing on a customer level?

#

I also have noticed that if a payment method is set as default to the customer, and then this payment method is removed, the most recent one will be automatically set as a default.

polar junco
#

Are there any other cases when the payment method might be missing on a customer level?
Only if it hasn't been set

rotund heron
#

Thanks! ๐Ÿ™‚

polar junco
#

I also have noticed that if a payment method is set as default to the customer, and then this payment method is removed, the most recent one will be automatically set as a default.
Do you have an example?

rotund heron
#

Can I send the request ID for the detach API call, or additional info is needed?

polar junco
#

Just the Customer ID

rotund heron
#

cus_LI0WBTxUurmSqo (it's a test customer)

#

I added the first payment method as default, then added another payment method; after the first payment method was removed, the last one became a default one.

polar junco
#

Yep, can see that

#

My guess is this is to prevent any interruption in recurring billing

#

If you'd detached the default PM (use for a subscription, for example) then recurring billing would be interrupted

#

So it's probably a safeguard that just 'promotes' the other source attached to the customer if they have an active subscription or something

rotund heron
#

That makes sense! ๐Ÿ™‚

#

Thank you.