Skip to content

feat(billing): wire fetchBilling() to real GET /api/v1/billing#23

Merged
mastermanas805 merged 1 commit into
mainfrom
feat/billing-state-real-endpoint
May 11, 2026
Merged

feat(billing): wire fetchBilling() to real GET /api/v1/billing#23
mastermanas805 merged 1 commit into
mainfrom
feat/billing-state-real-endpoint

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Agent API PR #15 just landed. This commit replaces the FIXTURE_BILLING fallback with a real call to /api/v1/billing, mapping the response into the dashboard's BillingDetails type. Keeps a 503 fallback so local dev without Razorpay still renders. Build + tests clean.

InstaNode-dev/api PR #15 just landed — the agent API now serves
GET /api/v1/billing as the aggregated subscription-state endpoint
the dashboard had been fixturing.

This commit drops the fixture path. fetchBilling() now calls the
real endpoint and maps the response into the dashboard's existing
BillingDetails shape (status, current_period_end, payment_last4,
payment_network — every field the agent API can populate is now
live; the ones the agent API doesn't expose yet stay undefined and
render as "—" in the UI).

Fallback: on 503 (Razorpay unconfigured in local dev), still falls
back to FIXTURE_BILLING so the BillingPage doesn't break for
developers without RAZORPAY_KEY_ID set. Any other error propagates
so production failures aren't silently swallowed.

Closes the partial-fixture comment block I left in PR #20.

Verified: npm run build clean (116 HTML + 116 .md), 26/26 markdown
renderer tests pass, Playwright auth/navigation/resources specs
all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 80ef6e6 into main May 11, 2026
2 checks passed
@mastermanas805 mastermanas805 deleted the feat/billing-state-real-endpoint branch May 11, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant