sim
sim copied to clipboard
feat(billing): integrate Loops checkout for subscription upgrades
Summary
- Add Loops SDK (@loops-fi/sdk) for checkout session management
- Create Loops client utility with environment variable support
- Implement Loops checkout helper using checkoutSessions API
- Add custom checkout API endpoint (/api/billing/checkout)
- Update subscription upgrade flow to use Loops checkout when enabled
- Fallback to Stripe checkout if Loops is not configured
- Use existing Stripe price IDs directly in Loops checkout sessions
- Add LOOPS_API_KEY environment variable
This integration allows using Loops checkout links while keeping all other billing functionality (webhooks, subscriptions) on Stripe.
Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
- [ ] Other: ___________
Testing
How has this been tested? What should reviewers focus on?
Checklist
- [ ] Code follows project style guidelines
- [ ] Self-reviewed my changes
- [ ] Tests added/updated and passing
- [ ] No new warnings introduced
- [ ] I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Screenshots/Videos
@heyfuaad is attempting to deploy a commit to the Sim Team on Vercel.
A member of the Team first needs to authorize it.