#idealconceptz

1 messages · Page 1 of 1 (latest)

blazing mothBOT
green gull
#

hi there!

#

so your code on localhost:3000/api2/payment/stripe/webhook is never called?

#

have you tried adding some logs to make sure it's the case?

normal tiger
#

yes, correct, 1st line of code is "console.log("WEBHOOK stripe post event ");

#

if I post from Postman, I see the log

green gull
#

308 error means there's a redirect in your endpoind, and Stripe doesn't follow redirects

normal tiger
#

ah, interesting. I'm using Nextjs with middleware, so that could be affecting it

#

thanks soma, that's given me something to investigate

#

I assume in production though, the webhooks will be hit?

green gull
#

in both test mode and live mode you need to make sure your webhook endpoint doesn't have any redirects, or it will fail.

normal tiger
#

thanks

blazing mothBOT
normal tiger
#

I've just removed the middleware and getting the same 308 error. Anything else you can think of that might cause this? I can't think of any other part of the code that would cause a redirect

#

FIXED IT!! the stripe listen url needed a trailing slash!! That's all it was. Middleware is fine!

#

thanks for helping me out!

dull mauve
#

Happy to help!