#neil_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1318297459453198378
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, unfortunately there isn't a way to have the customer's default PM automatically updated once the intent is confirmed. You will still need to set the payment method as the default in a separate update customer call
got it, I thought that might be the answer
as a follow up, is there a recommended approach on when you should set the default. I.e. a specific webhook to listen for or something else?
The three events that come to mind are payment_method.attached, payment_intent.succeeded, or setup_intent.succeeded
Question: are you building something where it is optional to set the default? Or are you trying to do something like always set the default to the latest payment method used if a new one is added?
that's a good question. Its optional to set the default!
any specific recommendation based on that^
One thing that comes to mind is that it may be hard to guaruntee that your server knows to set the PM as default when the customer selects it. Like you can send a message to your server whenever that setting is toggled, and that should almost always make it, but depending on your setup it technically might not before the payment intent is confirmed.
One thing that comes to mind there is that with our "finalize payments on the server" flow you could send whether or not to set a PM as the default along with the PM info after it has been tokenized. That could simplify that specific part of this but unfortunately it would still require a separate customer update call after the intent has been confirmed.
https://docs.stripe.com/payments/finalize-payments-on-the-server
And I will definitely file a feature request for this, or add to one if it already exists. I have definitely run in to other users for whom it would be useful to tell the intent to set the default PM on the customer when confirmed.
we do use finalize payments on the server flow. Is there always a payment method Id from the response of confirmation?
I think so but have not been able to test, even for asynchronous payment methods like ACH I think a PM should be created and the intent will go in to a processing state. Can you test quickly with ACH to see if that is how that works? Server is a bit too busy for me to test right now