#Stripe - double entry problem

10 messages · Page 1 of 1 (latest)

valid nest
#

Sometimes in production, after we have entered the customer's email address, the email form-field kind of resets or deletes the email and then if we proceed the checkout and finally submitting the payment 2 different payments arrive at Stripe Dashboard. See screenshot (in the screenshot somehow at the successful payment shipping costs are not included... thus the different amounts). Any tips what we're missing?

#

Stripe - double entry problem

versed topaz
#

I would advise to create payment sessions only after email form is filled out.

valid nest
#

Where exactly is the 1st payment session triggered? I think I remember that I read in the docs that the payment session by default is created as soon as the checkout page is entered...

versed topaz
#

That depends on your choice. I don't remember how it is in the starter. I do it onBlur when email is filled out.

#

Beforehand i check with yup if it is a proper email.

#

You run create payment sessions endpoint when email is filled. This way it works for me properly

valid nest
#

Yep, so the problem basically was the useEffect with the initPayment() from useCheckout() in the Medusa Payment Component from the NextJs starter package. Removed it and now everything works as intended (as far as we can see).

versed topaz
#

Maybe you could also add in that if statement cart?.email