#society-paymentelement-nextjs

1 messages ยท Page 1 of 1 (latest)

unkempt dockBOT
wanton valve
#

Hey, thanks for reaching out ๐Ÿ™‚

lime patio
#

society-paymentelement-nextjs

#

Okay so I am not good at Next.js or React and barely understand those. But the error message is quite explicit/clear and says you can't render the element until after you have a client_secret available

#

are you sure process.env.STRIPE_CLIENT_SECRET is correct? Because it's really abnormal to use an environment variable to store a client secret. Like that doesn't really make sense

#

does it work if you hardcode a value?

wanton valve
#

the client secret supposed to be created by a payment intent server-sided or the one from the dashboard?

#

My goal is to create a form where a user can pay and create his account at the same time.
So then, ill process the form data in the server - create a stripe customer and execute the subscription on that user that just got created

lime patio
#

yeah that's not really how any of this works ๐Ÿ˜…

#

You're supposed to create the Customer and the Subscription upfront and use the underlying PaymentIntent that is created for you to confirm client-side

wanton valve
#

there's no way for me to make a form where i can implement even card element? then ill process the data sent from the form and create the customer account and link the subscription?

#

Im trying to make it all in 1 form

lime patio
#

there are many ways to integrate

wanton valve
#

yeah thats kinda confusing ๐Ÿ˜…

lime patio
#

So it depends a lot on what you are doing. But if you are building an entirely new integration I would highly recommend following that guide first