#フランソワ
1 messages · Page 1 of 1 (latest)
Hi there. What's the error you're seeing?
Hi i'm getting
IntegrationError: In order to create a payment element, you must pass a valid PaymentIntent or SetupIntent client secret when creating the Elements group.
so basically i'm creating a subscription and returning the client secret to my front-end and passing it as option into my <Elements> container
within i'm rendering the
<PaymentsElements/>
as far as i understand it this should work, as i've used a react-state to store the client secret, but the <Elements> container is initially rendered without the clientSecret, so i'm wondering it i need to change the approach
Yeah so when you create the Element, you need to already have the client secret passed in
I know you're using react, so it'll look different, but the concept is the same
See what's done in this step: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-collect-payment-details
so its better to remove the <Elements> container from my HOC and only render the elements container after i have aquired the client secret?
Correct
Initialization requires client secret: https://stripe.com/docs/stripe-js/react#elements-provider
Thank you