Files
zeekay 4532862f22 fix: use query-param format for crypto bars (sandbox single path 404s)
Same issue as snapshots — Alpaca sandbox returns 404 for
/v1beta3/crypto/us/{sym}/bars but works with
/v1beta3/crypto/us/bars?symbols={sym}. Also handle the wrapped
response format {"bars":{"BTC/USD":[...]}} vs stock {"bars":[...]}.
2025-12-24 00:57:08 -07:00

23 lines
709 B
Go

package compliance
import "net/http"
// billingHandler holds billing HTTP handler state.
type billingHandler struct{}
func (h *billingHandler) handleGetBilling(w http.ResponseWriter, r *http.Request) {
// Static/mock billing data. In production this would come from Stripe.
billing := BillingInfo{
Plan: "professional",
PaymentMethod: "visa_4242",
NextBilling: "2026-04-01",
MonthlyUsage: 299.00,
Invoices: []Invoice{
{ID: "inv-001", Date: "2026-03-01", Amount: 299.00, Status: "paid"},
{ID: "inv-002", Date: "2026-02-01", Amount: 299.00, Status: "paid"},
{ID: "inv-003", Date: "2026-01-01", Amount: 299.00, Status: "paid"},
},
}
writeJSON(w, http.StatusOK, billing)
}