#cristoffer_webhooks

1 messages · Page 1 of 1 (latest)

flat zodiacBOT
#

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

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

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.

sharp bough
#

Hi, to distinguish expired/ unexpired sessions, you can look at the status. For expired sessions, you'd see"status": "expired"

river gust
#

Can I check somehow on checkout.session.expired webhook if payment still can be done via async method payment?

#

Use case is

  1. User pays via async payment method
  2. Session expires
  3. Payment fails/succeeds

I need to recognise if payment still can be done at second step

sharp bough
#

After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.

river gust
#

I know that, what if he uses async method payment before session expiration and money transfer succeeds after that

sharp bough
river gust
#

So, i didn't know that session at session.checkout.expired event can still be paid (what i mean Payment Intent related to this session can be paid) so i was setting order status to Expired in my database and sending appropriate email to customer.

As you said session can be expired yet still can be paid (too i mean Payment Intent related to session). So i want to write logic which will behave differently when:
a: session expires but PI is still waiting for payment via async payment method
b: session expires but there is no payment intent.

Right now while searching i found out that some sessions have filled payment_intent field and others doesnt (for example look into cs_test_b1C2F9RRdgsZhEe2wazLdgiS3HKS2c5HKGL3DYbAI5ouvRMyBJKN0KKJS4 which have expired and have null value in payment_intent).

My problem is that i can't reproduce use case which I described to you earlier

sharp bough
#

Looking at this CheckoutSession here.

#

You can see that the status of the payment is unpaid: payment_status: "unpaid",

#

I think there is a confusion here. With delayed payment methods, the status of the Session would be status: "complete", and you won't be able to expire that session. Only Checkout Sessions with a status in open can be expired.

#

As I stated earlier after the session expires, a customer can’t complete a Session

river gust
#

So if user uses async payment method, session wont expire?

sharp bough
river gust
#

Aah, I see

#

Thanks for that 🙏

sharp bough
#

Sure