#dan1106_webhooks

1 messages · Page 1 of 1 (latest)

slender sapphireBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1346000096747192411

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

slate quartz
deep aspen
#

thanks for looking! Where do you see that? I see one webhook endpoint in test mode:

#

and one in live mode

slate quartz
#

Ah I see, that's the endpoint in Live mode. I know this, one moment

deep aspen
#

thanks!

slate quartz
#

When a connected account is connected in Live and in Test mode to the platform, the Live events are sent to the platform's Live Connect webhook endpoint and the Test events are sent to both the Live and the Test Connect webhook endpoints on the platform

#

From https://docs.stripe.com/connect/webhooks

For Connect webhooks, only test webhooks are sent to your development webhook URLs, but both live and test webhooks are sent to your production webhook URLs. This is because you can perform both live and test transactions under a production application

Learn how to use webhooks with Connect to be notified of Stripe activity.

deep aspen
#

thanks for figuring that out for me

#

i'm a bit confused how I'm meant to handle this in my Stripe App though. A user can install my app in test mode and/or in live mode, how should I have my webhook endpoints set up?

#

If I don't have a test mode endpoint, and a user only installs my app in test mode, will I receive webhook events?

#

or if I receive a test event to the live endpoint, should I reject that to make sure I only get one event per event?

slate quartz
#

Um in this case, is acct_1Q3ka4AObmbUIwUr your account, and is acct_1Qw7oqLbCkFKbtzX the one who installed your app?

deep aspen
#

yes, that's right

slate quartz
#

Did it install in both Live mode and Test mode?

deep aspen
#

yes

slate quartz
#

Um that results in this edge case I guess.. But even when you have duplicated event, you can still look at the livemode: true/false to indicate whether to ignore it

deep aspen
#

ok, and to make sure I understand the event delivery correctly:

If the app is installed in live mode only:
Test events: Not delivered
Live events: Delivered to live endpoint

If the app is installed in test mode only:
Test events: Delivered to test endpoint
Live events: Not delivered

If the app is installed in test + live modes:
Test events: Delivered to live + test endpoint
Live events: Delivered to live endpoint

#

Is that correct?

slate quartz
#

If the app is installed in live mode only:
Test event still be delivered to the Live mode endpoint

Dropping you this graph for easy reference

deep aspen
#

ah, so my app receives the test mode events to the live endpoint. Does the end user see the app installed in test mode in their account?

#

e.g. a user has installed the app only in live mode, can they see the interface and use it in test mode (without installing it in test mode explicitly). I'm trying to figure out if my Live Mode endpoint receives a Test event, do I need to try to handle the Test event?

#

To put it another way, can I safely ignore a test event that is received to the Live Webhook Endpoint, or could the app user also be using the app in test mode?

#

ah, so checking on a personal account when I install the app in Live mode, it is also available in Test mode. So in that scenario, the Live Mode endpoint gets Live & Test events, and so it wouldn't be safe to ignore test events because the Test mode endpoint wouldn't receive events.

#

So I'm genuinely confused how I'm meant to handle this situation in my backend?

#

unfortunately I need to drop off for the night, I'll try and pick up this thread in the morning. Thank you for your help!

slate quartz
#

To put it another way, can I safely ignore a test event that is received to the Live Webhook Endpoint,
Yes you can. That's where you want to look at the livemode parameter coming from the Test event.

You may ask "Why Stripe, why would you do this". And the answer is a bit of historical context and we hope to unship this at some point in the future

deep aspen
#

I don’t think I can ignore it, because a test event to the live webhook endpoint will sometimes not also be delivered to the test endpoint. But the user sees a test interface in the Stripe dashboard and therefore expects me to handle the test event.

#

If I just ignore the test event sent to the live endpoint the app will be broken in test mode for users who only installed in live mode.

#

(Because Stripe makes the app available in the dashboard in test mode even if the user has only installed in live mode)

slate quartz
#

I mean the Test even will be sent to both Live mode and Test mode endpoint. And you can ignore Test mode events on Live mode endpoint, not the Test mode events on the Test mode endpoint

deep aspen
#

The test event is only sent to both endpoints if the connect account is linked in both live and test modes.

In the case where the app is only installed in live mode (and hence the account is only connected in live mode), I believe I still need to handle test events sent to the live endpoint because the app is shown/available in test mode (even though it wasn’t explicitly installed in test mode).