#suresh-chowdary_code

1 messages ¡ Page 1 of 1 (latest)

charred crystalBOT
#

👋 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/1285656817585750122

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

strong gazelle
#

Hello! Can you share the code you're using to retrieve the Checkout Session from the API and determine if it's been paid or not?

pale flame
#

Here is the code
const session = await stripe.checkout.sessions.retrieve(sessionId);

    // Handle cases where the payment is still processing
    if (session.payment_status === 'unpaid') {
        return res.status(200).json({
            success: false,
            message: 'Payment is still being processed. Please wait a moment and try again later.',
            sessionId: session.id,
        });
    }
strong gazelle
#

That should work as expected. Can you log the sessionId to make sure it's what you expect when this code runs?

#

If it is what you expect, can you share the Checkout Session ID so I can take a look?