#InstaTrigger

1 messages ยท Page 1 of 1 (latest)

orchid stagBOT
nocturne hound
#

hello! can you share the customer id?

clever geyser
nocturne hound
#

can you share your code to retrieve the default payment method for this customer?

clever geyser
nocturne hound
#

can you also paste the response? i assume this is in test mode and there's no sensitive data

clever geyser
nocturne hound
#

the bank account is there in the default_payment_method

clever geyser
#

Do I need another call then to determine if that paymetn method is a card or bank? When it is a card it will tell me "card"

nocturne hound
clever geyser
#

ok thanks I will try that. Can I reply to this chat later on to continue it or would I start a new one?

nocturne hound
#

this thread will be closed after a while, if it's still open when you're back you can continue here, otherwise you can ask again in the main channel ๐Ÿ˜„

clever geyser
#

OK I got it to work. Is there a reason why when a customer sets their default as a card it uses default_source but when it's a bank it uses invoice_settings.default_payment_method ?

steep wraith
#

Hi @clever geyser I'm taking over

#

Are you setting the default_source or invoice_settings.default_payment_method by yourself or through any 3rd-party plugin?

clever geyser
#

by myself in the Stripe dashboard for a test customer

#

by clicking the customer and going to add a payment method

steep wraith
#

OK, so you created it from Dashboard.

#

The Dashboard is still using Sources API for card payment methods, and that's why it set it to default_source.

clever geyser
#

So when I go live my customers will only use the portal to add their payment method, so I should expect that same behavior?

steep wraith
#

If i remember correctly the billing portal uses PaymentMethod API and set the default payment method to invoice_settings.default_payment_method. You can test it out yourself in test mode.

clever geyser
#

Well now the problem is if I first set their default to card, then add a bank account and make that the default, I can't tell which is the actual default the customer wants as this is produced

#

basically showing both default_source and invoice_settings.default_payment_method are filled

steep wraith
#

Can you tell what you want to achieve here? or what problem are you trying to resolve?

clever geyser
#

I'm trying to determine what a customer's default payment method is so I can decide if I need to charge their card or do a payment intent to charge their bank

#

I use the charges API for cards and payment intents for banks since I guess you can't use charges for banks

#

They enter their default method on the portal but I'm not using a Checkout session

steep wraith
#

You can use PaymentIntents API for both cases.