#vincent_react-update-elements

1 messages ยท Page 1 of 1 (latest)

nocturne flameBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

oak garnet
#

๐Ÿ‘‹

keen wolf
#

Sorry but this is really vague. Can you be much more crisp about what exact options you are trying to pass and what parts you need to be dynamic?

oak garnet
#

I can be more specific.

#

I avoided saying this becaues last time i got shut down ๐Ÿ˜

The property in question is customPaymentMethods

#

and it is not supported on the update funciton

#

i understand that it is a beta feature and this channel is not supposed to discuss it

#

but our inability to update the element to conditionally show the custom payment method significantly complicates things for us.

#

to flesh it out a bit more, we want to only show teh custom payment method if the user only selected one-time purchases. if they add a subscription product, the custom payment method should not be available.

keen wolf
#

You are right, we don't discuss betas here.

Why don't you defer the instantiation of the <Elements> component until you know what values you should specify?

oak garnet
#

my understanding is that it is supposed to wrap as much of the entire react app as possible for fraud detection purposes

#

we also have two places where someone can check out. one using express checkout, the other with the payment element

keen wolf
#

Unfortunately there is no way to update the Elements wrapper without using elements.update()

oak garnet
#

i see. so if <Elements> was rendered once, and the user does not refresh, changes state so the options object should change, the elements would not be re-rendered with new options?

#

just trying to be extra clear since this constraint greatly increases scope for us and i dont want to do all that work based on an incorrect assumption

keen wolf
#

If you change the value of the options object without calling elements.update() or re-creating the <Elements> provider, nothing in the Stripe Elements object will be changed.

oak garnet
#

got it. thank you.

#

thank you for clarifying. i appreciate your help.

keen wolf
#

Sure thing! I realize it might not be the ideal situation but it's definitely smart to clearly define the boundaries and limitations of your problem space.

Also, you can write in to Stripe Support to express interest in any ongoing betas that might impact this functionality. https://support.stripe.com/contact

oak garnet
#

thank you very much!

keen wolf
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚