#Priyanka

1 messages · Page 1 of 1 (latest)

glacial streamBOT
pliant briar
#

Hi! Let me help you with this.

#

What do you mean by "future payment intent" exactly?

whole jay
#

I need to create and charge customer using payment intent object. This process happens in the background and customer is not in checkout flow

#

For this I need to set default payment method

pliant briar
#

When you create a PaymentIntent in the future, you attach the Customer and the saved PaymentMethod.

whole jay
#

yes but what is the best way to set certain payment method as default one in Stripe?

pliant briar
#

What do you mean by that? Default for a specific Customer?

whole jay
#

customer A has 4 cards on his stripe account. I want to set 3rd card as a default one.

#

What's the best way to set and also retrieve it as a default payment method

#

You there?

pliant briar
whole jay
#

OK how about default_source property of customer

pliant briar
#

For PaymentIntents, you will need to explicitly set the PaymentMethod, but you can just take the one from Customer's invoice_settings.default_payment_method.

pliant briar
whole jay
#

So invoice_settings.default_payment_method is the best way to store default payment method?

#

for anything?

pliant briar
#

Yes, just note that for PaymentIntents you will still need to set it explicitly.

whole jay
#

True. Understood.

#

SO best way would be to set it in invoice_settings.default_payment_method and get it while payment intent

pliant briar
#

Yes

whole jay
#

Thank you

#

Also will it be ok if I set default payment method id in default_source property of customer?

pliant briar
#

No, Sources is a legacy concept so I would refrain from using it in new integrations. It might be deprecated at any time.

whole jay
#

OK thank you.

pliant briar
#

Happy to help!