#Monimolimnion - Laravel Webhooks
1 messages ยท Page 1 of 1 (latest)
This one is almost always because the constructEvent requires the rawBody of the request - the needed information is encoded in the "non-coding" part of the JSON body - extra spaces, line breaks, etc. Any processing will change those.
Yup. Even some hosting providers can transform request payloads. There should be examples of Laravel specific webhooks handlers on Stack Overflow but unfortunately I'm not familiar enough with Laravel to know what transformations are required.
Hmm
I'm using:
Which apparently just handles everything automagically
And locally, it does just that
If I disable the signature checking in the config, everything (saving an order and sending emails via a Laravel Event) works perfectly
Oh
My bad
It's this one, stripe specific
Wait... I've just thought
๐ @limber lantern has to head so I'm hopping in - give me a bit to catch up
Does the webhook secret change when you're using test mode? Even if it's a live, online webhook?
There are entirely separate Test and Live webhooks & secrets
well... that bears checking out ๐คฆ
......
that was the problem
or rather as usual... I was the problem
It's like 80% of the time not having the rawBody, and most of the rest are the secret being out of sync in some way
in my local environment i'd just been using the secret generated by the CLI where I listened for the webhook
then I created the one on the dashboard and figured it was the same key because it was the same hook
so just to be clear, when I switch to live mode I'm now switching my secret key, public key, and any webhook secrets to their live versions
yep.