#leovenbag

1 messages ยท Page 1 of 1 (latest)

wraith briarBOT
signal helm
#

Have you logged clientSecret and confirm that it's valid?

finite junco
#

Yep

#

Let me do it again

#

It looks ok to me

#

Does it check it against something?

#

I have the public key in place normally as well

#

It's test mode

signal helm
#

Hm... yeah that looks valid to me as well - let me look into a couple of things

#

Quick question - is there a reason you have options wrapped in double braces? So instead of options={{ shouldn't it be options={?

finite junco
#

I think it is standard React syntax {} would define a prop but a {{}} a prop with an object value ๐Ÿค”

#

This is WebStorm's complaint

#

If it were a string for example, it would be ={''} or ='' both would be valid

#

I am really confused, in no place I break away from the main context tree from React... and the Elements component is right above it... big chances something wrong with the secret validation ๐Ÿค”

signal helm
#

ahhh gotcha (sorry reacts not my strong suit)

finite junco
#

Ah no, in the debugger the value isn't there... so it is not updating it somehow

#

No worries, anything let me know and I can explain it if you need ๐Ÿ˜‰

signal helm
#

quick question - why is the code from your most recent screenshot different from the first screenshot? Did you do some refactoring since the first screenshot?

finite junco
#

Yes, I moved it around a bit, but it is still the same component

#

Just to make sure I did screw up somehow, but didn't work either

#

So basically how it works is that I have the flow in three steps, and I would render each one separately, and now I render one Elements for all steps

#

The problem occurs right after I create a customer + subscription + return the client secret, so the step 3 is broken

#

My suspicion is that the options prop did not update after the clientSecret popped up... as you can see the night theme is there still as part of an old state

signal helm
#

When you say you render one Elements for all three steps - does that mean you're rendering <Elements> when you don't have a clientSecret yet?

#

(Since in step 1 I imagine you don't have the Subscription created yet)

finite junco
#

Exactly, I need to have the address to create the customer and then the subscription in step 2

#

I will try something, I will create a separate component and and try to tap into the elements state by using the useElements hook, and wait until the secret is there somehow, let's see

#

Actually I need to have dinner otherwise my wife will kill me, and I don't have a deadline on this... thank you so much!

signal helm
#

Feel free to come back tomorrow/later

#

But i'll leave some thoughts for you to mull over

finite junco
#

Perfect, thank you!