Release v0.1.18 — Phase 18: Billing Page#249
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…age-route CONV-274: Create Billing page route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…age-livewire-component CONV-275: Create Billing page Livewire component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-284: Add buy credit pack actions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-286: Add credit transaction details CONV-287: Add customer portal and invoice links Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix lint issues Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-summary-card CONV-276–290: Billing Page Full Implementation
📝 WalkthroughWalkthroughThis PR introduces a complete billing page for subscription and credit management. A Livewire component provides checkout actions and data accessors, a Blade template renders plan selection, credits purchasing, transaction history, and billing management UI, and comprehensive tests validate checkout flows, page rendering, and user data isolation. ChangesBilling Page with Subscription & Credit Flows
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Livewire/Billing/BillingPage.php`:
- Around line 81-125: Extract the plan/pack validation and checkout
orchestration out of the Livewire component into two action classes (e.g.,
StartSubscriptionCheckoutAction and BuyCreditPackAction) in app/Actions: move
Plan::from validation, Plan::Free check, current-plan check,
BillingPlanRepository lookup, and call to
BillingPaymentService::createSubscriptionCheckout into
StartSubscriptionCheckoutAction (accept user and planKey, throw the same
ValidationException messages on error, and return the checkout session or
session->url); similarly move CreditPackRepository lookup and
BillingPaymentService::createCreditPackCheckout into BuyCreditPackAction (accept
user and packKey, throw the same ValidationException if missing, and return the
session or url). Then change BillingPage::startSubscriptionCheckout and
::buyCreditPack to simply dispatch the corresponding action (inject/resolve the
action), pass $this->authUser and key, receive the session/url, and call
$this->redirect(...) — preserve the same error types/messages and use the same
BillingPaymentService methods.
In `@resources/views/livewire/billing/billing-page.blade.php`:
- Around line 58-87: Add computed accessors on the Livewire component (e.g., in
class BillingPage add getApiAccessProperty() and getBatchConversionProperty())
that call app(FeatureAccessService::class)->allows($this->authUser,
'api_access') and 'batch_conversion' respectively, and then update the Blade
view to stop resolving FeatureAccessService and instead read the precomputed
booleans (use $apiAccess and $batchConversion) to decide which <x-badge> to
render; keep planLimits/authUser usage unchanged.
In `@tests/Feature/Livewire/Billing/BillingPageCreditPacksTest.php`:
- Line 30: The test currently uses a broad ->assertRedirect() which permits any
redirect; replace it with an exact-URL assertion using the fake gateway's
expected checkout URL so the test verifies the payment flow redirects to the
intended target. Locate the assertion in BillingPageCreditPacksTest and change
the broad assertRedirect() to assertRedirect($expectedUrl) (or the appropriate
exact-redirect assertion) using the fake gateway's provided checkout URL value
(e.g., from the fake gateway instance or helper) so the test asserts the
concrete checkout redirect.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 764c9b5e-189f-499e-a3cd-bf069f6e8b8f
📒 Files selected for processing (11)
app/Livewire/Billing/BillingPage.phpresources/views/livewire/billing/billing-page.blade.phproutes/web.phptests/Feature/Billing/BillingCheckoutNoticeTest.phptests/Feature/Billing/BillingPageRouteTest.phptests/Feature/Livewire/Billing/BillingPageCheckoutTest.phptests/Feature/Livewire/Billing/BillingPageCreditHistoryTest.phptests/Feature/Livewire/Billing/BillingPageCreditPacksTest.phptests/Feature/Livewire/Billing/BillingPageErrorStateTest.phptests/Feature/Livewire/Billing/BillingPageSmokeTest.phptests/Feature/Livewire/Billing/BillingPageTest.php
There was a problem hiding this comment.
1 issue found across 11 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
- Extract checkout orchestration into StartSubscriptionCheckoutAction and BuyCreditPackAction - Add getApiAccessProperty/getBatchConversionProperty computed properties to remove app() calls from Blade - Tighten assertRedirect to exact URL in BillingPageCreditPacksTest Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix billing page inline review issues
Phase 18 — Billing Page
Adds the
/billingpage where authenticated users can manage their plan, credits, and payment details.What's included
/billingroute (auth-protected)BillingPageLivewire componentCreditLedger)FeatureAccessService)BillingPaymentServiceBillingPaymentServiceArchitecture invariants
BillingPagedoes not mutateusers.plandirectlyBillingPagedoes not grant/spend credits directlyBillingPaymentServiceCreditLedgerinterfaceQuality gate
composer lintpassingnpm run buildpassing🤖 Generated with Claude Code
Summary by cubic
Adds an auth-only Billing page at
/billingso users can view their plan and credits, upgrade subscriptions, and buy credit packs. Fulfills Linear CONV-274–290 Billing Page scope.New Features
/billingroute and LivewireBillingPage.FeatureAccessService).BillingPaymentService).BillingPaymentService).Refactors
StartSubscriptionCheckoutActionandBuyCreditPackAction.getApiAccessProperty/getBatchConversionPropertyto simplify Blade and remove directapp()calls.Written for commit 260650f. Summary will update on new commits.
Summary by CodeRabbit
Release Notes