#harefix.dev-webhook-events
1 messages ยท Page 1 of 1 (latest)
hello
You can find the events sent to a specific webhook on the webhook detail page: https://dashboard.stripe.com/test/webhooks/we_xxx
Sure!
right now I can see that webhook has already been fired
but I keep getting Stripe::SignatureVerificationError
I don't know if the header HTTP_STRIPE_SIGNATURE is missing or not
but this webhook I fired by Stripe dashboard
The signature will always be included in the payload headers
yeah
It's up to you whether you verify the validity of the payload using the signing secret
yeah
I used it to create the webhook object
endpoint_secret = "the sample secret from Stripe Webhook pagee"
payload = request.body.read
sig_header = request.env["HTTP_STRIPE_SIGNATURE"]
@event = Stripe::Webhook.construct_event(
payload, sig_header, endpoint_secret
)
I kinda used the code suggested from Stripe page
so it's exactly like this. But it fails in the construct_event part
Hmm, my guess is that you're webhook endpoint is manipulating the payload somehow
We recommend payload = request.data as per https://stripe.com/docs/webhooks/quickstart
I think it's request.body.read
after that I used event object to determine the logic in some cases, but basically, all the code in the beginning is the same ๐ฆ
Can you try request.data? Or is that something specific to Flask?
I'm using Ruby on Rails
๐คฆ my bad
no, I should have told you ๐
Where is your endpoint_secret from?
it came from the stripe cli when I set up, so I just used it to test ๐
And you're forwarding events with the CLI, not a webhook configured in your Dashboard?
no, I set up the webhook on dashboard already
then I created a payment by the API
payment intent, to be specific
then I see the payment intent on dashboard is already changed the status to succeeded
but in my end, the webhook endpoint throw the error above ๐
Yep, I got that. But you also mentioned the CLI. Are you forwarding events via the CLI? How are you listening for them locally from your Dashboard webhook?