#seor_webhooks

1 messages ยท Page 1 of 1 (latest)

digital copperBOT
#

๐Ÿ‘‹ 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/1397237750763360438

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

trim ridge
#

look, i started my webhook and completed an application flow in local in order to buy a subscription via checkout session. here's the logs:
stripe listen --events customer.subscription.updated,customer.subscription.deleted,checkout.session.completed,invoice.payment_failed --forward-to http://localhost:5002/protected/stripe/webhook

2025-07-22 17:17:39 --> checkout.session.completed [evt_1RnhwlKKWf9Suo52KUoqN7tu]
2025-07-22 17:17:39 --> customer.subscription.updated [evt_1RnhwlKKWf9Suo52uDJklfry]
2025-07-22 17:17:42 <-- [200] POST http://localhost:5002/protected/stripe/webhook [evt_1RnhwlKKWf9Suo52KUoqN7tu]
2025-07-22 17:17:43 <-- [200] POST http://localhost:5002/protected/stripe/webhook [evt_1RnhwlKKWf9Suo52uDJklfry]

Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_a7bc2d2284b38df66c58d5cd6cf29962f42389db5de2a17e47a4057b25a516b0 (^C to quit)
then i fired this in another command line:
stripe trigger invoice.payment_failed --override payment_method:customer="cus_SjAGnUs5E494Cx" --override invoiceitem:customer="cus_SjAGnUs5E494Cx" --override invoice:customer="cus_SjAGnUs5E494Cx"
Setting up fixture for: customer
Running fixture for: customer
Setting up fixture for: payment_method
Running fixture for: payment_method
Setting up fixture for: invoiceitem
Running fixture for: invoiceitem
Setting up fixture for: invoice
Running fixture for: invoice
Setting up fixture for: invoice_pay
Running fixture for: invoice_pay
Trigger succeeded! Check dashboard for event details.

when i go back to the other shell where the webhook is running, NO EVENTS are received. what am i doing wrong?

slate reef
#

hi there, are you receiving any error messages in either shell?

trim ridge
#

nope

#

hi

#

not even on stripe UI dashboard there's such event

#

nothing

slate reef
#

the [200] POST logs in stripe listen indicate that your code is picking up on the events being triggered and responding. there should be something on the dashboard... did you try refreshing?

trim ridge
#

yes

#

i can attach screen of dashboard if you need

slate reef
#

looking up those event IDs on our backend, I can see that they were successfully received. do you have logging in your code that's printing out? also could you send me your account ID

trim ridge
#

logging in my code is not printing because there are no events received...

#

where can i find my account id?

#

acct_1Kc5KVKKWf9Suo52

#

found it

slate reef
#

try running stripe login just to make sure your CLI is logged in to the account, then try running stripe listen and stripe trigger again

trim ridge
#

doing them now

#

still same output

#

no event received

slate reef
#

can you paste me the output of stripe listen for that attempt? did you get more [200] responses?

trim ridge
#

no responses

#

Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_a7bc2d2284b38df66c58d5cd6cf29962f42389db5de2a17e47a4057b25a516b0 (^C to quit)

digital copperBOT
minor mica
#

Hi hi! Iโ€™m going to be taking over for my colleague here. Please give me a minute to read back and understand things.

trim ridge
#

hi, take your time. thanks for the support

minor mica
#

What server side language do you use, and what platform are you on (Win, Mac, Linux)?

trim ridge
#

windows, and nodejs

minor mica
trim ridge
#

let me check

minor mica
#

Or npx installed?

trim ridge
#

no i don't have http-server globally installed

minor mica
#

What about npx?

trim ridge
#

not even that

#

i can install http-server if necessary

minor mica
#

You can just install it in a folder somewhere and kill it later. If you do this in an empty folder (without your app running):

npm i http-server
node_modules/.bin/http-server -p 5002

...And then try the whole process again, but watch the terminal window where you ran the above. Do you get output in that terminal window?

trim ridge
#

i'll do that

#

node_modules/.bin/http-server -p 5002

this doesn't work

minor mica
#

Oh. Windows. Oops. Sorry.

node_modules\.bin\http-server -p 5002

trim ridge
minor mica
#

Ok cool, now run all your stripe-cli things and see if you get output.

#

You should see an error, but at least that's output. ๐Ÿ˜‚

trim ridge
#

i can't see any output

#

in the webhook listen command shell

#

just the usual ready bla bla

minor mica
#

Can you list out the commands you run, by terminal window (like "1: blah \n2: blah blah" etc)

trim ridge
#

i run in a shell:
stripe listen --events customer.subscription.updated,customer.subscription.deleted,checkout.session.completed,invoice.payment_failed --forward-to http://localhost:5002/protected/stripe/webhook

then another shell:
stripe trigger invoice.payment_failed --override payment_method:customer="cus_SitR4T1wjSUMwZ" --override invoiceitem:customer="cus_SitR4T1wjSUMwZ" --override invoice:customer="cus_SitR4T1wjSUMwZ"

#

if i run only:
stripe trigger invoice.payment_failed
int he second shell, then i get the event. but i need to tie that event to a particular customer that previously bought a paid yealry subscription

minor mica
#

Ok, try this, in this order:

Terminal 1, wherever you installed http-server:

\node_modules\.bin\http-server -p 5002

Terminal 2:

stripe listen --forward-to http://localhost:5002/protected/stripe/webhook

Terminal 3:

stripe trigger invoice.payment_failed

...Let me know if you see output in Terminal 1 after you run the Terminal 3 command.

trim ridge
#

in terminal 1 i don't see anything apart from:
Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
http://172.29.48.1:5002
http://192.168.0.151:5002
http://127.0.0.1:5002
http://172.18.32.1:5002
Hit CTRL-C to stop the server

in terminal 2 i see the event and a 400 error since my flow handles that particular customer which terminal 3 didn't specify

minor mica
#

Right, but what do you see in Terminal 1?

#

A bunch of error output?

trim ridge
#

nothing

minor mica
#

Nothing, huh?

#

And what was the output in Terminal 2?

trim ridge
#

nothing

minor mica
#

My current hypothesis is "this is Bill Gates' fault" but we probably should narrow it down further than that...

trim ridge
#

AHHAHAHAHAHAHAHHA

minor mica
#

Is your app running too?

trim ridge
#

for sure it's uncle bill

trim ridge
minor mica
#

How?

trim ridge
#

[18:04:41.933] WARN (15064): POST /webhook 400 539ms
[18:12:41.910] INFO (15064): WEBHOOK_HANDLER_STARTED @22/07/2025, 18:12:41
[18:12:41.910] INFO (15064): WEBHOOK - INVOICE.PAYMENT_FAILED
[18:12:41.910] INFO (15064): invoice is in status: open
[18:12:42.344] ERROR (15064): Could not fetch subscription purchase record associated to customer with id cus_SjBAnvMEQi413l
err: {
"type": "Error",
"message": "Could not fetch subscription purchase record associated to customer with id cus_SjBAnvMEQi413l",
"stack":
Error: Could not fetch subscription purchase record associated to customer with id cus_SjBAnvMEQi413l
at <anonymous> (C:\Users\Rafiols\Documents\LAVORO\HEU\MONOREPO\heu-monorepo\apps\back-nodejs\src\components\stripe\services\handle-invoice-payment-failed.webhook.service.ts:56:10)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\Rafiols\Documents\LAVORO\HEU\MONOREPO\heu-monorepo\apps\back-nodejs\node_modules.pnpm\kysely@0.27.2\node_modules\kysely\dist\cjs\kysely.js:418:32
at async DefaultConnectionProvider.provideConnection (C:\Users\Rafiols\Documents\LAVORO\HEU\MONOREPO\heu-monorepo\apps\back-nodejs\node_modules.pnpm\kysely@0.27.2\node_modules\kysely\dist\cjs\driver\default-connection-provider.js:12:20)
at async StripeWebhookController (C:\Users\Rafiols\Documents\LAVORO\HEU\MONOREPO\heu-monorepo\apps\back-nodejs\src\components\stripe\stripe-webhook.controller.ts:25:3)
}
[18:12:42.345] WARN (15064): POST /webhook 400 437ms

minor mica
#

On port 5002?

#

OH

trim ridge
#

yes

minor mica
#

You got output

#

This is actually good, right?

trim ridge
#

it receives this but i need to specify the customer

#

this is the one without overrides: stripe trigger invoice.payment_failed

i need : stripe trigger invoice.payment_failed --override payment_method:customer="cus_SitR4T1wjSUMwZ" --override invoiceitem:customer="cus_SitR4T1wjSUMwZ" --override invoice:customer="cus_SitR4T1wjSUMwZ"

minor mica
#

Ok, right. So let's tighten up the listen. Re-run in Terminal 2 but with your full code that specifies the events, and then try again, and see if the trigger we just tried makes it to your app (and breaks).

trim ridge
#

you mean this trigger: stripe trigger invoice.payment_failed?

#

because this one is always arriving, the one that is not arriving is this one
stripe trigger invoice.payment_failed --override payment_method:customer="cus_SitR4T1wjSUMwZ" --override invoiceitem:customer="cus_SitR4T1wjSUMwZ" --override invoice:customer="cus_SitR4T1wjSUMwZ"

minor mica
#

Right. First I just want to confirm the "simple" one works.

trim ridge
#

the simple one works

#

and the app breaks as it should be

minor mica
#

Good good. Let's try this next:

stripe trigger invoice.payment_failed --log-level debug --override invoice:customer="cus_SitR4T1wjSUMwZ"
#

Any luck?

trim ridge
#

no ๐Ÿ˜ฆ

#

it's ok. i'll try to debug more tomorrow. thanks for the support and have a nice day ๐Ÿš€

minor mica
#

Did the trigger one output anything more with that --log-level debug in there?