#jo07453

1 messages ยท Page 1 of 1 (latest)

vital sealBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

obsidian horizon
#

hi! well the way it works is we send any event to all endpoints that you've set up to listen to that type of event

#

I don't really follow the exact problem you're having

ultimately Stripe only has two modes, live and test, so the two "local" and "test env" (or staging) environments you have can only map into the one test mode inside Stripe

tropic frigate
#

Yes. But I would like not to have the local events to be fired to dev endpoint. Is it possible?

obsidian horizon
#

well not really no, if e.g.
-you do a payment in test mode
-that generates a charge.succeeded webhook event
-that event is sent to all test mode webhook endpoints on your account that listen to that event type

you just have to gracefully ignore things you don't recognise I would say (like return a HTTP 200 and do no further processing)

tropic frigate
#

is there a way I can check to which the webhook is being answered to? So I could easily ignore the local events on dev env ?

#

Like a signature or something on the responses

#

How do people do it usually?

obsidian horizon
#

which the webhook is being answered to
I'm not sure what that means

#

the way it works is

#

the body of the HTTP request is identical

#

like I said, if you look at the data in the event and find that you don't recognise the ch_xxx charge ID for example, you can just gracefully ignore it since presumably it's not for that envionment

tropic frigate
#

I get it. But is there a way I can the distinguish if the request was made by a local env so I can ignore it on dev? maybe using metadata?

I say that because if I ignore if not recognized the charge id (in you example) I may be neglecting the caught of an error on my platform that a charge id is not being saved and then I won't be able to catch that because I've ignored it

#

Does it make sense?

obsidian horizon
#

sure, you can pass metadata in the API request you make e.g. add it when you create the Charge and then see if that metadata is in the Charge object contained in the event

tropic frigate
#

Is this the way most people do? I guess I am not the first person with this problem ๐Ÿ˜†

obsidian horizon
#

not really foolproof though since it heavily depends on how your integration works and what events you listen to (e.g. a lot of objects get created/updated automatically from some actions or hosted surfaces and are not triggered by direct API calls you make)

#

the other option is to use multiple Stripe accounts and the test mode of each account for your environments

#

I suspect most people use some combination of these approaches and sure yes, it's a common topic, like I said ultimately we only have the distinction between 'test' and 'live' on an account and more granularity has to be built separately unfortunately

tropic frigate
#

Yes, this is definitly a topic where stripe can be improved. Anyway thanks a lot for you support ๐Ÿ™๐Ÿป