Feature #11529
closedFeature #11348: Integrate stripe subscription module for onboarding companies
Task 1: Complete Stripe Subscription Webhook Lifecycle (Backend)
Status:
Closed
Priority:
Normal
Assignee:
Target version:
Subtasks
Related issues
Updated by Divya Inapakurthi 7 days ago
- Due date set to 10/15/2026
- Status changed from New to Resolved
- Start date changed from 10/14/2026 to 10/15/2026
- % Done changed from 0 to 100
Complete Stripe Subscription Webhook Lifecycle (Backend)¶
Implemented and verified the webhook event lifecycle handling for tenant SaaS subscriptions:
1. Webhook Handlers Implemented
- invoice.paid:
- Processes successful renewals and first-time charges.
- Updates `saasBilling.planExpiresAt` to the new billing cycle date.
- Clears `past_due` status and resets grace counters.
- Generates paid transaction record and appends to `saasBillingActionHistory`.
- invoice.payment_failed:
- Handles recurring invoice charge failures.
- Updates status to `past_due` and activates grace period window.
- Dispatches email notification with payment update link.
- Logs `Renewal Payment Failed` into `saasBillingActionHistory`.
- customer.subscription.updated:
- Synchronizes status transitions (`active`, `past_due`, `canceled`, `trialing`).
- Correctly captures scheduled cancellations (`cancel_at_period_end: true`) and reversals.
- customer.subscription.deleted:
- Handles immediate subscription terminations.
- Transitions company status to `canceled` / `suspended`.
- Processes successful renewals and first-time charges.
- Updates `saasBilling.planExpiresAt` to the new billing cycle date.
- Clears `past_due` status and resets grace counters.
- Generates paid transaction record and appends to `saasBillingActionHistory`.
- Handles recurring invoice charge failures.
- Updates status to `past_due` and activates grace period window.
- Dispatches email notification with payment update link.
- Logs `Renewal Payment Failed` into `saasBillingActionHistory`.
- Synchronizes status transitions (`active`, `past_due`, `canceled`, `trialing`).
- Correctly captures scheduled cancellations (`cancel_at_period_end: true`) and reversals.
- Handles immediate subscription terminations.
- Transitions company status to `canceled` / `suspended`.
2. Verification
- Verified webhook processing and database updates via E2E test scripts.
- Code passed ESLint with 0 errors.
Updated by Divya Inapakurthi 3 days ago
- Target version set to sprint (10/12/2026 - 10/31/2026)
Updated by Divya Inapakurthi about 14 hours ago
- Status changed from Resolved to Closed