#danboyle8637-webhooks

1 messages · Page 1 of 1 (latest)

cinder pilot
#

You would just configure the webhook handler at your endpoint to check if there's an error before sending back a response

dull wolf
#

I get that ... but if I need to send a response to my app to signal there is an error... I can't send two responses... one to my app and one to Stripe

cinder pilot
#

Why not?

compact sparrow
#

In general, the only valid response to a webhook is "I got This" (200) - any subsequent "error" isn't part of Stripe's processing. My system simply queues up each webhook event, and sends back the 200 - a separate process runs through the created queue processing the events, and dealing with databases and other issues

cinder pilot
#

To copy off @compact sparrow a little bit. Stripe will eventually timeout if no response is sent and you will see errors in the logs of your Dashboard, so the worst-case here is that you don't send an error to Stripe at all

compact sparrow
#

Maybe it isn't clear that the webhook call does NOT come from your app, but from Stripe

dull wolf
#

@compact sparrow okay I was thinking that... shuffling off the database operations to another function to handle and I guess if there is an error I can log that in an admin system and notify myself that something went wrong for a particular user.

I know it comes from Stripe which is why when there is an error based on say a successful payment. I want to create a user in the database and add a membership to them. But if that fails... I can't talk back to my app because it's not part of this.

compact sparrow
#

Depending on WHAT failed, you may well have an error on the Front End call- more "asynchronous" issues (subscriptions ending, etc), you will have to have a messaging method of SOME type from your backend to frontend

#

My users have various structures/records that are monitored by the front end - errors are posted there, and exposed at the front end. Sometimes I have to send text/email to users to get them BACK to the app to deal with them.

dull wolf
#

Hmmmm... okay. Interesting. I'll have to grok this one and think about what I can do if an error happens. Thanks for the insight and help

compact sparrow
#

(my stack, btw, is based around Firebase Firestore, Storage and Cloud functions with a React front end)

dull wolf
#

Okay.. mine is React (Next) on front... and all Cloudflare on the back... KV Durable Objects and Workers

compact sparrow
#

(and a bunch of other APIs including Stripe)

#

Similar. I don't know KV Durable objects. I do use Firestore "Listeners" and Auth a lot to keep messages flowing