#iandk-event-checkout
1 messages · Page 1 of 1 (latest)
Hello 👋
AFAIK don't think so.
When you say leave, do you mean by clicking the back/cancel button or just close the tab?
exactly
sorry, which one out of the two?
I'd like to catch both, before the user visits the checkout page, he can configure some options which I'm saving as a "checkout attempt".
And I'd like to catch if he clicks on pay but closes the tab or just goes back again so I can delete the checkout attempt
I don't think there's a way to track if they just decide to close the tab.
You could listen for each checkout.session.created webhook event and check the customer property (if you're passing a customer ID when creating a session) to track session creation and then you can check each checkout.session.completed event to check if that customer ever completed their checkout session.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
If they click back/cancel, they're redirected to the cancel_url page on which you can write some logic to handle your use-case.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-cancel_url
Thank you!
One more question, there seems to be an option to set the expires_at option.
Does that only apply for unfinished checkout sessions or in general?