Add BTCPay as an alternative cloud billing provider#305
Conversation
b131fd3 to
d4a9431
Compare
|
|
🤖 Gemini Code ReviewGeneric billing endpoints in Pull Request Review: BTCPay Cloud Billing IntegrationThis PR introduces BTCPay Server as an alternative cloud billing provider alongside Stripe. While the abstraction of billing providers and the configuration management are well-executed, there is a critical functional gap in the BTCPay subscription fulfillment flow that will prevent users from actually being upgraded after payment. 🛑 Critical Issues & Bugs
✨ Code Quality & Best Practices
⚙️ Performance & Security
🧪 Test Coverage
💡 Recommendations
|
🤖 Codex Code Review
|
🤖 Claude Code ReviewPull Request Review: BTCPay Server Billing IntegrationThis PR adds BTCPay Server as an alternative cloud billing provider alongside Stripe. The implementation is reasonably structured, but there are several critical issues that should be addressed before shipping. Critical Issues1. No BTCPay Webhook Handler — Subscriptions Never Activate
There is no BTCPay webhook receiver. After a user pays via BTCPay and is redirected back, the backend has no mechanism to receive payment confirmation from BTCPay. Subscription status will remain in its pre-payment state indefinitely. The success page ( 2. Cancelled/Expired Status Buttons Silently No-op for BTCPay Users
3. BTCPay Pending Status on Success Page Is Permanent
Without a webhook, Security Concerns4. Donation Endpoints Are Unauthenticated and Rate-unlimited
5. No SSRF Validation on
|
| Priority | Issue |
|---|---|
| Critical | No BTCPay webhook → subscriptions never activate |
| Critical | Cancelled/expired action buttons silently no-op for BTCPay users |
| Security | Unauthenticated, rate-unlimited donation invoice creation endpoints |
| Architecture | Duplicated active_billing_provider() logic that can diverge |
| Architecture | btcpay_cloud_plan_config() / is_stripe_enabled() re-read env vars on every call |
| Architecture | Remove duplicate /stripe/* wrapper routes |
| Architecture | Over-strict validate_cloud_config() couples unrelated features |
| Quality | Stale log messages, alert() usage, misleading session_id |
| Testing | No integration tests for the BTCPay billing flow |
Summary
/api/billing/*can use Stripe or BTCPayValidation
cargo checkcargo test donations -- --nocapturepnpm lintpnpm exec jest --runInBand src/components/__tests__/plans-modal-basic.test.tsxNotes
pnpm buildis blocked in the sandbox becausenext/fontcannot fetch Google fonts without network access.pnpm exec tsc --noEmitreports existing repo-wide test typing issues unrelated to this change (missing Jest globals in test files).