#Sayid

1 messages · Page 1 of 1 (latest)

frigid drumBOT
thin fiber
#

What exactly do you need help with, can you share some details about the issue?

keen owl
#

Thanks so much

#

So im setting up stripe webhooks

#

and I have both test and live keys

#

Im testing locally

#

When I use the test keys in my .env everything works fine my webhook end point gets triggered

#

But when I switch to live keys nothing

#

can live stripe keys like / NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY be used to test locally

thin fiber
#

Are you encountering any specific erroers you can share?

#

Live keys can only be used over HTTPS and i don't believe you can use localhost

keen owl
#

No errors just a non responive webhook

thin fiber
#

but if you have a way of accessing your test page over a named host and https they should work, though i worry about what you're doing

#

Generally you should not be testing with live keys

#

What are you trying to do / test? Why not use test keys?

keen owl
#

Just a final test before we push to production

#

Also Im getting this error on live

thin fiber
#

Whats the error?

keen owl
thin fiber
#

Ok, well that's very different

#

You're hitting issues with signature verification

#

This is working in test mode, correct?

keen owl
#

No

#

wait

#

yes

#

Sorry

thin fiber
#

Ok good 😄

#

np

keen owl
#

When we have test keys and on local host yes it works

thin fiber
#

So then, are you replacing your webhook signing secret when switching to live mode?

#

Your live endpoint will have a different signing secret than your test mdoe endpoint

keen owl
#

Thats another thing

#

we have the same signing secret

#

and it wont change

#

when I run stripe listen --forward-to localhost:3000/api/stripe/webhooks

#

in my terminal

#

it gives the same sercet

thin fiber
#

That's going to be test mode events though

#

I'm not sure if listen support forward live events, let me check

#

Hmm the docs do list --live as an option, so you can try adding that

keen owl
#

so it would be

#

stripe listen --live --forward-to localhost:3000/api/stripe/webhooks

thin fiber
#

If that works, yea -- but really you don't want to be doing this part for live mode anyways

#

If you really need to smoek test this it should be in a deployed staging environment with a public https address

#

and then you could point your Stripe webhook endpoint there instead of using the CLI to forward

keen owl
#

Thanks soo much it finally works

thin fiber
#

Nice!