Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: make sure that users are unsuspended after payment

Blue Mousee0dd5be2f886
diff --git a/backend/apps/cloud/src/webhook/webhook.controller.ts b/backend/apps/cloud/src/webhook/webhook.controller.ts
index 27928352d..a5d7122e1 100644
--- a/backend/apps/cloud/src/webhook/webhook.controller.ts
+++ b/backend/apps/cloud/src/webhook/webhook.controller.ts
@@ -142,6 +142,7 @@ export class WebhookController {
const isTrialing = status === 'trialing'
const shouldUnlock =
+ status === 'active' ||
body.alert_name === 'subscription_created' ||
isNextPlan(currentUser.planCode, plan.id)
@@ -261,6 +262,10 @@ export class WebhookController {
updateParams.dashboardBlockReason = null
}
+ if (subscriber.isAccountBillingSuspended) {
+ updateParams.isAccountBillingSuspended = false
+ }
+
if (Object.keys(updateParams).length > 0) {
await this.userService.updateBySubID(subID, updateParams)
await this.projectService.clearProjectsRedisCacheBySubId(subID)