#mindsetinmeta
1 messages ยท Page 1 of 1 (latest)
hello! which portion are you referring to failing - the auth or the capture portion?
sure, it's possible to fail authorization, you can try with one of the test cards here : https://stripe.com/docs/testing#declined-payments
What event will it trigger?
I do not see a test card for pre-auth failure
am I missing anything?
i'd suggest testing it out, any of the cards that results in a decline would cause a failure
I did a testing with insufficient funds but it triggers no error. Checkout session status is still open and payment status is unpaid. PI.status stays the same as "requires_payment_method"
how to tell if the buyers has even tried pre-auth it? let alone the failure part.
can you share the checkout session id? It'd look like cs_test_
cs_test_a1cHT6pqoSOZkScA5yIcU54rcskNYI2TZ1JUXVCPZz8PTrpzFqFjzZZhex
i don't think this is the checkout session where you tested with a declined card
cs_test_a18lTKwQ9QAfNWY6LoeVLnULzyah34Se7OVYleNyrck0B91CTOfLXgZ95S
for a declined card, the cs has no change before and after
๐
that's why I'm curious how can I tell it is declined
anyway, if you login to your Dashboard and go to the All payments page and locate the corresponding PaymentIntent - https://dashboard.stripe.com/test/payments/pi_3LwQLvDaKMqxBxi41e44JmKd - scroll down the page to the timeline and you'll be able to see that a
payment_intent.payment_failed event is generated
but why do you want to know if the card was declined on a Checkout Session?
ultimately, all you would likely want to know is if the Checkout Session was successful in order to fulfill an order.
we are developing a booking system of tutors. if A books a tutor, we have to lock the tutor down so others cannot double book. we need to tell if A is trying to book otherwise we need to expire the checkout session to free up the tutor for others to book.
how are you planning to tell if A is trying to book?
I do not see how I can do that so I'm checking with you guys. ๐ One way might be through PI.status but for pre-auth, it's not working. Documentation says I can check PI.amount_capturable to tell the pre-auth is successful but how can I tell if it fails?
If you want to expire the Checkout Session after a period of time, you can set the expires_at : parameter
then you can listen for the checkout.session.expired event : https://stripe.com/docs/api/events/types#event_types-checkout.session.expired
and release the tutor for others to book
yes that's what I did
alright, is there something about this method (using expires_at and checkout.session.expired event) which isn't working out for you?
dude, you got too much in your plate now. I would bother you in another time.
my original question was, is it possible for "placing a hold on a payment method" to fail? What event will it trigger?
just give me a response when you get a chance. no worries.
i did answer earlier (in case you missed it) - #1034285904388427876 message
for context, a PaymentIntent is generated for a Checkout Session with mode:payment - https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent and the payment is made against the underlying PaymentIntent object
thanks alex
didn't know we can see all events on dashboard
it's pretty cool
was using the event triggers CLI only
anything else I can help with?
all good