#borja-webhook-cli-issue
1 messages ยท Page 1 of 1 (latest)
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.
- .borjasanchez, 18 hours ago, 90 messages
- .borjasanchez, 19 hours ago, 8 messages
๐ Can you share the problem you're facing?
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.
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?
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
Can you share your account ID, so that I can take a closer look at how your integration works? You can find your account ID by logging in to https://dashboard.stripe.com/settings/account. It'll be in the upper right hand corner and looks like acct_123
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The webhook endpoints in the above screenshot are disabled
Stripe will not send events to the webhook endpoints that are disabled
And how can I make it listen ?
You'd need enable the Webhook endpoint in the Dashboard, e.g. https://dashboard.stripe.com/test/webhooks/we_1NlQu8GaKGRdsAFCmYiDrHrY
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Done
let me try again
still not working
My local app is not aiming my local webhook
What is not working?
same thing ... My local app is not aiming my local webhook
I close and open the CLI also
I have seen your server acknowledge with 200 (successful) in https://dashboard.stripe.com/test/webhooks/we_1NpQPMGaKGRdsAFCrPh7lDjZ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
And Stagin stills aims to my local webhook instead of the new one enable
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:
Can you share the Checkout Session ID (cs_xxx)?
The response of that triggers reach my local enviroment ... the one setting up the the local whsec
sure
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 ?
This Checkout Session has not been expired, so checkout.session.expired won't be sent yet
In https://dashboard.stripe.com/test/logs/req_DizeSgyODvm3so, the Checkout Session will only be expired on 2024-01-26 07:44:37 UTC (check expires_at field at 1706255077)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Checking it now
let me know when u find it ๐
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?
Hi, Jack
I don't have any event with that name
Do you need me to explan my problem again ? ๐ I don't mind
Is cs_test_a1RWC57rOPNB1GS23lGYvbrXhjZleEaWZTJI4AjpKmIyDtsnmJmrM6dPQT the checkout session ID?
What's the latest checkout session ID?
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
Ok, you can go to Connect Dashboard -> Select the account -> and view its events and logs from there
You use Stripe CLI right? did you also specify a --forward-connect-to https://stripe.com/docs/cli/listen#listen-forward-connect-to ?
Can you change --forward-to to --forward-connect-to ?
sure, let me try
nop
"cs_test_a1NODYh9ukBjkiuA92gEdCvnb32iG6rEVCfWIJx1eXCGbYZjQANIWs1y8u"
Do you have multiple Stripe accounts? can you do a stripe login and make sure you have logged into the right account?
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)
hmm, your server responded with 500
at least your webhook endpoint is receiving events from Stripe now
Help me understand again, what's the difference between this staging and local?
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)
OK, so the staging is webhook endpoint that you hosted in your server, and that's the one didn't receive the events?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Based on what I saw here, your endpoint responded 404 (Not Found)
why ?
You may want to check your server log and see why it responded 404 instead of 200
No, that's the webhook that you hosted at https://aulavirtualctp.com/stripewebhook
Okay, my red webhook has a different key than my red webhook, but aims to my blue webhook because it cannot reach my https://stg.aulavirtualctp.com/stripewebhook ?
bear in mind that my blue webhook should aim to: localhost:61505/stripewebhook
OK, your staging webhook endpoint was enabled (https://dashboard.stripe.com/test/logs/req_whSv5tSJMt0Yg4) after the event evt_1OcOFP2el4RwAAwp1LTXbA7W
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
and that's why the event wasn't sent to the staging endpoint.
Do you have a checkout session that was completed after the webhook endpoint enablement?
sure
The endpoint was enabled at 2024-01-25 07:24:08 UTC
OK I found one evt_1OcNTN2eCkIhIZ064VgpdY1W
๐
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
Ok, lets focus on this part of the problem, please ๐
My staging environment is aiming to another webhook https://stg.aulavirtualctp.com/stripewebhook
If I create a checkout through https://stg.aulavirtualctp.com the request reach stripe and stripe trigger the event to my CLI.
Why ?
Is happening right now, webhook are enable and running, but the data is not reaching the correct webhook.
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?
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 ?
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
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
I don't know sorry, same as yesterday, all I can suggest is a fresh install
on Windows I'm not sure actually
I guess scoop uninstall if you installed it with that package manager
if you want to try to debug the problem more there is a flag for outputting more logs by the way (https://github.com/stripe/stripe-cli/issues/487#issuecomment-879217468)