#Abhishek-metadata
1 messages · Page 1 of 1 (latest)
@indigo finch hi! yes, the CheckoutSession and PaymentIntent are two different objects.
If you want to set metadata on the PaymentIntent specifically you have to set https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Thanks @small lake . It worked. Now I can resume my work again
Suppose I created the checkout session and I got redirected to the checkout page. Now instead of making payment, I close the tab or go to another url, then which webhook event will get invoked?
No event.
Is there any way to capture it?
not really, you can't know if the customer just closes the tab etc. What's the use case overall?
for example we have ways to set a maximum time for the customer to be able to pay, which might do what you need : https://stripe.com/docs/payments/checkout/managing-limited-inventory
The use case is if any user goes for payment and if the user cancels the payment, then I should get notified. But I'm not getting, how to do it?
you can't really(even if you build this yourself there's not really a way to reliably know it).
the most you can do is say "this customer hasn't paid yet and it's been 1 hour, so I'm going to assume they cancelled".
ok
Can we capture any event when the user clicks on the back button present in the checkout session?
what do you call 'the back button' exactly? the browser one, or the one that's inside the Checkout page itself(top left, where your merchant name is)
The one that's inside the Checkout page itself(top left, where your merchant name is present)
then there's no webhook event, but the user is sent to the cancel_url you set on the Session.
If they click on the browser's back button?