#Desa
1 messages ยท Page 1 of 1 (latest)
Basically- I have an element that shows stored payment methods associated with a stripe customer.
That element has an edit button that toggles the PaymentElement.
When someone clicks that edit button, I want the payment element to open to the payment method type that is selected. (I have this data available, just unsure how to pass it into the PaymentElement)
Checking on this and will circle back in a few minutes
Are you creating a Payment Intent in this case? Or are you deferring the Payment Intent until later?
I'm using it later, at this state there is no payment intent, but only a setup intent.
Ah! Okay, so you could set the payment_method_types explicitly on the Setup Intent that you're using to setup the payment method: https://stripe.com/docs/api/setup_intents/create#create_setup_intent-payment_method_types
once you feed that Setup Intent's client secret into the Payment Element, it should show only the payment method types you declared
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Well it needs to be kinda dynamic, because this is basically a payment page so i have both the payment element AND the saved payments, with basically a switch. So i just want to control the UI of it to pre-select
I still need multiple options
๐ stepping in for my teammate! I'm not sure I follow your use case for creating both a PaymentIntent and SetupIntent. Can you share more about this?
So we need a user to be able to both create payment methods or use a stored payment method. here is what it looks like.
I want to pre-select an option in the form, based on the payment type that is selected if they click 'edit' because it will be replacing that method in our UI, so we're just basically adding a new one, and soft deleting it on our back end.
Sorry for the really long delay. I'm still not quite sure I follow. Have you looked into the deferred PI creation flow? https://stripe.com/docs/payments/accept-a-payment-deferred?type=payment