#dvsk
1 messages ยท Page 1 of 1 (latest)
Hello again ๐
- At error scenario, how does it work? Will Stripe take me to the redirect url though my payment fails?
Afaik, Checkout is equipped to handle ~some errors on its own so it may prompt customer to provide a different payment method in case the card is declined for some basic reason.
- How can I check the error? Can I use the same checkout_session_id parameter and retrieve session?
yes you can
- I also see success_url and cancel_url and redirect url properties. What is the difference between them? (Specially success_url and redirect_url?)
Are you referring to Checkout Sessionsuccess_url,cancel_urlhere? Assuming yes, our docs describe them as
The URL the customer will be directed to after the payment or subscription creation is successful.
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-success_url
If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-cancel_url
- Will the retrieve session object have error object, with particular error message? I don't think I saw it anytime.
It won't be on the Checkout Session itself. The error message should be on the underlying PaymentIntent instead which you'll need to expand
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
Oh!
I am here and trying to completely understand what you said ๐ Please bear with me for delay in response
NP!
Yeah! I want to know how things work at webhook level.. If some error happens in the webhook, how can I capture the error object? so with the 4th point I understood that I need the payment intent object too in addition to retrieving the session, correct?
That's correct. You could listen to payment_intent.payment_failed event which would let you know when a customer attempted a payment, but the payment failed.
done! So at the client level, I can check the payment_intent.last_payment_error object right?
yup
super! Thank you so much Hanzo...Now I feel it was so simple...
So, another question please... I read that Stripe can take upto 16 webhooks.. But why does every webhook get called on completely different instances though we have different webhook secrets... I am not completely clear here...
Hello, I'm not quite clear on your question, can you try rephrasing it?
If you are asking why we send events out to multiple endpoints, it is because we don't filter beyond account and event type. So any endpoint for a specific account will get all of the events on that account that it has subscribed to. So if you are subscribed to payment_intent.payment_failed those events from all over the account will be sent to that endpoint.
yeah..okay