#deathnfudge

1 messages ยท Page 1 of 1 (latest)

hazy mauveBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dreamy marten
#

so default_source parameter is for the old Sources API

have you checked customer.invoice_settings.default_payment_method field?

plucky flare
#

I will give that a shot. Thanks.

hazy mauveBOT
dreamy marten
#

๐Ÿ‘

plucky flare
#

That seems to work for bank accounts, but when I check for a customer who has used a card, the card doesn't show up in the invoice_settings even though it shows it's the default method in the billing portal and on our Stripe dashboard. Is there a spot that works for all default payment types?

dreamy marten
#

It depends on how that payment method was stored. if the card was stored using SetupIntents API (pm_xxx object gets generated) and then set as default then it should show up under
customer.invoice_settings.default_payment_method

#

if it was tokenized using a legacy API (not PaymentMethod API, no pm_xxx object was generated) then it would show up under default_source

plucky flare
#

At this point. All our setup/saving stuff is handled by Stripe either using Checkout, Billing Portal, or by us using the Stripe dashboard. The card customer was set when they signed up for a subscription using Stripe Checkout so I guess that maps to the legacy API? Is there any plan to change that in the future?

sly meadow
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needed to step away.

plucky flare
#

Actually, after I'm checking, it looks like we do something in the process of calling the Checkout code that does the tokenized setting of the payment method. Is that method deprecated? Should I look at updating the way we set that in the process of setting up Stripe Checkout?

sly meadow
#

I think there are a couple things to take into consideration here. One being that a default payment method can be set at two different levels, as it sounds like you've discovered. They can either be set as the default for the Subscription itself, or they can be set as the default for the Customer.

Just double checking, you're hoping to set the default payment method/source so that it will be used automatically for new Subscriptions/Invoices that are created for a Customer?

plucky flare
#

Yes. We are looking at being able to use the customer's default method/source for any upcoming subscription renewals or one off invoices.

sly meadow
#

Gotcha, so yeah, you'll want to make sure you're always setting that on the Customer object. I'm double checking whether there is a way to force Checkout to do that for you, but I don't believe there is (offhand I think it sets the default at the Subscription level).

#

Yeah, I would recommend building a flow that explicitly sets it on the Customer object. So after you get a new Payment Method or Source, I would suggest updating the invoice_settings.default_payment_method field on the Customer object. (It can accept Sources as well as Payment Methods, if I recall correctly)

plucky flare
#

Ok. Thanks.

sly meadow
#

Any time!