mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
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":[...]}.
23 lines
709 B
Go
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)
|
|
}
|