#luanvdw-paymentmethod

1 messages · Page 1 of 1 (latest)

wild folio
#

hi! in general the default_source field is legacy, and it's not compatible with the current API object for cards(which is PaymentMethods pm_xxx) (hence the error). It's best not to use it at all.

idle pier
#

Thank you for your response. What will be the best way to set the default payment method for a customer then?

I am adding payment methods with setup intents and confirming the setup Intent with stripeJs + Elements stripe.confirmSetup

Since I cannot pass in options to do this with the stripe.confirmSetup method, what would be the best way to set this newly added payment method as the default for a customer?

wild folio
idle pier
#

It would be for subscriptions, and the cards are added before a subscription is created.

So ideally the default payment method would be set before a user subscribed to anything

I think your second route of updating invoice_settings on a customer is what I am looking for. I will quickly try that and see

Thank you for your response, I will confirm in the next few minutes

#

et voila!

#

Worked like a charm,

invoice_settings: {
  default_payment_method: 'pm_123'
}
#

Thank you for your response, I will make a note that we do not use default_source on a customer

#

thanks!