#wilem121982013

1 messages · Page 1 of 1 (latest)

cobalt pecanBOT
#

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.

velvet viper
#

Hi, let me help you with this.

#

What's the bug exactly?

subtle prism
#

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

velvet viper
#

Sorry, I still don't follow. Is there a bug in your React component?

subtle prism
#

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

velvet viper
#

It's best to loadStripe outside of the react component.

subtle prism
#

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 ?

velvet viper
#

Why would it re-render?

subtle prism
#

that's my problem i dont know why

velvet viper
subtle prism
#

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

velvet viper
#

need to pass a uuid
What UUID?

subtle prism
#

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

cobalt pecanBOT
subtle prism
#

the backend dev that made this in our backend ask the front to pass the uuid

velvet viper
#

What UUID?

subtle prism
#

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

hasty hill
#

you could add metadata to the PaymentIntent you create. Is that what you're looking for?

subtle prism
#

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

hasty hill
#

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

subtle prism
#

i'll try but i wanted to prevent to touch to the backend