#yassineh
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- yassineh, 1 day ago, 20 messages
hi! depends how you integrate, but for example https://stripe.com/docs/payments/build-a-two-step-confirmation could do that
this seems complicated, my reason for getting the paymentMethode id is to store it in the parent stripe account's customer.. and use it to pay the connected account with a new customer (where i wont store the paymentMethod), is this the right approach for that
ah ok, clearly there's a whole bunch of context here(like you're using Connect, and using https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods 🙂 )
ultimately most of what you're describing is backend actions so I don't think 'getting the PaymentMethod ID from the PaymentElement' is overall the right concern.
The PaymentMethod ID is always available, or example in payment_intent.payment_method after a payment, overall it depends exactly what code you have and what it's trying to do.
the problem i have goes deeper, the current implementation creates the paymentIntent when the pay button is pressed, i have been trying to move to paymentElements
so i am guessing i would need to move the create payementIntent to before the pay button is pressed, but that would require too many changes, i am trying to avoid that
yeah there are two ways of using the PaymentElement, one where you create the PaymentIntent before loading the page, and one where it can be defferred until after the user completes the PaymentElement form. You can use the 'deferred' flow, it's what my earlier link about a "two-step confirmation" does.
perfect, i will do that, and hopefully not comeback to disturb you hahahhaha, thank you for your time
one last question, i am guessing not all payment methodes are savable?, if so, how can i display the "save payment method" switch input conditionally with a paymentElement
unfortunately I don't think there's a good way to do that when using the 'deferred' integration since we don't support all the options you'd need
generally what you do is you set "setup_future_usage" per-payment method(e.g. https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method_options-card-setup_future_usage) on the PaymentIntent , to say that you only want to save that specific type of method
ok, say i only want customers to store cards
but I don't think you can do that for the deferred flow since it doesn't support the options to pass that, it only accept an overall "setupFutureUsage" so it's all-or-nothing(if you set it, non-savable payment methods types just don't appear). It's a product gap we're aware of.
ok a question about "setup_future_usage", does it store the paymentMethod in the customer payementMethods list, and what about connected account's customers, does it store the payementMethod in both customers?
does it store the paymentMethod in the customer payementMethods list
yes
what about connected account's customers, does it store the payementMethod in both customers?
no, it doesn't do anything specific to Connect. It would save the PaymentMethod to the Customer whose ID you pass tocustomerwhen creating the PaymentIntent(on whatever account that is).