#fatcat_api

1 messages ¡ Page 1 of 1 (latest)

wild shellBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1281634346104651826

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

cinder halo
#

Hello

#

Looks like your customer went through Checkout twice here

#

And looks like you are passing customer_email in your Checkout Session creation request so that's why you see two different Customer objects with the same email and each with one Subscription

#

You will need to add validation on your end to not create a new Checkout Session if your customer has already gone through one successfully

robust junco
#

so this is not a bug on our end, like creating multiple checkout sessions on accident, but the customer really put in their contact and payment information twice?

robust junco
#

out of ~260 trials in the last 20 days I've seen this happen maybe once or twice

cinder halo
#

Your code completely controls when a Checkout Session is created

#

So yeah this is all on your end

robust junco
#

ok understood but out of these 2 scenarios, which do you think is more likely:

#
  1. The customer was impatient on the confirm step, and the subscription never confirmed. They tried again and registered again.
  2. One checkout is somehow confirming 2 subscriptions
cinder halo
#

It is 1/

#

You can see from the creation request these happened over a minute apart

robust junco
#

Got it. Yeah when they come back from stripe we update their user with the subscription we get back. If you close that window it never confirms

cinder halo
#

My guess is that your customer closed the Checkout screen after hitting the "pay" button and then thought it didn't complete

#

So they went through the flow again

#

Yep you want to use Webhooks here instead

#

You shouldn't be relying on the client-side redirect for that

robust junco
#

OK got it. Any docs for webhooks and where I should write them?

#

I'm on vercel / nextjs

cinder halo
#

That doc talks about how we recommend handling fulfillment with Checkout

#

But yeah you want to listen for checkout.session.completed

#

And then take action based on that

robust junco
#

Got it

#

thank you

cinder halo
#

Sure