feat(billing): wire fetchBilling() to real GET /api/v1/billing#23
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.