#elporter - webhook

1 messages ยท Page 1 of 1 (latest)

sacred scroll
#

Hi there. Let's chat in this thread. What is your issue/question?

valid solar
#

I trying to use the webhooks in production ambient but it's not working well, trough me an error

sacred scroll
#

What is ambient?

#

And what is the error?

valid solar
#

this in console of stripe dashboard webhooks: Stripe.StripeException: The signature for the webhook is not present in the Stripe-Signature header.

#

I'm trying in test mode btw

sacred scroll
#

Ok. Can you share an event id (evt_123) where this is happening?

valid solar
#

evt_1LPpE3KepL2u5KJeZGh8GlqA

#

this event

sacred scroll
#

Ok I see. Now, can you share your webhook handler code?

#

(Leaving out any secret keys)

valid solar
#

oka

#

o you need all the proyect ?

sacred scroll
#

No this is fine

#

One minute

#

Ok. Where are you running this code? Is this local with the CLI?

valid solar
#

no, i've done published this on my server

#

but i tryed it before en local with CLI and it's works

sacred scroll
#

Ok. So you need to verify endpointSecret is set to whsec_..... that is retrieved from the dashboard. The value will be different from the one you got from the CLI, so double check it matches the one on the dashboard for the webhook endpoint you are using/deployed.

valid solar
#

Signing secret it's the same on my code

#

it's already worked ๐Ÿ˜…

#

did you did something?

sacred scroll
#

No

#

I didn't do anything

#

It just started working without any changes?

valid solar
#

just published again

sacred scroll
#

That was the only change you made? No code change?

#

No configuration change?

valid solar
#

no, anything changed ๐Ÿ˜„

#

well thanks for your help listening xD

#

just one more thing, you know why the events emit twice?

#

i send an email when i subscribe but it's send twice

sacred scroll
#

Can you share both event id's?

#

Need to verify if it's duplicate events or your code sending that email twice

valid solar
#

evt_1LPpqLKepL2u5KJefGU3u2VF
just one has created

sacred scroll
#

So yeah that would be a bug in your code sending that email twice then

valid solar
#

i calling the event emiter once

stable yew
#

๐Ÿ‘‹ I'm hopping in since @sacred scroll has to head out soon

valid solar
#

okay

stable yew
#

Have you done some basic debugging/added logging to confirm that both of these emails were sent for the same event evt_1LPpqLKepL2u5KJefGU3u2VF?

valid solar
#

yes i have a log

#

i save when the event done

stable yew
#

On our end I can see that we've only sent it to your endpoint once - can you try testing again a new subscription and see if you get the same behavior?

valid solar
#

yes, some reason it's duplicate the calling
evt_1LPq6XKepL2u5KJeS6txHhcB

stable yew
#

Then there's definitely something in your code that's accidentally duplicating this - you need to dig around in your own code and find why you may be processing it twice

valid solar
#

okay!

#

i will check my code

#

if i've another problem i let you know

#

thanks!!

stable yew
#

๐Ÿ‘