Fix Stripe integration webhook validation (#836)
The SubtleCryptoProvider cannot be used in a synchronous context. This is a problem for non-node environments where the Stripe client falls back to SubtleCryptoProvider. Co-authored-by: Matt Aitken <matt@mattaitken.com>
This commit is contained in:
committed by
GitHub
parent
85ce729bf2
commit
5af2003516
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@trigger.dev/stripe": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix SubtleCryptoProvider webhook validation
|
||||||
@@ -1151,7 +1151,7 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) {
|
|||||||
const stripeClient = new StripeClient("", { apiVersion: "2022-11-15" });
|
const stripeClient = new StripeClient("", { apiVersion: "2022-11-15" });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const event = stripeClient.webhooks.constructEvent(rawBody, signature, source.secret);
|
const event = await stripeClient.webhooks.constructEventAsync(rawBody, signature, source.secret);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
events: [
|
events: [
|
||||||
|
|||||||
Reference in New Issue
Block a user