#borja-webhook-cli-issue

1 messages ยท Page 1 of 1 (latest)

stuck vaultBOT
#

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.

shy flower
#

๐Ÿ‘‹ Can you share the problem you're facing?

worn tinsel
#

Hello

#

yes, i'm trying to work with a local webhook so I can make some test. The problem is that everything is running correctly, but my local webhook.

I have 3 evironments: Production, staging and local. each of them with differents API Keys, but, when I run the CLI and introduce in my local environment the whsec secret that cli provides me, I can't comunicate mi local app with my local webhook, on the other hand, is the staging environment who has connection with my local webhook. I don't understand why.

shy flower
#

The Webhook secrets are different in every endpoint in the Dashboard and the one in local endpoint

#

What is the error you're facing? Can you share the details?

worn tinsel
#

The error is that an enviroment with a different Whsec than the one provided by CLI y triggering event to my local enviroment (the one setting up with de whsec CLI) and I can't trigger any event from my local enviroment because, for some reason, Stripe looks like is not listening.

#

Is like the comunication is confused

#

IDK

shy flower
worn tinsel
#

acct_1NKflOGaKGRdsAFC

#

Thank you

shy flower
#

The webhook endpoints in the above screenshot are disabled

#

Stripe will not send events to the webhook endpoints that are disabled

worn tinsel
#

And how can I make it listen ?

shy flower
worn tinsel
#

Done

#

let me try again

#

still not working

#

My local app is not aiming my local webhook

shy flower
#

What is not working?

worn tinsel
#

same thing ... My local app is not aiming my local webhook

#

I close and open the CLI also

shy flower
worn tinsel
#

And Stagin stills aims to my local webhook instead of the new one enable

shy flower
worn tinsel
#

Okay let me explain it this way

#

when I make a checkout session on this enviroment : "local" it doesn't trigger any event ...

#

eventhough the config is correct:

#

But !

#

When I do a checkout session in this eviroment:

shy flower
#

Can you share the Checkout Session ID (cs_xxx)?

worn tinsel
#

The response of that triggers reach my local enviroment ... the one setting up the the local whsec

worn tinsel
#

The one triggered in my local environment ?

#

I doesn't appear anywhere in the dashboard, let me check the response in my code. One sec.

#

"cs_test_a1RWC57rOPNB1GS23lGYvbrXhjZleEaWZTJI4AjpKmIyDtsnmJmrM6dPQT"

#

Could be this ?

shy flower
worn tinsel
#

Okay, i', holding it

#

now should be completed

#

can you take a look ?

shy flower
#

Checking it now

worn tinsel
#

let me know when u find it ๐Ÿ™‚

serene turtle
#

Hi @worn tinsel This is Jack, I'm also a engineer from Stripe

#

Is evt_1OcNiX2el4RwAAwpnq44TPxg the event that didn't arrive at your webhook endpoint?

worn tinsel
#

Hi, Jack

#

I don't have any event with that name

#

Do you need me to explan my problem again ? ๐Ÿ™‚ I don't mind

serene turtle
#

Is cs_test_a1RWC57rOPNB1GS23lGYvbrXhjZleEaWZTJI4AjpKmIyDtsnmJmrM6dPQT the checkout session ID?

worn tinsel
#

I did another one after that

#

let me try again

serene turtle
#

What's the latest checkout session ID?

worn tinsel
#

I don't know, I didn't check, I was testing because I was wating

#

Let me do another one for you

#

"cs_test_a1SUWmedM4CTNzW0tA4l7m6QMK3GKbJvrOPk2vs0SV45X5ZgUbYYD2pJoe"

#

This is fresh ! ๐Ÿ™‚

#

that's the ID I can retrive from this :

#

once the checkout is completed I lost the data.

#

And I don't know where to look to find the event

serene turtle
#

Ok, you can go to Connect Dashboard -> Select the account -> and view its events and logs from there

worn tinsel
#

yes but

#

why those event doesn't reach a webhook ?

serene turtle
worn tinsel
#

stripe listen --forward-to localhost:61505/stripewebhook

#

I used this

serene turtle
#

Can you change --forward-to to --forward-connect-to ?

worn tinsel
#

sure, let me try

#

nop

#

"cs_test_a1NODYh9ukBjkiuA92gEdCvnb32iG6rEVCfWIJx1eXCGbYZjQANIWs1y8u"

serene turtle
#

Do you have multiple Stripe accounts? can you do a stripe login and make sure you have logged into the right account?

worn tinsel
#

yes I'll do the login again

#

"cs_test_a1UDB7Uy2zzHY7nqaeh4BaZYRAtSDrgXKnw3TY4Nw4pwwKy6t9dQL6747A"

#

It doesn't work

#

Do you know about the environments?

#

My stagin evironment reach my local webhook, but STG doen't have the CLI whsec key

#

this is staging

#

this is local:

#

this is my CLI (and the blue is a customer created in staging)

serene turtle
#

hmm, your server responded with 500

worn tinsel
#

yes

#

but that's ok

#

I have response status code in my webhook

serene turtle
#

at least your webhook endpoint is receiving events from Stripe now

worn tinsel
#

Yes, but from staging ...

#

That's the problem.

#

๐Ÿ˜ฆ

serene turtle
#

Help me understand again, what's the difference between this staging and local?

worn tinsel
#

Okay, local is my machine:

#

and whit the use of CLI I connect my machine with stripe and viceversa

#

and staging is a web page in my server

#

witch also is conected with stripe

#

but, with different whsec to a different webhook

#

blue should recive my local request and showthem in the CLI, but insted, is reciving staging request (the red one)

serene turtle
#

OK, so the staging is webhook endpoint that you hosted in your server, and that's the one didn't receive the events?

#

Based on what I saw here, your endpoint responded 404 (Not Found)

worn tinsel
#

why ?

serene turtle
#

You may want to check your server log and see why it responded 404 instead of 200

worn tinsel
#

But this is my local endpoint, right?

#

the blue one

serene turtle
worn tinsel
#

bear in mind that my blue webhook should aim to: localhost:61505/stripewebhook

serene turtle
#

and that's why the event wasn't sent to the staging endpoint.

worn tinsel
#

But now is enable

#

right ? Should work fine ?

serene turtle
#

Do you have a checkout session that was completed after the webhook endpoint enablement?

worn tinsel
#

sure

serene turtle
#

The endpoint was enabled at 2024-01-25 07:24:08 UTC

#

OK I found one evt_1OcNTN2eCkIhIZ064VgpdY1W

worn tinsel
#

๐Ÿ™‚

serene turtle
#

You endpoint responded 500

#

This event happend at 2024-01-25 07:35:47 UTC, you should check your server log and see what is the error

worn tinsel
#

Why ?

#

Is happening right now, webhook are enable and running, but the data is not reaching the correct webhook.

serene turtle
#

As I explained to you earlier, Stripe tried to sent the webhook event to your webhook endpoint (https://stg.aulavirtualctp.com/stripewebhook), but your endpoint responded with 500 and that's why the delivery wasn't successful.

#

Have you check your server log?

worn tinsel
#

but a 500 response is not a "problem" 500 response could be that the endpoint is reached but couldn't perform the request for some reason.
The natural behaviour for stripe is that, if staging doesn't reache the correct enpoint aims to another one available ?

polar ore
#

hi! I'm taking over this thread.

#

Stripe did send your webhook endpoint URL the event (as expected), then your server encountered an error and returned a 500 (unexpected).

#

so now the next step is for you to check your server logs to understand what the issue is, and then try to fix it

worn tinsel
#

we are looking into it, meanwhile, can u tell me why my local enviroment is not reaching my localhost:61505/stripewebhook through the CLI ?

#

is different environment, so it shoundn't be related

broken brook
#

I don't know sorry, same as yesterday, all I can suggest is a fresh install

worn tinsel
#

Can you let me know how to unistall stipe CLI ?

#

lets start fresh

broken brook
#

on Windows I'm not sure actually

#

I guess scoop uninstall if you installed it with that package manager