#Priyanka
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
What do you mean by "future payment intent" exactly?
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
You can collect a PaymentMethod and attach it to a Customer for future use, with a SetupIntent: https://stripe.com/docs/payments/save-and-reuse
When you create a PaymentIntent in the future, you attach the Customer and the saved PaymentMethod.
yes but what is the best way to set certain payment method as default one in Stripe?
What do you mean by that? Default for a specific Customer?
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?
You can't set a default PM for PaymentIntents, only for Invoices: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
OK how about default_source property of customer
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.
Sources are the same but a legacy concept.
So invoice_settings.default_payment_method is the best way to store default payment method?
for anything?
Yes, just note that for PaymentIntents you will still need to set it explicitly.
True. Understood.
SO best way would be to set it in invoice_settings.default_payment_method and get it while payment intent
Yes
Thank you
Also will it be ok if I set default payment method id in default_source property of customer?
No, Sources is a legacy concept so I would refrain from using it in new integrations. It might be deprecated at any time.
OK thank you.
Happy to help!