#tryhardeng_webhooks

1 messages ยท Page 1 of 1 (latest)

plush needleBOT
#

๐Ÿ‘‹ 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/1451637561213718738

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

storm current
#

with the value --forward-to for the correct webhook, only 1 webhook works

#

I mean, I can run twice:

terse basin
#

๐Ÿ‘‹ taking a look

#

So you trying to test two webhook endpoints?

storm current
#

We have 2 "webhooks", endpoints.

#

Which one only handle connection events, the other one only handle the payments.

#

In dev env works well. Last time here you and the other guy helped me

#

And works correctly. But I have been some issues with some events in local that doesn't come

#

It's seems like only one works in local, the first one I run

#

The second one runs well in local, but it doesn't send events to my local endpoint

#

And in webhooks section in my sandbox, you can only see 1 webhook to local

#

That is the first command I run

#

Not the second

terse basin
#

So you're using two local listeners?

storm current
#

So what I do is:

  • If I will connect some stripe account in my system, I stop the 2 local listeners, and onyl run one.
  • When I finish my connection I stop that listener and run the other one
#

Yeah exactly

#

I thought the other day that is possible

#

In the terminal I don't get any warning message

storm current
#

So that's why I'm back to your discord haha

#

To know if I'm missing something?

#

I supposed that my 2 listeners should be here:

#

But only the first listener I run is showed up there

#

So last week I had problems with some events in local, and I realiazed this stuff. I stopped my first listener, run the other one, make the same process again

#

And worked

#

So is weird

terse basin
#

testing somethign really quick

storm current
#

sure, thanks bro.

terse basin
#

So this should be doable with just one instance of stripe cli local listener

storm current
#

sure? because I remember you told that but didn't work. And other guy told me that I need --forward-to exactly the endpoint

#

And that worked

#

So I started use 2 listeners, but the 2nd listener not works

#

I need stop one, start other, and viceversa

terse basin
#

i'm currently getting a working result with just one.

storm current
#

but how?

Example, my api is running in:

localhost:8000

My 2 endpoints are:

/api/webhook/stripe/connected-accounts
/api/webhook/stripe/subscription-processing

#

How your listener is configured to forward to the exactly endpoint?

#

That's my question

#

is similar to this post

terse basin
#

I'm not

My Local listener is running this exactly

stripe listen --forward-to localhost:4242

I have my standard endoint at /webhook and my connect is at /connect-webhook.

And i'm able to receive events for both endpoints

storm current
#

really? I mean, how? because if I do that exactly as you

#

I didn't receive anything, until define the forward to

#

Let me test again, 1s

storm current
#

1s sorry

#

I'm checking some stuff before test the single listener

#

Sorry , 10m max

terse basin
#

no worries we'll be here ๐Ÿ™‚

#

I'm so sorry, I just realized I had a tunnel running as a background service on my machine that might have been conflating my results.

storm current
#

Oooh

#

So is impossible run two stripe listeners

#

I have to make a tunnel:/

#

XD

terse basin
#

I'm still testing but that might be the case. Let me struggle with this for a minute before I have you commit to putting that effort.

storm current
#

Thanks, anyway I tested and didn't work:/

#

So is pretty sure that we can't have 2 terminal instances running stripe listen at the same time because stripe only take the first listener:/

terse basin
#

yeah, I was playing with some additional arguements, it seems it will forward both connect events and platform events to whatever listener is run first

storm current
#

yes .. u.u

terse basin
#

I def think this would be something worth filing some product feedback for.

storm current
#

Is probably that the stripe listen function was coded when you only allowed 1 webhook/destination?

#

And when the dev team added the 1-N webhook/destinations feature

#

They forgot modifty this CLI function?

#

modify*

terse basin
#

Yeah i'd have to ask around for some of the historic context.

My apologizes again, I think I may have set a tunnel to launch as a background process on boot for testing other things and it slipped my mind.

storm current
#

Nah no problem. So for now to don't waste my time configuring some tunnel, I'm gonna still stopping one listener, then run the other one, etc

#

At the moment this works for me, to don't configure some endpoint in my local api that forward to the correct endpoint, or configure some tunnel, etc.

terse basin
#

I did find one thing stripe listen --forward-connect-to will only listen to connect events and won't forward platform events

but the stripe listen --foward-to will forward both platform and connect

plush needleBOT
storm current
#

I read something like that here

#

But I haven't tested, the OP says that doesn't work

terse basin
#

ok I found it

storm current
#

In my case I need the --forward-to, because while I'm developing in dev, sometimes I connect some stripe accounts to some local accounts

terse basin
#

stripe listen --load-from-webhooks-api --forward-to localhost:8000

storm current
#

and in other proccess I just buy a subscription of some user in local, etc

#

ok, let me listen it

#

check it

terse basin
#

just run one listener, don't specify the endpoint and that flag will route them to the endpoints accordingly

storm current
#

ok let me test, if this works

#

bro, I'm the dumbest guy

#

Because the docs has that explicit

#

XDD

#

1s, testing.

terse basin
#

nah, I'm just now learning that flag myself. Don't be hard on yourself : p

#

when testing though both will be using the same signing secret so keep that in mind.

storm current
#

yeah, I'm testing right now

#

it seems like works @terse basin

#

I'm receiving events to the 2 webhooks without problems

#

Thank you man, I promise you, next time I will read EVERY PARAGRAPH of each documentation HAHA

#

it can't be possible, why I didn't see that lol

#

Thank you agian!

#

again*

terse basin
#

No worries! I totally passed over that one myself, i guess the flag's name didn't jump out at me. Glad we could help!