#jry_j
1 messages · Page 1 of 1 (latest)
Hi 👋 I'm not sure I understand the question. Are you referring to where the console.log() statements in the code that's running on your webhook endpoint are being logged?
I'm currently running my stripe service locally for debugging, and I use Stripe Webhook to fire updates on Firebase based on the event received (i.e. payment succeed -> update order status on Firebase). However, this process doesn't seem to be working...
I'm running "node server" and "stripe listen" in my local terminal, which are both responding fine, I just don't know how to get a response from the webhook event i.e. from console.log to see if it's a problem with my function or if it's related to my setup
What's the full command you're running for stripe listen?
just "stripe listen"
Gotcha, I'm still not quite sure I have the full picture, but my suspicion is you're trying to use the Stripe CLI to forward events to a local endpoint, and need to also use --forward-to to send the events to your locally running endpoint:
https://stripe.com/docs/cli/listen#listen-forward-to
do you mean I need to forward it to the url my node server is running on?
You need to send it to wherever the code you're running that you want to do something with that Event is set up to receive the events.
We typically refer to that as a webhook endpoint
I'm testing my stripe service locally, and the url is http://10.0.0.115:5050
and my stripe webhook is setup as router.post('/webook')
I tried running "stripe listen --forward-to http://10.0.0.115:5050/webook "
What happened?
Which is an unauthorized and typically indicates your endpoint is refusing the connection.
when I go to http://10.0.0.115:5050/webook
it says user is not authorized to use
Did I set it up incorrectly?
That sounds like it's likely something Next specific that I'm not familiar with, but it does sound like the CLI is now sending Events to your endpoint as expected.
Sorry, Firebase, not Next
Kinda hard to say, I'm not sure what you're running for your web framework on your end, or how it's setup to handle authentication.
I see
but in my webhook, where can I see the console.log?
On the tutorial it has it as well, but I don't see it the log message in any of my terminals even though the event has occured
Is it getting to that point, or is deciding to return a 401 before that?
I think so? I'm able to see the event and also see that the payment as uncaptured as well
I don't think that's enough to say it's definitely making it to the chunk of code you shared. I would recommend adding additional log lines further up in the flow, and see if any of those get hit.
If you don't see anywhere in the code you're running that explicitly returns a 401, then the error could also be further upstream.
I see, so normally the console.log from the webhook should show up in the Stripe service that's being run, not from "stripe listen" right?
It will show up where the logs for your server get stored, I'm not sure where that is for your environment.