#dmayo2
1 messages · Page 1 of 1 (latest)
Hello 👋
This seems something specific to cloudflare, we don't know a ton about cloudflare integration as such.
What happens if you switch to constructEventAsync?
I started with this:
try {
event = stripe.webhooks.constructEvent(request.body, sig, env.STRIPE_KEY);
} catch (err) {
which worked on Netlify's serverless function
Then I tried wrapping this in await.
try {
event = await stripe.webhooks.constructEvent(request.body, sig, env.STRIPE_KEY);
} catch (err) {
That didn't solve it, so I tried one more:
try {
newStripeEvent = await stripe.webhooks.constructEvent(request.body, sig, env.STRIPE_KEY);
event = await newStripeEvent
} catch (err) {
and that didn't change the error message
So, I'm not directly using ...OH, I see what you're asking...
hold on, brb
Thank you. I did not see that variation on constructEvent anywhere in the documentation.
Yeah not sure when we added constructEventAsync but seems like it's helpful with cloudflare deployments