Both test and live webhooks sent to production URL

1,007 views
Skip to first unread message

Gun Gun Iskandar

unread,
Jul 3, 2015, 3:02:48 AM7/3/15
to api-d...@lists.stripe.com
Hi

I setup webhooks for my application, I setup them for both TEST and LIVE mode with different URLs.
It works fine for TEST mode, I got the webhooks in my staging server and process the params.
But in my production server, beside LIVE webhooks, I also get the webhooks which is "livemode" in its params set to false. Which is should be webhook for TEST mode.
This is what I see in Stripe settings modal : 
"Only test webhooks will be sent to your development webhoook URLs, but both live and test webhooks will be sent to your production webhook URLs ........"

Anyone can confirm? And what is the best way to do to handle this?

Thanks

Remi J.

unread,
Jul 3, 2015, 3:05:18 AM7/3/15
to api-d...@lists.stripe.com
Hey!

I can confirm that if you setup a Connect webhook endpoint for your
platform in Live mode you'll get both the Live events and the Test
ones for your connected accounts. You can look at the `livemode`
property on the event payload and drop the ones where it says
`livemode=false` for your Live webhook handler.

All the best,
Rémi
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to api-discuss...@lists.stripe.com.

Matthew Arkin

unread,
Jul 3, 2015, 3:05:54 AM7/3/15
to api-d...@lists.stripe.com
That is correct, as the settings modal says, your live connect endpoint will receive both test and live events while the test endpoint only gets test events.

If you don't need test events in live mode your webhook handler can read the live mode property and just ignore it by returning a 200 OK status code

Sent from Outlook

_____________________________
From: Gun Gun Iskandar <gun...@gmail.com>
Sent: Friday, July 3, 2015 12:02 AM
Subject: [stripe-api-discuss] Both test and live webhooks sent to production URL
To: <api-d...@lists.stripe.com>
--

Gun Gun Iskandar

unread,
Jul 3, 2015, 3:12:15 AM7/3/15
to api-d...@lists.stripe.com
Hi Remi

Thanks for the quick response.
Any reason why Stripe do this (send both live and test webhooks to production) ?

Brian Krausz

unread,
Jul 5, 2015, 12:45:47 PM7/5/15
to api-d...@lists.stripe.com
Hello,

There are 3 ways you can connect to and access other accounts:

1) "Development" connections, which exist for testing and only give you testmode access to another account
2) "Production" connections in livemode, which is the common use case
3) "Production" connections in testmode, which some platforms use to enable their customers to test things. For example, if you run a store and want to try out how the store interacts with Stripe, they can let you run your store in testmode.

From the platform's perspective, #2 and #3 are both "production" features: it's a capability built into the platform for its customers. That's why we include both in webhooks. Also because it's very simple to filter out, as long as you are made aware of its existence.

Thanks,
Brian
Reply all
Reply to author
Forward
0 new messages