-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add Stripe-based billing subscription management #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @solimander's task —— View job PR Review: Stripe-based Billing Subscription ManagementTodo List:
Code Review SummaryThis PR successfully adds Stripe-based billing subscription management to the eigenx CLI. The implementation is well-structured and follows Go best practices. Here's my detailed analysis: ✅ Strengths
🔍 Code Quality & Best PracticesGood Practices:
Suggestions for Improvement: pkg/commands/billing/subscribe.go:73-80The 5-minute timeout for payment polling is reasonable, but consider adding a progress indicator: logger.Info("Waiting for payment completion... (timeout in 5 minutes)")pkg/commands/billing/status.go:87-91The price display logic could be more robust: if subscription.PlanPrice != nil && subscription.Currency != nil && *subscription.PlanPrice > 0 {
logger.Info("Plan: $%.2f/month", *subscription.PlanPrice)
} else {
logger.Info("Plan: Standard")
}Consider handling different currencies and showing the currency symbol. 🔒 Security AnalysisExcellent Security Practices:
No security issues found - the implementation follows security best practices throughout. 🚀 Performance ConsiderationsGood Performance Characteristics:
🧪 Test Coverage RecommendationsThe implementation would benefit from:
🐛 Potential IssuesMinor Issues:
✨ User Experience ExcellenceOutstanding UX Features:
📋 Integration QualityThe billing integration seamlessly fits into the existing codebase:
Overall AssessmentThis is a high-quality implementation that successfully adds billing functionality while maintaining the CLI's existing patterns and security standards. The code is production-ready with excellent error handling and user experience. Recommended Actions:
The implementation demonstrates strong engineering practices and security awareness. Great work! 🎉 |
|
|
||
| // Poll for subscription activation | ||
| logger.Info("\nWaiting for payment completion...") | ||
| timeout := time.After(5 * time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why timeout? just allow them to ctrl+C
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't seem worth continuing to poll after 5 mins or so. they can also view the billing status via eigenx billing status if it stops watching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. will check when i go through it myself
pkg/commands/billing/cancel.go
Outdated
|
|
||
| for env, info := range results { | ||
| if info.Count > 0 { | ||
| networkAppCounts[env] = info.Count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont u already have this in results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4b9e50a to
3927170
Compare
pkg/commands/billing/status.go
Outdated
|
|
||
| // Plan details | ||
| if subscription.PlanPrice != nil && subscription.Currency != nil && *subscription.PlanPrice > 0 { | ||
| logger.Info("Plan: $%.2f %s", *subscription.PlanPrice, strings.ToUpper(*subscription.Currency)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need $ and currency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/commands/billing/status.go
Outdated
|
|
||
| // Cancellation status | ||
| if subscription.CancelAtPeriodEnd != nil && *subscription.CancelAtPeriodEnd { | ||
| if subscription.CurrentPeriodEnd != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another &&?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } else { | ||
| logger.Info(" %d / 1 apps deployed on %s", count, envName) | ||
| logger.Info("") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just split up into if err != nils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if/else feels cleaner given we pass-through imo
…h environment-specific auth
…ointer dereference
…add portal URL display
- Refactored subscription management to handle subscriptions per environment instead of globally - Updated status command to show subscription details and app usage for current environment only - Modified cancel command to suspend apps only on current environment when canceling - Added improved handling of different subscription states (past_due, unpaid, etc.) with portal links - Enhanced status display formatting with clearer subscription
97f7307 to
0f1a7a5
Compare
Summary
eigenx billingcommands for Stripe-based subscription managementChanges
billing subscribe,billing cancel,billing status