#umethi

1 messages · Page 1 of 1 (latest)

lyric kayakBOT
normal obsidian
#

Hello!

#

@mild palm Please use the this thread I have open for you

#

You should be using default_payment_method. default_payment_method will take precedence over default_source (which is the older, legacy param we don't recommend using anymore) - we mention this in the API reference (https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method)

mild palm
#

Thank you!

#

Are we able to test this in test mode with this default_payment_method key?

#

The cards I'm using in test mode always output the **default_source ** key

normal obsidian
#

Yes, you should be able to use default_payment_method in test mode

mild palm
#

When I'm updating a PAST_DUE subscription's payment method, the subscription.updated event's previous attributes only show default_source

normal obsidian
#

Can you share one of those event IDs with me?

mild palm
normal obsidian
#

Ah, you're doing this through the dashboard , not the API?

mild palm
#

Correct through the Dashboard

normal obsidian
#

I don't know the details of the dashboard logic (it sometimes uses default_payment_method and sometimes uses default_source)

#

Backing up for a second - what is your handler doing? Are you checking the customer.subscription.updated event to see if the default has been updated and then paying the invoice if it's been changed?

mild palm
#

Correct

#

If the subscription is PAST_DUE and the default payment method has changed

normal obsidian
#

Gotcha - so then you need to be checking for ALL the places that can affect the default payment method/source

#

There's four (I know it's a lot):

  • default_payment_method on the Subscription
  • default_source on the Subscription
  • invoice_settings.default_payment_method on the Customer
  • default_source on the Customer