#Desa

1 messages ยท Page 1 of 1 (latest)

wide minnowBOT
muted hornet
#

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)

grizzled spire
#

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?

muted hornet
#

I'm using it later, at this state there is no payment intent, but only a setup intent.

wide minnowBOT
grizzled spire
#

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

muted hornet
#

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

vital lake
#

๐Ÿ‘‹ 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?

muted hornet
#

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.

vital lake