#dvsk

1 messages · Page 1 of 1 (latest)

foggy jackalBOT
high junco
#

Hello 👋 If you're using Stripe.js client-side then you'd typically see the error returned as part of the response from your API endpoint.

If you have a specific use-case in mind, I'm happy to provide a deeper context on that

vernal gust
#

I am actually using a payment link and I open that link from client (react) and I have a webhook...

#

so say one scenario, user enters all the information but then there is some issue in the webhook, so how should I make sure that the webhook returns that error back to my client? For now only way is, I can see it only in the dashboard webhook logs right?

high junco
#

Ah gotcha. Webhooks will only deliver the information server-side. It doesn't have a way to notify client-side code that an event occurred.

One option is that you can poll the API to see if anything changed. Another option I can think of is if you have a socket connection between your react app and your server listening to webhooks. In that case, your server can notify your app about the events as they're coming in and then you can trigger client-side behavior accordingly.

vernal gust
#

okay but unfortunately we don't have both..like no polling or no socket connection

#

for now am using the checkout session id and checking if the payment_status is paid and the status is complete

#

but I want the user to know the exact reason of the failure...not sure how to test that because when I test with failure card, it throws error then and there itself. Is there anyway that i can simulate some error scenarios with calling webhooks and still it redirects to my page and see how the event object with that checkout session id is?

high junco