#wilem121982013
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- wilem121982013, 14 hours ago, 41 messages
- wilem121982013, 17 hours ago, 40 messages
- wilem121982013, 18 hours ago, 4 messages
everything is on the thread above
i integrate a stripe form with PaymentElement component but when i arrived to my form which is the last step of my checkout the form load, i focus an input and then i blur it and ir refresh my form, not my page only the form and then it's fine
i reintegrate the form in a new clear project and it's working fine
i think the issue is that i have my loadStripe in my checkoutForm but i need it here so i can set up the Element Component with the load stripe and my options which is the currency and the clientSecrets
Sorry, I still don't follow. Is there a bug in your React component?
i have this
const StripeForm = () => {
const { user } = useUserSession();
const stripePromise = loadStripe(STRIPE_PUBLIC_KEY);
const options = {
currency: "eur",
clientSecret
};
return (
<Elements stripe={stripePromise} options={options}>
<CheckoutForm />
</Elements>
);
};
i load stripte here cause i need the client secrets
but i think it's bad and thats what make my form rerender
It's best to loadStripe outside of the react component.
yeah but i can't understand how i'm supposed to access the client secrets then
event when i put it outside on the top of my file its still rerender
i just dont understand what happens
is my Elements component the problem ? should i put it in my app.jsx file ?
Why would it re-render?
that's my problem i dont know why
Could you try to carefully follow the guide here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
i have a backend where i do the payment intent, and i need to pass a uuid so i cant load it in the app.jsx since i have to access to the user id
need to pass a uuid
What UUID?
in your documentation you have this
i also have this in my backend but i have to link the client secret to my user that i created in my database
the backend dev that made this in our backend ask the front to pass the uuid
What UUID?
when a new customer come on our checkout, we create a a user with a uuid that we stock in our db and i use that uuid in the intent api call to link the clientSecret in our database
you could add metadata to the PaymentIntent you create. Is that what you're looking for?
no its not that
when i create a checkout on my website it create a userSession with a uuid in it and we can have multiple checkout at the same time so we need to identify which user is doing a payment in our backend
metadata should help with that then.
your backend will recive webhooks for example, and those contain the metadata. Or you can retrieve the PaymentIntent object based on the ID(which is returned in multiple places in the integration) and check the metadata
i'll try but i wanted to prevent to touch to the backend