diff --git a/crates/app/src/routes/api/v1/auth/connections/stripe.rs b/crates/app/src/routes/api/v1/auth/connections/stripe.rs index 91560b0..b9964f6 100644 --- a/crates/app/src/routes/api/v1/auth/connections/stripe.rs +++ b/crates/app/src/routes/api/v1/auth/connections/stripe.rs @@ -274,6 +274,15 @@ pub async fn stripe_webhook( Err(e) => return Json(e.into()), }; + if !user.permissions.check(FinePermission::SUPPORTER) { + // the user isn't currently a supporter, there's no reason to send this notification + return Json(ApiReturn { + ok: true, + message: "Acceptable".to_string(), + payload: (), + }); + } + tracing::info!( "unsubscribe (pay fail) {} (stripe: {})", user.id, @@ -303,7 +312,7 @@ pub async fn stripe_webhook( if let Err(e) = data .create_notification(Notification::new( "It seems your recent payment has failed :(".to_string(), - "No worries! Your subscription is still active and will be retried. Your supporter status will resume when you have a successful payment.\n\nIf you've cancelled your subscription, you can safely disregard this." + "No worries! Your subscription is still active and will be retried. Your supporter status will resume when you have a successful payment." .to_string(), user.id, ))