#thierno-hamidou-diallo_webhooks

1 messages ¡ Page 1 of 1 (latest)

placid trailBOT
#

👋 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/1288846643705413663

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

mighty oar
#

need help

glad trellis
#

Hello

#

@mild lantern please use your own thread.

#

@mighty oar can you give me more details?

#

When you test your endpoint do you see it receiving the Webhook request?

mighty oar
#

yeah

glad trellis
#

Where are you seeing a 403 error exactly?

#

And do you have an example Event ID that you tested with that you can share?

mighty oar
#

on stripe dashbord

glad trellis
#

Can you share the Event ID?

mighty oar
#

ok

#

1 minute

#

evt_1Q3HKnIRaYjb5t8lZHDLsbFQ

glad trellis
#

Hmm that Event doesn't have any Webhook attempts / responses?

mighty oar
glad trellis
#

Okay I do see these failed Events when I look at your endpoint

#

So that 403 status is a response that is coming from your server

mighty oar
#

how to create listen url without stripe cli

glad trellis
glad trellis
mighty oar
#

it's online domain

glad trellis
#

Correct

#

Looks like you already have an endpoint that these Events are being sent to

#

But that endpoint is returning a 403

mighty oar
#

on my hosting server ?

glad trellis
#

Yes, your server is sending back that 403

#

So you need to debug why that is happening

#

Most likely it is because there is some firewall or something that is blocking the reception of these Events

#

So I'd first allowlist the IP Addresses that I provided above and then test again

mighty oar
#

do you know laravel ?

glad trellis
#

No I'm not intimately familiar with Laravel

#

But Laravel is just a framework that sits on top of your server, no?

#

This is at the server configuration level

mighty oar
#

do i need to have a specially prepared route on post to accommodate this request from stripe

#

?

#

like local : stripe listen --forward-to localhost:8000/stripe/webhook

glad trellis
mighty oar
#

what is the equivalent of the command "stripe listen --forward-to localhost:8000/stripe/webhook" on an online hosting

#

just I can't use stripe cli

glad trellis
#

You just trigger an Event

#

You can do that by making a normal API request or if you want to use the CLI you can just do stripe trigger xyz

mighty oar
#

i can use stripe cli

glad trellis
#

So for example stripe trigger payment_intent.created

mighty oar
glad trellis
#

You don't have to?

#

You just run the CLI locally

#

It still will send all Events to your hosted endpoint

#

As long as that endpoint is listening for that Event type

mighty oar
#

i can't use stripe commande on my hosting

#

that's work locally

#

on my localhost

glad trellis
#

Yeah you are misunderstanding

#

You don't have to use the CLI from your hosted server

#

You can trigger Events locally using the CLI and they will be send to your server endpoint

mighty oar
#

okay

#

let's me do its

#

i dit it

#

I did it

#

evt_3Q3HbdIRaYjb5t8l0iL9boug

#

this request is from my localhost machine

glad trellis
#

Your endpoint isn't listening for payment_intent.created

#

So it won't receive that Event

#

Otherwise it looks like you are listening for stuff like customer.subscription.created so you could trigger that instead for testing

mighty oar
#

ok

#

what is the full command

#

stripe customer.subscription.created ?

glad trellis
#

stripe trigger customer.subscription.created

mighty oar
#

i did it

#

evt_1Q3HjfIRaYjb5t8lF65dnfRT

glad trellis
#

Great, and your Webhook endpoint returned a 403 like before

#

So now you need to go debug on your end why your endpoint/server did that

mighty oar
#

can you send me php webhook creation docs

#

if i use php language to call api

glad trellis
mighty oar
#

to configure authorization on my server

witch mode i need to allow : get or post or put or patch or delete ?

glad trellis
#

It will be a POST request to your server

mighty oar
#

they are already post authorization

glad trellis
#

Have you added a log within your endpoint code to see if that log fires when you trigger an Event?

mighty oar
#

no

glad trellis
#

Okay well that's the next step. You need to find out if your endpoint is even being reached, which I doubt it is since you are returning a 403

#

The issue here is almost definitely at the server configuration level

#

So before the request actually reaches your endpoint code

#

It is being rejected by your server

mighty oar
#

you see in local mode that's work

#

but online that doesn't work

glad trellis
#

We are going in circles here

#

The issue is your server

#

If you aren't familiar with how to configure you server to allowlist certain IP addresses then you need to reach out to your hosting provider

#

I can't help you with that part

mighty oar
glad trellis
#

Not necessarily for Webhooks. I provided the list of IP addresses above

mighty oar
glad trellis
mighty oar
#

I must add all :

3.18.12.63
3.130.192.231
13.235.14.237
13.235.122.149
18.211.135.69
35.154.171.200
52.15.183.38
54.88.130.119
54.88.130.237
54.187.174.169
54.187.205.235
54.187.216.72

or juste 1

glad trellis
#

All

mighty oar
#

okay

mighty oar
glad trellis
#

Do you still get a 403?

mighty oar
#

yeah

glad trellis
#

Okay then at this point you need to look at your server logs to see what the issue is specifically there.

#

I'd recommend contacting your hosting provider for help in debugging this.

mighty oar
#

let's me find it

#

there are not log error for 403 errors on my hosting

glad trellis
#

Please contact your hosting provider and work with them on this.

#

I can't help you any further here

#

Your server is returning a 403 response and you need to figure out why

mighty oar
#

for online webhook need i equivalent of this command "stripe listen --forward-to localhost:8000/stripe/webhook" so a listener

#

or not not

#

stripe and my hosting can communicate directly ?

glad trellis
#

By creating a Webhook endpoint in your Dashboard you already have a "listener"

#

It seems you really don't understand how Webhooks work

mighty oar
#

stripe listen --forward-to localhost:8000/stripe/webhook

what do this command on my localhost ?

glad trellis
#

In order to test your webhook endpoint code without actually having a server endpoint set up

mighty oar
#

how can i did same on my endpoint

placid trailBOT
sly knoll
#

Hi taking over here. This is a long-runing thread

#

What specifically are you stuck on right now? What's your exact question?

mighty oar
#

i fixed it thanks you

#

i forgot to change webhook_secret on my hosting server

sly knoll
#

Ah glad you got it

mighty oar
#

thank you