#celebration - webhooks

1 messages ยท Page 1 of 1 (latest)

gilded jungle
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐Ÿ™‚

#

What do you need help with exactly?

fathom zephyr
#

I was about to add more details. But didn't know I could not start a thread

#

Thanks for creating this thread. I'll add more details now

#

I have an web app with 2 api and one web:

  • web
  • apiOne
  • apiTwo

All three(web, apiOne, apiTwo) have different domains. web connects to both of them depending on the need.

Now for each apiOne and apiTwo there is a different hosted endpoint added into webhooks in stripe with the same exact events.

PaymentIntent is used mostly in this app.

stable ledge
#

๐Ÿ‘‹ stepping in here. Reading!

#

Alright, I've read your response :). What's the challenge here?

fathom zephyr
#

apiOne and apiTwo handle different products.

So when I use web and try to buy a production from apiOne . Payment intent events are sent to both apiOne and apiTwo.

#

Same happens if I try with apiTwo

#

What I need is a way to specify for what endpoint should I deliver events.

#

Example

If I use web buy products using apiOne then events should be send only to apiOne.

If I use web and apiTwo then it should only send events to apiTwo

stable ledge
#

Gotcha so what you want to do here is to set metadata on your PaymentIntents. There is no way to not have the events sent to both if you are listening for the same event type

#

The metadata will come through and you can then handle the event based on the metadata

fathom zephyr
#

So each events has metadata?

stable ledge
#

The event will contain any metadata you set on the object

fathom zephyr
#

What should I do with events which are supposed to be handled by apiOne ?

Do I just respond with 200 when I get them in apiTwo?

stable ledge
#

Yes you always respond with a 200. Then you handle the event as you so desire.