#jry_j

1 messages · Page 1 of 1 (latest)

weary lagoonBOT
iron monolith
#

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?

bright wraith
#

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

iron monolith
#

What's the full command you're running for stripe listen?

bright wraith
#

just "stripe listen"

iron monolith
bright wraith
#

do you mean I need to forward it to the url my node server is running on?

iron monolith
#

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

bright wraith
#

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')

iron monolith
#

What happened?

bright wraith
#

and it's giving me a 401

iron monolith
#

Which is an unauthorized and typically indicates your endpoint is refusing the connection.

bright wraith
#

Did I set it up incorrectly?

iron monolith
#

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.

bright wraith
#

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

iron monolith
#

Is it getting to that point, or is deciding to return a 401 before that?

bright wraith
#

I think so? I'm able to see the event and also see that the payment as uncaptured as well

iron monolith
#

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.

bright wraith
#

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?

iron monolith
#

It will show up where the logs for your server get stored, I'm not sure where that is for your environment.