Skip to content

Add Legacy Cancellation Support and Fix Stripe Webhook Verification for App Router#162

Merged
Ashad001 merged 2 commits intoFireBird-Technologies:mainfrom
Ashad001:refactor/paid-plan
Jun 24, 2025
Merged

Add Legacy Cancellation Support and Fix Stripe Webhook Verification for App Router#162
Ashad001 merged 2 commits intoFireBird-Technologies:mainfrom
Ashad001:refactor/paid-plan

Conversation

@Ashad001
Copy link
Contributor

This pull request introduces support for handling legacy users who do not have proper Stripe subscription IDs in the subscription cancellation flow. The changes ensure that legacy users are processed differently, bypassing Stripe API calls and updating Redis directly. Key updates include adjustments to logic for determining user type, handling credits, and updating subscription statuses.

Enhancements for Legacy User Handling:

  • Added isLegacyUser logic to identify users without valid Stripe subscription IDs and adjusted the cancellation flow to skip Stripe API calls for these users. (auto-analyst-frontend/app/api/trial/cancel/route.ts: [1] [2] [3]
  • Updated Redis operations to immediately set credits to zero and mark subscriptions as canceled for legacy users. (auto-analyst-frontend/app/api/trial/cancel/route.ts: [1] [2]; auto-analyst-frontend/app/api/user/cancel-subscription/route.ts: [3]

Message and Status Updates:

  • Adjusted cancellation response messages to differentiate between legacy users and trial or standard users. (auto-analyst-frontend/app/api/trial/cancel/route.ts: [1] [2]; auto-analyst-frontend/app/api/user/cancel-subscription/route.ts: [3]
  • Updated subscription status handling to reflect immediate cancellation for legacy users versus scheduled cancellation for others. (auto-analyst-frontend/app/api/user/cancel-subscription/route.ts: auto-analyst-frontend/app/api/user/cancel-subscription/route.tsL34-R101)

These changes ensure a smoother cancellation process for legacy users while maintaining proper handling for standard and trial users.

@Ashad001 Ashad001 merged commit 94fb421 into FireBird-Technologies:main Jun 24, 2025
1 check passed
ArslanS1997 pushed a commit that referenced this pull request Mar 17, 2026
Add Legacy Cancellation Support and Fix Stripe Webhook Verification for App Router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant