#mikealexmartinez_checkout-saving-payment-methods
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/1450157577664200918
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, just making sure I understand your question: are you placing a hold with the payment intent and then trying to update setup_future_usage after the confirm but before the capture? Or are you trying to set this at some other point? Looking in to your options here
yes, I was wondering if it's possible to update setup_future_usage at some point after they press the pay button to attach the used payment method to the associated account.
It looks like that is not possible unfortunately. I just tried and got the error:
This PaymentIntent's setup_future_usage could not be updated because it has a status of requires_capture. You may only update the setup_future_usage of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action.
I am trying to think of what else may help you here. How were you looking to verify that the customer was someone you know from that page?
we didn't want payment methods to be available automatically when they use a payment link to get to the page, as the link could be used by somebody else. So we removed the customerSession from the associated stripe elements (we're using stripes react package). This also seems to remove the ability to save for future use. I was wondering if there was a workaround to get them to be able to save a payment method to the account associated with the payment link we provide. Is attaching a payment method id (after successful capture) to a stripe customer account possible?
The payment_method_redisplay and payment_method_save features are separate, so you can set up the PE to be able to save new PMs to a customer but not redisplay any existing ones if that would be helpful here.
https://docs.stripe.com/api/customer_sessions/create#create_customer_session-components-payment_element-features
are these all dependent on the customerSession being provided and set on the associated elements?
Yes, though that is because I thought you mentioned already having the customer session set up on that page. You could also save a payment method with setup_future_usage which will save the PM to the customer but by default will not set it up to be redisplayed with customer sessions
so there's some instances when we would want options redisplayed (when accessing from authenticated pages) but in this instance, we wouldn't. So I guess that's okay if we setup the session appropriately in each instance
Exactly, you can include payment_method_redisplay on pages where your customers are authenticated and exclude it when they haven't been yet.