File tree Expand file tree Collapse file tree
apps/backend/src/app/api/latest/integrations/stripe/webhooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,15 @@ const subscriptionChangedEvents = [
4040 "payment_intent.canceled" ,
4141] as const satisfies Stripe . Event . Type [ ] ;
4242
43+ const ignoredEvents = [
44+ "account.updated" ,
45+ "account.application.authorized" ,
46+ "capability.updated" ,
47+ "charge.failed" ,
48+ "balance.available" ,
49+ "customer.updated" ,
50+ ] as const satisfies Stripe . Event . Type [ ] ;
51+
4352const isSubscriptionChangedEvent = ( event : Stripe . Event ) : event is Stripe . Event & { type : ( typeof subscriptionChangedEvents ) [ number ] } => {
4453 return subscriptionChangedEvents . includes ( event . type as any ) ;
4554} ;
@@ -399,6 +408,10 @@ async function processStripeWebhookEvent(event: Stripe.Event): Promise<void> {
399408 } ) ;
400409 }
401410 }
411+ else if ( typedIncludes ( ignoredEvents , event . type ) ) {
412+ // These events are received but don't require processing
413+ return ;
414+ }
402415 else {
403416 throw new StackAssertionError ( "Unknown stripe webhook type received: " + event . type , { event } ) ;
404417 }
You can’t perform that action at this time.
0 commit comments